diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-05-13 10:46:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-13 10:46:37 -0700 |
commit | 4282c9478c7cb435401e0eed1a464c1d7a2db213 (patch) | |
tree | fa3689ab10e428f1cd9cd853f8884f2bc6e4ab4c /test/wasm2asm/wasm2asm.wast.asserts | |
parent | 51e515748e56c3ace6b3181e9ca8bf464c86f0e0 (diff) | |
download | binaryen-4282c9478c7cb435401e0eed1a464c1d7a2db213.tar.gz binaryen-4282c9478c7cb435401e0eed1a464c1d7a2db213.tar.bz2 binaryen-4282c9478c7cb435401e0eed1a464c1d7a2db213.zip |
Clean up wasm2asm testing (#1546)
* Move wasm2asm test outputs into their natural location, test/wasm2asm/
* Let people create new tests in there that ./auto_update_tests.py will auto-generate outputs for, just like all the other tests.
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") |