From 1aa7beb2b8ce44fadb8983a14fc4862d0cecd754 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 26 Dec 2023 22:37:52 +0000 Subject: Add i64.sub instruction --- .../binary/WasmBinaryFormatInstructionsTests.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/test/java/org') diff --git a/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java b/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java index 797c8275..4f94a130 100644 --- a/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java +++ b/src/test/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatInstructionsTests.java @@ -32,6 +32,20 @@ public class WasmBinaryFormatInstructionsTests { snapshotter.assertSnapshot(result); } + @Test + public void canSerializeI32Sub(Snapshotter snapshotter) throws IOException, InterruptedException { + var instructions = List.of( + new WasmI32Const(0), + new WasmI32Const(0), + new WasmI32Sub(), + new WasmDrop() + ); + + var result = serializeInstructions(instructions); + + snapshotter.assertSnapshot(result); + } + @Test public void canSerializeI64Add(Snapshotter snapshotter) throws IOException, InterruptedException { var instructions = List.of( @@ -46,6 +60,20 @@ public class WasmBinaryFormatInstructionsTests { snapshotter.assertSnapshot(result); } + @Test + public void canSerializeI64Sub(Snapshotter snapshotter) throws IOException, InterruptedException { + var instructions = List.of( + new WasmI64Const(0), + new WasmI64Const(0), + new WasmI64Sub(), + new WasmDrop() + ); + + var result = serializeInstructions(instructions); + + snapshotter.assertSnapshot(result); + } + // == Exception Instructions (v3 proposal) == @Test -- cgit v1.2.3