diff options
Diffstat (limited to 'test/wasm2asm/wasm2asm.wast.asserts')
-rw-r--r-- | test/wasm2asm/wasm2asm.wast.asserts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/wasm2asm/wasm2asm.wast.asserts b/test/wasm2asm/wasm2asm.wast.asserts new file mode 100644 index 000000000..353f563f2 --- /dev/null +++ b/test/wasm2asm/wasm2asm.wast.asserts @@ -0,0 +1,12 @@ +;; i32 operations + +(module + (func (export "empty")) + (func (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (get_local $x) (get_local $y))) + (func (export "div_s") (param $x i32) (param $y i32) (result i32) (i32.div_s (get_local $x) (get_local $y))) +) + +(assert_return (invoke "empty")) +(assert_return (invoke "add" (i32.const 1) (i32.const 1)) (i32.const 2)) +(assert_trap (invoke "div_s" (i32.const 0) (i32.const 0)) "integer divide by zero") +(assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const -1)) "integer overflow") |