diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-11-29 18:33:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-29 18:33:41 -0800 |
commit | 24d274983df9f7dbeebe8a890297d4f30d5bbca7 (patch) | |
tree | b76f10f6de34e94b8c0e449b18427daeb34bee0c /test | |
parent | 8c97dc61a713768d7f8302ec3a695c1207ce7239 (diff) | |
download | binaryen-24d274983df9f7dbeebe8a890297d4f30d5bbca7.tar.gz binaryen-24d274983df9f7dbeebe8a890297d4f30d5bbca7.tar.bz2 binaryen-24d274983df9f7dbeebe8a890297d4f30d5bbca7.zip |
Update spec test suite (#2484)
This updates spec test suite to that of the current up-to-date version
of https://github.com/WebAssembly/spec repo.
- All failing tests are added in `BLACKLIST` in shared.py with reasons.
- For tests that already existed and was passing and started failing
after the update, we add the new test to the blacklist and preserve
the old file by renaming it to 'old_[FILENAME].wast' not to lose test
coverage. When the cause of the error is fixed or the unsupported
construct gets support so the new test passes, we can delete the
corresponding 'old_[FILENAME].wast' file.
- Adds support for `spectest.print_[type] style imports.
Diffstat (limited to 'test')
103 files changed, 43125 insertions, 5603 deletions
diff --git a/test/spec/README.md b/test/spec/README.md index 2548cd3d7..319151461 100644 --- a/test/spec/README.md +++ b/test/spec/README.md @@ -1,2 +1,11 @@ -This repository holds a mirror of the spec testsuite which is maintained -[here](https://github.com/WebAssembly/spec/tree/master/ml-proto/test). +This directory contains tests for the core WebAssembly semantics, as described in [Semantics.md](https://github.com/WebAssembly/design/blob/master/Semantics.md) and specified by the [spec interpreter](https://github.com/WebAssembly/spec/blob/master/interpreter). + +Tests are written in the [S-Expression script format](https://github.com/WebAssembly/spec/blob/master/interpreter/README.md#s-expression-syntax) defined by the interpreter. + +The test suite can be run with the spec interpreter as follows: +``` +./run.py --wasm <path-to-wasm-interpreter> +``` +where the path points to the spec interpreter executable (or a tool that understands similar options). If the binary is in the working directory, this option can be omitted. + +In addition, the option `--js <path-to-js-interpreter>` can be given to point to a stand-alone JavaScript interpreter supporting the WebAssembly API. If provided, all tests are also executed in JavaScript. diff --git a/test/spec/address.wast b/test/spec/address.wast index a3fb19b83..e071cca50 100644 --- a/test/spec/address.wast +++ b/test/spec/address.wast @@ -1,34 +1,589 @@ -(module - (import "spectest" "print" (func $print (param i32))) +;; Load i32 data with different offset/align arguments +(module (memory 1) (data (i32.const 0) "abcdefghijklmnopqrstuvwxyz") - (func (export "good") (param $i i32) - (call $print (i32.load8_u offset=0 (local.get $i))) ;; 97 'a' - (call $print (i32.load8_u offset=1 (local.get $i))) ;; 98 'b' - (call $print (i32.load8_u offset=2 (local.get $i))) ;; 99 'c' - (call $print (i32.load8_u offset=25 (local.get $i))) ;; 122 'z' + (func (export "8u_good1") (param $i i32) (result i32) + (i32.load8_u offset=0 (local.get $i)) ;; 97 'a' + ) + (func (export "8u_good2") (param $i i32) (result i32) + (i32.load8_u align=1 (local.get $i)) ;; 97 'a' + ) + (func (export "8u_good3") (param $i i32) (result i32) + (i32.load8_u offset=1 align=1 (local.get $i)) ;; 98 'b' + ) + (func (export "8u_good4") (param $i i32) (result i32) + (i32.load8_u offset=2 align=1 (local.get $i)) ;; 99 'c' + ) + (func (export "8u_good5") (param $i i32) (result i32) + (i32.load8_u offset=25 align=1 (local.get $i)) ;; 122 'z' + ) - (call $print (i32.load16_u offset=0 (local.get $i))) ;; 25185 'ab' - (call $print (i32.load16_u align=1 (local.get $i))) ;; 25185 'ab' - (call $print (i32.load16_u offset=1 align=1 (local.get $i))) ;; 25442 'bc' - (call $print (i32.load16_u offset=2 (local.get $i))) ;; 25699 'cd' - (call $print (i32.load16_u offset=25 align=1 (local.get $i))) ;; 122 'z\0' + (func (export "8s_good1") (param $i i32) (result i32) + (i32.load8_s offset=0 (local.get $i)) ;; 97 'a' + ) + (func (export "8s_good2") (param $i i32) (result i32) + (i32.load8_s align=1 (local.get $i)) ;; 97 'a' + ) + (func (export "8s_good3") (param $i i32) (result i32) + (i32.load8_s offset=1 align=1 (local.get $i)) ;; 98 'b' + ) + (func (export "8s_good4") (param $i i32) (result i32) + (i32.load8_s offset=2 align=1 (local.get $i)) ;; 99 'c' + ) + (func (export "8s_good5") (param $i i32) (result i32) + (i32.load8_s offset=25 align=1 (local.get $i)) ;; 122 'z' + ) - (call $print (i32.load offset=0 (local.get $i))) ;; 1684234849 'abcd' - (call $print (i32.load offset=1 align=1 (local.get $i))) ;; 1701077858 'bcde' - (call $print (i32.load offset=2 align=2 (local.get $i))) ;; 1717920867 'cdef' - (call $print (i32.load offset=25 align=1 (local.get $i))) ;; 122 'z\0\0\0' + (func (export "16u_good1") (param $i i32) (result i32) + (i32.load16_u offset=0 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16u_good2") (param $i i32) (result i32) + (i32.load16_u align=1 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16u_good3") (param $i i32) (result i32) + (i32.load16_u offset=1 align=1 (local.get $i)) ;; 25442 'bc' + ) + (func (export "16u_good4") (param $i i32) (result i32) + (i32.load16_u offset=2 align=2 (local.get $i)) ;; 25699 'cd' + ) + (func (export "16u_good5") (param $i i32) (result i32) + (i32.load16_u offset=25 align=2 (local.get $i)) ;; 122 'z\0' ) - (func (export "bad") (param $i i32) + (func (export "16s_good1") (param $i i32) (result i32) + (i32.load16_s offset=0 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16s_good2") (param $i i32) (result i32) + (i32.load16_s align=1 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16s_good3") (param $i i32) (result i32) + (i32.load16_s offset=1 align=1 (local.get $i)) ;; 25442 'bc' + ) + (func (export "16s_good4") (param $i i32) (result i32) + (i32.load16_s offset=2 align=2 (local.get $i)) ;; 25699 'cd' + ) + (func (export "16s_good5") (param $i i32) (result i32) + (i32.load16_s offset=25 align=2 (local.get $i)) ;; 122 'z\0' + ) + + (func (export "32_good1") (param $i i32) (result i32) + (i32.load offset=0 (local.get $i)) ;; 1684234849 'abcd' + ) + (func (export "32_good2") (param $i i32) (result i32) + (i32.load align=1 (local.get $i)) ;; 1684234849 'abcd' + ) + (func (export "32_good3") (param $i i32) (result i32) + (i32.load offset=1 align=1 (local.get $i)) ;; 1701077858 'bcde' + ) + (func (export "32_good4") (param $i i32) (result i32) + (i32.load offset=2 align=2 (local.get $i)) ;; 1717920867 'cdef' + ) + (func (export "32_good5") (param $i i32) (result i32) + (i32.load offset=25 align=4 (local.get $i)) ;; 122 'z\0\0\0' + ) + + (func (export "8u_bad") (param $i i32) + (drop (i32.load8_u offset=4294967295 (local.get $i))) + ) + (func (export "8s_bad") (param $i i32) + (drop (i32.load8_s offset=4294967295 (local.get $i))) + ) + (func (export "16u_bad") (param $i i32) + (drop (i32.load16_u offset=4294967295 (local.get $i))) + ) + (func (export "16s_bad") (param $i i32) + (drop (i32.load16_s offset=4294967295 (local.get $i))) + ) + (func (export "32_bad") (param $i i32) (drop (i32.load offset=4294967295 (local.get $i))) ) ) -(invoke "good" (i32.const 0)) -(invoke "good" (i32.const 65507)) -(assert_trap (invoke "good" (i32.const 65508)) "out of bounds memory access") -(assert_trap (invoke "bad" (i32.const 0)) "out of bounds memory access") -(assert_trap (invoke "bad" (i32.const 1)) "out of bounds memory access") +(assert_return (invoke "8u_good1" (i32.const 0)) (i32.const 97)) +(assert_return (invoke "8u_good2" (i32.const 0)) (i32.const 97)) +(assert_return (invoke "8u_good3" (i32.const 0)) (i32.const 98)) +(assert_return (invoke "8u_good4" (i32.const 0)) (i32.const 99)) +(assert_return (invoke "8u_good5" (i32.const 0)) (i32.const 122)) + +(assert_return (invoke "8s_good1" (i32.const 0)) (i32.const 97)) +(assert_return (invoke "8s_good2" (i32.const 0)) (i32.const 97)) +(assert_return (invoke "8s_good3" (i32.const 0)) (i32.const 98)) +(assert_return (invoke "8s_good4" (i32.const 0)) (i32.const 99)) +(assert_return (invoke "8s_good5" (i32.const 0)) (i32.const 122)) + +(assert_return (invoke "16u_good1" (i32.const 0)) (i32.const 25185)) +(assert_return (invoke "16u_good2" (i32.const 0)) (i32.const 25185)) +(assert_return (invoke "16u_good3" (i32.const 0)) (i32.const 25442)) +(assert_return (invoke "16u_good4" (i32.const 0)) (i32.const 25699)) +(assert_return (invoke "16u_good5" (i32.const 0)) (i32.const 122)) + +(assert_return (invoke "16s_good1" (i32.const 0)) (i32.const 25185)) +(assert_return (invoke "16s_good2" (i32.const 0)) (i32.const 25185)) +(assert_return (invoke "16s_good3" (i32.const 0)) (i32.const 25442)) +(assert_return (invoke "16s_good4" (i32.const 0)) (i32.const 25699)) +(assert_return (invoke "16s_good5" (i32.const 0)) (i32.const 122)) + +(assert_return (invoke "32_good1" (i32.const 0)) (i32.const 1684234849)) +(assert_return (invoke "32_good2" (i32.const 0)) (i32.const 1684234849)) +(assert_return (invoke "32_good3" (i32.const 0)) (i32.const 1701077858)) +(assert_return (invoke "32_good4" (i32.const 0)) (i32.const 1717920867)) +(assert_return (invoke "32_good5" (i32.const 0)) (i32.const 122)) + +(assert_return (invoke "8u_good1" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8u_good2" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8u_good3" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8u_good4" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8u_good5" (i32.const 65507)) (i32.const 0)) + +(assert_return (invoke "8s_good1" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8s_good2" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8s_good3" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8s_good4" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "8s_good5" (i32.const 65507)) (i32.const 0)) + +(assert_return (invoke "16u_good1" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16u_good2" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16u_good3" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16u_good4" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16u_good5" (i32.const 65507)) (i32.const 0)) + +(assert_return (invoke "16s_good1" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16s_good2" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16s_good3" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16s_good4" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "16s_good5" (i32.const 65507)) (i32.const 0)) + +(assert_return (invoke "32_good1" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "32_good2" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "32_good3" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "32_good4" (i32.const 65507)) (i32.const 0)) +(assert_return (invoke "32_good5" (i32.const 65507)) (i32.const 0)) + +(assert_return (invoke "8u_good1" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8u_good2" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8u_good3" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8u_good4" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8u_good5" (i32.const 65508)) (i32.const 0)) + +(assert_return (invoke "8s_good1" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8s_good2" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8s_good3" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8s_good4" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "8s_good5" (i32.const 65508)) (i32.const 0)) + +(assert_return (invoke "16u_good1" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16u_good2" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16u_good3" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16u_good4" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16u_good5" (i32.const 65508)) (i32.const 0)) + +(assert_return (invoke "16s_good1" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16s_good2" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16s_good3" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16s_good4" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "16s_good5" (i32.const 65508)) (i32.const 0)) + +(assert_return (invoke "32_good1" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "32_good2" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "32_good3" (i32.const 65508)) (i32.const 0)) +(assert_return (invoke "32_good4" (i32.const 65508)) (i32.const 0)) +(assert_trap (invoke "32_good5" (i32.const 65508)) "out of bounds memory access") + +(assert_trap (invoke "8u_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "8s_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "16u_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "16s_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "32_bad" (i32.const 0)) "out of bounds memory access") + +(assert_trap (invoke "8u_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "8s_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "16u_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "16s_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "32_bad" (i32.const 1)) "out of bounds memory access") + +(assert_malformed + (module quote + "(memory 1)" + "(func (drop (i32.load offset=4294967296 (i32.const 0))))" + ) + "i32 constant" +) + +;; Load i64 data with different offset/align arguments + +(module + (memory 1) + (data (i32.const 0) "abcdefghijklmnopqrstuvwxyz") + + (func (export "8u_good1") (param $i i32) (result i64) + (i64.load8_u offset=0 (local.get $i)) ;; 97 'a' + ) + (func (export "8u_good2") (param $i i32) (result i64) + (i64.load8_u align=1 (local.get $i)) ;; 97 'a' + ) + (func (export "8u_good3") (param $i i32) (result i64) + (i64.load8_u offset=1 align=1 (local.get $i)) ;; 98 'b' + ) + (func (export "8u_good4") (param $i i32) (result i64) + (i64.load8_u offset=2 align=1 (local.get $i)) ;; 99 'c' + ) + (func (export "8u_good5") (param $i i32) (result i64) + (i64.load8_u offset=25 align=1 (local.get $i)) ;; 122 'z' + ) + + (func (export "8s_good1") (param $i i32) (result i64) + (i64.load8_s offset=0 (local.get $i)) ;; 97 'a' + ) + (func (export "8s_good2") (param $i i32) (result i64) + (i64.load8_s align=1 (local.get $i)) ;; 97 'a' + ) + (func (export "8s_good3") (param $i i32) (result i64) + (i64.load8_s offset=1 align=1 (local.get $i)) ;; 98 'b' + ) + (func (export "8s_good4") (param $i i32) (result i64) + (i64.load8_s offset=2 align=1 (local.get $i)) ;; 99 'c' + ) + (func (export "8s_good5") (param $i i32) (result i64) + (i64.load8_s offset=25 align=1 (local.get $i)) ;; 122 'z' + ) + + (func (export "16u_good1") (param $i i32) (result i64) + (i64.load16_u offset=0 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16u_good2") (param $i i32) (result i64) + (i64.load16_u align=1 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16u_good3") (param $i i32) (result i64) + (i64.load16_u offset=1 align=1 (local.get $i)) ;; 25442 'bc' + ) + (func (export "16u_good4") (param $i i32) (result i64) + (i64.load16_u offset=2 align=2 (local.get $i)) ;; 25699 'cd' + ) + (func (export "16u_good5") (param $i i32) (result i64) + (i64.load16_u offset=25 align=2 (local.get $i)) ;; 122 'z\0' + ) + + (func (export "16s_good1") (param $i i32) (result i64) + (i64.load16_s offset=0 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16s_good2") (param $i i32) (result i64) + (i64.load16_s align=1 (local.get $i)) ;; 25185 'ab' + ) + (func (export "16s_good3") (param $i i32) (result i64) + (i64.load16_s offset=1 align=1 (local.get $i)) ;; 25442 'bc' + ) + (func (export "16s_good4") (param $i i32) (result i64) + (i64.load16_s offset=2 align=2 (local.get $i)) ;; 25699 'cd' + ) + (func (export "16s_good5") (param $i i32) (result i64) + (i64.load16_s offset=25 align=2 (local.get $i)) ;; 122 'z\0' + ) + + (func (export "32u_good1") (param $i i32) (result i64) + (i64.load32_u offset=0 (local.get $i)) ;; 1684234849 'abcd' + ) + (func (export "32u_good2") (param $i i32) (result i64) + (i64.load32_u align=1 (local.get $i)) ;; 1684234849 'abcd' + ) + (func (export "32u_good3") (param $i i32) (result i64) + (i64.load32_u offset=1 align=1 (local.get $i)) ;; 1701077858 'bcde' + ) + (func (export "32u_good4") (param $i i32) (result i64) + (i64.load32_u offset=2 align=2 (local.get $i)) ;; 1717920867 'cdef' + ) + (func (export "32u_good5") (param $i i32) (result i64) + (i64.load32_u offset=25 align=4 (local.get $i)) ;; 122 'z\0\0\0' + ) + + (func (export "32s_good1") (param $i i32) (result i64) + (i64.load32_s offset=0 (local.get $i)) ;; 1684234849 'abcd' + ) + (func (export "32s_good2") (param $i i32) (result i64) + (i64.load32_s align=1 (local.get $i)) ;; 1684234849 'abcd' + ) + (func (export "32s_good3") (param $i i32) (result i64) + (i64.load32_s offset=1 align=1 (local.get $i)) ;; 1701077858 'bcde' + ) + (func (export "32s_good4") (param $i i32) (result i64) + (i64.load32_s offset=2 align=2 (local.get $i)) ;; 1717920867 'cdef' + ) + (func (export "32s_good5") (param $i i32) (result i64) + (i64.load32_s offset=25 align=4 (local.get $i)) ;; 122 'z\0\0\0' + ) + + (func (export "64_good1") (param $i i32) (result i64) + (i64.load offset=0 (local.get $i)) ;; 0x6867666564636261 'abcdefgh' + ) + (func (export "64_good2") (param $i i32) (result i64) + (i64.load align=1 (local.get $i)) ;; 0x6867666564636261 'abcdefgh' + ) + (func (export "64_good3") (param $i i32) (result i64) + (i64.load offset=1 align=1 (local.get $i)) ;; 0x6968676665646362 'bcdefghi' + ) + (func (export "64_good4") (param $i i32) (result i64) + (i64.load offset=2 align=2 (local.get $i)) ;; 0x6a69686766656463 'cdefghij' + ) + (func (export "64_good5") (param $i i32) (result i64) + (i64.load offset=25 align=8 (local.get $i)) ;; 122 'z\0\0\0\0\0\0\0' + ) + + (func (export "8u_bad") (param $i i32) + (drop (i64.load8_u offset=4294967295 (local.get $i))) + ) + (func (export "8s_bad") (param $i i32) + (drop (i64.load8_s offset=4294967295 (local.get $i))) + ) + (func (export "16u_bad") (param $i i32) + (drop (i64.load16_u offset=4294967295 (local.get $i))) + ) + (func (export "16s_bad") (param $i i32) + (drop (i64.load16_s offset=4294967295 (local.get $i))) + ) + (func (export "32u_bad") (param $i i32) + (drop (i64.load32_u offset=4294967295 (local.get $i))) + ) + (func (export "32s_bad") (param $i i32) + (drop (i64.load32_s offset=4294967295 (local.get $i))) + ) + (func (export "64_bad") (param $i i32) + (drop (i64.load offset=4294967295 (local.get $i))) + ) +) + +(assert_return (invoke "8u_good1" (i32.const 0)) (i64.const 97)) +(assert_return (invoke "8u_good2" (i32.const 0)) (i64.const 97)) +(assert_return (invoke "8u_good3" (i32.const 0)) (i64.const 98)) +(assert_return (invoke "8u_good4" (i32.const 0)) (i64.const 99)) +(assert_return (invoke "8u_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "8s_good1" (i32.const 0)) (i64.const 97)) +(assert_return (invoke "8s_good2" (i32.const 0)) (i64.const 97)) +(assert_return (invoke "8s_good3" (i32.const 0)) (i64.const 98)) +(assert_return (invoke "8s_good4" (i32.const 0)) (i64.const 99)) +(assert_return (invoke "8s_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "16u_good1" (i32.const 0)) (i64.const 25185)) +(assert_return (invoke "16u_good2" (i32.const 0)) (i64.const 25185)) +(assert_return (invoke "16u_good3" (i32.const 0)) (i64.const 25442)) +(assert_return (invoke "16u_good4" (i32.const 0)) (i64.const 25699)) +(assert_return (invoke "16u_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "16s_good1" (i32.const 0)) (i64.const 25185)) +(assert_return (invoke "16s_good2" (i32.const 0)) (i64.const 25185)) +(assert_return (invoke "16s_good3" (i32.const 0)) (i64.const 25442)) +(assert_return (invoke "16s_good4" (i32.const 0)) (i64.const 25699)) +(assert_return (invoke "16s_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "32u_good1" (i32.const 0)) (i64.const 1684234849)) +(assert_return (invoke "32u_good2" (i32.const 0)) (i64.const 1684234849)) +(assert_return (invoke "32u_good3" (i32.const 0)) (i64.const 1701077858)) +(assert_return (invoke "32u_good4" (i32.const 0)) (i64.const 1717920867)) +(assert_return (invoke "32u_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "32s_good1" (i32.const 0)) (i64.const 1684234849)) +(assert_return (invoke "32s_good2" (i32.const 0)) (i64.const 1684234849)) +(assert_return (invoke "32s_good3" (i32.const 0)) (i64.const 1701077858)) +(assert_return (invoke "32s_good4" (i32.const 0)) (i64.const 1717920867)) +(assert_return (invoke "32s_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "64_good1" (i32.const 0)) (i64.const 0x6867666564636261)) +(assert_return (invoke "64_good2" (i32.const 0)) (i64.const 0x6867666564636261)) +(assert_return (invoke "64_good3" (i32.const 0)) (i64.const 0x6968676665646362)) +(assert_return (invoke "64_good4" (i32.const 0)) (i64.const 0x6a69686766656463)) +(assert_return (invoke "64_good5" (i32.const 0)) (i64.const 122)) + +(assert_return (invoke "8u_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8u_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8u_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8u_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8u_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "8s_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8s_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8s_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8s_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "8s_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "16u_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16u_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16u_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16u_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16u_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "16s_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16s_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16s_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16s_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "16s_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "32u_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32u_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32u_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32u_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32u_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "32s_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32s_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32s_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32s_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "32s_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "64_good1" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "64_good2" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "64_good3" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "64_good4" (i32.const 65503)) (i64.const 0)) +(assert_return (invoke "64_good5" (i32.const 65503)) (i64.const 0)) + +(assert_return (invoke "8u_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8u_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8u_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8u_good4" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8u_good5" (i32.const 65504)) (i64.const 0)) + +(assert_return (invoke "8s_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8s_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8s_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8s_good4" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "8s_good5" (i32.const 65504)) (i64.const 0)) + +(assert_return (invoke "16u_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16u_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16u_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16u_good4" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16u_good5" (i32.const 65504)) (i64.const 0)) + +(assert_return (invoke "16s_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16s_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16s_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16s_good4" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "16s_good5" (i32.const 65504)) (i64.const 0)) + +(assert_return (invoke "32u_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32u_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32u_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32u_good4" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32u_good5" (i32.const 65504)) (i64.const 0)) + +(assert_return (invoke "32s_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32s_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32s_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32s_good4" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "32s_good5" (i32.const 65504)) (i64.const 0)) + +(assert_return (invoke "64_good1" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "64_good2" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "64_good3" (i32.const 65504)) (i64.const 0)) +(assert_return (invoke "64_good4" (i32.const 65504)) (i64.const 0)) +(assert_trap (invoke "64_good5" (i32.const 65504)) "out of bounds memory access") + +(assert_trap (invoke "8u_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "8s_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "16u_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "16s_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "32u_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "32s_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "64_bad" (i32.const 0)) "out of bounds memory access") + +(assert_trap (invoke "8u_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "8s_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "16u_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "16s_bad" (i32.const 1)) "out of bounds memory access") +(assert_trap (invoke "32u_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "32s_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "64_bad" (i32.const 1)) "out of bounds memory access") + +;; Load f32 data with different offset/align arguments + +(module + (memory 1) + (data (i32.const 0) "\00\00\00\00\00\00\a0\7f\01\00\d0\7f") + + (func (export "32_good1") (param $i i32) (result f32) + (f32.load offset=0 (local.get $i)) ;; 0.0 '\00\00\00\00' + ) + (func (export "32_good2") (param $i i32) (result f32) + (f32.load align=1 (local.get $i)) ;; 0.0 '\00\00\00\00' + ) + (func (export "32_good3") (param $i i32) (result f32) + (f32.load offset=1 align=1 (local.get $i)) ;; 0.0 '\00\00\00\00' + ) + (func (export "32_good4") (param $i i32) (result f32) + (f32.load offset=2 align=2 (local.get $i)) ;; 0.0 '\00\00\00\00' + ) + (func (export "32_good5") (param $i i32) (result f32) + (f32.load offset=8 align=4 (local.get $i)) ;; nan:0x500001 '\01\00\d0\7f' + ) + (func (export "32_bad") (param $i i32) + (drop (f32.load offset=4294967295 (local.get $i))) + ) +) + +(assert_return (invoke "32_good1" (i32.const 0)) (f32.const 0.0)) +(assert_return (invoke "32_good2" (i32.const 0)) (f32.const 0.0)) +(assert_return (invoke "32_good3" (i32.const 0)) (f32.const 0.0)) +(assert_return (invoke "32_good4" (i32.const 0)) (f32.const 0.0)) +(assert_return (invoke "32_good5" (i32.const 0)) (f32.const nan:0x500001)) + +(assert_return (invoke "32_good1" (i32.const 65524)) (f32.const 0.0)) +(assert_return (invoke "32_good2" (i32.const 65524)) (f32.const 0.0)) +(assert_return (invoke "32_good3" (i32.const 65524)) (f32.const 0.0)) +(assert_return (invoke "32_good4" (i32.const 65524)) (f32.const 0.0)) +(assert_return (invoke "32_good5" (i32.const 65524)) (f32.const 0.0)) + +(assert_return (invoke "32_good1" (i32.const 65525)) (f32.const 0.0)) +(assert_return (invoke "32_good2" (i32.const 65525)) (f32.const 0.0)) +(assert_return (invoke "32_good3" (i32.const 65525)) (f32.const 0.0)) +(assert_return (invoke "32_good4" (i32.const 65525)) (f32.const 0.0)) +(assert_trap (invoke "32_good5" (i32.const 65525)) "out of bounds memory access") + +(assert_trap (invoke "32_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "32_bad" (i32.const 1)) "out of bounds memory access") + +;; Load f64 data with different offset/align arguments + +(module + (memory 1) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f4\7f\01\00\00\00\00\00\fc\7f") + + (func (export "64_good1") (param $i i32) (result f64) + (f64.load offset=0 (local.get $i)) ;; 0.0 '\00\00\00\00\00\00\00\00' + ) + (func (export "64_good2") (param $i i32) (result f64) + (f64.load align=1 (local.get $i)) ;; 0.0 '\00\00\00\00\00\00\00\00' + ) + (func (export "64_good3") (param $i i32) (result f64) + (f64.load offset=1 align=1 (local.get $i)) ;; 0.0 '\00\00\00\00\00\00\00\00' + ) + (func (export "64_good4") (param $i i32) (result f64) + (f64.load offset=2 align=2 (local.get $i)) ;; 0.0 '\00\00\00\00\00\00\00\00' + ) + (func (export "64_good5") (param $i i32) (result f64) + (f64.load offset=18 align=8 (local.get $i)) ;; nan:0xc000000000001 '\01\00\00\00\00\00\fc\7f' + ) + (func (export "64_bad") (param $i i32) + (drop (f64.load offset=4294967295 (local.get $i))) + ) +) + +(assert_return (invoke "64_good1" (i32.const 0)) (f64.const 0.0)) +(assert_return (invoke "64_good2" (i32.const 0)) (f64.const 0.0)) +(assert_return (invoke "64_good3" (i32.const 0)) (f64.const 0.0)) +(assert_return (invoke "64_good4" (i32.const 0)) (f64.const 0.0)) +(assert_return (invoke "64_good5" (i32.const 0)) (f64.const nan:0xc000000000001)) + +(assert_return (invoke "64_good1" (i32.const 65510)) (f64.const 0.0)) +(assert_return (invoke "64_good2" (i32.const 65510)) (f64.const 0.0)) +(assert_return (invoke "64_good3" (i32.const 65510)) (f64.const 0.0)) +(assert_return (invoke "64_good4" (i32.const 65510)) (f64.const 0.0)) +(assert_return (invoke "64_good5" (i32.const 65510)) (f64.const 0.0)) + +(assert_return (invoke "64_good1" (i32.const 65511)) (f64.const 0.0)) +(assert_return (invoke "64_good2" (i32.const 65511)) (f64.const 0.0)) +(assert_return (invoke "64_good3" (i32.const 65511)) (f64.const 0.0)) +(assert_return (invoke "64_good4" (i32.const 65511)) (f64.const 0.0)) +(assert_trap (invoke "64_good5" (i32.const 65511)) "out of bounds memory access") + +(assert_trap (invoke "64_bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "64_bad" (i32.const 1)) "out of bounds memory access") diff --git a/test/spec/align.wast b/test/spec/align.wast new file mode 100644 index 000000000..93064649d --- /dev/null +++ b/test/spec/align.wast @@ -0,0 +1,866 @@ +;; Test alignment annotation rules + +(module (memory 0) (func (drop (i32.load8_s align=1 (i32.const 0))))) +(module (memory 0) (func (drop (i32.load8_u align=1 (i32.const 0))))) +(module (memory 0) (func (drop (i32.load16_s align=2 (i32.const 0))))) +(module (memory 0) (func (drop (i32.load16_u align=2 (i32.const 0))))) +(module (memory 0) (func (drop (i32.load align=4 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load8_s align=1 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load8_u align=1 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load16_s align=2 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load16_u align=2 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load32_s align=4 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load32_u align=4 (i32.const 0))))) +(module (memory 0) (func (drop (i64.load align=8 (i32.const 0))))) +(module (memory 0) (func (drop (f32.load align=4 (i32.const 0))))) +(module (memory 0) (func (drop (f64.load align=8 (i32.const 0))))) +(module (memory 0) (func (i32.store8 align=1 (i32.const 0) (i32.const 1)))) +(module (memory 0) (func (i32.store16 align=2 (i32.const 0) (i32.const 1)))) +(module (memory 0) (func (i32.store align=4 (i32.const 0) (i32.const 1)))) +(module (memory 0) (func (i64.store8 align=1 (i32.const 0) (i64.const 1)))) +(module (memory 0) (func (i64.store16 align=2 (i32.const 0) (i64.const 1)))) +(module (memory 0) (func (i64.store32 align=4 (i32.const 0) (i64.const 1)))) +(module (memory 0) (func (i64.store align=8 (i32.const 0) (i64.const 1)))) +(module (memory 0) (func (f32.store align=4 (i32.const 0) (f32.const 1.0)))) +(module (memory 0) (func (f64.store align=8 (i32.const 0) (f64.const 1.0)))) + +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load8_s align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load8_s align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load8_u align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load8_u align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load16_s align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load16_s align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load16_u align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load16_u align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i32.load align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load8_s align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load8_s align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load8_u align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load8_u align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load16_s align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load16_s align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load16_u align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load16_u align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load32_s align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load32_s align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load32_u align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load32_u align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (i64.load align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (f32.load align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (f32.load align=7 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (f64.load align=0 (i32.const 0)))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (drop (f64.load align=7 (i32.const 0)))))" + ) + "alignment" +) + +(assert_malformed + (module quote + "(module (memory 0) (func (i32.store8 align=0 (i32.const 0) (i32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i32.store8 align=7 (i32.const 0) (i32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i32.store16 align=0 (i32.const 0) (i32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i32.store16 align=7 (i32.const 0) (i32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i32.store align=0 (i32.const 0) (i32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i32.store align=7 (i32.const 0) (i32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store8 align=0 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store8 align=7 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store16 align=0 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store16 align=7 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store32 align=0 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store32 align=7 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store align=0 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (i64.store align=7 (i32.const 0) (i64.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (f32.store align=0 (i32.const 0) (f32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (f32.store align=7 (i32.const 0) (f32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (f64.store align=0 (i32.const 0) (f32.const 0))))" + ) + "alignment" +) +(assert_malformed + (module quote + "(module (memory 0) (func (f64.store align=7 (i32.const 0) (f32.const 0))))" + ) + "alignment" +) + +(assert_invalid + (module (memory 0) (func (drop (i32.load8_s align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load8_u align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load16_s align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load16_u align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load8_s align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load8_u align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load16_s align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load16_u align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load32_s align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load32_u align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load align=16 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (f32.load align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (f64.load align=16 (i32.const 0))))) + "alignment must not be larger than natural" +) + +(assert_invalid + (module (memory 0) (func (drop (i32.load8_s align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load8_u align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load16_s align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load16_u align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i32.load align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load8_s align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load8_u align=2 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load16_s align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load16_u align=4 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load32_s align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load32_u align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (i64.load align=16 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (f32.load align=8 (i32.const 0))))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (drop (f64.load align=16 (i32.const 0))))) + "alignment must not be larger than natural" +) + +(assert_invalid + (module (memory 0) (func (i32.store8 align=2 (i32.const 0) (i32.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (i32.store16 align=4 (i32.const 0) (i32.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (i32.store align=8 (i32.const 0) (i32.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (i64.store8 align=2 (i32.const 0) (i64.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (i64.store16 align=4 (i32.const 0) (i64.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (i64.store32 align=8 (i32.const 0) (i64.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (i64.store align=16 (i32.const 0) (i64.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (f32.store align=8 (i32.const 0) (f32.const 0)))) + "alignment must not be larger than natural" +) +(assert_invalid + (module (memory 0) (func (f64.store align=16 (i32.const 0) (f64.const 0)))) + "alignment must not be larger than natural" +) + +;; Test aligned and unaligned read/write + +(module + (memory 1) + + ;; $default: natural alignment, $1: align=1, $2: align=2, $4: align=4, $8: align=8 + + (func (export "f32_align_switch") (param i32) (result f32) + (local f32 f32) + (local.set 1 (f32.const 10.0)) + (block $4 + (block $2 + (block $1 + (block $default + (block $0 + (br_table $0 $default $1 $2 $4 (local.get 0)) + ) ;; 0 + (f32.store (i32.const 0) (local.get 1)) + (local.set 2 (f32.load (i32.const 0))) + (br $4) + ) ;; default + (f32.store align=1 (i32.const 0) (local.get 1)) + (local.set 2 (f32.load align=1 (i32.const 0))) + (br $4) + ) ;; 1 + (f32.store align=2 (i32.const 0) (local.get 1)) + (local.set 2 (f32.load align=2 (i32.const 0))) + (br $4) + ) ;; 2 + (f32.store align=4 (i32.const 0) (local.get 1)) + (local.set 2 (f32.load align=4 (i32.const 0))) + ) ;; 4 + (local.get 2) + ) + + (func (export "f64_align_switch") (param i32) (result f64) + (local f64 f64) + (local.set 1 (f64.const 10.0)) + (block $8 + (block $4 + (block $2 + (block $1 + (block $default + (block $0 + (br_table $0 $default $1 $2 $4 $8 (local.get 0)) + ) ;; 0 + (f64.store (i32.const 0) (local.get 1)) + (local.set 2 (f64.load (i32.const 0))) + (br $8) + ) ;; default + (f64.store align=1 (i32.const 0) (local.get 1)) + (local.set 2 (f64.load align=1 (i32.const 0))) + (br $8) + ) ;; 1 + (f64.store align=2 (i32.const 0) (local.get 1)) + (local.set 2 (f64.load align=2 (i32.const 0))) + (br $8) + ) ;; 2 + (f64.store align=4 (i32.const 0) (local.get 1)) + (local.set 2 (f64.load align=4 (i32.const 0))) + (br $8) + ) ;; 4 + (f64.store align=8 (i32.const 0) (local.get 1)) + (local.set 2 (f64.load align=8 (i32.const 0))) + ) ;; 8 + (local.get 2) + ) + + ;; $8s: i32/i64.load8_s, $8u: i32/i64.load8_u, $16s: i32/i64.load16_s, $16u: i32/i64.load16_u, $32: i32.load + ;; $32s: i64.load32_s, $32u: i64.load32_u, $64: i64.load + + (func (export "i32_align_switch") (param i32 i32) (result i32) + (local i32 i32) + (local.set 2 (i32.const 10)) + (block $32 + (block $16u + (block $16s + (block $8u + (block $8s + (block $0 + (br_table $0 $8s $8u $16s $16u $32 (local.get 0)) + ) ;; 0 + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i32.store8 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load8_s (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i32.store8 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load8_s align=1 (i32.const 0))) + ) + ) + (br $32) + ) ;; 8s + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i32.store8 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load8_u (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i32.store8 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load8_u align=1 (i32.const 0))) + ) + ) + (br $32) + ) ;; 8u + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i32.store16 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load16_s (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i32.store16 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load16_s align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i32.store16 align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load16_s align=2 (i32.const 0))) + ) + ) + (br $32) + ) ;; 16s + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i32.store16 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load16_u (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i32.store16 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load16_u align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i32.store16 align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load16_u align=2 (i32.const 0))) + ) + ) + (br $32) + ) ;; 16u + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i32.store (i32.const 0) (local.get 2)) + (local.set 3 (i32.load (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i32.store align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i32.store align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load align=2 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 4)) + (then + (i32.store align=4 (i32.const 0) (local.get 2)) + (local.set 3 (i32.load align=4 (i32.const 0))) + ) + ) + ) ;; 32 + (local.get 3) + ) + + (func (export "i64_align_switch") (param i32 i32) (result i64) + (local i64 i64) + (local.set 2 (i64.const 10)) + (block $64 + (block $32u + (block $32s + (block $16u + (block $16s + (block $8u + (block $8s + (block $0 + (br_table $0 $8s $8u $16s $16u $32s $32u $64 (local.get 0)) + ) ;; 0 + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store8 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load8_s (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store8 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load8_s align=1 (i32.const 0))) + ) + ) + (br $64) + ) ;; 8s + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store8 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load8_u (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store8 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load8_u align=1 (i32.const 0))) + ) + ) + (br $64) + ) ;; 8u + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store16 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load16_s (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store16 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load16_s align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i64.store16 align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load16_s align=2 (i32.const 0))) + ) + ) + (br $64) + ) ;; 16s + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store16 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load16_u (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store16 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load16_u align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i64.store16 align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load16_u align=2 (i32.const 0))) + ) + ) + (br $64) + ) ;; 16u + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store32 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_s (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store32 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_s align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i64.store32 align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_s align=2 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 4)) + (then + (i64.store32 align=4 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_s align=4 (i32.const 0))) + ) + ) + (br $64) + ) ;; 32s + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store32 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_u (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store32 align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_u align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i64.store32 align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_u align=2 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 4)) + (then + (i64.store32 align=4 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load32_u align=4 (i32.const 0))) + ) + ) + (br $64) + ) ;; 32u + (if (i32.eq (local.get 1) (i32.const 0)) + (then + (i64.store (i32.const 0) (local.get 2)) + (local.set 3 (i64.load (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 1)) + (then + (i64.store align=1 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load align=1 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 2)) + (then + (i64.store align=2 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load align=2 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 4)) + (then + (i64.store align=4 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load align=4 (i32.const 0))) + ) + ) + (if (i32.eq (local.get 1) (i32.const 8)) + (then + (i64.store align=8 (i32.const 0) (local.get 2)) + (local.set 3 (i64.load align=8 (i32.const 0))) + ) + ) + ) ;; 64 + (local.get 3) + ) +) + +(assert_return (invoke "f32_align_switch" (i32.const 0)) (f32.const 10.0)) +(assert_return (invoke "f32_align_switch" (i32.const 1)) (f32.const 10.0)) +(assert_return (invoke "f32_align_switch" (i32.const 2)) (f32.const 10.0)) +(assert_return (invoke "f32_align_switch" (i32.const 3)) (f32.const 10.0)) + +(assert_return (invoke "f64_align_switch" (i32.const 0)) (f64.const 10.0)) +(assert_return (invoke "f64_align_switch" (i32.const 1)) (f64.const 10.0)) +(assert_return (invoke "f64_align_switch" (i32.const 2)) (f64.const 10.0)) +(assert_return (invoke "f64_align_switch" (i32.const 3)) (f64.const 10.0)) +(assert_return (invoke "f64_align_switch" (i32.const 4)) (f64.const 10.0)) + +(assert_return (invoke "i32_align_switch" (i32.const 0) (i32.const 0)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 0) (i32.const 1)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 1) (i32.const 0)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 1) (i32.const 1)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 2) (i32.const 0)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 2) (i32.const 1)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 2) (i32.const 2)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 3) (i32.const 0)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 3) (i32.const 1)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 3) (i32.const 2)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 4) (i32.const 0)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 4) (i32.const 1)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 4) (i32.const 2)) (i32.const 10)) +(assert_return (invoke "i32_align_switch" (i32.const 4) (i32.const 4)) (i32.const 10)) + +(assert_return (invoke "i64_align_switch" (i32.const 0) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 0) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 1) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 1) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 2) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 2) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 2) (i32.const 2)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 3) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 3) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 3) (i32.const 2)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 4) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 4) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 4) (i32.const 2)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 4) (i32.const 4)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 5) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 5) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 5) (i32.const 2)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 5) (i32.const 4)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 6) (i32.const 0)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 6) (i32.const 1)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 6) (i32.const 2)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 6) (i32.const 4)) (i64.const 10)) +(assert_return (invoke "i64_align_switch" (i32.const 6) (i32.const 8)) (i64.const 10)) + +;; Test that an i64 store with 4-byte alignment that's 4 bytes out of bounds traps without storing anything + +(module + (memory 1) + (func (export "store") (param i32 i64) + (i64.store align=4 (local.get 0) (local.get 1)) + ) + (func (export "load") (param i32) (result i32) + (i32.load (local.get 0)) + ) +) + +(assert_trap (invoke "store" (i32.const 65532) (i64.const -1)) "out of bounds memory access") +;; No memory was changed +(assert_return (invoke "load" (i32.const 65532)) (i32.const 0)) diff --git a/test/spec/binary-leb128.wast b/test/spec/binary-leb128.wast new file mode 100644 index 000000000..9afcb540c --- /dev/null +++ b/test/spec/binary-leb128.wast @@ -0,0 +1,963 @@ +;; Unsigned LEB128 can have non-minimal length +(module binary + "\00asm" "\01\00\00\00" + "\05\04\01" ;; Memory section with 1 entry + "\00\82\00" ;; no max, minimum 2 +) +(module binary + "\00asm" "\01\00\00\00" + "\05\07\01" ;; Memory section with 1 entry + "\00\82\80\80\80\00" ;; no max, minimum 2 +) +(module binary + "\00asm" "\01\00\00\00" + "\05\06\01" ;; Memory section with 1 entry + "\01\82\00" ;; minimum 2 + "\82\00" ;; max 2 +) +(module binary + "\00asm" "\01\00\00\00" + "\05\09\01" ;; Memory section with 1 entry + "\01\82\00" ;; minimum 2 + "\82\80\80\80\00" ;; max 2 +) +(module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; Memory section with 1 entry + "\00\00" ;; no max, minimum 0 + "\0b\07\01" ;; Data section with 1 entry + "\80\00" ;; Memory index 0, encoded with 2 bytes + "\41\00\0b\00" ;; (i32.const 0) with contents "" +) +(module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\07\01" ;; Element section with 1 entry + "\80\00" ;; Table index 0, encoded with 2 bytes + "\41\00\0b\00" ;; (i32.const 0) with no elements +) +(module binary + "\00asm" "\01\00\00\00" + "\00" ;; custom section + "\8a\00" ;; section size 10, encoded with 2 bytes + "\01" ;; name byte count + "1" ;; name + "23456789" ;; sequence of bytes +) +(module binary + "\00asm" "\01\00\00\00" + "\00" ;; custom section + "\0b" ;; section size + "\88\00" ;; name byte count 8, encoded with 2 bytes + "12345678" ;; name + "9" ;; sequence of bytes +) +(module binary + "\00asm" "\01\00\00\00" + "\01\08\01" ;; type section + "\60" ;; func type + "\82\00" ;; num params 2, encoded with 2 bytes + "\7f\7e" ;; param type + "\01" ;; num results + "\7f" ;; result type +) +(module binary + "\00asm" "\01\00\00\00" + "\01\08\01" ;; type section + "\60" ;; func type + "\02" ;; num params + "\7f\7e" ;; param type + "\81\00" ;; num results 1, encoded with 2 bytes + "\7f" ;; result type +) +(module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\17\01" ;; import section + "\88\00" ;; module name length 8, encoded with 2 bytes + "\73\70\65\63\74\65\73\74" ;; module name + "\09" ;; entity name length + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\00" ;; import signature index +) +(module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\17\01" ;; import section + "\08" ;; module name length + "\73\70\65\63\74\65\73\74" ;; module name + "\89\00" ;; entity name length 9, encoded with 2 bytes + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\00" ;; import signature index +) +(module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\17\01" ;; import section + "\08" ;; module name length + "\73\70\65\63\74\65\73\74" ;; module name + "\09" ;; entity name length 9 + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\80\00" ;; import signature index, encoded with 2 bytes +) +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; function type + "\03\03\01" ;; function section + "\80\00" ;; function 0 signature index, encoded with 2 bytes + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body +) +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\07\07\01" ;; export section + "\82\00" ;; string length 2, encoded with 2 bytes + "\66\31" ;; export name f1 + "\00" ;; export kind + "\00" ;; export func index + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body +) +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\07\07\01" ;; export section + "\02" ;; string length 2 + "\66\31" ;; export name f1 + "\00" ;; export kind + "\80\00" ;; export func index, encoded with 2 bytes + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body +) +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\0a" ;; code section + "\05" ;; section size + "\81\00" ;; num functions, encoded with 2 bytes + "\02\00\0b" ;; function body +) + +;; Signed LEB128 can have non-minimal length +(module binary + "\00asm" "\01\00\00\00" + "\06\07\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\80\00" ;; i32.const 0 + "\0b" ;; end +) +(module binary + "\00asm" "\01\00\00\00" + "\06\07\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\ff\7f" ;; i32.const -1 + "\0b" ;; end +) +(module binary + "\00asm" "\01\00\00\00" + "\06\0a\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\80\80\80\80\00" ;; i32.const 0 + "\0b" ;; end +) +(module binary + "\00asm" "\01\00\00\00" + "\06\0a\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\ff\ff\ff\ff\7f" ;; i32.const -1 + "\0b" ;; end +) + +(module binary + "\00asm" "\01\00\00\00" + "\06\07\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\80\00" ;; i64.const 0 with unused bits set + "\0b" ;; end +) +(module binary + "\00asm" "\01\00\00\00" + "\06\07\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\ff\7f" ;; i64.const -1 with unused bits unset + "\0b" ;; end +) +(module binary + "\00asm" "\01\00\00\00" + "\06\0f\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\80\80\80\80\80\80\80\80\80\00" ;; i64.const 0 with unused bits set + "\0b" ;; end +) +(module binary + "\00asm" "\01\00\00\00" + "\06\0f\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\7f" ;; i64.const -1 with unused bits unset + "\0b" ;; end +) + +;; Unsigned LEB128 must not be overlong +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\08\01" ;; Memory section with 1 entry + "\00\82\80\80\80\80\00" ;; no max, minimum 2 with one byte too many + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\0a\01" ;; Memory section with 1 entry + "\01\82\00" ;; minimum 2 + "\82\80\80\80\80\00" ;; max 2 with one byte too many + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; Memory section with 1 entry + "\00\00" ;; no max, minimum 0 + "\0b\0b\01" ;; Data section with 1 entry + "\80\80\80\80\80\00" ;; Memory index 0 with one byte too many + "\41\00\0b\00" ;; (i32.const 0) with contents "" + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\0b\01" ;; Element section with 1 entry + "\80\80\80\80\80\00" ;; Table index 0 with one byte too many + "\41\00\0b\00" ;; (i32.const 0) with no elements + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00" ;; custom section + "\83\80\80\80\80\00" ;; section size 3 with one byte too many + "\01" ;; name byte count + "1" ;; name + "2" ;; sequence of bytes + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00" ;; custom section + "\0A" ;; section size + "\83\80\80\80\80\00" ;; name byte count 3 with one byte too many + "123" ;; name + "4" ;; sequence of bytes + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\0c\01" ;; type section + "\60" ;; func type + "\82\80\80\80\80\00" ;; num params 2 with one byte too many + "\7f\7e" ;; param type + "\01" ;; num result + "\7f" ;; result type + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\08\01" ;; type section + "\60" ;; func type + "\02" ;; num params + "\7f\7e" ;; param type + "\81\80\80\80\80\00" ;; num result 1 with one byte too many + "\7f" ;; result type + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\1b\01" ;; import section + "\88\80\80\80\80\00" ;; module name length 8 with one byte too many + "\73\70\65\63\74\65\73\74" ;; module name + "\09" ;; entity name length + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\00" ;; import signature index + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\1b\01" ;; import section + "\08" ;; module name length + "\73\70\65\63\74\65\73\74" ;; module name + "\89\80\80\80\80\00" ;; entity name length 9 with one byte too many + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\00" ;; import signature index + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\1b\01" ;; import section + "\08" ;; module name length + "\73\70\65\63\74\65\73\74" ;; module name + "\09" ;; entity name length 9 + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\80\80\80\80\80\00" ;; import signature index 0 with one byte too many + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; function type + "\03\03\01" ;; function section + "\80\80\80\80\80\00" ;; function 0 signature index with one byte too many + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\07\0b\01" ;; export section + "\82\80\80\80\80\00" ;; string length 2 with one byte too many + "\66\31" ;; export name f1 + "\00" ;; export kind + "\00" ;; export func index + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\07\0b\01" ;; export section + "\02" ;; string length 2 + "\66\31" ;; export name f1 + "\00" ;; export kind + "\80\80\80\80\80\00" ;; export func index 0 with one byte too many + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\0a" ;; code section + "\05" ;; section size + "\81\80\80\80\80\00" ;; num functions 1 with one byte too many + "\02\00\0b" ;; function body + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\11\01" ;; Code section + ;; function 0 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\02" ;; alignment 2 + "\82\80\80\80\80\00" ;; offset 2 with one byte too many + "\1a" ;; drop + "\0b" ;; end + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\11\01" ;; Code section + ;; function 0 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\82\80\80\80\80\00" ;; alignment 2 with one byte too many + "\00" ;; offset 0 + "\1a" ;; drop + "\0b" ;; end + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\12\01" ;; Code section + ;; function 0 + "\10\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\41\03" ;; i32.const 3 + "\36" ;; i32.store + "\82\80\80\80\80\00" ;; alignment 2 with one byte too many + "\03" ;; offset 3 + "\0b" ;; end + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\12\01" ;; Code section + ;; function 0 + "\10\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\41\03" ;; i32.const 3 + "\36" ;; i32.store + "\02" ;; alignment 2 + "\82\80\80\80\80\00" ;; offset 2 with one byte too many + "\0b" ;; end + ) + "integer representation too long" +) + +;; Signed LEB128 must not be overlong +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0b\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\80\80\80\80\80\00" ;; i32.const 0 with one byte too many + "\0b" ;; end + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0b\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\ff\ff\ff\ff\ff\7f" ;; i32.const -1 with one byte too many + "\0b" ;; end + ) + "integer representation too long" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\10\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\80\80\80\80\80\80\80\80\80\80\00" ;; i64.const 0 with one byte too many + "\0b" ;; end + ) + "integer representation too long" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\10\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\ff\7f" ;; i64.const -1 with one byte too many + "\0b" ;; end + ) + "integer representation too long" +) + +;; Unsigned LEB128s zero-extend +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\07\01" ;; Memory section with 1 entry + "\00\82\80\80\80\70" ;; no max, minimum 2 with unused bits set + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\07\01" ;; Memory section with 1 entry + "\00\82\80\80\80\40" ;; no max, minimum 2 with some unused bits set + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\09\01" ;; Memory section with 1 entry + "\01\82\00" ;; minimum 2 + "\82\80\80\80\10" ;; max 2 with unused bits set + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\09\01" ;; Memory section with 1 entry + "\01\82\00" ;; minimum 2 + "\82\80\80\80\40" ;; max 2 with some unused bits set + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; Memory section with 1 entry + "\00\00" ;; no max, minimum 0 + "\0b\0a\01" ;; Data section with 1 entry + "\80\80\80\80\10" ;; Memory index 0 with unused bits set + "\41\00\0b\00" ;; (i32.const 0) with contents "" + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\04\04\01" ;; Table section with 1 entry + "\70\00\00" ;; no max, minimum 0, funcref + "\09\0a\01" ;; Element section with 1 entry + "\80\80\80\80\10" ;; Table index 0 with unused bits set + "\41\00\0b\00" ;; (i32.const 0) with no elements + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00" ;; custom section + "\83\80\80\80\10" ;; section size 3 with unused bits set + "\01" ;; name byte count + "1" ;; name + "2" ;; sequence of bytes + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00" ;; custom section + "\09" ;; section size + "\83\80\80\80\40" ;; name byte count 3 with unused bits set + "123" ;; name + "4" ;; sequence of bytes + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\0b\01" ;; type section + "\60" ;; func type + "\82\80\80\80\10" ;; num params 2 with unused bits set + "\7f\7e" ;; param type + "\01" ;; num result + "\7f" ;; result type + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\0b\01" ;; type section + "\60" ;; func type + "\02" ;; num params + "\7f\7e" ;; param type + "\81\80\80\80\40" ;; num result 1 with unused bits set + "\7f" ;; result type + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\1a\01" ;; import section + "\88\80\80\80\10" ;; module name length 8 with unused bits set + "\73\70\65\63\74\65\73\74" ;; module name + "\09" ;; entity name length + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\00" ;; import signature index + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\1a\01" ;; import section + "\08" ;; module name length + "\73\70\65\63\74\65\73\74" ;; module name + "\89\80\80\80\40" ;; entity name length 9 with unused bits set + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\00" ;; import signature index + ) + "integer too large" +) +(assert_malformed +(module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; function type + "\02\1a\01" ;; import section + "\08" ;; module name length + "\73\70\65\63\74\65\73\74" ;; module name + "\09" ;; entity name length 9 + "\70\72\69\6e\74\5f\69\33\32" ;; entity name + "\00" ;; import kind + "\80\80\80\80\10" ;; import signature index 0 with unused bits set +) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; function type + "\03\06\01" ;; function section + "\80\80\80\80\10" ;; function 0 signature index with unused bits set + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "integer too large" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\07\0a\01" ;; export section + "\82\80\80\80\10" ;; string length 2 with unused bits set + "\66\31" ;; export name f1 + "\00" ;; export kind + "\00" ;; export func index + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\07\0a\01" ;; export section + "\02" ;; string length 2 + "\66\31" ;; export name f1 + "\00" ;; export kind + "\80\80\80\80\10" ;; export func index with unused bits set + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; fun type + "\03\02\01\00" ;; function section + "\0a" ;; code section + "\08" ;; section size + "\81\80\80\80\10" ;; num functions 1 with unused bits set + "\02\00\0b" ;; function body + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\10\01" ;; Code section + ;; function 0 + "\0e\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\02" ;; alignment 2 + "\82\80\80\80\10" ;; offset 2 with unused bits set + "\1a" ;; drop + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\10\01" ;; Code section + ;; function 0 + "\0e\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\02" ;; alignment 2 + "\82\80\80\80\40" ;; offset 2 with some unused bits set + "\1a" ;; drop + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\10\01" ;; Code section + "\0e\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\82\80\80\80\10" ;; alignment 2 with unused bits set + "\00" ;; offset 0 + "\1a" ;; drop + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\10\01" ;; Code section + ;; function 0 + "\0e\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\28" ;; i32.load + "\82\80\80\80\40" ;; alignment 2 with some unused bits set + "\00" ;; offset 0 + "\1a" ;; drop + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\11\01" ;; Code section + ;; function 0 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\41\03" ;; i32.const 3 + "\36" ;; i32.store + "\82\80\80\80\10" ;; alignment 2 with unused bits set + "\03" ;; offset 3 + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\11\01" ;; Code section + ;; function 0 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\41\03" ;; i32.const 3 + "\36" ;; i32.store + "\82\80\80\80\40" ;; alignment 2 with some unused bits set + "\03" ;; offset 3 + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\11\01" ;; Code section + ;; function 0 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\41\03" ;; i32.const 3 + "\36" ;; i32.store + "\03" ;; alignment 2 + "\82\80\80\80\10" ;; offset 2 with unused bits set + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\01" ;; Memory section + "\0a\11\01" ;; Code section + + ;; function 0 + "\0f\01\01" ;; local type count + "\7f" ;; i32 + "\41\00" ;; i32.const 0 + "\41\03" ;; i32.const 3 + "\36" ;; i32.store + "\02" ;; alignment 2 + "\82\80\80\80\40" ;; offset 2 with some unused bits set + "\0b" ;; end + ) + "integer too large" +) + +;; Signed LEB128s sign-extend +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0a\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\80\80\80\80\70" ;; i32.const 0 with unused bits set + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0a\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\ff\ff\ff\ff\0f" ;; i32.const -1 with unused bits unset + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0a\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\80\80\80\80\1f" ;; i32.const 0 with some unused bits set + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0a\01" ;; Global section with 1 entry + "\7f\00" ;; i32, immutable + "\41\ff\ff\ff\ff\4f" ;; i32.const -1 with some unused bits unset + "\0b" ;; end + ) + "integer too large" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0f\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\80\80\80\80\80\80\80\80\80\7e" ;; i64.const 0 with unused bits set + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0f\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\01" ;; i64.const -1 with unused bits unset + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0f\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\80\80\80\80\80\80\80\80\80\02" ;; i64.const 0 with some unused bits set + "\0b" ;; end + ) + "integer too large" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0f\01" ;; Global section with 1 entry + "\7e\00" ;; i64, immutable + "\42\ff\ff\ff\ff\ff\ff\ff\ff\ff\41" ;; i64.const -1 with some unused bits unset + "\0b" ;; end + ) + "integer too large" +) diff --git a/test/spec/binary.wast b/test/spec/binary.wast index 07fc114a9..e748bbe8c 100644 --- a/test/spec/binary.wast +++ b/test/spec/binary.wast @@ -1,15 +1,811 @@ -(module "\00asm\0c\00\00\00") -(module "\00asm" "\0c\00\00\00") -(module $M1 "\00asm\0c\00\00\00") -(module $M2 "\00asm" "\0c\00\00\00") - -(assert_malformed (module "") "unexpected end") -(assert_malformed (module "\01") "unexpected end") -(assert_malformed (module "\00as") "unexpected end") -(assert_malformed (module "\01") "unexpected end") -(assert_malformed (module "asm\00") "magic header not detected") - -(assert_malformed (module "\00asm") "unexpected end") -(assert_malformed (module "\00asm\0c") "unexpected end") -(assert_malformed (module "\00asm\0c\00\00") "unexpected end") -(assert_malformed (module "\00asm\10\00\00\00") "unknown binary version") +(module binary "\00asm\01\00\00\00") +(module binary "\00asm" "\01\00\00\00") +(module $M1 binary "\00asm\01\00\00\00") +(module $M2 binary "\00asm" "\01\00\00\00") + +(assert_malformed (module binary "") "unexpected end") +(assert_malformed (module binary "\01") "unexpected end") +(assert_malformed (module binary "\00as") "unexpected end") +(assert_malformed (module binary "asm\00") "magic header not detected") +(assert_malformed (module binary "msa\00") "magic header not detected") +(assert_malformed (module binary "msa\00\01\00\00\00") "magic header not detected") +(assert_malformed (module binary "msa\00\00\00\00\01") "magic header not detected") +(assert_malformed (module binary "asm\01\00\00\00\00") "magic header not detected") +(assert_malformed (module binary "wasm\01\00\00\00") "magic header not detected") +(assert_malformed (module binary "\7fasm\01\00\00\00") "magic header not detected") +(assert_malformed (module binary "\80asm\01\00\00\00") "magic header not detected") +(assert_malformed (module binary "\82asm\01\00\00\00") "magic header not detected") +(assert_malformed (module binary "\ffasm\01\00\00\00") "magic header not detected") + +;; 8-byte endian-reversed. +(assert_malformed (module binary "\00\00\00\01msa\00") "magic header not detected") + +;; Middle-endian byte orderings. +(assert_malformed (module binary "a\00ms\00\01\00\00") "magic header not detected") +(assert_malformed (module binary "sm\00a\00\00\01\00") "magic header not detected") + +;; Upper-cased. +(assert_malformed (module binary "\00ASM\01\00\00\00") "magic header not detected") + +;; EBCDIC-encoded magic. +(assert_malformed (module binary "\00\81\a2\94\01\00\00\00") "magic header not detected") + +;; Leading UTF-8 BOM. +(assert_malformed (module binary "\ef\bb\bf\00asm\01\00\00\00") "magic header not detected") + +;; Malformed binary version. +(assert_malformed (module binary "\00asm") "unexpected end") +(assert_malformed (module binary "\00asm\01") "unexpected end") +(assert_malformed (module binary "\00asm\01\00\00") "unexpected end") +(assert_malformed (module binary "\00asm\00\00\00\00") "unknown binary version") +(assert_malformed (module binary "\00asm\0d\00\00\00") "unknown binary version") +(assert_malformed (module binary "\00asm\0e\00\00\00") "unknown binary version") +(assert_malformed (module binary "\00asm\00\01\00\00") "unknown binary version") +(assert_malformed (module binary "\00asm\00\00\01\00") "unknown binary version") +(assert_malformed (module binary "\00asm\00\00\00\01") "unknown binary version") + + +;; call_indirect reserved byte equal to zero. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\04\04\01\70\00\00" ;; Table section + "\0a\09\01" ;; Code section + + ;; function 0 + "\07\00" + "\41\00" ;; i32.const 0 + "\11\00" ;; call_indirect (type 0) + "\01" ;; call_indirect reserved byte is not equal to zero! + "\0b" ;; end + ) + "zero flag expected" +) + +;; call_indirect reserved byte should not be a "long" LEB128 zero. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\04\04\01\70\00\00" ;; Table section + "\0a\0a\01" ;; Code section + + ;; function 0 + "\07\00" + "\41\00" ;; i32.const 0 + "\11\00" ;; call_indirect (type 0) + "\80\00" ;; call_indirect reserved byte + "\0b" ;; end + ) + "zero flag expected" +) + +;; Same as above for 3, 4, and 5-byte zero encodings. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\04\04\01\70\00\00" ;; Table section + "\0a\0b\01" ;; Code section + + ;; function 0 + "\08\00" + "\41\00" ;; i32.const 0 + "\11\00" ;; call_indirect (type 0) + "\80\80\00" ;; call_indirect reserved byte + "\0b" ;; end + ) + "zero flag expected" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\04\04\01\70\00\00" ;; Table section + "\0a\0c\01" ;; Code section + + ;; function 0 + "\09\00" + "\41\00" ;; i32.const 0 + "\11\00" ;; call_indirect (type 0) + "\80\80\80\00" ;; call_indirect reserved byte + "\0b" ;; end + ) + "zero flag expected" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\04\04\01\70\00\00" ;; Table section + "\0a\0d\01" ;; Code section + + ;; function 0 + "\0a\00" + "\41\00" ;; i32.const 0 + "\11\00" ;; call_indirect (type 0) + "\80\80\80\80\00" ;; call_indirect reserved byte + "\0b" ;; end + ) + "zero flag expected" +) + +;; memory.grow reserved byte equal to zero. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\09\01" ;; Code section + + ;; function 0 + "\07\00" + "\41\00" ;; i32.const 0 + "\40" ;; memory.grow + "\01" ;; memory.grow reserved byte is not equal to zero! + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +;; memory.grow reserved byte should not be a "long" LEB128 zero. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\0a\01" ;; Code section + + ;; function 0 + "\08\00" + "\41\00" ;; i32.const 0 + "\40" ;; memory.grow + "\80\00" ;; memory.grow reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +;; Same as above for 3, 4, and 5-byte zero encodings. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\0b\01" ;; Code section + + ;; function 0 + "\09\00" + "\41\00" ;; i32.const 0 + "\40" ;; memory.grow + "\80\80\00" ;; memory.grow reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\0c\01" ;; Code section + + ;; function 0 + "\0a\00" + "\41\00" ;; i32.const 0 + "\40" ;; memory.grow + "\80\80\80\00" ;; memory.grow reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\0d\01" ;; Code section + + ;; function 0 + "\0b\00" + "\41\00" ;; i32.const 0 + "\40" ;; memory.grow + "\80\80\80\80\00" ;; memory.grow reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +;; memory.size reserved byte equal to zero. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\07\01" ;; Code section + + ;; function 0 + "\05\00" + "\3f" ;; memory.size + "\01" ;; memory.size reserved byte is not equal to zero! + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +;; memory.size reserved byte should not be a "long" LEB128 zero. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\08\01" ;; Code section + + ;; function 0 + "\06\00" + "\3f" ;; memory.size + "\80\00" ;; memory.size reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +;; Same as above for 3, 4, and 5-byte zero encodings. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\09\01" ;; Code section + + ;; function 0 + "\07\00" + "\3f" ;; memory.size + "\80\80\00" ;; memory.size reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\0a\01" ;; Code section + + ;; function 0 + "\08\00" + "\3f" ;; memory.size + "\80\80\80\00" ;; memory.size reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\05\03\01\00\00" ;; Memory section + "\0a\0b\01" ;; Code section + + ;; function 0 + "\09\00" + "\3f" ;; memory.size + "\80\80\80\80\00" ;; memory.size reserved byte + "\1a" ;; drop + "\0b" ;; end + ) + "zero flag expected" +) + +;; No more than 2^32 locals. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\0a\0c\01" ;; Code section + + ;; function 0 + "\0a\02" + "\ff\ff\ff\ff\0f\7f" ;; 0xFFFFFFFF i32 + "\02\7e" ;; 0x00000002 i64 + "\0b" ;; end + ) + "too many locals" +) + +;; Local count can be 0. +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\0a\0a\01" ;; Code section + + ;; function 0 + "\08\03" + "\00\7f" ;; 0 i32 + "\00\7e" ;; 0 i64 + "\02\7d" ;; 2 f32 + "\0b" ;; end +) + +;; Function section has non-zero count, but code section is absent. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\03\02\00\00" ;; Function section with 2 functions + ) + "function and code section have inconsistent lengths" +) + +;; Code section has non-zero count, but function section is absent. +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\0a\04\01\02\00\0b" ;; Code section with 1 empty function + ) + "function and code section have inconsistent lengths" +) + +;; Function section count > code section count +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\03\02\00\00" ;; Function section with 2 functions + "\0a\04\01\02\00\0b" ;; Code section with 1 empty function + ) + "function and code section have inconsistent lengths" +) + +;; Function section count < code section count +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section with 1 function + "\0a\07\02\02\00\0b\02\00\0b" ;; Code section with 2 empty functions + ) + "function and code section have inconsistent lengths" +) + +;; Function section has zero count, and code section is absent. +(module binary + "\00asm" "\01\00\00\00" + "\03\01\00" ;; Function section with 0 functions +) + +;; Code section has zero count, and function section is absent. +(module binary + "\00asm" "\01\00\00\00" + "\0a\01\00" ;; Code section with 0 functions +) + +;; Type count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\01\01\00" ;; type count can be zero +) + +;; 2 type declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\07\02" ;; type section with inconsistent count (2 declared, 1 given) + "\60\00\00" ;; 1st type + ;; "\60\00\00" ;; 2nd type (missed) + ) + "unexpected end of section or function" +) + +;; 1 type declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\07\01" ;; type section with inconsistent count (1 declared, 2 given) + "\60\00\00" ;; 1st type + "\60\00\00" ;; 2nd type (redundant) + ) + "section size mismatch" +) + +;; Import count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; type 0 + "\02\01\00" ;; import count can be zero +) + +;; 2 import declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\05\01" ;; type section + "\60\01\7f\00" ;; type 0 + "\02\16\02" ;; import section with inconsistent count (2 declared, 1 given) + ;; 1st import + "\08" ;; string length + "\73\70\65\63\74\65\73\74" ;; spectest + "\09" ;; string length + "\70\72\69\6e\74\5f\69\33\32" ;; print_i32 + "\00\00" ;; import kind, import signature index + ;; 2nd import + ;; (missed) + ) + "unexpected end of section or function" +) + +;; 1 import declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\09\02" ;; type section + "\60\01\7f\00" ;; type 0 + "\60\01\7d\00" ;; type 1 + "\02\2b\01" ;; import section with inconsistent count (1 declared, 2 given) + ;; 1st import + "\08" ;; string length + "\73\70\65\63\74\65\73\74" ;; spectest + "\09" ;; string length + "\70\72\69\6e\74\5f\69\33\32" ;; print_i32 + "\00\00" ;; import kind, import signature index + ;; 2nd import + ;; (redundant) + "\08" ;; string length + "\73\70\65\63\74\65\73\74" ;; spectest + "\09" ;; string length + "\70\72\69\6e\74\5f\66\33\32" ;; print_f32 + "\00\01" ;; import kind, import signature index + ) + "section size mismatch" +) + +;; Table count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\04\01\00" ;; table count can be zero +) + +;; 1 table declared, 0 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\04\01\01" ;; table section with inconsistent count (1 declared, 0 given) + ;; "\70\01\00\00" ;; table entity + ) + "unexpected end of section or function" +) + +;; Memory count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\05\01\00" ;; memory count can be zero +) + +;; 1 memory declared, 0 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\01\01" ;; memory section with inconsistent count (1 declared, 0 given) + ;; "\00\00" ;; memory 0 (missed) + ) + "unexpected end of section or function" +) + +;; Global count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\06\01\00" ;; global count can be zero +) + +;; 2 global declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\06\02" ;; global section with inconsistent count (2 declared, 1 given) + "\7f\00\41\00\0b" ;; global 0 + ;; "\7f\00\41\00\0b" ;; global 1 (missed) + ) + "unexpected end of section or function" +) + +;; 1 global declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\0b\01" ;; global section with inconsistent count (1 declared, 2 given) + "\7f\00\41\00\0b" ;; global 0 + "\7f\00\41\00\0b" ;; global 1 (redundant) + ) + "section size mismatch" +) + +;; Export count can be 0 +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\03\02\00\00" ;; func section + "\07\01\00" ;; export count can be zero + "\0a\07\02" ;; code section + "\02\00\0b" ;; function body 0 + "\02\00\0b" ;; function body 1 +) + +;; 2 export declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\03\02\00\00" ;; func section + "\07\06\02" ;; export section with inconsistent count (2 declared, 1 given) + "\02" ;; export 0 + "\66\31" ;; export name + "\00\00" ;; export kind, export func index + ;; "\02" ;; export 1 (missed) + ;; "\66\32" ;; export name + ;; "\00\01" ;; export kind, export func index + "\0a\07\02" ;; code section + "\02\00\0b" ;; function body 0 + "\02\00\0b" ;; function body 1 + ) + "unexpected end of section or function" +) + +;; 1 export declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\03\02\00\00" ;; func section + "\07\0b\01" ;; export section with inconsistent count (1 declared, 2 given) + "\02" ;; export 0 + "\66\31" ;; export name + "\00\00" ;; export kind, export func index + "\02" ;; export 1 (redundant) + "\66\32" ;; export name + "\00\01" ;; export kind, export func index + "\0a\07\02" ;; code section + "\02\00\0b" ;; function body 0 + "\02\00\0b" ;; function body 1 + ) + "section size mismatch" +) + +;; elem segment count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\02\01\00" ;; func section + "\04\04\01" ;; table section + "\70\00\01" ;; table 0 + "\09\01\00" ;; elem segment count can be zero + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body +) + +;; 2 elem segment declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\02\01\00" ;; func section + "\04\04\01" ;; table section + "\70\00\01" ;; table 0 + "\09\07\02" ;; elem with inconsistent segment count (2 declared, 1 given) + "\00\41\00\0b\01\00" ;; elem 0 + ;; "\00\41\00\0b\01\00" ;; elem 1 (missed) + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "invalid value type" +) + +;; 1 elem segment declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\02\01\00" ;; func section + "\04\04\01" ;; table section + "\70\00\01" ;; table 0 + "\09\0d\01" ;; elem with inconsistent segment count (1 declared, 2 given) + "\00\41\00\0b\01\00" ;; elem 0 + "\00\41\00\0b\01\00" ;; elem 1 (redundant) + "\0a\04\01" ;; code section + "\02\00\0b" ;; function body + ) + "section size mismatch" +) + +;; data segment count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; memory section + "\00\01" ;; memory 0 + "\0b\01\00" ;; data segment count can be zero +) + +;; 2 data segment declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; memory section + "\00\01" ;; memory 0 + "\0b\07\02" ;; data with inconsistent segment count (2 declared, 1 given) + "\00\41\00\0b\01\61" ;; data 0 + ;; "\00\41\01\0b\01\62" ;; data 1 (missed) + ) + "unexpected end of section or function" +) + +;; 1 data segment declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; memory section + "\00\01" ;; memory 0 + "\0b\0d\01" ;; data with inconsistent segment count (1 declared, 2 given) + "\00\41\00\0b\01\61" ;; data 0 + "\00\41\01\0b\01\62" ;; data 1 (redundant) + ) + "section size mismatch" +) + +;; data segment has 7 bytes declared, but 6 bytes given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; memory section + "\00\01" ;; memory 0 + "\0b\0c\01" ;; data section + "\00\41\03\0b" ;; data segment 0 + "\07" ;; data segment size with inconsistent lengths (7 declared, 6 given) + "\61\62\63\64\65\66" ;; 6 bytes given + ) + "unexpected end of section or function" +) + +;; data segment has 5 bytes declared, but 6 bytes given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\05\03\01" ;; memory section + "\00\01" ;; memory 0 + "\0b\0c\01" ;; data section + "\00\41\00\0b" ;; data segment 0 + "\05" ;; data segment size with inconsistent lengths (5 declared, 6 given) + "\61\62\63\64\65\66" ;; 6 bytes given + ) + "section size mismatch" +) + +;; br_table target count can be zero +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\02\01\00" ;; func section + "\0a\11\01" ;; code section + "\0f\00" ;; func 0 + "\02\40" ;; block 0 + "\41\01" ;; condition of if 0 + "\04\40" ;; if 0 + "\41\01" ;; index of br_table element + "\0e\00" ;; br_table target count can be zero + "\02" ;; break depth for default + "\0b\0b\0b" ;; end +) + +;; 2 br_table target declared, 1 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\02\01\00" ;; func section + "\0a\12\01" ;; code section + "\10\00" ;; func 0 + "\02\40" ;; block 0 + "\41\01" ;; condition of if 0 + "\04\40" ;; if 0 + "\41\01" ;; index of br_table element + "\0e\02" ;; br_table with inconsistent target count (2 declared, 1 given) + "\00" ;; break depth 0 + ;; "\01" ;; break depth 1 (missed) + "\02" ;; break depth for default + "\0b\0b\0b" ;; end + ) + "unexpected end of section or function" +) + +;; 1 br_table target declared, 2 given +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01" ;; type section + "\60\00\00" ;; type 0 + "\03\02\01\00" ;; func section + "\0a\12\01" ;; code section + "\11\00" ;; func 0 + "\02\40" ;; block 0 + "\41\01" ;; condition of if 0 + "\04\40" ;; if 0 + "\41\01" ;; index of br_table element + "\0e\01" ;; br_table with inconsistent target count (1 declared, 2 given) + "\00" ;; break depth 0 + "\01" ;; break depth 1 + "\02" ;; break depth for default + "\0b\0b\0b" ;; end + ) + "invalid value type" +) + +;; Start section +(module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\08\01\00" ;; Start section: function 0 + + "\0a\04\01" ;; Code section + ;; function 0 + "\02\00" + "\0b" ;; end +) + +;; Multiple start sections +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\04\01\60\00\00" ;; Type section + "\03\02\01\00" ;; Function section + "\08\01\00" ;; Start section: function 0 + "\08\01\00" ;; Start section: function 0 + + "\0a\04\01" ;; Code section + ;; function 0 + "\02\00" + "\0b" ;; end + ) + "junk after last section" +) diff --git a/test/spec/block.wast b/test/spec/block.wast index 505560885..625dd98fb 100644 --- a/test/spec/block.wast +++ b/test/spec/block.wast @@ -2,6 +2,8 @@ (module ;; Auxiliary definition + (memory 1) + (func $dummy) (func (export "empty") @@ -11,53 +13,189 @@ (func (export "singular") (result i32) (block (nop)) - (block i32 (i32.const 7)) + (block (result i32) (i32.const 7)) ) (func (export "multi") (result i32) (block (call $dummy) (call $dummy) (call $dummy) (call $dummy)) - (block i32 (call $dummy) (call $dummy) (call $dummy) (i32.const 8)) + (block (result i32) (call $dummy) (call $dummy) (call $dummy) (i32.const 8)) ) (func (export "nested") (result i32) - (block i32 + (block (result i32) (block (call $dummy) (block) (nop)) - (block i32 (call $dummy) (i32.const 9)) + (block (result i32) (call $dummy) (i32.const 9)) ) ) (func (export "deep") (result i32) - (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 - (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 - (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 - (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 - (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 - (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 - (block i32 (block i32 (call $dummy) (i32.const 150))) - )))))) - )))))) - )))))) - )))))) - )))))) - )))))) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (block (result i32) (block (result i32) + (call $dummy) (i32.const 150) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + ) + + (func (export "as-select-first") (result i32) + (select (block (result i32) (i32.const 1)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-select-mid") (result i32) + (select (i32.const 2) (block (result i32) (i32.const 1)) (i32.const 3)) + ) + (func (export "as-select-last") (result i32) + (select (i32.const 2) (i32.const 3) (block (result i32) (i32.const 1))) + ) + + (func (export "as-loop-first") (result i32) + (loop (result i32) (block (result i32) (i32.const 1)) (call $dummy) (call $dummy)) + ) + (func (export "as-loop-mid") (result i32) + (loop (result i32) (call $dummy) (block (result i32) (i32.const 1)) (call $dummy)) + ) + (func (export "as-loop-last") (result i32) + (loop (result i32) (call $dummy) (call $dummy) (block (result i32) (i32.const 1))) + ) + + (func (export "as-if-condition") + (block (result i32) (i32.const 1)) (if (then (call $dummy))) + ) + (func (export "as-if-then") (result i32) + (if (result i32) (i32.const 1) (then (block (result i32) (i32.const 1))) (else (i32.const 2))) + ) + (func (export "as-if-else") (result i32) + (if (result i32) (i32.const 1) (then (i32.const 2)) (else (block (result i32) (i32.const 1)))) + ) + + (func (export "as-br_if-first") (result i32) + (block (result i32) (br_if 0 (block (result i32) (i32.const 1)) (i32.const 2))) + ) + (func (export "as-br_if-last") (result i32) + (block (result i32) (br_if 0 (i32.const 2) (block (result i32) (i32.const 1)))) + ) + + (func (export "as-br_table-first") (result i32) + (block (result i32) (block (result i32) (i32.const 1)) (i32.const 2) (br_table 0 0)) + ) + (func (export "as-br_table-last") (result i32) + (block (result i32) (i32.const 2) (block (result i32) (i32.const 1)) (br_table 0 0)) + ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (result i32) + (block (result i32) + (call_indirect (type $check) + (block (result i32) (i32.const 1)) (i32.const 2) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) (block (result i32) (i32.const 1)) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (i32.const 2) (block (result i32) (i32.const 0)) + ) + ) + ) + + (func (export "as-store-first") + (block (result i32) (i32.const 1)) (i32.const 1) (i32.store) + ) + (func (export "as-store-last") + (i32.const 10) (block (result i32) (i32.const 1)) (i32.store) + ) + + (func (export "as-memory.grow-value") (result i32) + (memory.grow (block (result i32) (i32.const 1))) + ) + + (func $f (param i32) (result i32) (local.get 0)) + + (func (export "as-call-value") (result i32) + (call $f (block (result i32) (i32.const 1))) + ) + (func (export "as-return-value") (result i32) + (block (result i32) (i32.const 1)) (return) + ) + (func (export "as-drop-operand") + (drop (block (result i32) (i32.const 1))) + ) + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (block (result i32) (i32.const 1)))) + ) + (func (export "as-local.set-value") (result i32) + (local i32) (local.set 0 (block (result i32) (i32.const 1))) (local.get 0) + ) + (func (export "as-local.tee-value") (result i32) + (local i32) (local.tee 0 (block (result i32) (i32.const 1))) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (result i32) + (global.set $a (block (result i32) (i32.const 1))) + (global.get $a) + ) + + (func (export "as-load-operand") (result i32) + (i32.load (block (result i32) (i32.const 1))) ) (func (export "as-unary-operand") (result i32) - (i32.ctz (block i32 (call $dummy) (i32.const 13))) + (i32.ctz (block (result i32) (call $dummy) (i32.const 13))) ) (func (export "as-binary-operand") (result i32) (i32.mul - (block i32 (call $dummy) (i32.const 3)) - (block i32 (call $dummy) (i32.const 4)) + (block (result i32) (call $dummy) (i32.const 3)) + (block (result i32) (call $dummy) (i32.const 4)) ) ) (func (export "as-test-operand") (result i32) - (i32.eqz (block i32 (call $dummy) (i32.const 13))) + (i32.eqz (block (result i32) (call $dummy) (i32.const 13))) ) (func (export "as-compare-operand") (result i32) (f32.gt - (block f32 (call $dummy) (f32.const 3)) - (block f32 (call $dummy) (f32.const 3)) + (block (result f32) (call $dummy) (f32.const 3)) + (block (result f32) (call $dummy) (f32.const 3)) ) ) @@ -69,10 +207,10 @@ (i32.const 19) ) (func (export "break-value") (result i32) - (block i32 (br 0 (i32.const 18)) (i32.const 19)) + (block (result i32) (br 0 (i32.const 18)) (i32.const 19)) ) (func (export "break-repeated") (result i32) - (block i32 + (block (result i32) (br 0 (i32.const 18)) (br 0 (i32.const 19)) (drop (br_if 0 (i32.const 20) (i32.const 0))) @@ -86,13 +224,13 @@ (func (export "break-inner") (result i32) (local i32) (local.set 0 (i32.const 0)) - (local.set 0 (i32.add (local.get 0) (block i32 (block i32 (br 1 (i32.const 0x1)))))) - (local.set 0 (i32.add (local.get 0) (block i32 (block (br 0)) (i32.const 0x2)))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (block (result i32) (br 1 (i32.const 0x1)))))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (block (br 0)) (i32.const 0x2)))) (local.set 0 - (i32.add (local.get 0) (block i32 (i32.ctz (br 0 (i32.const 0x4))))) + (i32.add (local.get 0) (block (result i32) (i32.ctz (br 0 (i32.const 0x4))))) ) (local.set 0 - (i32.add (local.get 0) (block i32 (i32.ctz (block i32 (br 1 (i32.const 0x8)))))) + (i32.add (local.get 0) (block (result i32) (i32.ctz (block (result i32) (br 1 (i32.const 0x8)))))) ) (local.get 0) ) @@ -117,6 +255,41 @@ (assert_return (invoke "nested") (i32.const 9)) (assert_return (invoke "deep") (i32.const 150)) +(assert_return (invoke "as-select-first") (i32.const 1)) +(assert_return (invoke "as-select-mid") (i32.const 2)) +(assert_return (invoke "as-select-last") (i32.const 2)) + +(assert_return (invoke "as-loop-first") (i32.const 1)) +(assert_return (invoke "as-loop-mid") (i32.const 1)) +(assert_return (invoke "as-loop-last") (i32.const 1)) + +(assert_return (invoke "as-if-condition")) +(assert_return (invoke "as-if-then") (i32.const 1)) +(assert_return (invoke "as-if-else") (i32.const 2)) + +(assert_return (invoke "as-br_if-first") (i32.const 1)) +(assert_return (invoke "as-br_if-last") (i32.const 2)) + +(assert_return (invoke "as-br_table-first") (i32.const 1)) +(assert_return (invoke "as-br_table-last") (i32.const 2)) + +(assert_return (invoke "as-call_indirect-first") (i32.const 1)) +(assert_return (invoke "as-call_indirect-mid") (i32.const 2)) +(assert_return (invoke "as-call_indirect-last") (i32.const 1)) + +(assert_return (invoke "as-store-first")) +(assert_return (invoke "as-store-last")) + +(assert_return (invoke "as-memory.grow-value") (i32.const 1)) +(assert_return (invoke "as-call-value") (i32.const 1)) +(assert_return (invoke "as-return-value") (i32.const 1)) +(assert_return (invoke "as-drop-operand")) +(assert_return (invoke "as-br-value") (i32.const 1)) +(assert_return (invoke "as-local.set-value") (i32.const 1)) +(assert_return (invoke "as-local.tee-value") (i32.const 1)) +(assert_return (invoke "as-global.set-value") (i32.const 1)) +(assert_return (invoke "as-load-operand") (i32.const 1)) + (assert_return (invoke "as-unary-operand") (i32.const 0)) (assert_return (invoke "as-binary-operand") (i32.const 12)) (assert_return (invoke "as-test-operand") (i32.const 0)) @@ -147,138 +320,801 @@ ) (assert_invalid - (module (func $type-value-num-vs-void + (module (func $type-value-i32-vs-void (block (i32.const 1)) )) "type mismatch" ) (assert_invalid - (module (func $type-value-void-vs-num (result i32) - (block (nop)) + (module (func $type-value-i64-vs-void + (block (i64.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f32-vs-void + (block (f32.const 1.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f64-vs-void + (block (f64.const 1.0)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-empty-vs-i32 (result i32) + (block (result i32)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-empty-vs-i64 (result i64) + (block (result i64)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-empty-vs-f32 (result f32) + (block (result f32)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-empty-vs-f64 (result f64) + (block (result f64)) + )) + "type mismatch" +) + +(assert_invalid + (module + (func $type-value-empty-in-block + (i32.const 0) + (block (block (result i32)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-in-loop + (i32.const 0) + (loop (block (result i32)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (block (result i32)) (drop))) + ) + ) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-void-vs-i32 (result i32) + (block (result i32) (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-i64 (result i64) + (block (result i64) (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-f32 (result f32) + (block (result f32) (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-f64 (result f64) + (block (result f64) (nop)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-i32-vs-i64 (result i32) + (block (result i32) (i64.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-i32-vs-f32 (result i32) + (block (result i32) (f32.const 0.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-i32-vs-f64 (result i32) + (block (result i32) (f64.const 0.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-i64-vs-i32 (result i64) + (block (result i64) (i32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-i64-vs-f32 (result i64) + (block (result i64) (f32.const 0.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-i64-vs-f64 (result i64) + (block (result i64) (f64.const 0.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f32-vs-i32 (result f32) + (block (result f32) (i32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f32-vs-i64 (result f32) + (block (result f32) (i64.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f32-vs-f64 (result f32) + (block (result f32) (f64.const 0.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f64-vs-i32 (result f64) + (block (result f64) (i32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f64-vs-i64 (result f64) + (block (result f64) (i64.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-f64-vs-f32 (result f32) + (block (result f64) (f32.const 0.0)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-unreached-select-i32-i64 (result i32) + (block (result i64) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-i32-f32 (result i32) + (block (result f32) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-i32-f64 (result i32) + (block (result f64) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-i64-i32 (result i64) + (block (result i32) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-i64-f32 (result i64) + (block (result f32) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-i64-f64 (result i64) + (block (result f64) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-f32-i32 (result f32) + (block (result i32) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-f32-i64 (result f32) + (block (result i64) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-f32-f64 (result f32) + (block (result f64) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-f64-i32 (result f64) + (block (result i32) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-f64-i64 (result f64) + (block (result i64) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-unreached-select-f64-f32 (result f64) + (block (result f32) (select (unreachable) (unreachable) (unreachable))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-last-void-vs-i32 (result i32) + (block (result i32) (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-last-void-vs-i64 (result i64) + (block (result i64) (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-last-void-vs-f32 (result f32) + (block (result f32) (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-last-void-vs-f64 (result f64) + (block (result f64) (br 0)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-empty-vs-i32 (result i32) + (block (result i32) (br 0) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-empty-vs-i64 (result i64) + (block (result i64) (br 0) (i64.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-empty-vs-f32 (result f32) + (block (result f32) (br 0) (f32.const 1.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-empty-vs-f64 (result f64) + (block (result f64) (br 0) (f64.const 1.0)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-void-vs-i32 (result i32) + (block (result i32) (br 0 (nop)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-void-vs-i64 (result i64) + (block (result i64) (br 0 (nop)) (i64.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-void-vs-f32 (result f32) + (block (result f32) (br 0 (nop)) (f32.const 1.0)) )) "type mismatch" ) (assert_invalid - (module (func $type-value-num-vs-num (result i32) - (block (f32.const 0)) + (module (func $type-break-void-vs-f64 (result f64) + (block (result f64) (br 0 (nop)) (f64.const 1.0)) )) "type mismatch" ) -(; TODO(stack): soft failure (assert_invalid - (module (func $type-value-num-vs-void-after-break - (block (br 0) (i32.const 1)) + (module (func $type-break-i32-vs-i64 (result i32) + (block (result i32) (br 0 (i64.const 1)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-i32-vs-f32 (result i32) + (block (result i32) (br 0 (f32.const 1.0)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-i32-vs-f64 (result i32) + (block (result i32) (br 0 (f64.const 1.0)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-i64-vs-i32 (result i64) + (block (result i64) (br 0 (i32.const 1)) (i64.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-i64-vs-f32 (result i64) + (block (result i64) (br 0 (f32.const 1.0)) (i64.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-i64-vs-f64 (result i64) + (block (result i64) (br 0 (f64.const 1.0)) (i64.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-f32-vs-i32 (result f32) + (block (result f32) (br 0 (i32.const 1)) (f32.const 1.0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-f32-vs-i64 (result f32) + (block (result f32) (br 0 (i64.const 1)) (f32.const 1.0)) )) "type mismatch" ) (assert_invalid - (module (func $type-value-void-vs-num-after-break (result i32) - (block (i32.const 1) (br 0) (nop)) + (module (func $type-break-f32-vs-f64 (result f32) + (block (result f32) (br 0 (f64.const 1.0)) (f32.const 1.0)) )) "type mismatch" ) (assert_invalid - (module (func $type-value-num-vs-num-after-break (result i32) - (block (i32.const 1) (br 0) (f32.const 0)) + (module (func $type-break-f64-vs-i32 (result f64) + (block (result i64) (br 0 (i32.const 1)) (f64.const 1.0)) )) "type mismatch" ) (assert_invalid - (module (func $type-break-second-void-vs-num (result i32) - (block i32 (br 0 (i32.const 1)) (br 0 (nop))) + (module (func $type-break-f64-vs-i64 (result f64) + (block (result f64) (br 0 (i64.const 1)) (f64.const 1.0)) )) "type mismatch" ) (assert_invalid - (module (func $type-break-second-num-vs-num (result i32) - (block i32 (br 0 (i32.const 1)) (br 0 (f64.const 1))) + (module (func $type-break-f64-vs-f32 (result f64) + (block (result f64) (br 0 (f32.const 1.0)) (f64.const 1)) )) "type mismatch" ) -;) (assert_invalid - (module (func $type-break-last-void-vs-num (result i32) - (block i32 (br 0)) + (module (func $type-break-first-void-vs-i32 (result i32) + (block (result i32) (br 0 (nop)) (br 0 (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-void-vs-i64 (result i64) + (block (result i64) (br 0 (nop)) (br 0 (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-void-vs-f32 (result f32) + (block (result f32) (br 0 (nop)) (br 0 (f32.const 1.0))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-void-vs-num (result i32) - (block i32 (br 0) (i32.const 1)) + (module (func $type-break-first-void-vs-f64 (result f64) + (block (result f64) (br 0 (nop)) (br 0 (f64.const 1.0))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-void-vs-num (result i32) - (block (br 0 (nop)) (i32.const 1)) + (module (func $type-break-first-i32-vs-i64 (result i32) + (block (result i32) (br 0 (i64.const 1)) (br 0 (i32.const 1))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-num-vs-num (result i32) - (block (br 0 (i64.const 1)) (i32.const 1)) + (module (func $type-break-first-i32-vs-f32 (result i32) + (block (result i32) (br 0 (f32.const 1.0)) (br 0 (i32.const 1))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-first-void-vs-num (result i32) - (block (br 0 (nop)) (br 0 (i32.const 1))) + (module (func $type-break-first-i32-vs-f64 (result i32) + (block (result i32) (br 0 (f64.const 1.0)) (br 0 (i32.const 1))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-first-num-vs-num (result i32) - (block (br 0 (i64.const 1)) (br 0 (i32.const 1))) + (module (func $type-break-first-i64-vs-i32 (result i64) + (block (result i64) (br 0 (i32.const 1)) (br 0 (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-i64-vs-f32 (result i64) + (block (result i64) (br 0 (f32.const 1.0)) (br 0 (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-i64-vs-f64 (result i64) + (block (result i64) (br 0 (f64.const 1.0)) (br 0 (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-f32-vs-i32 (result f32) + (block (result f32) (br 0 (i32.const 1)) (br 0 (f32.const 1.0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-f32-vs-i64 (result f32) + (block (result f32) (br 0 (i64.const 1)) (br 0 (f32.const 1.0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-f32-vs-f64 (result f32) + (block (result f32) (br 0 (f64.const 1.0)) (br 0 (f32.const 1.0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-f64-vs-i32 (result f64) + (block (result f64) (br 0 (i32.const 1)) (br 0 (f64.const 1.0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-f64-vs-i64 (result f64) + (block (result f64) (br 0 (i64.const 1)) (br 0 (f64.const 1.0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-f64-vs-f32 (result f64) + (block (result f64) (br 0 (f32.const 1.0)) (br 0 (f64.const 1.0))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-nested-num-vs-void - (block i32 (block i32 (br 1 (i32.const 1))) (br 0)) + (module (func $type-break-nested-i32-vs-void + (block (result i32) (block (result i32) (br 1 (i32.const 1))) (br 0)) )) "type mismatch" ) (assert_invalid - (module (func $type-break-nested-empty-vs-num (result i32) - (block (block (br 1)) (br 0 (i32.const 1))) + (module (func $type-break-nested-i64-vs-void + (block (result i64) (block (result i64) (br 1 (i64.const 1))) (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f32-vs-void + (block (result f32) (block (result f32) (br 1 (f32.const 1.0))) (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f64-vs-void + (block (result f64) (block (result f64) (br 1 (f64.const 1.0))) (br 0)) )) "type mismatch" ) (assert_invalid - (module (func $type-break-nested-void-vs-num (result i32) - (block (block (br 1 (nop))) (br 0 (i32.const 1))) + (module (func $type-break-nested-empty-vs-i32 (result i32) + (block (result i32) (block (br 1)) (br 0 (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-empty-vs-i64 (result i64) + (block (result i64) (block (br 1)) (br 0 (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-empty-vs-f32 (result f32) + (block (result f32) (block (br 1)) (br 0 (f32.const 1.0))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-nested-num-vs-num (result i32) - (block (block (br 1 (i64.const 1))) (br 0 (i32.const 1))) + (module (func $type-break-nested-empty-vs-f64 (result f64) + (block (result f64) (block (br 1)) (br 0 (f64.const 1))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-operand-empty-vs-num (result i32) + (module (func $type-break-nested-void-vs-i32 (result i32) + (block (result i32) (block (result i32) (br 1 (nop))) (br 0 (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-void-vs-i64 (result i64) + (block (result i64) (block (result i64) (br 1 (nop))) (br 0 (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-void-vs-f32 (result f32) + (block (result f32) (block (result f32) (br 1 (nop))) (br 0 (f32.const 1.0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-void-vs-f64 (result f64) + (block (result f64) (block (result f64) (br 1 (nop))) (br 0 (f64.const 1.0))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-nested-i32-vs-i64 (result i32) + (block (result i32) + (block (result i32) (br 1 (i64.const 1))) (br 0 (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-i32-vs-f32 (result i32) + (block (result i32) + (block (result i32) (br 1 (f32.const 1.0))) (br 0 (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-i32-vs-f64 (result i32) + (block (result i32) + (block (result i32) (br 1 (f64.const 1.0))) (br 0 (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-i64-vs-i32 (result i64) + (block (result i64) + (block (result i64) (br 1 (i32.const 1))) (br 0 (i64.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-i64-vs-f32 (result i64) + (block (result i64) + (block (result i64) (br 1 (f32.const 1.0))) (br 0 (i64.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-i64-vs-f64 (result i64) + (block (result i64) + (block (result i64) (br 1 (f64.const 1.0))) (br 0 (i64.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f32-vs-i32 (result f32) + (block (result f32) + (block (result f32) (br 1 (i32.const 1))) (br 0 (f32.const 1.0)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f32-vs-i64 (result f32) + (block (result f32) + (block (result f32) (br 1 (i64.const 1))) (br 0 (f32.const 1.0)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f32-vs-f64 (result f32) + (block (result f32) + (block (result f32) (br 1 (f64.const 1.0))) (br 0 (f32.const 1.0)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f64-vs-i32 (result f64) + (block (result f64) + (block (result f64) (br 1 (i32.const 1))) (br 0 (f64.const 1.0)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f64-vs-i64 (result f64) + (block (result f64) + (block (result f64) (br 1 (i64.const 1))) (br 0 (f64.const 1.0)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-f64-vs-f32 (result f64) + (block (result f64) + (block (result f64) (br 1 (f32.const 1.0))) (br 0 (f64.const 1.0)) + ) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-operand-empty-vs-i32 (result i32) (i32.ctz (block (br 0))) )) "type mismatch" ) +(assert_invalid + (module (func $type-break-operand-empty-vs-i64 (result i64) + (i64.ctz (block (br 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-empty-vs-f32 (result f32) + (f32.floor (block (br 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-empty-vs-f64 (result f64) + (f64.floor (block (br 0))) + )) + "type mismatch" +) (assert_invalid - (module (func $type-break-operand-void-vs-num (result i32) + (module (func $type-break-operand-void-vs-i32 (result i32) + (i32.ctz (block (br 0 (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-void-vs-i64 (result i64) (i64.ctz (block (br 0 (nop)))) )) "type mismatch" ) (assert_invalid - (module (func $type-break-operand-num-vs-num (result i32) + (module (func $type-break-operand-void-vs-f32 (result f32) + (f32.floor (block (br 0 (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-void-vs-f64 (result f64) + (f64.floor (block (br 0 (nop)))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-operand-i32-vs-i64 (result i32) (i64.ctz (block (br 0 (i64.const 9)))) )) "type mismatch" ) +(assert_invalid + (module (func $type-break-operand-i32-vs-f32 (result i32) + (f32.floor (block (br 0 (f32.const 9.0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-i32-vs-f64 (result i32) + (f64.floor (block (br 0 (f64.const 9.0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-i64-vs-i32 (result i64) + (i32.ctz (block (br 0 (i32.const 9)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-i64-vs-f32 (result i64) + (f32.floor (block (br 0 (f32.const 9.0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-i64-vs-f64 (result i64) + (f64.floor (block (br 0 (f64.const 9.0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-f32-vs-i32 (result f32) + (i32.ctz (block (br 0 (i32.const 9)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-f32-vs-i64 (result f32) + (i64.ctz (block (br 0 (i64.const 9)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-f32-vs-f64 (result f32) + (f64.floor (block (br 0 (f64.const 9.0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-f64-vs-i32 (result f64) + (i32.ctz (block (br 0 (i32.const 9)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-f64-vs-i64 (result f64) + (i64.ctz (block (br 0 (i64.const 9)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-f64-vs-f32 (result f64) + (f32.floor (block (br 0 (f32.const 9.0)))) + )) + "type mismatch" +) + +(assert_malformed + (module quote "(func block end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func block $a end $l)") + "mismatching label" +) diff --git a/test/spec/br.wast b/test/spec/br.wast index 5937375dd..98a3a34bd 100644 --- a/test/spec/br.wast +++ b/test/spec/br.wast @@ -10,16 +10,16 @@ (func (export "type-f64") (block (drop (f64.neg (br 0))))) (func (export "type-i32-value") (result i32) - (block i32 (i32.ctz (br 0 (i32.const 1)))) + (block (result i32) (i32.ctz (br 0 (i32.const 1)))) ) (func (export "type-i64-value") (result i64) - (block i64 (i64.ctz (br 0 (i64.const 2)))) + (block (result i64) (i64.ctz (br 0 (i64.const 2)))) ) (func (export "type-f32-value") (result f32) - (block f32 (f32.neg (br 0 (f32.const 3)))) + (block (result f32) (f32.neg (br 0 (f32.const 3)))) ) (func (export "type-f64-value") (result f64) - (block f64 (f64.neg (br 0 (f64.const 4)))) + (block (result f64) (f64.neg (br 0 (f64.const 4)))) ) (func (export "as-block-first") @@ -32,86 +32,121 @@ (block (nop) (call $dummy) (br 0)) ) (func (export "as-block-value") (result i32) - (block i32 (nop) (call $dummy) (br 0 (i32.const 2))) + (block (result i32) (nop) (call $dummy) (br 0 (i32.const 2))) ) (func (export "as-loop-first") (result i32) - (block i32 (loop i32 (br 1 (i32.const 3)) (i32.const 2))) + (block (result i32) (loop (result i32) (br 1 (i32.const 3)) (i32.const 2))) ) (func (export "as-loop-mid") (result i32) - (block i32 (loop i32 (call $dummy) (br 1 (i32.const 4)) (i32.const 2))) + (block (result i32) + (loop (result i32) (call $dummy) (br 1 (i32.const 4)) (i32.const 2)) + ) ) (func (export "as-loop-last") (result i32) - (block i32 (loop i32 (nop) (call $dummy) (br 1 (i32.const 5)))) + (block (result i32) + (loop (result i32) (nop) (call $dummy) (br 1 (i32.const 5))) + ) ) (func (export "as-br-value") (result i32) - (block i32 (br 0 (br 0 (i32.const 9)))) + (block (result i32) (br 0 (br 0 (i32.const 9)))) ) (func (export "as-br_if-cond") (block (br_if 0 (br 0))) ) (func (export "as-br_if-value") (result i32) - (block i32 (br_if 0 (br 0 (i32.const 8)) (i32.const 1)) (i32.const 7)) + (block (result i32) + (drop (br_if 0 (br 0 (i32.const 8)) (i32.const 1))) (i32.const 7) + ) ) (func (export "as-br_if-value-cond") (result i32) - (block i32 (drop (br_if 0 (i32.const 6) (br 0 (i32.const 9)))) (i32.const 7)) + (block (result i32) + (drop (br_if 0 (i32.const 6) (br 0 (i32.const 9)))) (i32.const 7) + ) ) (func (export "as-br_table-index") (block (br_table 0 0 0 (br 0))) ) (func (export "as-br_table-value") (result i32) - (block i32 + (block (result i32) (br_table 0 0 0 (br 0 (i32.const 10)) (i32.const 1)) (i32.const 7) ) ) (func (export "as-br_table-value-index") (result i32) - (block i32 + (block (result i32) (br_table 0 0 (i32.const 6) (br 0 (i32.const 11))) (i32.const 7) ) ) (func (export "as-return-value") (result i64) - (block i64 (return (br 0 (i64.const 7)))) + (block (result i64) (return (br 0 (i64.const 7)))) ) (func (export "as-if-cond") (result i32) - (block i32 (if i32 (br 0 (i32.const 2)) (i32.const 0) (i32.const 1))) + (block (result i32) + (if (result i32) (br 0 (i32.const 2)) + (then (i32.const 0)) + (else (i32.const 1)) + ) + ) ) (func (export "as-if-then") (param i32 i32) (result i32) - (block i32 (if i32 (local.get 0) (br 1 (i32.const 3)) (local.get 1))) + (block (result i32) + (if (result i32) (local.get 0) + (then (br 1 (i32.const 3))) + (else (local.get 1)) + ) + ) ) (func (export "as-if-else") (param i32 i32) (result i32) - (block i32 (if i32 (local.get 0) (local.get 1) (br 1 (i32.const 4)))) + (block (result i32) + (if (result i32) (local.get 0) + (then (local.get 1)) + (else (br 1 (i32.const 4))) + ) + ) ) (func (export "as-select-first") (param i32 i32) (result i32) - (block i32 (select (br 0 (i32.const 5)) (local.get 0) (local.get 1))) + (block (result i32) + (select (br 0 (i32.const 5)) (local.get 0) (local.get 1)) + ) ) (func (export "as-select-second") (param i32 i32) (result i32) - (block i32 (select (local.get 0) (br 0 (i32.const 6)) (local.get 1))) + (block (result i32) + (select (local.get 0) (br 0 (i32.const 6)) (local.get 1)) + ) ) (func (export "as-select-cond") (result i32) - (block i32 (select (i32.const 0) (i32.const 1) (br 0 (i32.const 7)))) + (block (result i32) + (select (i32.const 0) (i32.const 1) (br 0 (i32.const 7))) + ) ) (func $f (param i32 i32 i32) (result i32) (i32.const -1)) (func (export "as-call-first") (result i32) - (block i32 (call $f (br 0 (i32.const 12)) (i32.const 2) (i32.const 3))) + (block (result i32) + (call $f (br 0 (i32.const 12)) (i32.const 2) (i32.const 3)) + ) ) (func (export "as-call-mid") (result i32) - (block i32 (call $f (i32.const 1) (br 0 (i32.const 13)) (i32.const 3))) + (block (result i32) + (call $f (i32.const 1) (br 0 (i32.const 13)) (i32.const 3)) + ) ) (func (export "as-call-last") (result i32) - (block i32 (call $f (i32.const 1) (i32.const 2) (br 0 (i32.const 14)))) + (block (result i32) + (call $f (i32.const 1) (i32.const 2) (br 0 (i32.const 14))) + ) ) (type $sig (func (param i32 i32 i32) (result i32))) (table funcref (elem $f)) (func (export "as-call_indirect-func") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (br 0 (i32.const 20)) (i32.const 1) (i32.const 2) (i32.const 3) @@ -119,7 +154,7 @@ ) ) (func (export "as-call_indirect-first") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (i32.const 0) (br 0 (i32.const 21)) (i32.const 2) (i32.const 3) @@ -127,7 +162,7 @@ ) ) (func (export "as-call_indirect-mid") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (i32.const 0) (i32.const 1) (br 0 (i32.const 22)) (i32.const 3) @@ -135,7 +170,7 @@ ) ) (func (export "as-call_indirect-last") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (br 0 (i32.const 23)) @@ -144,65 +179,80 @@ ) (func (export "as-local.set-value") (result i32) (local f32) - (block i32 (local.set 0 (br 0 (i32.const 17))) (i32.const -1)) + (block (result i32) (local.set 0 (br 0 (i32.const 17))) (i32.const -1)) + ) + (func (export "as-local.tee-value") (result i32) (local i32) + (block (result i32) (local.tee 0 (br 0 (i32.const 1)))) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (result i32) + (block (result i32) (global.set $a (br 0 (i32.const 1)))) ) (memory 1) (func (export "as-load-address") (result f32) - (block f32 (f32.load (br 0 (f32.const 1.7)))) + (block (result f32) (f32.load (br 0 (f32.const 1.7)))) ) (func (export "as-loadN-address") (result i64) - (block i64 (i64.load8_s (br 0 (i64.const 30)))) + (block (result i64) (i64.load8_s (br 0 (i64.const 30)))) ) (func (export "as-store-address") (result i32) - (block i32 (f64.store (br 0 (i32.const 30)) (f64.const 7)) (i32.const -1)) + (block (result i32) + (f64.store (br 0 (i32.const 30)) (f64.const 7)) (i32.const -1) + ) ) (func (export "as-store-value") (result i32) - (block i32 (i64.store (i32.const 2) (br 0 (i32.const 31))) (i32.const -1)) + (block (result i32) + (i64.store (i32.const 2) (br 0 (i32.const 31))) (i32.const -1) + ) ) (func (export "as-storeN-address") (result i32) - (block i32 (i32.store8 (br 0 (i32.const 32)) (i32.const 7)) (i32.const -1)) + (block (result i32) + (i32.store8 (br 0 (i32.const 32)) (i32.const 7)) (i32.const -1) + ) ) (func (export "as-storeN-value") (result i32) - (block i32 (i64.store16 (i32.const 2) (br 0 (i32.const 33))) (i32.const -1)) + (block (result i32) + (i64.store16 (i32.const 2) (br 0 (i32.const 33))) (i32.const -1) + ) ) (func (export "as-unary-operand") (result f32) - (block f32 (f32.neg (br 0 (f32.const 3.4)))) + (block (result f32) (f32.neg (br 0 (f32.const 3.4)))) ) (func (export "as-binary-left") (result i32) - (block i32 (i32.add (br 0 (i32.const 3)) (i32.const 10))) + (block (result i32) (i32.add (br 0 (i32.const 3)) (i32.const 10))) ) (func (export "as-binary-right") (result i64) - (block i64 (i64.sub (i64.const 10) (br 0 (i64.const 45)))) + (block (result i64) (i64.sub (i64.const 10) (br 0 (i64.const 45)))) ) (func (export "as-test-operand") (result i32) - (block i32 (i32.eqz (br 0 (i32.const 44)))) + (block (result i32) (i32.eqz (br 0 (i32.const 44)))) ) (func (export "as-compare-left") (result i32) - (block i32 (f64.le (br 0 (i32.const 43)) (f64.const 10))) + (block (result i32) (f64.le (br 0 (i32.const 43)) (f64.const 10))) ) (func (export "as-compare-right") (result i32) - (block i32 (f32.ne (f32.const 10) (br 0 (i32.const 42)))) + (block (result i32) (f32.ne (f32.const 10) (br 0 (i32.const 42)))) ) (func (export "as-convert-operand") (result i32) - (block i32 (i32.wrap_i64 (br 0 (i32.const 41)))) + (block (result i32) (i32.wrap_i64 (br 0 (i32.const 41)))) ) (func (export "as-memory.grow-size") (result i32) - (block i32 (memory.grow (br 0 (i32.const 40)))) + (block (result i32) (memory.grow (br 0 (i32.const 40)))) ) (func (export "nested-block-value") (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (call $dummy) (i32.add (i32.const 4) (br 0 (i32.const 8))) ) @@ -212,10 +262,10 @@ (func (export "nested-br-value") (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop - (block i32 + (block (result i32) (drop (i32.const 4)) (br 0 (br 1 (i32.const 8))) ) @@ -228,12 +278,12 @@ (func (export "nested-br_if-value") (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop - (block i32 + (block (result i32) (drop (i32.const 4)) - (br_if 0 (br 1 (i32.const 8)) (i32.const 1)) + (drop (br_if 0 (br 1 (i32.const 8)) (i32.const 1))) (i32.const 32) ) ) @@ -245,7 +295,7 @@ (func (export "nested-br_if-value-cond") (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop (br_if 0 (i32.const 4) (br 0 (i32.const 8)))) (i32.const 16) @@ -256,10 +306,10 @@ (func (export "nested-br_table-value") (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop - (block i32 + (block (result i32) (drop (i32.const 4)) (br_table 0 (br 1 (i32.const 8)) (i32.const 1)) ) @@ -272,7 +322,7 @@ (func (export "nested-br_table-value-index") (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (br_table 0 (i32.const 4) (br 0 (i32.const 8))) (i32.const 16) @@ -334,6 +384,8 @@ (assert_return (invoke "as-call_indirect-last") (i32.const 23)) (assert_return (invoke "as-local.set-value") (i32.const 17)) +(assert_return (invoke "as-local.tee-value") (i32.const 1)) +(assert_return (invoke "as-global.set-value") (i32.const 1)) (assert_return (invoke "as-load-address") (f32.const 1.7)) (assert_return (invoke "as-loadN-address") (i64.const 30)) @@ -366,39 +418,181 @@ (assert_invalid (module (func $type-arg-empty-vs-num (result i32) - (block (br 0) (i32.const 1)) + (block (result i32) (br 0) (i32.const 1)) )) "type mismatch" ) -;; TODO(stack): move this elsewhere -(module (func $type-arg-num-vs-void - (block (drop (i32.const 0)) (br 0)) -)) - -(; TODO(stack): soft failure (assert_invalid - (module (func $type-arg-poly-vs-empty - (block (br 0 (unreachable))) + (module (func $type-arg-void-vs-num (result i32) + (block (result i32) (br 0 (nop)) (i32.const 1)) )) "type mismatch" ) -;) - (assert_invalid - (module (func $type-arg-void-vs-num (result i32) - (block (br 0 (nop)) (i32.const 1)) + (module (func $type-arg-void-vs-num-nested (result i32) + (block (result i32) (i32.const 0) (block (br 1))) )) "type mismatch" ) (assert_invalid (module (func $type-arg-num-vs-num (result i32) - (block (br 0 (i64.const 1)) (i32.const 1)) + (block (result i32) (br 0 (i64.const 1)) (i32.const 1)) )) "type mismatch" ) (assert_invalid + (module + (func $type-arg-empty-in-br + (i32.const 0) + (block (result i32) (br 0 (br 0))) (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-br_if + (i32.const 0) + (block (result i32) (br_if 0 (br 0) (i32.const 1))) (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-br_table + (i32.const 0) + (block (result i32) (br_table 0 (br 0))) (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-return + (block (result i32) + (return (br 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-select + (block (result i32) + (select (br 0) (i32.const 1) (i32.const 2)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-call + (block (result i32) + (call 1 (br 0)) + ) + (i32.eqz) (drop) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-arg-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (br 0) (i32.const 0) + ) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-local.set + (local i32) + (block (result i32) + (local.set 0 (br 0)) (local.get 0) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-empty-in-local.tee + (local i32) + (block (result i32) + (local.tee 0 (br 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-arg-empty-in-global.set + (block (result i32) + (global.set $x (br 0)) (global.get $x) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-arg-empty-in-memory.grow + (block (result i32) + (memory.grow (br 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-arg-empty-in-load + (block (result i32) + (i32.load (br 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-arg-empty-in-store + (block (result i32) + (i32.store (br 0) (i32.const 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) + +(assert_invalid (module (func $unbound-label (br 1))) "unknown label" ) diff --git a/test/spec/br_if.wast b/test/spec/br_if.wast index 44aeffbe7..fba5deb9b 100644 --- a/test/spec/br_if.wast +++ b/test/spec/br_if.wast @@ -3,6 +3,32 @@ (module (func $dummy) + (func (export "type-i32") + (block (drop (i32.ctz (br_if 0 (i32.const 0) (i32.const 1))))) + ) + (func (export "type-i64") + (block (drop (i64.ctz (br_if 0 (i64.const 0) (i32.const 1))))) + ) + (func (export "type-f32") + (block (drop (f32.neg (br_if 0 (f32.const 0) (i32.const 1))))) + ) + (func (export "type-f64") + (block (drop (f64.neg (br_if 0 (f64.const 0) (i32.const 1))))) + ) + + (func (export "type-i32-value") (result i32) + (block (result i32) (i32.ctz (br_if 0 (i32.const 1) (i32.const 1)))) + ) + (func (export "type-i64-value") (result i64) + (block (result i64) (i64.ctz (br_if 0 (i64.const 2) (i32.const 1)))) + ) + (func (export "type-f32-value") (result f32) + (block (result f32) (f32.neg (br_if 0 (f32.const 3) (i32.const 1)))) + ) + (func (export "type-f64-value") (result f64) + (block (result f64) (f64.neg (br_if 0 (f64.const 4) (i32.const 1)))) + ) + (func (export "as-block-first") (param i32) (result i32) (block (br_if 0 (local.get 0)) (return (i32.const 2))) (i32.const 3) ) @@ -14,13 +40,19 @@ (block (call $dummy) (call $dummy) (br_if 0 (local.get 0))) ) (func (export "as-block-first-value") (param i32) (result i32) - (block i32 (drop (br_if 0 (i32.const 10) (local.get 0))) (return (i32.const 11))) + (block (result i32) + (drop (br_if 0 (i32.const 10) (local.get 0))) (return (i32.const 11)) + ) ) (func (export "as-block-mid-value") (param i32) (result i32) - (block i32 (call $dummy) (drop (br_if 0 (i32.const 20) (local.get 0))) (return (i32.const 21))) + (block (result i32) + (call $dummy) + (drop (br_if 0 (i32.const 20) (local.get 0))) + (return (i32.const 21)) + ) ) (func (export "as-block-last-value") (param i32) (result i32) - (block i32 + (block (result i32) (call $dummy) (call $dummy) (br_if 0 (i32.const 11) (local.get 0)) ) ) @@ -36,21 +68,218 @@ (loop (call $dummy) (br_if 1 (local.get 0))) ) + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (br_if 0 (i32.const 1) (i32.const 2)))) + ) + + (func (export "as-br_if-cond") + (block (br_if 0 (br_if 0 (i32.const 1) (i32.const 1)))) + ) + (func (export "as-br_if-value") (result i32) + (block (result i32) + (drop (br_if 0 (br_if 0 (i32.const 1) (i32.const 2)) (i32.const 3))) + (i32.const 4) + ) + ) + (func (export "as-br_if-value-cond") (param i32) (result i32) + (block (result i32) + (drop (br_if 0 (i32.const 2) (br_if 0 (i32.const 1) (local.get 0)))) + (i32.const 4) + ) + ) + + (func (export "as-br_table-index") + (block (br_table 0 0 0 (br_if 0 (i32.const 1) (i32.const 2)))) + ) + (func (export "as-br_table-value") (result i32) + (block (result i32) + (br_table 0 0 0 (br_if 0 (i32.const 1) (i32.const 2)) (i32.const 3)) (i32.const 4) + ) + ) + (func (export "as-br_table-value-index") (result i32) + (block (result i32) + (br_table 0 0 (i32.const 2) (br_if 0 (i32.const 1) (i32.const 3))) (i32.const 4) + ) + ) + (func (export "as-return-value") (result i64) + (block (result i64) (return (br_if 0 (i64.const 1) (i32.const 2)))) + ) + + (func (export "as-if-cond") (param i32) (result i32) + (block (result i32) + (if (result i32) + (br_if 0 (i32.const 1) (local.get 0)) + (then (i32.const 2)) + (else (i32.const 3)) + ) + ) + ) (func (export "as-if-then") (param i32 i32) - (block (if (local.get 0) (br_if 1 (local.get 1)) (call $dummy))) + (block + (if (local.get 0) (then (br_if 1 (local.get 1))) (else (call $dummy))) + ) ) (func (export "as-if-else") (param i32 i32) - (block (if (local.get 0) (call $dummy) (br_if 1 (local.get 1)))) + (block + (if (local.get 0) (then (call $dummy)) (else (br_if 1 (local.get 1)))) + ) + ) + + (func (export "as-select-first") (param i32) (result i32) + (block (result i32) + (select (br_if 0 (i32.const 3) (i32.const 10)) (i32.const 2) (local.get 0)) + ) + ) + (func (export "as-select-second") (param i32) (result i32) + (block (result i32) + (select (i32.const 1) (br_if 0 (i32.const 3) (i32.const 10)) (local.get 0)) + ) + ) + (func (export "as-select-cond") (result i32) + (block (result i32) + (select (i32.const 1) (i32.const 2) (br_if 0 (i32.const 3) (i32.const 10))) + ) + ) + + (func $f (param i32 i32 i32) (result i32) (i32.const -1)) + (func (export "as-call-first") (result i32) + (block (result i32) + (call $f + (br_if 0 (i32.const 12) (i32.const 1)) (i32.const 2) (i32.const 3) + ) + ) + ) + (func (export "as-call-mid") (result i32) + (block (result i32) + (call $f + (i32.const 1) (br_if 0 (i32.const 13) (i32.const 1)) (i32.const 3) + ) + ) + ) + (func (export "as-call-last") (result i32) + (block (result i32) + (call $f + (i32.const 1) (i32.const 2) (br_if 0 (i32.const 14) (i32.const 1)) + ) + ) + ) + + (func $func (param i32 i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-func") (result i32) + (block (result i32) + (call_indirect (type $check) + (br_if 0 (i32.const 4) (i32.const 10)) + (i32.const 1) (i32.const 2) (i32.const 0) + ) + ) + ) + + (func (export "as-call_indirect-first") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (br_if 0 (i32.const 4) (i32.const 10)) (i32.const 2) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (i32.const 2) (br_if 0 (i32.const 4) (i32.const 10)) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (i32.const 2) (i32.const 3) (br_if 0 (i32.const 4) (i32.const 10)) + ) + ) + ) + + (func (export "as-local.set-value") (param i32) (result i32) + (local i32) + (block (result i32) + (local.set 0 (br_if 0 (i32.const 17) (local.get 0))) + (i32.const -1) + ) + ) + (func (export "as-local.tee-value") (param i32) (result i32) + (block (result i32) + (local.tee 0 (br_if 0 (i32.const 1) (local.get 0))) + (return (i32.const -1)) + ) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (param i32) (result i32) + (block (result i32) + (global.set $a (br_if 0 (i32.const 1) (local.get 0))) + (return (i32.const -1)) + ) + ) + + (memory 1) + (func (export "as-load-address") (result i32) + (block (result i32) (i32.load (br_if 0 (i32.const 1) (i32.const 1)))) + ) + (func (export "as-loadN-address") (result i32) + (block (result i32) (i32.load8_s (br_if 0 (i32.const 30) (i32.const 1)))) + ) + + (func (export "as-store-address") (result i32) + (block (result i32) + (i32.store (br_if 0 (i32.const 30) (i32.const 1)) (i32.const 7)) (i32.const -1) + ) + ) + (func (export "as-store-value") (result i32) + (block (result i32) + (i32.store (i32.const 2) (br_if 0 (i32.const 31) (i32.const 1))) (i32.const -1) + ) + ) + + (func (export "as-storeN-address") (result i32) + (block (result i32) + (i32.store8 (br_if 0 (i32.const 32) (i32.const 1)) (i32.const 7)) (i32.const -1) + ) + ) + (func (export "as-storeN-value") (result i32) + (block (result i32) + (i32.store16 (i32.const 2) (br_if 0 (i32.const 33) (i32.const 1))) (i32.const -1) + ) + ) + + (func (export "as-unary-operand") (result f64) + (block (result f64) (f64.neg (br_if 0 (f64.const 1.0) (i32.const 1)))) + ) + (func (export "as-binary-left") (result i32) + (block (result i32) (i32.add (br_if 0 (i32.const 1) (i32.const 1)) (i32.const 10))) + ) + (func (export "as-binary-right") (result i32) + (block (result i32) (i32.sub (i32.const 10) (br_if 0 (i32.const 1) (i32.const 1)))) + ) + (func (export "as-test-operand") (result i32) + (block (result i32) (i32.eqz (br_if 0 (i32.const 0) (i32.const 1)))) + ) + (func (export "as-compare-left") (result i32) + (block (result i32) (i32.le_u (br_if 0 (i32.const 1) (i32.const 1)) (i32.const 10))) + ) + (func (export "as-compare-right") (result i32) + (block (result i32) (i32.ne (i32.const 10) (br_if 0 (i32.const 1) (i32.const 42)))) + ) + + (func (export "as-memory.grow-size") (result i32) + (block (result i32) (memory.grow (br_if 0 (i32.const 1) (i32.const 1)))) ) (func (export "nested-block-value") (param i32) (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (i32.add (i32.const 4) - (block i32 + (block (result i32) (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 16) ) @@ -62,10 +291,12 @@ (func (export "nested-br-value") (param i32) (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (br 0 - (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4)) + (block (result i32) + (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4) + ) ) (i32.const 16) ) @@ -75,10 +306,12 @@ (func (export "nested-br_if-value") (param i32) (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop (br_if 0 - (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4)) + (block (result i32) + (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4) + ) (i32.const 1) )) (i32.const 16) @@ -89,11 +322,13 @@ (func (export "nested-br_if-value-cond") (param i32) (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop (br_if 0 (i32.const 4) - (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1)) + (block (result i32) + (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1) + ) )) (i32.const 16) ) @@ -103,10 +338,12 @@ (func (export "nested-br_table-value") (param i32) (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (br_table 0 - (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4)) + (block (result i32) + (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4) + ) (i32.const 1) ) (i32.const 16) @@ -117,24 +354,42 @@ (func (export "nested-br_table-value-index") (param i32) (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (br_table 0 (i32.const 4) - (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1)) + (block (result i32) + (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1) + ) ) (i32.const 16) ) ) ) + ) +(assert_return (invoke "type-i32")) +(assert_return (invoke "type-i64")) +(assert_return (invoke "type-f32")) +(assert_return (invoke "type-f64")) + +(assert_return (invoke "type-i32-value") (i32.const 1)) +(assert_return (invoke "type-i64-value") (i64.const 2)) +(assert_return (invoke "type-f32-value") (f32.const 3)) +(assert_return (invoke "type-f64-value") (f64.const 4)) + (assert_return (invoke "as-block-first" (i32.const 0)) (i32.const 2)) (assert_return (invoke "as-block-first" (i32.const 1)) (i32.const 3)) (assert_return (invoke "as-block-mid" (i32.const 0)) (i32.const 2)) (assert_return (invoke "as-block-mid" (i32.const 1)) (i32.const 3)) (assert_return (invoke "as-block-last" (i32.const 0))) (assert_return (invoke "as-block-last" (i32.const 1))) + +(assert_return (invoke "as-block-first-value" (i32.const 0)) (i32.const 11)) +(assert_return (invoke "as-block-first-value" (i32.const 1)) (i32.const 10)) +(assert_return (invoke "as-block-mid-value" (i32.const 0)) (i32.const 21)) +(assert_return (invoke "as-block-mid-value" (i32.const 1)) (i32.const 20)) (assert_return (invoke "as-block-last-value" (i32.const 0)) (i32.const 11)) (assert_return (invoke "as-block-last-value" (i32.const 1)) (i32.const 11)) @@ -145,6 +400,21 @@ (assert_return (invoke "as-loop-last" (i32.const 0))) (assert_return (invoke "as-loop-last" (i32.const 1))) +(assert_return (invoke "as-br-value") (i32.const 1)) + +(assert_return (invoke "as-br_if-cond")) +(assert_return (invoke "as-br_if-value") (i32.const 1)) +(assert_return (invoke "as-br_if-value-cond" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-br_if-value-cond" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-br_table-index")) +(assert_return (invoke "as-br_table-value") (i32.const 1)) +(assert_return (invoke "as-br_table-value-index") (i32.const 1)) + +(assert_return (invoke "as-return-value") (i64.const 1)) + +(assert_return (invoke "as-if-cond" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-if-cond" (i32.const 1)) (i32.const 1)) (assert_return (invoke "as-if-then" (i32.const 0) (i32.const 0))) (assert_return (invoke "as-if-then" (i32.const 4) (i32.const 0))) (assert_return (invoke "as-if-then" (i32.const 0) (i32.const 1))) @@ -154,6 +424,46 @@ (assert_return (invoke "as-if-else" (i32.const 0) (i32.const 1))) (assert_return (invoke "as-if-else" (i32.const 3) (i32.const 1))) +(assert_return (invoke "as-select-first" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-select-first" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "as-select-second" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-select-second" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "as-select-cond") (i32.const 3)) + +(assert_return (invoke "as-call-first") (i32.const 12)) +(assert_return (invoke "as-call-mid") (i32.const 13)) +(assert_return (invoke "as-call-last") (i32.const 14)) + +(assert_return (invoke "as-call_indirect-func") (i32.const 4)) +(assert_return (invoke "as-call_indirect-first") (i32.const 4)) +(assert_return (invoke "as-call_indirect-mid") (i32.const 4)) +(assert_return (invoke "as-call_indirect-last") (i32.const 4)) + +(assert_return (invoke "as-local.set-value" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-local.set-value" (i32.const 1)) (i32.const 17)) + +(assert_return (invoke "as-local.tee-value" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-local.tee-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-global.set-value" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-global.set-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-load-address") (i32.const 1)) +(assert_return (invoke "as-loadN-address") (i32.const 30)) + +(assert_return (invoke "as-store-address") (i32.const 30)) +(assert_return (invoke "as-store-value") (i32.const 31)) +(assert_return (invoke "as-storeN-address") (i32.const 32)) +(assert_return (invoke "as-storeN-value") (i32.const 33)) + +(assert_return (invoke "as-unary-operand") (f64.const 1.0)) +(assert_return (invoke "as-binary-left") (i32.const 1)) +(assert_return (invoke "as-binary-right") (i32.const 1)) +(assert_return (invoke "as-test-operand") (i32.const 0)) +(assert_return (invoke "as-compare-left") (i32.const 1)) +(assert_return (invoke "as-compare-right") (i32.const 1)) +(assert_return (invoke "as-memory.grow-size") (i32.const 1)) + (assert_return (invoke "nested-block-value" (i32.const 0)) (i32.const 21)) (assert_return (invoke "nested-block-value" (i32.const 1)) (i32.const 9)) (assert_return (invoke "nested-br-value" (i32.const 0)) (i32.const 5)) @@ -203,13 +513,13 @@ (assert_invalid (module (func $type-false-arg-void-vs-num (result i32) - (block i32 (br_if 0 (i32.const 0)) (i32.const 1)) + (block (result i32) (br_if 0 (i32.const 0)) (i32.const 1)) )) "type mismatch" ) (assert_invalid (module (func $type-true-arg-void-vs-num (result i32) - (block i32 (br_if 0 (i32.const 1)) (i32.const 1)) + (block (result i32) (br_if 0 (i32.const 1)) (i32.const 1)) )) "type mismatch" ) @@ -226,47 +536,42 @@ "type mismatch" ) -(; TODO(stack): soft failure -(assert_invalid - (module (func $type-false-arg-poly-vs-empty - (block (br_if 0 (unreachable) (i32.const 0))) - )) - "type mismatch" -) -(assert_invalid - (module (func $type-true-arg-poly-vs-empty - (block (br_if 0 (unreachable) (i32.const 1))) - )) - "type mismatch" -) -;) - (assert_invalid (module (func $type-false-arg-void-vs-num (result i32) - (block i32 (br_if 0 (nop) (i32.const 0)) (i32.const 1)) + (block (result i32) (br_if 0 (nop) (i32.const 0)) (i32.const 1)) )) "type mismatch" ) (assert_invalid (module (func $type-true-arg-void-vs-num (result i32) - (block i32 (br_if 0 (nop) (i32.const 1)) (i32.const 1)) + (block (result i32) (br_if 0 (nop) (i32.const 1)) (i32.const 1)) )) "type mismatch" ) (assert_invalid (module (func $type-false-arg-num-vs-num (result i32) - (block i32 (drop (br_if 0 (i64.const 1) (i32.const 0))) (i32.const 1)) + (block (result i32) + (drop (br_if 0 (i64.const 1) (i32.const 0))) (i32.const 1) + ) )) "type mismatch" ) (assert_invalid (module (func $type-true-arg-num-vs-num (result i32) - (block i32 (drop (br_if 0 (i64.const 1) (i32.const 0))) (i32.const 1)) + (block (result i32) + (drop (br_if 0 (i64.const 1) (i32.const 0))) (i32.const 1) + ) )) "type mismatch" ) (assert_invalid + (module (func $type-cond-empty-vs-i32 + (block (br_if 0)) + )) + "type mismatch" +) +(assert_invalid (module (func $type-cond-void-vs-i32 (block (br_if 0 (nop))) )) @@ -280,18 +585,72 @@ ) (assert_invalid (module (func $type-arg-cond-void-vs-i32 (result i32) - (block i32 (br_if 0 (i32.const 0) (nop)) (i32.const 1)) + (block (result i32) (br_if 0 (i32.const 0) (nop)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-arg-void-vs-num-nested (result i32) + (block (result i32) (i32.const 0) (block (br_if 1 (i32.const 1)))) )) "type mismatch" ) (assert_invalid (module (func $type-arg-cond-num-vs-i32 (result i32) - (block i32 (br_if 0 (i32.const 0) (i64.const 0)) (i32.const 1)) + (block (result i32) (br_if 0 (i32.const 0) (i64.const 0)) (i32.const 1)) )) "type mismatch" ) (assert_invalid + (module + (func $type-1st-cond-empty-in-then + (block + (i32.const 0) (i32.const 0) + (if (result i32) (then (br_if 0))) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-2nd-cond-empty-in-then + (block + (i32.const 0) (i32.const 0) + (if (result i32) (then (br_if 0 (i32.const 1)))) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-1st-cond-empty-in-return + (block (result i32) + (return (br_if 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-2nd-cond-empty-in-return + (block (result i32) + (return (br_if 0 (i32.const 1))) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) + + +(assert_invalid (module (func $unbound-label (br_if 1 (i32.const 1)))) "unknown label" ) diff --git a/test/spec/br_table.wast b/test/spec/br_table.wast index 663bb9ecb..58abe38a4 100644 --- a/test/spec/br_table.wast +++ b/test/spec/br_table.wast @@ -18,16 +18,16 @@ ) (func (export "type-i32-value") (result i32) - (block i32 (i32.ctz (br_table 0 0 (i32.const 1) (i32.const 0)))) + (block (result i32) (i32.ctz (br_table 0 0 (i32.const 1) (i32.const 0)))) ) (func (export "type-i64-value") (result i64) - (block i64 (i64.ctz (br_table 0 0 (i64.const 2) (i32.const 0)))) + (block (result i64) (i64.ctz (br_table 0 0 (i64.const 2) (i32.const 0)))) ) (func (export "type-f32-value") (result f32) - (block f32 (f32.neg (br_table 0 0 (f32.const 3) (i32.const 0)))) + (block (result f32) (f32.neg (br_table 0 0 (f32.const 3) (i32.const 0)))) ) (func (export "type-f64-value") (result f64) - (block f64 (f64.neg (br_table 0 0 (f64.const 4) (i32.const 0)))) + (block (result f64) (f64.neg (br_table 0 0 (f64.const 4) (i32.const 0)))) ) (func (export "empty") (param i32) (result i32) @@ -35,7 +35,9 @@ (i32.const 22) ) (func (export "empty-value") (param i32) (result i32) - (block i32 (br_table 0 (i32.const 33) (local.get 0)) (i32.const 31)) + (block (result i32) + (br_table 0 (i32.const 33) (local.get 0)) (i32.const 31) + ) ) (func (export "singleton") (param i32) (result i32) @@ -50,9 +52,9 @@ ) (func (export "singleton-value") (param i32) (result i32) - (block i32 + (block (result i32) (drop - (block i32 + (block (result i32) (br_table 0 1 (i32.const 33) (local.get 0)) (return (i32.const 31)) ) @@ -83,11 +85,11 @@ (func (export "multiple-value") (param i32) (result i32) (local i32) - (local.set 1 (block i32 - (local.set 1 (block i32 - (local.set 1 (block i32 - (local.set 1 (block i32 - (local.set 1 (block i32 + (local.set 1 (block (result i32) + (local.set 1 (block (result i32) + (local.set 1 (block (result i32) + (local.set 1 (block (result i32) + (local.set 1 (block (result i32) (br_table 3 2 1 0 4 (i32.const 200) (local.get 0)) (return (i32.add (local.get 1) (i32.const 99))) )) @@ -849,38 +851,42 @@ (block (nop) (call $dummy) (br_table 0 0 0 (i32.const 0))) ) (func (export "as-block-value") (result i32) - (block i32 (nop) (call $dummy) (br_table 0 0 0 (i32.const 2) (i32.const 0))) + (block (result i32) + (nop) (call $dummy) (br_table 0 0 0 (i32.const 2) (i32.const 0)) + ) ) (func (export "as-loop-first") (result i32) - (loop i32 (br_table 1 1 (i32.const 3) (i32.const 0)) (i32.const 1)) + (loop (result i32) (br_table 1 1 (i32.const 3) (i32.const 0)) (i32.const 1)) ) (func (export "as-loop-mid") (result i32) - (loop i32 + (loop (result i32) (call $dummy) (br_table 1 1 1 (i32.const 4) (i32.const -1)) (i32.const 2) ) ) (func (export "as-loop-last") (result i32) - (loop i32 (nop) (call $dummy) (br_table 1 1 1 (i32.const 5) (i32.const 1))) + (loop (result i32) + (nop) (call $dummy) (br_table 1 1 1 (i32.const 5) (i32.const 1)) + ) ) (func (export "as-br-value") (result i32) - (block i32 (br 0 (br 0 (i32.const 9)))) + (block (result i32) (br 0 (br_table 0 (i32.const 9) (i32.const 0)))) ) (func (export "as-br_if-cond") (block (br_if 0 (br_table 0 0 0 (i32.const 1)))) ) (func (export "as-br_if-value") (result i32) - (block i32 - (br_if 0 (br_table 0 (i32.const 8) (i32.const 0)) (i32.const 1)) + (block (result i32) + (drop (br_if 0 (br_table 0 (i32.const 8) (i32.const 0)) (i32.const 1))) (i32.const 7) ) ) (func (export "as-br_if-value-cond") (result i32) - (block i32 + (block (result i32) (drop (br_if 0 (i32.const 6) (br_table 0 0 (i32.const 9) (i32.const 0)))) (i32.const 7) ) @@ -890,66 +896,66 @@ (block (br_table 0 0 0 (br_table 0 (i32.const 1)))) ) (func (export "as-br_table-value") (result i32) - (block i32 + (block (result i32) (br_table 0 0 0 (br_table 0 (i32.const 10) (i32.const 0)) (i32.const 1)) (i32.const 7) ) ) (func (export "as-br_table-value-index") (result i32) - (block i32 + (block (result i32) (br_table 0 0 (i32.const 6) (br_table 0 (i32.const 11) (i32.const 1))) (i32.const 7) ) ) (func (export "as-return-value") (result i64) - (block i64 (return (br_table 0 (i64.const 7) (i32.const 0)))) + (block (result i64) (return (br_table 0 (i64.const 7) (i32.const 0)))) ) (func (export "as-if-cond") (result i32) - (block i32 - (if i32 + (block (result i32) + (if (result i32) (br_table 0 (i32.const 2) (i32.const 0)) - (i32.const 0) - (i32.const 1) + (then (i32.const 0)) + (else (i32.const 1)) ) ) ) (func (export "as-if-then") (param i32 i32) (result i32) - (block i32 - (if i32 + (block (result i32) + (if (result i32) (local.get 0) - (br_table 1 (i32.const 3) (i32.const 0)) - (local.get 1) + (then (br_table 1 (i32.const 3) (i32.const 0))) + (else (local.get 1)) ) ) ) (func (export "as-if-else") (param i32 i32) (result i32) - (block i32 - (if i32 + (block (result i32) + (if (result i32) (local.get 0) - (local.get 1) - (br_table 1 0 (i32.const 4) (i32.const 0)) + (then (local.get 1)) + (else (br_table 1 0 (i32.const 4) (i32.const 0))) ) ) ) (func (export "as-select-first") (param i32 i32) (result i32) - (block i32 + (block (result i32) (select (br_table 0 (i32.const 5) (i32.const 0)) (local.get 0) (local.get 1) ) ) ) (func (export "as-select-second") (param i32 i32) (result i32) - (block i32 + (block (result i32) (select (local.get 0) (br_table 0 (i32.const 6) (i32.const 1)) (local.get 1) ) ) ) (func (export "as-select-cond") (result i32) - (block i32 + (block (result i32) (select (i32.const 0) (i32.const 1) (br_table 0 (i32.const 7) (i32.const 1)) ) @@ -958,21 +964,21 @@ (func $f (param i32 i32 i32) (result i32) (i32.const -1)) (func (export "as-call-first") (result i32) - (block i32 + (block (result i32) (call $f (br_table 0 (i32.const 12) (i32.const 1)) (i32.const 2) (i32.const 3) ) ) ) (func (export "as-call-mid") (result i32) - (block i32 + (block (result i32) (call $f (i32.const 1) (br_table 0 (i32.const 13) (i32.const 1)) (i32.const 3) ) ) ) (func (export "as-call-last") (result i32) - (block i32 + (block (result i32) (call $f (i32.const 1) (i32.const 2) (br_table 0 (i32.const 14) (i32.const 1)) ) @@ -982,7 +988,7 @@ (type $sig (func (param i32 i32 i32) (result i32))) (table funcref (elem $f)) (func (export "as-call_indirect-first") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (br_table 0 (i32.const 20) (i32.const 1)) (i32.const 1) (i32.const 2) (i32.const 3) @@ -990,7 +996,7 @@ ) ) (func (export "as-call_indirect-mid") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (i32.const 0) (br_table 0 (i32.const 21) (i32.const 1)) (i32.const 2) (i32.const 3) @@ -998,7 +1004,7 @@ ) ) (func (export "as-call_indirect-last") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (i32.const 0) (i32.const 1) (br_table 0 (i32.const 22) (i32.const 1)) (i32.const 3) @@ -1006,7 +1012,7 @@ ) ) (func (export "as-call_indirect-func") (result i32) - (block i32 + (block (result i32) (call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (br_table 0 (i32.const 23) (i32.const 1)) @@ -1016,93 +1022,109 @@ (func (export "as-local.set-value") (result i32) (local f32) - (block i32 + (block (result i32) (local.set 0 (br_table 0 (i32.const 17) (i32.const 1))) (i32.const -1) ) ) + (func (export "as-local.tee-value") (result i32) + (local i32) + (block (result i32) + (local.set 0 (br_table 0 (i32.const 1) (i32.const 1))) + (i32.const -1) + ) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (result i32) + (block (result i32) + (global.set $a (br_table 0 (i32.const 1) (i32.const 1))) + (i32.const -1) + ) + ) (memory 1) (func (export "as-load-address") (result f32) - (block f32 (f32.load (br_table 0 (f32.const 1.7) (i32.const 1)))) + (block (result f32) (f32.load (br_table 0 (f32.const 1.7) (i32.const 1)))) ) (func (export "as-loadN-address") (result i64) - (block i64 (i64.load8_s (br_table 0 (i64.const 30) (i32.const 1)))) + (block (result i64) (i64.load8_s (br_table 0 (i64.const 30) (i32.const 1)))) ) (func (export "as-store-address") (result i32) - (block i32 + (block (result i32) (f64.store (br_table 0 (i32.const 30) (i32.const 1)) (f64.const 7)) (i32.const -1) ) ) (func (export "as-store-value") (result i32) - (block i32 + (block (result i32) (i64.store (i32.const 2) (br_table 0 (i32.const 31) (i32.const 1))) (i32.const -1) ) ) (func (export "as-storeN-address") (result i32) - (block i32 + (block (result i32) (i32.store8 (br_table 0 (i32.const 32) (i32.const 0)) (i32.const 7)) (i32.const -1) ) ) (func (export "as-storeN-value") (result i32) - (block i32 + (block (result i32) (i64.store16 (i32.const 2) (br_table 0 (i32.const 33) (i32.const 0))) (i32.const -1) ) ) (func (export "as-unary-operand") (result f32) - (block f32 (f32.neg (br_table 0 (f32.const 3.4) (i32.const 0)))) + (block (result f32) (f32.neg (br_table 0 (f32.const 3.4) (i32.const 0)))) ) (func (export "as-binary-left") (result i32) - (block i32 + (block (result i32) (i32.add (br_table 0 0 (i32.const 3) (i32.const 0)) (i32.const 10)) ) ) (func (export "as-binary-right") (result i64) - (block i64 + (block (result i64) (i64.sub (i64.const 10) (br_table 0 (i64.const 45) (i32.const 0))) ) ) (func (export "as-test-operand") (result i32) - (block i32 (i32.eqz (br_table 0 (i32.const 44) (i32.const 0)))) + (block (result i32) (i32.eqz (br_table 0 (i32.const 44) (i32.const 0)))) ) (func (export "as-compare-left") (result i32) - (block i32 + (block (result i32) (f64.le (br_table 0 0 (i32.const 43) (i32.const 0)) (f64.const 10)) ) ) (func (export "as-compare-right") (result i32) - (block i32 + (block (result i32) (f32.ne (f32.const 10) (br_table 0 (i32.const 42) (i32.const 0))) ) ) (func (export "as-convert-operand") (result i32) - (block i32 (i32.wrap_i64 (br_table 0 (i32.const 41) (i32.const 0)))) + (block (result i32) + (i32.wrap_i64 (br_table 0 (i32.const 41) (i32.const 0))) + ) ) (func (export "as-memory.grow-size") (result i32) - (block i32 (memory.grow (br_table 0 (i32.const 40) (i32.const 0)))) + (block (result i32) (memory.grow (br_table 0 (i32.const 40) (i32.const 0)))) ) (func (export "nested-block-value") (param i32) (result i32) - (block i32 + (block (result i32) (drop (i32.const -1)) (i32.add (i32.const 1) - (block i32 + (block (result i32) (i32.add (i32.const 2) - (block i32 + (block (result i32) (drop (i32.const 4)) (i32.add (i32.const 8) @@ -1116,13 +1138,13 @@ ) (func (export "nested-br-value") (param i32) (result i32) - (block i32 + (block (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop - (block i32 + (block (result i32) (drop (i32.const 4)) (br 0 (br_table 2 1 0 (i32.const 8) (local.get 0))) ) @@ -1134,15 +1156,20 @@ ) (func (export "nested-br_if-value") (param i32) (result i32) - (block i32 + (block (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop - (block i32 + (block (result i32) (drop (i32.const 4)) - (br_if 0 (br_table 0 1 2 (i32.const 8) (local.get 0)) (i32.const 1)) + (drop + (br_if 0 + (br_table 0 1 2 (i32.const 8) (local.get 0)) + (i32.const 1) + ) + ) (i32.const 32) ) ) @@ -1153,12 +1180,14 @@ ) (func (export "nested-br_if-value-cond") (param i32) (result i32) - (block i32 + (block (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) - (drop (br_if 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (local.get 0)))) + (drop + (br_if 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (local.get 0))) + ) (i32.const 16) ) ) @@ -1166,13 +1195,13 @@ ) (func (export "nested-br_table-value") (param i32) (result i32) - (block i32 + (block (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (drop - (block i32 + (block (result i32) (drop (i32.const 4)) (br_table 0 (br_table 0 1 2 (i32.const 8) (local.get 0)) (i32.const 1)) (i32.const 32) @@ -1185,10 +1214,10 @@ ) (func (export "nested-br_table-value-index") (param i32) (result i32) - (block i32 + (block (result i32) (i32.add (i32.const 1) - (block i32 + (block (result i32) (drop (i32.const 2)) (br_table 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (local.get 0))) (i32.const 16) @@ -1196,6 +1225,23 @@ ) ) ) + + (func (export "nested-br_table-loop-block") (param i32) (result i32) + (local.set 0 + (loop (result i32) + (block + (br_table 1 0 0 (local.get 0)) + ) + (i32.const 0) + ) + ) + (loop (result i32) + (block + (br_table 0 1 1 (local.get 0)) + ) + (i32.const 3) + ) + ) ) (assert_return (invoke "type-i32")) @@ -1310,6 +1356,8 @@ (assert_return (invoke "as-call_indirect-func") (i32.const 23)) (assert_return (invoke "as-local.set-value") (i32.const 17)) +(assert_return (invoke "as-local.tee-value") (i32.const 1)) +(assert_return (invoke "as-global.set-value") (i32.const 1)) (assert_return (invoke "as-load-address") (f32.const 1.7)) (assert_return (invoke "as-loadN-address") (i64.const 30)) @@ -1375,6 +1423,8 @@ (assert_return (invoke "nested-br_table-value-index" (i32.const -1000000)) (i32.const 9)) (assert_return (invoke "nested-br_table-value-index" (i32.const 9423975)) (i32.const 9)) +(assert_return (invoke "nested-br_table-loop-block" (i32.const 1)) (i32.const 3)) + (assert_invalid (module (func $type-arg-void-vs-num (result i32) (block (br_table 0 (i32.const 1)) (i32.const 1)) @@ -1382,24 +1432,35 @@ "type mismatch" ) -(; TODO(stack): soft failure (assert_invalid - (module (func $type-arg-poly-vs-empty - (block (br_table 0 (unreachable) (i32.const 1))) + (module (func $type-arg-empty-vs-num (result i32) + (block (br_table 0) (i32.const 1)) )) "type mismatch" ) -;) (assert_invalid (module (func $type-arg-void-vs-num (result i32) - (block i32 (br_table 0 (nop) (i32.const 1)) (i32.const 1)) + (block (result i32) (br_table 0 (nop) (i32.const 1)) (i32.const 1)) )) "type mismatch" ) (assert_invalid (module (func $type-arg-num-vs-num (result i32) - (block i32 (br_table 0 0 0 (i64.const 1) (i32.const 1)) (i32.const 1)) + (block (result i32) + (br_table 0 0 0 (i64.const 1) (i32.const 1)) (i32.const 1) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-arg-num-vs-arg-num + (block + (block (result f32) + (br_table 0 1 (f32.const 0) (i32.const 0)) + ) + (drop) + ) )) "type mismatch" ) @@ -1418,18 +1479,81 @@ ) (assert_invalid (module (func $type-arg-index-void-vs-i32 (result i32) - (block i32 (br_table 0 0 (i32.const 0) (nop)) (i32.const 1)) + (block (result i32) (br_table 0 0 (i32.const 0) (nop)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-arg-void-vs-num-nested (result i32) + (block (result i32) (i32.const 0) (block (br_table 1 (i32.const 0)))) )) "type mismatch" ) (assert_invalid (module (func $type-arg-index-num-vs-i32 (result i32) - (block i32 (br_table 0 0 (i32.const 0) (i64.const 0)) (i32.const 1)) + (block (result i32) + (br_table 0 0 (i32.const 0) (i64.const 0)) (i32.const 1) + ) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-arg-void-vs-num (result i32) + (block (br_table 0 (i32.const 1)) (i32.const 1)) )) "type mismatch" ) (assert_invalid + (module + (func $type-arg-index-empty-in-then + (block + (i32.const 0) (i32.const 0) + (if (result i32) (then (br_table 0))) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-value-empty-in-then + (block + (i32.const 0) (i32.const 0) + (if (result i32) (then (br_table 0 (i32.const 1)))) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-index-empty-in-return + (block (result i32) + (return (br_table 0)) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-arg-value-empty-in-return + (block (result i32) + (return (br_table 0 (i32.const 1))) + ) + (i32.eqz) (drop) + ) + ) + "type mismatch" +) + + +(assert_invalid (module (func $unbound-label (block (br_table 2 1 (i32.const 1))) )) diff --git a/test/spec/call.wast b/test/spec/call.wast index 00bd97397..4d0f1a7c2 100644 --- a/test/spec/call.wast +++ b/test/spec/call.wast @@ -45,42 +45,51 @@ ;; Recursion (func $fac (export "fac") (param i64) (result i64) - (if i64 (i64.eqz (local.get 0)) - (i64.const 1) - (i64.mul (local.get 0) (call $fac (i64.sub (local.get 0) (i64.const 1)))) + (if (result i64) (i64.eqz (local.get 0)) + (then (i64.const 1)) + (else + (i64.mul + (local.get 0) + (call $fac (i64.sub (local.get 0) (i64.const 1))) + ) + ) ) ) (func $fac-acc (export "fac-acc") (param i64 i64) (result i64) - (if i64 (i64.eqz (local.get 0)) - (local.get 1) - (call $fac-acc - (i64.sub (local.get 0) (i64.const 1)) - (i64.mul (local.get 0) (local.get 1)) + (if (result i64) (i64.eqz (local.get 0)) + (then (local.get 1)) + (else + (call $fac-acc + (i64.sub (local.get 0) (i64.const 1)) + (i64.mul (local.get 0) (local.get 1)) + ) ) ) ) (func $fib (export "fib") (param i64) (result i64) - (if i64 (i64.le_u (local.get 0) (i64.const 1)) - (i64.const 1) - (i64.add - (call $fib (i64.sub (local.get 0) (i64.const 2))) - (call $fib (i64.sub (local.get 0) (i64.const 1))) + (if (result i64) (i64.le_u (local.get 0) (i64.const 1)) + (then (i64.const 1)) + (else + (i64.add + (call $fib (i64.sub (local.get 0) (i64.const 2))) + (call $fib (i64.sub (local.get 0) (i64.const 1))) + ) ) ) ) (func $even (export "even") (param i64) (result i32) - (if i32 (i64.eqz (local.get 0)) - (i32.const 44) - (call $odd (i64.sub (local.get 0) (i64.const 1))) + (if (result i32) (i64.eqz (local.get 0)) + (then (i32.const 44)) + (else (call $odd (i64.sub (local.get 0) (i64.const 1)))) ) ) (func $odd (export "odd") (param i64) (result i32) - (if i32 (i64.eqz (local.get 0)) - (i32.const 99) - (call $even (i64.sub (local.get 0) (i64.const 1))) + (if (result i32) (i64.eqz (local.get 0)) + (then (i32.const 99)) + (else (call $even (i64.sub (local.get 0) (i64.const 1)))) ) ) @@ -97,6 +106,135 @@ (func $mutual-runaway1 (export "mutual-runaway") (call $mutual-runaway2)) (func $mutual-runaway2 (call $mutual-runaway1)) + + ;; As parameter of control constructs and instructions + + (memory 1) + + (func (export "as-select-first") (result i32) + (select (call $const-i32) (i32.const 2) (i32.const 3)) + ) + (func (export "as-select-mid") (result i32) + (select (i32.const 2) (call $const-i32) (i32.const 3)) + ) + (func (export "as-select-last") (result i32) + (select (i32.const 2) (i32.const 3) (call $const-i32)) + ) + + (func (export "as-if-condition") (result i32) + (if (result i32) (call $const-i32) (then (i32.const 1)) (else (i32.const 2))) + ) + + (func (export "as-br_if-first") (result i32) + (block (result i32) (br_if 0 (call $const-i32) (i32.const 2))) + ) + (func (export "as-br_if-last") (result i32) + (block (result i32) (br_if 0 (i32.const 2) (call $const-i32))) + ) + + (func (export "as-br_table-first") (result i32) + (block (result i32) (call $const-i32) (i32.const 2) (br_table 0 0)) + ) + (func (export "as-br_table-last") (result i32) + (block (result i32) (i32.const 2) (call $const-i32) (br_table 0 0)) + ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (result i32) + (block (result i32) + (call_indirect (type $check) + (call $const-i32) (i32.const 2) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) (call $const-i32) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (i32.const 2) (call $const-i32) + ) + ) + ) + + (func (export "as-store-first") + (call $const-i32) (i32.const 1) (i32.store) + ) + (func (export "as-store-last") + (i32.const 10) (call $const-i32) (i32.store) + ) + + (func (export "as-memory.grow-value") (result i32) + (memory.grow (call $const-i32)) + ) + (func (export "as-return-value") (result i32) + (call $const-i32) (return) + ) + (func (export "as-drop-operand") + (call $const-i32) (drop) + ) + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (call $const-i32))) + ) + (func (export "as-local.set-value") (result i32) + (local i32) (local.set 0 (call $const-i32)) (local.get 0) + ) + (func (export "as-local.tee-value") (result i32) + (local i32) (local.tee 0 (call $const-i32)) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (result i32) + (global.set $a (call $const-i32)) + (global.get $a) + ) + (func (export "as-load-operand") (result i32) + (i32.load (call $const-i32)) + ) + + (func $dummy (param i32) (result i32) (local.get 0)) + (func $du (param f32) (result f32) (local.get 0)) + (func (export "as-unary-operand") (result f32) + (block (result f32) (f32.sqrt (call $du (f32.const 0x0p+0)))) + ) + + (func (export "as-binary-left") (result i32) + (block (result i32) (i32.add (call $dummy (i32.const 1)) (i32.const 10))) + ) + (func (export "as-binary-right") (result i32) + (block (result i32) (i32.sub (i32.const 10) (call $dummy (i32.const 1)))) + ) + + (func (export "as-test-operand") (result i32) + (block (result i32) (i32.eqz (call $dummy (i32.const 1)))) + ) + + (func (export "as-compare-left") (result i32) + (block (result i32) (i32.le_u (call $dummy (i32.const 1)) (i32.const 10))) + ) + (func (export "as-compare-right") (result i32) + (block (result i32) (i32.ne (i32.const 10) (call $dummy (i32.const 1)))) + ) + + (func (export "as-convert-operand") (result i64) + (block (result i64) (i64.extend_i32_s (call $dummy (i32.const 1)))) + ) + + ;; Test correct argument passing + + (func $return-from-long-argument-list-helper (param f32 i32 i32 f64 f32 f32 f32 f64 f32 i32 i32 f32 f64 i64 i64 i32 i64 i64 f32 i64 i64 i64 i32 f32 f32 f32 f64 f32 i32 i64 f32 f64 f64 f32 i32 f32 f32 f64 i64 f64 i32 i64 f32 f64 i32 i32 i32 i64 f64 i32 i64 i64 f64 f64 f64 f64 f64 f64 i32 f32 f64 f64 i32 i64 f32 f32 f32 i32 f64 f64 f64 f64 f64 f32 i64 i64 i32 i32 i32 f32 f64 i32 i64 f32 f32 f32 i32 i32 f32 f64 i64 f32 f64 f32 f32 f32 i32 f32 i64 i32) (result i32) + (local.get 99) + ) + + (func (export "return-from-long-argument-list") (param i32) (result i32) + (call $return-from-long-argument-list-helper (f32.const 0) (i32.const 0) (i32.const 0) (f64.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f64.const 0) (f32.const 0) (i32.const 0) (i32.const 0) (f32.const 0) (f64.const 0) (i64.const 0) (i64.const 0) (i32.const 0) (i64.const 0) (i64.const 0) (f32.const 0) (i64.const 0) (i64.const 0) (i64.const 0) (i32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f64.const 0) (f32.const 0) (i32.const 0) (i64.const 0) (f32.const 0) (f64.const 0) (f64.const 0) (f32.const 0) (i32.const 0) (f32.const 0) (f32.const 0) (f64.const 0) (i64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (f32.const 0) (f64.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (i64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (i64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (i32.const 0) (f32.const 0) (f64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (i32.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f64.const 0) (f32.const 0) (i64.const 0) (i64.const 0) (i32.const 0) (i32.const 0) (i32.const 0) (f32.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (i32.const 0) (i32.const 0) (f32.const 0) (f64.const 0) (i64.const 0) (f32.const 0) (f64.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (i32.const 0) (f32.const 0) (i64.const 0) (local.get 0)) + ) ) (assert_return (invoke "type-i32") (i32.const 0x132)) @@ -134,16 +272,53 @@ (assert_return (invoke "even" (i64.const 0)) (i32.const 44)) (assert_return (invoke "even" (i64.const 1)) (i32.const 99)) -(assert_return (invoke "even" (i64.const 10)) (i32.const 44)) -(assert_return (invoke "even" (i64.const 7)) (i32.const 99)) +(assert_return (invoke "even" (i64.const 100)) (i32.const 44)) +(assert_return (invoke "even" (i64.const 77)) (i32.const 99)) (assert_return (invoke "odd" (i64.const 0)) (i32.const 99)) (assert_return (invoke "odd" (i64.const 1)) (i32.const 44)) -(assert_return (invoke "odd" (i64.const 20)) (i32.const 99)) -(assert_return (invoke "odd" (i64.const 7)) (i32.const 44)) +(assert_return (invoke "odd" (i64.const 200)) (i32.const 99)) +(assert_return (invoke "odd" (i64.const 77)) (i32.const 44)) + +(assert_exhaustion (invoke "runaway") "call stack exhausted") +(assert_exhaustion (invoke "mutual-runaway") "call stack exhausted") + +(assert_return (invoke "as-select-first") (i32.const 0x132)) +(assert_return (invoke "as-select-mid") (i32.const 2)) +(assert_return (invoke "as-select-last") (i32.const 2)) + +(assert_return (invoke "as-if-condition") (i32.const 1)) + +(assert_return (invoke "as-br_if-first") (i32.const 0x132)) +(assert_return (invoke "as-br_if-last") (i32.const 2)) + +(assert_return (invoke "as-br_table-first") (i32.const 0x132)) +(assert_return (invoke "as-br_table-last") (i32.const 2)) + +(assert_return (invoke "as-call_indirect-first") (i32.const 0x132)) +(assert_return (invoke "as-call_indirect-mid") (i32.const 2)) +(assert_trap (invoke "as-call_indirect-last") "undefined element") -(assert_trap (invoke "runaway") "call stack exhausted") -(assert_trap (invoke "mutual-runaway") "call stack exhausted") +(assert_return (invoke "as-store-first")) +(assert_return (invoke "as-store-last")) +(assert_return (invoke "as-memory.grow-value") (i32.const 1)) +(assert_return (invoke "as-return-value") (i32.const 0x132)) +(assert_return (invoke "as-drop-operand")) +(assert_return (invoke "as-br-value") (i32.const 0x132)) +(assert_return (invoke "as-local.set-value") (i32.const 0x132)) +(assert_return (invoke "as-local.tee-value") (i32.const 0x132)) +(assert_return (invoke "as-global.set-value") (i32.const 0x132)) +(assert_return (invoke "as-load-operand") (i32.const 1)) + +(assert_return (invoke "as-unary-operand") (f32.const 0x0p+0)) +(assert_return (invoke "as-binary-left") (i32.const 11)) +(assert_return (invoke "as-binary-right") (i32.const 9)) +(assert_return (invoke "as-test-operand") (i32.const 0)) +(assert_return (invoke "as-compare-left") (i32.const 1)) +(assert_return (invoke "as-compare-right") (i32.const 1)) +(assert_return (invoke "as-convert-operand") (i64.const 1)) + +(assert_return (invoke "return-from-long-argument-list" (i32.const 42)) (i32.const 42)) ;; Invalid typing @@ -220,6 +395,61 @@ "type mismatch" ) +(assert_invalid + (module + (func $type-first-empty-in-block + (block (call 1)) + ) + (func (param i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-second-empty-in-block + (block (call 1 (i32.const 0))) + ) + (func (param i32 i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-first-empty-in-loop + (loop (call 1)) + ) + (func (param i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-second-empty-in-loop + (loop (call 1 (i32.const 0))) + ) + (func (param i32 i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-first-empty-in-then + (if (i32.const 0) (then (call 1))) + ) + (func (param i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-second-empty-in-then + (if (i32.const 0) (then (call 1 (i32.const 0)))) + ) + (func (param i32 i32)) + ) + "type mismatch" +) + ;; Unbound function diff --git a/test/spec/call_indirect.wast b/test/spec/call_indirect.wast index 41f4316f6..87d1df75a 100644 --- a/test/spec/call_indirect.wast +++ b/test/spec/call_indirect.wast @@ -45,19 +45,57 @@ $const-i32 $const-i64 $const-f32 $const-f64 $id-i32 $id-i64 $id-f32 $id-f64 $f32-i32 $i32-i64 $f64-f32 $i64-f64 - $fac $fib $even $odd + $fac-i64 $fib-i64 $even $odd $runaway $mutual-runaway1 $mutual-runaway2 $over-i32-duplicate $over-i64-duplicate $over-f32-duplicate $over-f64-duplicate + $fac-i32 $fac-f32 $fac-f64 + $fib-i32 $fib-f32 $fib-f64 ) ) + ;; Syntax + + (func + (call_indirect (i32.const 0)) + (call_indirect (param i64) (i64.const 0) (i32.const 0)) + (call_indirect (param i64) (param) (param f64 i32 i64) + (i64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (i32.const 0) + ) + (call_indirect (result) (i32.const 0)) + (drop (i32.eqz (call_indirect (result i32) (i32.const 0)))) + (drop (i32.eqz (call_indirect (result i32) (result) (i32.const 0)))) + (drop (i32.eqz + (call_indirect (param i64) (result i32) (i64.const 0) (i32.const 0)) + )) + (drop (i32.eqz + (call_indirect + (param) (param i64) (param) (param f64 i32 i64) (param) (param) + (result) (result i32) (result) (result) + (i64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (i32.const 0) + ) + )) + (drop (i64.eqz + (call_indirect (type $over-i64) (param i64) (result i64) + (i64.const 0) (i32.const 0) + ) + )) + ) + ;; Typing - (func (export "type-i32") (result i32) (call_indirect (type $out-i32) (i32.const 0))) - (func (export "type-i64") (result i64) (call_indirect (type $out-i64) (i32.const 1))) - (func (export "type-f32") (result f32) (call_indirect (type $out-f32) (i32.const 2))) - (func (export "type-f64") (result f64) (call_indirect (type $out-f64) (i32.const 3))) + (func (export "type-i32") (result i32) + (call_indirect (type $out-i32) (i32.const 0)) + ) + (func (export "type-i64") (result i64) + (call_indirect (type $out-i64) (i32.const 1)) + ) + (func (export "type-f32") (result f32) + (call_indirect (type $out-f32) (i32.const 2)) + ) + (func (export "type-f64") (result f64) + (call_indirect (type $out-f64) (i32.const 3)) + ) (func (export "type-index") (result i64) (call_indirect (type $over-i64) (i64.const 100) (i32.const 5)) @@ -95,56 +133,172 @@ (call_indirect (type $over-i64) (local.get 1) (local.get 0)) ) - (func (export "dispatch-structural") (param i32) (result i64) + (func (export "dispatch-structural-i64") (param i32) (result i64) (call_indirect (type $over-i64-duplicate) (i64.const 9) (local.get 0)) ) + (func (export "dispatch-structural-i32") (param i32) (result i32) + (call_indirect (type $over-i32-duplicate) (i32.const 9) (local.get 0)) + ) + (func (export "dispatch-structural-f32") (param i32) (result f32) + (call_indirect (type $over-f32-duplicate) (f32.const 9.0) (local.get 0)) + ) + (func (export "dispatch-structural-f64") (param i32) (result f64) + (call_indirect (type $over-f64-duplicate) (f64.const 9.0) (local.get 0)) + ) ;; Recursion - (func $fac (export "fac") (type $over-i64) - (if i64 (i64.eqz (local.get 0)) - (i64.const 1) - (i64.mul - (local.get 0) - (call_indirect (type $over-i64) - (i64.sub (local.get 0) (i64.const 1)) - (i32.const 12) + (func $fac-i64 (export "fac-i64") (type $over-i64) + (if (result i64) (i64.eqz (local.get 0)) + (then (i64.const 1)) + (else + (i64.mul + (local.get 0) + (call_indirect (type $over-i64) + (i64.sub (local.get 0) (i64.const 1)) + (i32.const 12) + ) + ) + ) + ) + ) + + (func $fib-i64 (export "fib-i64") (type $over-i64) + (if (result i64) (i64.le_u (local.get 0) (i64.const 1)) + (then (i64.const 1)) + (else + (i64.add + (call_indirect (type $over-i64) + (i64.sub (local.get 0) (i64.const 2)) + (i32.const 13) + ) + (call_indirect (type $over-i64) + (i64.sub (local.get 0) (i64.const 1)) + (i32.const 13) + ) + ) + ) + ) + ) + + (func $fac-i32 (export "fac-i32") (type $over-i32) + (if (result i32) (i32.eqz (local.get 0)) + (then (i32.const 1)) + (else + (i32.mul + (local.get 0) + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 1)) + (i32.const 23) + ) + ) + ) + ) + ) + + (func $fac-f32 (export "fac-f32") (type $over-f32) + (if (result f32) (f32.eq (local.get 0) (f32.const 0.0)) + (then (f32.const 1.0)) + (else + (f32.mul + (local.get 0) + (call_indirect (type $over-f32) + (f32.sub (local.get 0) (f32.const 1.0)) + (i32.const 24) + ) + ) + ) + ) + ) + + (func $fac-f64 (export "fac-f64") (type $over-f64) + (if (result f64) (f64.eq (local.get 0) (f64.const 0.0)) + (then (f64.const 1.0)) + (else + (f64.mul + (local.get 0) + (call_indirect (type $over-f64) + (f64.sub (local.get 0) (f64.const 1.0)) + (i32.const 25) + ) ) ) ) ) - (func $fib (export "fib") (type $over-i64) - (if i64 (i64.le_u (local.get 0) (i64.const 1)) - (i64.const 1) - (i64.add - (call_indirect (type $over-i64) - (i64.sub (local.get 0) (i64.const 2)) - (i32.const 13) + (func $fib-i32 (export "fib-i32") (type $over-i32) + (if (result i32) (i32.le_u (local.get 0) (i32.const 1)) + (then (i32.const 1)) + (else + (i32.add + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 2)) + (i32.const 26) + ) + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 1)) + (i32.const 26) + ) ) - (call_indirect (type $over-i64) - (i64.sub (local.get 0) (i64.const 1)) - (i32.const 13) + ) + ) + ) + + (func $fib-f32 (export "fib-f32") (type $over-f32) + (if (result f32) (f32.le (local.get 0) (f32.const 1.0)) + (then (f32.const 1.0)) + (else + (f32.add + (call_indirect (type $over-f32) + (f32.sub (local.get 0) (f32.const 2.0)) + (i32.const 27) + ) + (call_indirect (type $over-f32) + (f32.sub (local.get 0) (f32.const 1.0)) + (i32.const 27) + ) + ) + ) + ) + ) + + (func $fib-f64 (export "fib-f64") (type $over-f64) + (if (result f64) (f64.le (local.get 0) (f64.const 1.0)) + (then (f64.const 1.0)) + (else + (f64.add + (call_indirect (type $over-f64) + (f64.sub (local.get 0) (f64.const 2.0)) + (i32.const 28) + ) + (call_indirect (type $over-f64) + (f64.sub (local.get 0) (f64.const 1.0)) + (i32.const 28) + ) ) ) ) ) (func $even (export "even") (param i32) (result i32) - (if i32 (i32.eqz (local.get 0)) - (i32.const 44) - (call_indirect (type $over-i32) - (i32.sub (local.get 0) (i32.const 1)) - (i32.const 15) + (if (result i32) (i32.eqz (local.get 0)) + (then (i32.const 44)) + (else + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 1)) + (i32.const 15) + ) ) ) ) (func $odd (export "odd") (param i32) (result i32) - (if i32 (i32.eqz (local.get 0)) - (i32.const 99) - (call_indirect (type $over-i32) - (i32.sub (local.get 0) (i32.const 1)) - (i32.const 14) + (if (result i32) (i32.eqz (local.get 0)) + (then (i32.const 99)) + (else + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 1)) + (i32.const 14) + ) ) ) ) @@ -162,6 +316,132 @@ (func $mutual-runaway1 (export "mutual-runaway") (call_indirect (type $proc) (i32.const 18))) (func $mutual-runaway2 (call_indirect (type $proc) (i32.const 17))) + + ;; As parameter of control constructs and instructions + + (memory 1) + + (func (export "as-select-first") (result i32) + (select (call_indirect (type $out-i32) (i32.const 0)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-select-mid") (result i32) + (select (i32.const 2) (call_indirect (type $out-i32) (i32.const 0)) (i32.const 3)) + ) + (func (export "as-select-last") (result i32) + (select (i32.const 2) (i32.const 3) (call_indirect (type $out-i32) (i32.const 0))) + ) + + (func (export "as-if-condition") (result i32) + (if (result i32) (call_indirect (type $out-i32) (i32.const 0)) (then (i32.const 1)) (else (i32.const 2))) + ) + + (func (export "as-br_if-first") (result i64) + (block (result i64) (br_if 0 (call_indirect (type $out-i64) (i32.const 1)) (i32.const 2))) + ) + (func (export "as-br_if-last") (result i32) + (block (result i32) (br_if 0 (i32.const 2) (call_indirect (type $out-i32) (i32.const 0)))) + ) + + (func (export "as-br_table-first") (result f32) + (block (result f32) (call_indirect (type $out-f32) (i32.const 2)) (i32.const 2) (br_table 0 0)) + ) + (func (export "as-br_table-last") (result i32) + (block (result i32) (i32.const 2) (call_indirect (type $out-i32) (i32.const 0)) (br_table 0 0)) + ) + + (func (export "as-store-first") + (call_indirect (type $out-i32) (i32.const 0)) (i32.const 1) (i32.store) + ) + (func (export "as-store-last") + (i32.const 10) (call_indirect (type $out-f64) (i32.const 3)) (f64.store) + ) + + (func (export "as-memory.grow-value") (result i32) + (memory.grow (call_indirect (type $out-i32) (i32.const 0))) + ) + (func (export "as-return-value") (result i32) + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) (return) + ) + (func (export "as-drop-operand") + (call_indirect (type $over-i64) (i64.const 1) (i32.const 5)) (drop) + ) + (func (export "as-br-value") (result f32) + (block (result f32) (br 0 (call_indirect (type $over-f32) (f32.const 1) (i32.const 6)))) + ) + (func (export "as-local.set-value") (result f64) + (local f64) (local.set 0 (call_indirect (type $over-f64) (f64.const 1) (i32.const 7))) (local.get 0) + ) + (func (export "as-local.tee-value") (result f64) + (local f64) (local.tee 0 (call_indirect (type $over-f64) (f64.const 1) (i32.const 7))) + ) + (global $a (mut f64) (f64.const 10.0)) + (func (export "as-global.set-value") (result f64) + (global.set $a (call_indirect (type $over-f64) (f64.const 1.0) (i32.const 7))) + (global.get $a) + ) + + (func (export "as-load-operand") (result i32) + (i32.load (call_indirect (type $out-i32) (i32.const 0))) + ) + + (func (export "as-unary-operand") (result f32) + (block (result f32) + (f32.sqrt + (call_indirect (type $over-f32) (f32.const 0x0p+0) (i32.const 6)) + ) + ) + ) + + (func (export "as-binary-left") (result i32) + (block (result i32) + (i32.add + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) + (i32.const 10) + ) + ) + ) + (func (export "as-binary-right") (result i32) + (block (result i32) + (i32.sub + (i32.const 10) + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) + ) + ) + ) + + (func (export "as-test-operand") (result i32) + (block (result i32) + (i32.eqz + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) + ) + ) + ) + + (func (export "as-compare-left") (result i32) + (block (result i32) + (i32.le_u + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) + (i32.const 10) + ) + ) + ) + (func (export "as-compare-right") (result i32) + (block (result i32) + (i32.ne + (i32.const 10) + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) + ) + ) + ) + + (func (export "as-convert-operand") (result i64) + (block (result i64) + (i64.extend_i32_s + (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) + ) + ) + ) + ) (assert_return (invoke "type-i32") (i32.const 0x132)) @@ -186,42 +466,249 @@ (assert_return (invoke "dispatch" (i32.const 12) (i64.const 5)) (i64.const 120)) (assert_return (invoke "dispatch" (i32.const 13) (i64.const 5)) (i64.const 8)) (assert_return (invoke "dispatch" (i32.const 20) (i64.const 2)) (i64.const 2)) -(assert_trap (invoke "dispatch" (i32.const 0) (i64.const 2)) "indirect call signature mismatch") -(assert_trap (invoke "dispatch" (i32.const 15) (i64.const 2)) "indirect call signature mismatch") -(assert_trap (invoke "dispatch" (i32.const 23) (i64.const 2)) "undefined element") +(assert_trap (invoke "dispatch" (i32.const 0) (i64.const 2)) "indirect call type mismatch") +(assert_trap (invoke "dispatch" (i32.const 15) (i64.const 2)) "indirect call type mismatch") +(assert_trap (invoke "dispatch" (i32.const 29) (i64.const 2)) "undefined element") (assert_trap (invoke "dispatch" (i32.const -1) (i64.const 2)) "undefined element") (assert_trap (invoke "dispatch" (i32.const 1213432423) (i64.const 2)) "undefined element") -(assert_return (invoke "dispatch-structural" (i32.const 5)) (i64.const 9)) -(assert_return (invoke "dispatch-structural" (i32.const 5)) (i64.const 9)) -(assert_return (invoke "dispatch-structural" (i32.const 12)) (i64.const 362880)) -(assert_return (invoke "dispatch-structural" (i32.const 20)) (i64.const 9)) -(assert_trap (invoke "dispatch-structural" (i32.const 11)) "indirect call signature mismatch") -(assert_trap (invoke "dispatch-structural" (i32.const 22)) "indirect call signature mismatch") - -(assert_return (invoke "fac" (i64.const 0)) (i64.const 1)) -(assert_return (invoke "fac" (i64.const 1)) (i64.const 1)) -(assert_return (invoke "fac" (i64.const 5)) (i64.const 120)) -(assert_return (invoke "fac" (i64.const 25)) (i64.const 7034535277573963776)) - -(assert_return (invoke "fib" (i64.const 0)) (i64.const 1)) -(assert_return (invoke "fib" (i64.const 1)) (i64.const 1)) -(assert_return (invoke "fib" (i64.const 2)) (i64.const 2)) -(assert_return (invoke "fib" (i64.const 5)) (i64.const 8)) -(assert_return (invoke "fib" (i64.const 20)) (i64.const 10946)) +(assert_return (invoke "dispatch-structural-i64" (i32.const 5)) (i64.const 9)) +(assert_return (invoke "dispatch-structural-i64" (i32.const 12)) (i64.const 362880)) +(assert_return (invoke "dispatch-structural-i64" (i32.const 13)) (i64.const 55)) +(assert_return (invoke "dispatch-structural-i64" (i32.const 20)) (i64.const 9)) +(assert_trap (invoke "dispatch-structural-i64" (i32.const 11)) "indirect call type mismatch") +(assert_trap (invoke "dispatch-structural-i64" (i32.const 22)) "indirect call type mismatch") + +(assert_return (invoke "dispatch-structural-i32" (i32.const 4)) (i32.const 9)) +(assert_return (invoke "dispatch-structural-i32" (i32.const 23)) (i32.const 362880)) +(assert_return (invoke "dispatch-structural-i32" (i32.const 26)) (i32.const 55)) +(assert_return (invoke "dispatch-structural-i32" (i32.const 19)) (i32.const 9)) +(assert_trap (invoke "dispatch-structural-i32" (i32.const 9)) "indirect call type mismatch") +(assert_trap (invoke "dispatch-structural-i32" (i32.const 21)) "indirect call type mismatch") + +(assert_return (invoke "dispatch-structural-f32" (i32.const 6)) (f32.const 9.0)) +(assert_return (invoke "dispatch-structural-f32" (i32.const 24)) (f32.const 362880.0)) +(assert_return (invoke "dispatch-structural-f32" (i32.const 27)) (f32.const 55.0)) +(assert_return (invoke "dispatch-structural-f32" (i32.const 21)) (f32.const 9.0)) +(assert_trap (invoke "dispatch-structural-f32" (i32.const 8)) "indirect call type mismatch") +(assert_trap (invoke "dispatch-structural-f32" (i32.const 19)) "indirect call type mismatch") + +(assert_return (invoke "dispatch-structural-f64" (i32.const 7)) (f64.const 9.0)) +(assert_return (invoke "dispatch-structural-f64" (i32.const 25)) (f64.const 362880.0)) +(assert_return (invoke "dispatch-structural-f64" (i32.const 28)) (f64.const 55.0)) +(assert_return (invoke "dispatch-structural-f64" (i32.const 22)) (f64.const 9.0)) +(assert_trap (invoke "dispatch-structural-f64" (i32.const 10)) "indirect call type mismatch") +(assert_trap (invoke "dispatch-structural-f64" (i32.const 18)) "indirect call type mismatch") + +(assert_return (invoke "fac-i64" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "fac-i64" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fac-i64" (i64.const 5)) (i64.const 120)) +(assert_return (invoke "fac-i64" (i64.const 25)) (i64.const 7034535277573963776)) + +(assert_return (invoke "fac-i32" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "fac-i32" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "fac-i32" (i32.const 5)) (i32.const 120)) +(assert_return (invoke "fac-i32" (i32.const 10)) (i32.const 3628800)) + +(assert_return (invoke "fac-f32" (f32.const 0.0)) (f32.const 1.0)) +(assert_return (invoke "fac-f32" (f32.const 1.0)) (f32.const 1.0)) +(assert_return (invoke "fac-f32" (f32.const 5.0)) (f32.const 120.0)) +(assert_return (invoke "fac-f32" (f32.const 10.0)) (f32.const 3628800.0)) + +(assert_return (invoke "fac-f64" (f64.const 0.0)) (f64.const 1.0)) +(assert_return (invoke "fac-f64" (f64.const 1.0)) (f64.const 1.0)) +(assert_return (invoke "fac-f64" (f64.const 5.0)) (f64.const 120.0)) +(assert_return (invoke "fac-f64" (f64.const 10.0)) (f64.const 3628800.0)) + +(assert_return (invoke "fib-i64" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "fib-i64" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fib-i64" (i64.const 2)) (i64.const 2)) +(assert_return (invoke "fib-i64" (i64.const 5)) (i64.const 8)) +(assert_return (invoke "fib-i64" (i64.const 20)) (i64.const 10946)) + +(assert_return (invoke "fib-i32" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "fib-i32" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "fib-i32" (i32.const 2)) (i32.const 2)) +(assert_return (invoke "fib-i32" (i32.const 5)) (i32.const 8)) +(assert_return (invoke "fib-i32" (i32.const 20)) (i32.const 10946)) + +(assert_return (invoke "fib-f32" (f32.const 0.0)) (f32.const 1.0)) +(assert_return (invoke "fib-f32" (f32.const 1.0)) (f32.const 1.0)) +(assert_return (invoke "fib-f32" (f32.const 2.0)) (f32.const 2.0)) +(assert_return (invoke "fib-f32" (f32.const 5.0)) (f32.const 8.0)) +(assert_return (invoke "fib-f32" (f32.const 20.0)) (f32.const 10946.0)) + +(assert_return (invoke "fib-f64" (f64.const 0.0)) (f64.const 1.0)) +(assert_return (invoke "fib-f64" (f64.const 1.0)) (f64.const 1.0)) +(assert_return (invoke "fib-f64" (f64.const 2.0)) (f64.const 2.0)) +(assert_return (invoke "fib-f64" (f64.const 5.0)) (f64.const 8.0)) +(assert_return (invoke "fib-f64" (f64.const 20.0)) (f64.const 10946.0)) (assert_return (invoke "even" (i32.const 0)) (i32.const 44)) (assert_return (invoke "even" (i32.const 1)) (i32.const 99)) -(assert_return (invoke "even" (i32.const 10)) (i32.const 44)) -(assert_return (invoke "even" (i32.const 7)) (i32.const 99)) +(assert_return (invoke "even" (i32.const 100)) (i32.const 44)) +(assert_return (invoke "even" (i32.const 77)) (i32.const 99)) (assert_return (invoke "odd" (i32.const 0)) (i32.const 99)) (assert_return (invoke "odd" (i32.const 1)) (i32.const 44)) -(assert_return (invoke "odd" (i32.const 20)) (i32.const 99)) -(assert_return (invoke "odd" (i32.const 7)) (i32.const 44)) - -(assert_trap (invoke "runaway") "call stack exhausted") -(assert_trap (invoke "mutual-runaway") "call stack exhausted") +(assert_return (invoke "odd" (i32.const 200)) (i32.const 99)) +(assert_return (invoke "odd" (i32.const 77)) (i32.const 44)) + +(assert_exhaustion (invoke "runaway") "call stack exhausted") +(assert_exhaustion (invoke "mutual-runaway") "call stack exhausted") + +(assert_return (invoke "as-select-first") (i32.const 0x132)) +(assert_return (invoke "as-select-mid") (i32.const 2)) +(assert_return (invoke "as-select-last") (i32.const 2)) + +(assert_return (invoke "as-if-condition") (i32.const 1)) + +(assert_return (invoke "as-br_if-first") (i64.const 0x164)) +(assert_return (invoke "as-br_if-last") (i32.const 2)) + +(assert_return (invoke "as-br_table-first") (f32.const 0xf32)) +(assert_return (invoke "as-br_table-last") (i32.const 2)) + +(assert_return (invoke "as-store-first")) +(assert_return (invoke "as-store-last")) + +(assert_return (invoke "as-memory.grow-value") (i32.const 1)) +(assert_return (invoke "as-return-value") (i32.const 1)) +(assert_return (invoke "as-drop-operand")) +(assert_return (invoke "as-br-value") (f32.const 1)) +(assert_return (invoke "as-local.set-value") (f64.const 1)) +(assert_return (invoke "as-local.tee-value") (f64.const 1)) +(assert_return (invoke "as-global.set-value") (f64.const 1.0)) +(assert_return (invoke "as-load-operand") (i32.const 1)) + +(assert_return (invoke "as-unary-operand") (f32.const 0x0p+0)) +(assert_return (invoke "as-binary-left") (i32.const 11)) +(assert_return (invoke "as-binary-right") (i32.const 9)) +(assert_return (invoke "as-test-operand") (i32.const 0)) +(assert_return (invoke "as-compare-left") (i32.const 1)) +(assert_return (invoke "as-compare-right") (i32.const 1)) +(assert_return (invoke "as-convert-operand") (i64.const 1)) + +;; Invalid syntax + +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (type $sig) (result i32) (param i32)" + " (i32.const 0) (i32.const 0)" + " )" + ")" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (param i32) (type $sig) (result i32)" + " (i32.const 0) (i32.const 0)" + " )" + ")" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (param i32) (result i32) (type $sig)" + " (i32.const 0) (i32.const 0)" + " )" + ")" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (result i32) (type $sig) (param i32)" + " (i32.const 0) (i32.const 0)" + " )" + ")" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (result i32) (param i32) (type $sig)" + " (i32.const 0) (i32.const 0)" + " )" + ")" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0))" + ")" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(table 0 funcref)" + "(func (call_indirect (param $x i32) (i32.const 0) (i32.const 0)))" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (type $sig) (result i32) (i32.const 0))" + ")" + ) + "inline function type" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (type $sig) (result i32) (i32.const 0))" + ")" + ) + "inline function type" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(table 0 funcref)" + "(func" + " (call_indirect (type $sig) (param i32) (i32.const 0) (i32.const 0))" + ")" + ) + "inline function type" +) +(assert_malformed + (module quote + "(type $sig (func (param i32 i32) (result i32)))" + "(table 0 funcref)" + "(func (result i32)" + " (call_indirect (type $sig) (param i32) (result i32)" + " (i32.const 0) (i32.const 0)" + " )" + ")" + ) + "inline function type" +) ;; Invalid typing @@ -343,6 +830,91 @@ "type mismatch" ) +(assert_invalid + (module + (func $f (param i32)) + (type $sig (func (param i32))) + (table funcref (elem $f)) + (func $type-first-empty-in-block + (block + (call_indirect (type $sig) (i32.const 0)) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32 i32)) + (type $sig (func (param i32 i32))) + (table funcref (elem $f)) + (func $type-second-empty-in-block + (block + (call_indirect (type $sig) (i32.const 0) (i32.const 0)) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32)) + (type $sig (func (param i32))) + (table funcref (elem $f)) + (func $type-first-empty-in-loop + (loop + (call_indirect (type $sig) (i32.const 0)) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32 i32)) + (type $sig (func (param i32 i32))) + (table funcref (elem $f)) + (func $type-second-empty-in-loop + (loop + (call_indirect (type $sig) (i32.const 0) (i32.const 0)) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32)) + (type $sig (func (param i32))) + (table funcref (elem $f)) + (func $type-first-empty-in-then + (i32.const 0) (i32.const 0) + (if + (then + (call_indirect (type $sig) (i32.const 0)) + ) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32 i32)) + (type $sig (func (param i32 i32))) + (table funcref (elem $f)) + (func $type-second-empty-in-then + (i32.const 0) (i32.const 0) + (if + (then + (call_indirect (type $sig) (i32.const 0) (i32.const 0)) + ) + ) + ) + ) + "type mismatch" +) + ;; Unbound type @@ -360,3 +932,11 @@ ) "unknown type" ) + + +;; Unbound function in table + +(assert_invalid + (module (table funcref (elem 0 0))) + "unknown function" +) diff --git a/test/spec/comments.wast b/test/spec/comments.wast Binary files differindex 07a6298c4..90a64b42d 100644 --- a/test/spec/comments.wast +++ b/test/spec/comments.wast diff --git a/test/spec/const.wast b/test/spec/const.wast new file mode 100644 index 000000000..6e8931a06 --- /dev/null +++ b/test/spec/const.wast @@ -0,0 +1,1046 @@ +;; Test t.const instructions + +;; Syntax error + +(module (func (i32.const 0_123_456_789) drop)) +(module (func (i32.const 0x0_9acf_fBDF) drop)) +(assert_malformed + (module quote "(func (i32.const) drop)") + "unexpected token" +) +(assert_malformed + (module quote "(func (i32.const 0x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (i32.const 1x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (i32.const 0xg) drop)") + "unknown operator" +) + +(module (func (i64.const 0_123_456_789) drop)) +(module (func (i64.const 0x0125_6789_ADEF_bcef) drop)) +(assert_malformed + (module quote "(func (i64.const) drop)") + "unexpected token" +) +(assert_malformed + (module quote "(func (i64.const 0x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (i64.const 1x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (i64.const 0xg) drop)") + "unknown operator" +) + +(module (func (f32.const 0123456789) drop)) +(module (func (f32.const 0123456789e019) drop)) +(module (func (f32.const 0123456789e+019) drop)) +(module (func (f32.const 0123456789e-019) drop)) +(module (func (f32.const 0123456789.) drop)) +(module (func (f32.const 0123456789.e019) drop)) +(module (func (f32.const 0123456789.e+019) drop)) +(module (func (f32.const 0123456789.e-019) drop)) +(module (func (f32.const 0123456789.0123456789) drop)) +(module (func (f32.const 0123456789.0123456789e019) drop)) +(module (func (f32.const 0123456789.0123456789e+019) drop)) +(module (func (f32.const 0123456789.0123456789e-019) drop)) +(module (func (f32.const 0x0123456789ABCDEF) drop)) +(module (func (f32.const 0x0123456789ABCDEFp019) drop)) +(module (func (f32.const 0x0123456789ABCDEFp+019) drop)) +(module (func (f32.const 0x0123456789ABCDEFp-019) drop)) +(module (func (f32.const 0x0123456789ABCDEF.) drop)) +(module (func (f32.const 0x0123456789ABCDEF.p019) drop)) +(module (func (f32.const 0x0123456789ABCDEF.p+019) drop)) +(module (func (f32.const 0x0123456789ABCDEF.p-019) drop)) +(module (func (f32.const 0x0123456789ABCDEF.019aF) drop)) +(module (func (f32.const 0x0123456789ABCDEF.019aFp019) drop)) +(module (func (f32.const 0x0123456789ABCDEF.019aFp+019) drop)) +(module (func (f32.const 0x0123456789ABCDEF.019aFp-019) drop)) +(assert_malformed + (module quote "(func (f32.const) drop)") + "unexpected token" +) +(assert_malformed + (module quote "(func (f32.const .0) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const .0e0) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0e) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0e+) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0.0e) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0.0e-) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 1x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0xg) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x.) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0.g) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0p) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0p+) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0p-) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0.0p) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0.0p+) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0.0p-) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f32.const 0x0pA) drop)") + "unknown operator" +) + + +(module (func (f64.const 0123456789) drop)) +(module (func (f64.const 0123456789e019) drop)) +(module (func (f64.const 0123456789e+019) drop)) +(module (func (f64.const 0123456789e-019) drop)) +(module (func (f64.const 0123456789.) drop)) +(module (func (f64.const 0123456789.e019) drop)) +(module (func (f64.const 0123456789.e+019) drop)) +(module (func (f64.const 0123456789.e-019) drop)) +(module (func (f64.const 0123456789.0123456789) drop)) +(module (func (f64.const 0123456789.0123456789e019) drop)) +(module (func (f64.const 0123456789.0123456789e+019) drop)) +(module (func (f64.const 0123456789.0123456789e-019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdefp019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdefp+019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdefp-019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.p019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.p+019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.p-019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdef) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp+019) drop)) +(module (func (f64.const 0x0123456789ABCDEFabcdef.0123456789ABCDEFabcdefp-019) drop)) +(assert_malformed + (module quote "(func (f64.const) drop)") + "unexpected token" +) +(assert_malformed + (module quote "(func (f64.const .0) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const .0e0) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0e) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0e+) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0.0e) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0.0e-) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 1x) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0xg) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x.) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0.g) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0p) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0p+) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0p-) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0.0p) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0.0p+) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0.0p-) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const 0x0pA) drop)") + "unknown operator" +) + + +;; Range error + +(module (func (i32.const 0xffffffff) drop)) +(module (func (i32.const -0x80000000) drop)) +(assert_malformed + (module quote "(func (i32.const 0x100000000) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (i32.const -0x80000001) drop)") + "constant out of range" +) + +(module (func (i32.const 4294967295) drop)) +(module (func (i32.const -2147483648) drop)) +(assert_malformed + (module quote "(func (i32.const 4294967296) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (i32.const -2147483649) drop)") + "constant out of range" +) + +(module (func (i64.const 0xffffffffffffffff) drop)) +(module (func (i64.const -0x8000000000000000) drop)) +(assert_malformed + (module quote "(func (i64.const 0x10000000000000000) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (i64.const -0x8000000000000001) drop)") + "constant out of range" +) + +(module (func (i64.const 18446744073709551615) drop)) +(module (func (i64.const -9223372036854775808) drop)) +(assert_malformed + (module quote "(func (i64.const 18446744073709551616) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (i64.const -9223372036854775809) drop)") + "constant out of range" +) + +(module (func (f32.const 0x1p127) drop)) +(module (func (f32.const -0x1p127) drop)) +(module (func (f32.const 0x1.fffffep127) drop)) +(module (func (f32.const -0x1.fffffep127) drop)) +(module (func (f32.const 0x1.fffffe7p127) drop)) +(module (func (f32.const -0x1.fffffe7p127) drop)) +(module (func (f32.const 0x1.fffffefffffff8000000p127) drop)) +(module (func (f32.const -0x1.fffffefffffff8000000p127) drop)) +(module (func (f32.const 0x1.fffffefffffffffffffp127) drop)) +(module (func (f32.const -0x1.fffffefffffffffffffp127) drop)) +(assert_malformed + (module quote "(func (f32.const 0x1p128) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f32.const -0x1p128) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f32.const 0x1.ffffffp127) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f32.const -0x1.ffffffp127) drop)") + "constant out of range" +) + +(module (func (f32.const 1e38) drop)) +(module (func (f32.const -1e38) drop)) +(assert_malformed + (module quote "(func (f32.const 1e39) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f32.const -1e39) drop)") + "constant out of range" +) + +(module (func (f32.const 340282356779733623858607532500980858880) drop)) +(module (func (f32.const -340282356779733623858607532500980858880) drop)) +(assert_malformed + (module quote "(func (f32.const 340282356779733661637539395458142568448) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f32.const -340282356779733661637539395458142568448) drop)") + "constant out of range" +) + +(module (func (f64.const 0x1p1023) drop)) +(module (func (f64.const -0x1p1023) drop)) +(module (func (f64.const 0x1.fffffffffffffp1023) drop)) +(module (func (f64.const -0x1.fffffffffffffp1023) drop)) +(module (func (f64.const 0x1.fffffffffffff7p1023) drop)) +(module (func (f64.const -0x1.fffffffffffff7p1023) drop)) +(module (func (f64.const 0x1.fffffffffffff7ffffffp1023) drop)) +(module (func (f64.const -0x1.fffffffffffff7ffffffp1023) drop)) +(assert_malformed + (module quote "(func (f64.const 0x1p1024) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const -0x1p1024) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const 0x1.fffffffffffff8p1023) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const -0x1.fffffffffffff8p1023) drop)") + "constant out of range" +) + +(module (func (f64.const 1e308) drop)) +(module (func (f64.const -1e308) drop)) +(assert_malformed + (module quote "(func (f64.const 1e309) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const -1e309) drop)") + "constant out of range" +) + +(module (func (f64.const 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368) drop)) +(module (func (f64.const -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368) drop)) +(assert_malformed + (module quote "(func (f64.const 269653970229347356221791135597556535197105851288767494898376215204735891170042808140884337949150317257310688430271573696351481990334196274152701320055306275479074865864826923114368235135583993416113802762682700913456874855354834422248712838998185022412196739306217084753107265771378949821875606039276187287552) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const -269653970229347356221791135597556535197105851288767494898376215204735891170042808140884337949150317257310688430271573696351481990334196274152701320055306275479074865864826923114368235135583993416113802762682700913456874855354834422248712838998185022412196739306217084753107265771378949821875606039276187287552) drop)") + "constant out of range" +) + +(module (func (f32.const nan:0x1) drop)) +(module (func (f64.const nan:0x1) drop)) +(module (func (f32.const nan:0x7f_ffff) drop)) +(module (func (f64.const nan:0xf_ffff_ffff_ffff) drop)) + +(assert_malformed + (module quote "(func (f32.const nan:1) drop)") + "unknown operator" +) +(assert_malformed + (module quote "(func (f64.const nan:1) drop)") + "unknown operator" +) + +(assert_malformed + (module quote "(func (f32.const nan:0x0) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const nan:0x0) drop)") + "constant out of range" +) + +(assert_malformed + (module quote "(func (f32.const nan:0x80_0000) drop)") + "constant out of range" +) +(assert_malformed + (module quote "(func (f64.const nan:0x10_0000_0000_0000) drop)") + "constant out of range" +) + + +;; Rounding behaviour + +;; f32, small exponent +(module (func (export "f") (result f32) (f32.const +0x1.00000100000000000p-50))) +(assert_return (invoke "f") (f32.const +0x1.000000p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000100000000000p-50))) +(assert_return (invoke "f") (f32.const -0x1.000000p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000100000000001p-50))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000100000000001p-50))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.000001fffffffffffp-50))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.000001fffffffffffp-50))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000200000000000p-50))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000200000000000p-50))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000200000000001p-50))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000200000000001p-50))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.000002fffffffffffp-50))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.000002fffffffffffp-50))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000300000000000p-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000300000000000p-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000300000000001p-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000300000000001p-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.000003fffffffffffp-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.000003fffffffffffp-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000400000000000p-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000400000000000p-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000400000000001p-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000400000000001p-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.000004fffffffffffp-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.000004fffffffffffp-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000500000000000p-50))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000500000000000p-50))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000500000000001p-50))) +(assert_return (invoke "f") (f32.const +0x1.000006p-50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000500000000001p-50))) +(assert_return (invoke "f") (f32.const -0x1.000006p-50)) + +(module (func (export "f") (result f32) (f32.const +0x4000.004000000p-64))) +(assert_return (invoke "f") (f32.const +0x1.000000p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.004000000p-64))) +(assert_return (invoke "f") (f32.const -0x1.000000p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.004000001p-64))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.004000001p-64))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.007ffffffp-64))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.007ffffffp-64))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.008000000p-64))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.008000000p-64))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.008000001p-64))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.008000001p-64))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.00bffffffp-64))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.00bffffffp-64))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.00c000000p-64))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.00c000000p-64))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.00c000001p-64))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.00c000001p-64))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.00fffffffp-64))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.00fffffffp-64))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.010000001p-64))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.010000001p-64))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.013ffffffp-64))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.013ffffffp-64))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const +0x4000.014000001p-64))) +(assert_return (invoke "f") (f32.const +0x1.000006p-50)) +(module (func (export "f") (result f32) (f32.const -0x4000.014000001p-64))) +(assert_return (invoke "f") (f32.const -0x1.000006p-50)) + +(module (func (export "f") (result f32) (f32.const +8.8817847263968443573e-16))) +(assert_return (invoke "f") (f32.const +0x1.000000p-50)) +(module (func (export "f") (result f32) (f32.const -8.8817847263968443573e-16))) +(assert_return (invoke "f") (f32.const -0x1.000000p-50)) +(module (func (export "f") (result f32) (f32.const +8.8817847263968443574e-16))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -8.8817847263968443574e-16))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +8.8817857851880284252e-16))) +(assert_return (invoke "f") (f32.const +0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const -8.8817857851880284252e-16))) +(assert_return (invoke "f") (f32.const -0x1.000002p-50)) +(module (func (export "f") (result f32) (f32.const +8.8817857851880284253e-16))) +(assert_return (invoke "f") (f32.const +0x1.000004p-50)) +(module (func (export "f") (result f32) (f32.const -8.8817857851880284253e-16))) +(assert_return (invoke "f") (f32.const -0x1.000004p-50)) + +;; f32, large exponent +(module (func (export "f") (result f32) (f32.const +0x1.00000100000000000p+50))) +(assert_return (invoke "f") (f32.const +0x1.000000p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000100000000000p+50))) +(assert_return (invoke "f") (f32.const -0x1.000000p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000100000000001p+50))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000100000000001p+50))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.000001fffffffffffp+50))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.000001fffffffffffp+50))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000200000000000p+50))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000200000000000p+50))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000200000000001p+50))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000200000000001p+50))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.000002fffffffffffp+50))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.000002fffffffffffp+50))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000300000000000p+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000300000000000p+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000300000000001p+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000300000000001p+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.000003fffffffffffp+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.000003fffffffffffp+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000400000000000p+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000400000000000p+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000400000000001p+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000400000000001p+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.000004fffffffffffp+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.000004fffffffffffp+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000500000000000p+50))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000500000000000p+50))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const +0x1.00000500000000001p+50))) +(assert_return (invoke "f") (f32.const +0x1.000006p+50)) +(module (func (export "f") (result f32) (f32.const -0x1.00000500000000001p+50))) +(assert_return (invoke "f") (f32.const -0x1.000006p+50)) + +(module (func (export "f") (result f32) (f32.const +0x4000004000000))) +(assert_return (invoke "f") (f32.const +0x1.000000p+50)) +(module (func (export "f") (result f32) (f32.const -0x4000004000000))) +(assert_return (invoke "f") (f32.const -0x1.000000p+50)) +(module (func (export "f") (result f32) (f32.const +0x4000004000001))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x4000004000001))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x4000007ffffff))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x4000007ffffff))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x4000008000000))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x4000008000000))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x4000008000001))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x4000008000001))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x400000bffffff))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -0x400000bffffff))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +0x400000c000000))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -0x400000c000000))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) + +(module (func (export "f") (result f32) (f32.const +1125899973951488))) +(assert_return (invoke "f") (f32.const +0x1.000000p+50)) +(module (func (export "f") (result f32) (f32.const -1125899973951488))) +(assert_return (invoke "f") (f32.const -0x1.000000p+50)) +(module (func (export "f") (result f32) (f32.const +1125899973951489))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -1125899973951489))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +1125900108169215))) +(assert_return (invoke "f") (f32.const +0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const -1125900108169215))) +(assert_return (invoke "f") (f32.const -0x1.000002p+50)) +(module (func (export "f") (result f32) (f32.const +1125900108169216))) +(assert_return (invoke "f") (f32.const +0x1.000004p+50)) +(module (func (export "f") (result f32) (f32.const -1125900108169216))) +(assert_return (invoke "f") (f32.const -0x1.000004p+50)) + +;; f32, subnormal +(module (func (export "f") (result f32) (f32.const +0x0.00000100000000000p-126))) +(assert_return (invoke "f") (f32.const +0x0.000000p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000100000000000p-126))) +(assert_return (invoke "f") (f32.const -0x0.000000p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000100000000001p-126))) +(assert_return (invoke "f") (f32.const +0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000100000000001p-126))) +(assert_return (invoke "f") (f32.const -0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.000001fffffffffffp-126))) +(assert_return (invoke "f") (f32.const +0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.000001fffffffffffp-126))) +(assert_return (invoke "f") (f32.const -0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000200000000000p-126))) +(assert_return (invoke "f") (f32.const +0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000200000000000p-126))) +(assert_return (invoke "f") (f32.const -0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000200000000001p-126))) +(assert_return (invoke "f") (f32.const +0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000200000000001p-126))) +(assert_return (invoke "f") (f32.const -0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.000002fffffffffffp-126))) +(assert_return (invoke "f") (f32.const +0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.000002fffffffffffp-126))) +(assert_return (invoke "f") (f32.const -0x0.000002p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000300000000000p-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000300000000000p-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000300000000001p-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000300000000001p-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.000003fffffffffffp-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.000003fffffffffffp-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000400000000000p-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000400000000000p-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000400000000001p-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000400000000001p-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.000004fffffffffffp-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.000004fffffffffffp-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000500000000000p-126))) +(assert_return (invoke "f") (f32.const +0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000500000000000p-126))) +(assert_return (invoke "f") (f32.const -0x0.000004p-126)) +(module (func (export "f") (result f32) (f32.const +0x0.00000500000000001p-126))) +(assert_return (invoke "f") (f32.const +0x0.000006p-126)) +(module (func (export "f") (result f32) (f32.const -0x0.00000500000000001p-126))) +(assert_return (invoke "f") (f32.const -0x0.000006p-126)) + +;; f32, round down at limit to infinity +(module (func (export "f") (result f32) (f32.const +0x1.fffffe8p127))) +(assert_return (invoke "f") (f32.const +0x1.fffffep127)) +(module (func (export "f") (result f32) (f32.const -0x1.fffffe8p127))) +(assert_return (invoke "f") (f32.const -0x1.fffffep127)) +(module (func (export "f") (result f32) (f32.const +0x1.fffffefffffff8p127))) +(assert_return (invoke "f") (f32.const +0x1.fffffep127)) +(module (func (export "f") (result f32) (f32.const -0x1.fffffefffffff8p127))) +(assert_return (invoke "f") (f32.const -0x1.fffffep127)) +(module (func (export "f") (result f32) (f32.const +0x1.fffffefffffffffffp127))) +(assert_return (invoke "f") (f32.const +0x1.fffffep127)) +(module (func (export "f") (result f32) (f32.const -0x1.fffffefffffffffffp127))) +(assert_return (invoke "f") (f32.const -0x1.fffffep127)) + +;; f64, small exponent +(module (func (export "f") (result f64) (f64.const +0x1.000000000000080000000000p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000000p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000080000000000p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000000p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000080000000001p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000080000000001p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.0000000000000fffffffffffp-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.0000000000000fffffffffffp-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000100000000000p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000100000000000p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000100000000001p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000100000000001p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.00000000000017ffffffffffp-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.00000000000017ffffffffffp-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000180000000000p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000180000000000p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000180000000001p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000180000000001p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.0000000000001fffffffffffp-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.0000000000001fffffffffffp-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000200000000000p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000200000000000p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000200000000001p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000200000000001p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.00000000000027ffffffffffp-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.00000000000027ffffffffffp-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000280000000001p-600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000003p-600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000280000000001p-600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000003p-600)) + +(module (func (export "f") (result f64) (f64.const +0x8000000.000000400000000000p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000000p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000400000000000p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000000p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000400000000001p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000400000000001p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.0000007fffffffffffp-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.0000007fffffffffffp-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000800000000000p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000800000000000p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000800000000001p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000800000000001p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000bfffffffffffp-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000bfffffffffffp-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000c00000000000p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000c00000000000p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000c00000000001p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000c00000000001p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000000ffffffffffffp-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000000ffffffffffffp-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000001000000000000p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000001000000000000p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000001000000000001p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000001000000000001p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.0000013fffffffffffp-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.0000013fffffffffffp-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p-600)) +(module (func (export "f") (result f64) (f64.const +0x8000000.000001400000000001p-627))) +(assert_return (invoke "f") (f64.const +0x1.0000000000003p-600)) +(module (func (export "f") (result f64) (f64.const -0x8000000.000001400000000001p-627))) +(assert_return (invoke "f") (f64.const -0x1.0000000000003p-600)) + +(module (func (export "f") (result f64) (f64.const +5.3575430359313371995e+300))) +(assert_return (invoke "f") (f64.const +0x1.0000000000000p+999)) +(module (func (export "f") (result f64) (f64.const -5.3575430359313371995e+300))) +(assert_return (invoke "f") (f64.const -0x1.0000000000000p+999)) +(module (func (export "f") (result f64) (f64.const +5.3575430359313371996e+300))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+999)) +(module (func (export "f") (result f64) (f64.const -5.3575430359313371996e+300))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+999)) +(module (func (export "f") (result f64) (f64.const +5.3575430359313383891e+300))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+999)) +(module (func (export "f") (result f64) (f64.const -5.3575430359313383891e+300))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+999)) +(module (func (export "f") (result f64) (f64.const +5.3575430359313383892e+300))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+999)) +(module (func (export "f") (result f64) (f64.const -5.3575430359313383892e+300))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+999)) + +;; f64, large exponent +(module (func (export "f") (result f64) (f64.const +0x1.000000000000080000000000p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000000p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000080000000000p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000000p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000080000000001p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000080000000001p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.0000000000000fffffffffffp+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.0000000000000fffffffffffp+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000100000000000p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000100000000000p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000100000000001p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000100000000001p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.00000000000017ffffffffffp+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.00000000000017ffffffffffp+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000180000000000p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000180000000000p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000180000000001p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000180000000001p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.0000000000001fffffffffffp+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.0000000000001fffffffffffp+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000200000000000p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000200000000000p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000200000000001p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000200000000001p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.00000000000027ffffffffffp+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.00000000000027ffffffffffp+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000280000000000p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000280000000000p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+600)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000280000000001p+600))) +(assert_return (invoke "f") (f64.const +0x1.0000000000003p+600)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000280000000001p+600))) +(assert_return (invoke "f") (f64.const -0x1.0000000000003p+600)) + +(module (func (export "f") (result f64) (f64.const +0x2000000000000100000000000))) +(assert_return (invoke "f") (f64.const +0x1.0000000000000p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000100000000000))) +(assert_return (invoke "f") (f64.const -0x1.0000000000000p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000100000000001))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000100000000001))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const +0x20000000000001fffffffffff))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const -0x20000000000001fffffffffff))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000200000000000))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000200000000000))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000200000000001))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000200000000001))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const +0x20000000000002fffffffffff))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const -0x20000000000002fffffffffff))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000300000000000))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000300000000000))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000300000000001))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000300000000001))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x20000000000003fffffffffff))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x20000000000003fffffffffff))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000400000000000))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000400000000000))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000400000000001))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000400000000001))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x20000000000004fffffffffff))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x20000000000004fffffffffff))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000500000000000))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000500000000000))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+97)) +(module (func (export "f") (result f64) (f64.const +0x2000000000000500000000001))) +(assert_return (invoke "f") (f64.const +0x1.0000000000003p+97)) +(module (func (export "f") (result f64) (f64.const -0x2000000000000500000000001))) +(assert_return (invoke "f") (f64.const -0x1.0000000000003p+97)) + +(module (func (export "f") (result f64) (f64.const +1152921504606847104))) +(assert_return (invoke "f") (f64.const +0x1.0000000000000p+60)) +(module (func (export "f") (result f64) (f64.const -1152921504606847104))) +(assert_return (invoke "f") (f64.const -0x1.0000000000000p+60)) +(module (func (export "f") (result f64) (f64.const +1152921504606847105))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+60)) +(module (func (export "f") (result f64) (f64.const -1152921504606847105))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+60)) +(module (func (export "f") (result f64) (f64.const +1152921504606847359))) +(assert_return (invoke "f") (f64.const +0x1.0000000000001p+60)) +(module (func (export "f") (result f64) (f64.const -1152921504606847359))) +(assert_return (invoke "f") (f64.const -0x1.0000000000001p+60)) +(module (func (export "f") (result f64) (f64.const +1152921504606847360))) +(assert_return (invoke "f") (f64.const +0x1.0000000000002p+60)) +(module (func (export "f") (result f64) (f64.const -1152921504606847360))) +(assert_return (invoke "f") (f64.const -0x1.0000000000002p+60)) + +;; f64, subnormal +(module (func (export "f") (result f64) (f64.const +0x0.000000000000080000000000p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000000p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000080000000000p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000000p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000080000000001p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000080000000001p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.0000000000000fffffffffffp-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.0000000000000fffffffffffp-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000100000000000p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000100000000000p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000100000000001p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000100000000001p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.00000000000017ffffffffffp-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.00000000000017ffffffffffp-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000001p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000180000000000p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000180000000000p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000180000000001p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000180000000001p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.0000000000001fffffffffffp-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.0000000000001fffffffffffp-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000200000000000p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000200000000000p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000200000000001p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000200000000001p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.00000000000027ffffffffffp-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.00000000000027ffffffffffp-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x0.000000000000280000000000p-1022))) +(assert_return (invoke "f") (f64.const +0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const -0x0.000000000000280000000000p-1022))) +(assert_return (invoke "f") (f64.const -0x0.0000000000002p-1022)) +(module (func (export "f") (result f64) (f64.const +0x1.000000000000280000000001p-1022))) +(assert_return (invoke "f") (f64.const +0x1.0000000000003p-1022)) +(module (func (export "f") (result f64) (f64.const -0x1.000000000000280000000001p-1022))) +(assert_return (invoke "f") (f64.const -0x1.0000000000003p-1022)) + +;; f64, round down at limit to infinity +(module (func (export "f") (result f64) (f64.const +0x1.fffffffffffff4p1023))) +(assert_return (invoke "f") (f64.const +0x1.fffffffffffffp1023)) +(module (func (export "f") (result f64) (f64.const -0x1.fffffffffffff4p1023))) +(assert_return (invoke "f") (f64.const -0x1.fffffffffffffp1023)) +(module (func (export "f") (result f64) (f64.const +0x1.fffffffffffff7ffffffp1023))) +(assert_return (invoke "f") (f64.const +0x1.fffffffffffffp1023)) +(module (func (export "f") (result f64) (f64.const -0x1.fffffffffffff7ffffffp1023))) +(assert_return (invoke "f") (f64.const -0x1.fffffffffffffp1023)) diff --git a/test/spec/conversions.wast b/test/spec/conversions.wast index c4d0f00e5..c0ae54a53 100644 --- a/test/spec/conversions.wast +++ b/test/spec/conversions.wast @@ -1,31 +1,23 @@ (module - (func (export "i64.extend_s_i32") (param $x i32) (result i64) (i64.extend_i32_s (local.get $x))) - (func (export "i64.extend_u_i32") (param $x i32) (result i64) (i64.extend_i32_u (local.get $x))) + (func (export "i64.extend_i32_s") (param $x i32) (result i64) (i64.extend_i32_s (local.get $x))) + (func (export "i64.extend_i32_u") (param $x i32) (result i64) (i64.extend_i32_u (local.get $x))) (func (export "i32.wrap_i64") (param $x i64) (result i32) (i32.wrap_i64 (local.get $x))) - (func (export "i32.trunc_s_f32") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x))) - (func (export "i32.trunc_u_f32") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x))) - (func (export "i32.trunc_s_f64") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x))) - (func (export "i32.trunc_u_f64") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x))) - (func (export "i64.trunc_s_f32") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x))) - (func (export "i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x))) - (func (export "i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x))) - (func (export "i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x))) - (func (export "i32.trunc_s_sat_f32") (param $x f32) (result i32) (i32.trunc_sat_f32_s (local.get $x))) - (func (export "i32.trunc_u_sat_f32") (param $x f32) (result i32) (i32.trunc_sat_f32_u (local.get $x))) - (func (export "i32.trunc_s_sat_f64") (param $x f64) (result i32) (i32.trunc_sat_f64_s (local.get $x))) - (func (export "i32.trunc_u_sat_f64") (param $x f64) (result i32) (i32.trunc_sat_f64_u (local.get $x))) - (func (export "i64.trunc_s_sat_f32") (param $x f32) (result i64) (i64.trunc_sat_f32_s (local.get $x))) - (func (export "i64.trunc_u_sat_f32") (param $x f32) (result i64) (i64.trunc_sat_f32_u (local.get $x))) - (func (export "i64.trunc_s_sat_f64") (param $x f64) (result i64) (i64.trunc_sat_f64_s (local.get $x))) - (func (export "i64.trunc_u_sat_f64") (param $x f64) (result i64) (i64.trunc_sat_f64_u (local.get $x))) - (func (export "f32.convert_s_i32") (param $x i32) (result f32) (f32.convert_i32_s (local.get $x))) - (func (export "f32.convert_s_i64") (param $x i64) (result f32) (f32.convert_i64_s (local.get $x))) - (func (export "f64.convert_s_i32") (param $x i32) (result f64) (f64.convert_i32_s (local.get $x))) - (func (export "f64.convert_s_i64") (param $x i64) (result f64) (f64.convert_i64_s (local.get $x))) - (func (export "f32.convert_u_i32") (param $x i32) (result f32) (f32.convert_i32_u (local.get $x))) - (func (export "f32.convert_u_i64") (param $x i64) (result f32) (f32.convert_i64_u (local.get $x))) - (func (export "f64.convert_u_i32") (param $x i32) (result f64) (f64.convert_i32_u (local.get $x))) - (func (export "f64.convert_u_i64") (param $x i64) (result f64) (f64.convert_i64_u (local.get $x))) + (func (export "i32.trunc_f32_s") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x))) + (func (export "i32.trunc_f32_u") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x))) + (func (export "i32.trunc_f64_s") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x))) + (func (export "i32.trunc_f64_u") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x))) + (func (export "i64.trunc_f32_s") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x))) + (func (export "i64.trunc_f32_u") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x))) + (func (export "i64.trunc_f64_s") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x))) + (func (export "i64.trunc_f64_u") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x))) + (func (export "f32.convert_i32_s") (param $x i32) (result f32) (f32.convert_i32_s (local.get $x))) + (func (export "f32.convert_i64_s") (param $x i64) (result f32) (f32.convert_i64_s (local.get $x))) + (func (export "f64.convert_i32_s") (param $x i32) (result f64) (f64.convert_i32_s (local.get $x))) + (func (export "f64.convert_i64_s") (param $x i64) (result f64) (f64.convert_i64_s (local.get $x))) + (func (export "f32.convert_i32_u") (param $x i32) (result f32) (f32.convert_i32_u (local.get $x))) + (func (export "f32.convert_i64_u") (param $x i64) (result f32) (f32.convert_i64_u (local.get $x))) + (func (export "f64.convert_i32_u") (param $x i32) (result f64) (f64.convert_i32_u (local.get $x))) + (func (export "f64.convert_i64_u") (param $x i64) (result f64) (f64.convert_i64_u (local.get $x))) (func (export "f64.promote_f32") (param $x f32) (result f64) (f64.promote_f32 (local.get $x))) (func (export "f32.demote_f64") (param $x f64) (result f32) (f32.demote_f64 (local.get $x))) (func (export "f32.reinterpret_i32") (param $x i32) (result f32) (f32.reinterpret_i32 (local.get $x))) @@ -34,19 +26,19 @@ (func (export "i64.reinterpret_f64") (param $x f64) (result i64) (i64.reinterpret_f64 (local.get $x))) ) -(assert_return (invoke "i64.extend_s_i32" (i32.const 0)) (i64.const 0)) -(assert_return (invoke "i64.extend_s_i32" (i32.const 10000)) (i64.const 10000)) -(assert_return (invoke "i64.extend_s_i32" (i32.const -10000)) (i64.const -10000)) -(assert_return (invoke "i64.extend_s_i32" (i32.const -1)) (i64.const -1)) -(assert_return (invoke "i64.extend_s_i32" (i32.const 0x7fffffff)) (i64.const 0x000000007fffffff)) -(assert_return (invoke "i64.extend_s_i32" (i32.const 0x80000000)) (i64.const 0xffffffff80000000)) +(assert_return (invoke "i64.extend_i32_s" (i32.const 0)) (i64.const 0)) +(assert_return (invoke "i64.extend_i32_s" (i32.const 10000)) (i64.const 10000)) +(assert_return (invoke "i64.extend_i32_s" (i32.const -10000)) (i64.const -10000)) +(assert_return (invoke "i64.extend_i32_s" (i32.const -1)) (i64.const -1)) +(assert_return (invoke "i64.extend_i32_s" (i32.const 0x7fffffff)) (i64.const 0x000000007fffffff)) +(assert_return (invoke "i64.extend_i32_s" (i32.const 0x80000000)) (i64.const 0xffffffff80000000)) -(assert_return (invoke "i64.extend_u_i32" (i32.const 0)) (i64.const 0)) -(assert_return (invoke "i64.extend_u_i32" (i32.const 10000)) (i64.const 10000)) -(assert_return (invoke "i64.extend_u_i32" (i32.const -10000)) (i64.const 0x00000000ffffd8f0)) -(assert_return (invoke "i64.extend_u_i32" (i32.const -1)) (i64.const 0xffffffff)) -(assert_return (invoke "i64.extend_u_i32" (i32.const 0x7fffffff)) (i64.const 0x000000007fffffff)) -(assert_return (invoke "i64.extend_u_i32" (i32.const 0x80000000)) (i64.const 0x0000000080000000)) +(assert_return (invoke "i64.extend_i32_u" (i32.const 0)) (i64.const 0)) +(assert_return (invoke "i64.extend_i32_u" (i32.const 10000)) (i64.const 10000)) +(assert_return (invoke "i64.extend_i32_u" (i32.const -10000)) (i64.const 0x00000000ffffd8f0)) +(assert_return (invoke "i64.extend_i32_u" (i32.const -1)) (i64.const 0xffffffff)) +(assert_return (invoke "i64.extend_i32_u" (i32.const 0x7fffffff)) (i64.const 0x000000007fffffff)) +(assert_return (invoke "i64.extend_i32_u" (i32.const 0x80000000)) (i64.const 0x0000000080000000)) (assert_return (invoke "i32.wrap_i64" (i64.const -1)) (i32.const -1)) (assert_return (invoke "i32.wrap_i64" (i64.const -100000)) (i32.const -100000)) @@ -61,410 +53,292 @@ (assert_return (invoke "i32.wrap_i64" (i64.const 0x0000000100000000)) (i32.const 0x00000000)) (assert_return (invoke "i32.wrap_i64" (i64.const 0x0000000100000001)) (i32.const 0x00000001)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const 0x1.19999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -1.0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -0x1.19999ap+0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -1.5)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -1.9)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -2.0)) (i32.const -2)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const 2147483520.0)) (i32.const 2147483520)) -(assert_return (invoke "i32.trunc_s_f32" (f32.const -2147483648.0)) (i32.const -2147483648)) -(assert_trap (invoke "i32.trunc_s_f32" (f32.const 2147483648.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f32" (f32.const -2147483904.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f32" (f32.const infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f32" (f32.const -infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f32" (f32.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i32.trunc_u_f32" (f32.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 0x1.19999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 1.9)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 2.0)) (i32.const 2)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 -(assert_return (invoke "i32.trunc_u_f32" (f32.const 4294967040.0)) (i32.const -256)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const -0x1.ccccccp-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f32" (f32.const -0x1.fffffep-1)) (i32.const 0)) -(assert_trap (invoke "i32.trunc_u_f32" (f32.const 4294967296.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f32" (f32.const -1.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f32" (f32.const infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f32" (f32.const -infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f32" (f32.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i32.trunc_s_f64" (f64.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -1.0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -0x1.199999999999ap+0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -1.5)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -1.9)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -2.0)) (i32.const -2)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const 2147483647.0)) (i32.const 2147483647)) -(assert_return (invoke "i32.trunc_s_f64" (f64.const -2147483648.0)) (i32.const -2147483648)) -(assert_trap (invoke "i32.trunc_s_f64" (f64.const 2147483648.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f64" (f64.const -2147483649.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f64" (f64.const infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f64" (f64.const -infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_s_f64" (f64.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i32.trunc_u_f64" (f64.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 1.9)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 2.0)) (i32.const 2)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 -(assert_return (invoke "i32.trunc_u_f64" (f64.const 4294967295.0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_f64" (f64.const 1e8)) (i32.const 100000000)) -(assert_trap (invoke "i32.trunc_u_f64" (f64.const 4294967296.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const -1.0)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const 1e16)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const 1e30)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const 9223372036854775808)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const -infinity)) "integer overflow") -(assert_trap (invoke "i32.trunc_u_f64" (f64.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i64.trunc_s_f32" (f32.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const 0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const 0x1.19999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -1.0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -0x1.19999ap+0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -1.5)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -1.9)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -2.0)) (i64.const -2)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 -(assert_return (invoke "i64.trunc_s_f32" (f32.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 -(assert_return (invoke "i64.trunc_s_f32" (f32.const 9223371487098961920.0)) (i64.const 9223371487098961920)) -(assert_return (invoke "i64.trunc_s_f32" (f32.const -9223372036854775808.0)) (i64.const -9223372036854775808)) -(assert_trap (invoke "i64.trunc_s_f32" (f32.const 9223372036854775808.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f32" (f32.const -9223373136366403584.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f32" (f32.const infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f32" (f32.const -infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f32" (f32.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i64.trunc_u_f32" (f32.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const 0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const -0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const 0x1.19999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const 4294967296)) (i64.const 4294967296)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const 18446742974197923840.0)) (i64.const -1099511627776)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const -0x1.ccccccp-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f32" (f32.const -0x1.fffffep-1)) (i64.const 0)) -(assert_trap (invoke "i64.trunc_u_f32" (f32.const 18446744073709551616.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f32" (f32.const -1.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f32" (f32.const infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f32" (f32.const -infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f32" (f32.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i64.trunc_s_f64" (f64.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -1.0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -0x1.199999999999ap+0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -1.5)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -1.9)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -2.0)) (i64.const -2)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 -(assert_return (invoke "i64.trunc_s_f64" (f64.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 -(assert_return (invoke "i64.trunc_s_f64" (f64.const 9223372036854774784.0)) (i64.const 9223372036854774784)) -(assert_return (invoke "i64.trunc_s_f64" (f64.const -9223372036854775808.0)) (i64.const -9223372036854775808)) -(assert_trap (invoke "i64.trunc_s_f64" (f64.const 9223372036854775808.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f64" (f64.const -9223372036854777856.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f64" (f64.const infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f64" (f64.const -infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_s_f64" (f64.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i64.trunc_u_f64" (f64.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 4294967295)) (i64.const 0xffffffff)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 4294967296)) (i64.const 0x100000000)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 18446744073709549568.0)) (i64.const -2048)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const -0x1.ccccccccccccdp-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const -0x1.fffffffffffffp-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 1e8)) (i64.const 100000000)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 1e16)) (i64.const 10000000000000000)) -(assert_return (invoke "i64.trunc_u_f64" (f64.const 9223372036854775808)) (i64.const -9223372036854775808)) -(assert_trap (invoke "i64.trunc_u_f64" (f64.const 18446744073709551616.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f64" (f64.const -1.0)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f64" (f64.const infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f64" (f64.const -infinity)) "integer overflow") -(assert_trap (invoke "i64.trunc_u_f64" (f64.const nan)) "invalid conversion to integer") - -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 0x1.19999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -1.0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -0x1.19999ap+0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -1.5)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -1.9)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -2.0)) (i32.const -2)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 2147483520.0)) (i32.const 2147483520)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -2147483648.0)) (i32.const -2147483648)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 2147483648.0)) (i32.const 2147483647)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -2147483904.0)) (i32.const -2147483648)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const infinity)) (i32.const 2147483647)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -infinity)) (i32.const -2147483648)) -(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const nan)) (i32.const 0)) - -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 0x1.19999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 1.9)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 2.0)) (i32.const 2)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 4294967040.0)) (i32.const -256)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0x1.ccccccp-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0x1.fffffep-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 4294967296.0)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -1.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const infinity)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const nan)) (i32.const 0)) - -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -1.0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -0x1.199999999999ap+0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -1.5)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -1.9)) (i32.const -1)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -2.0)) (i32.const -2)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 2147483647.0)) (i32.const 2147483647)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -2147483648.0)) (i32.const -2147483648)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 2147483648.0)) (i32.const 2147483647)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -2147483649.0)) (i32.const -2147483648)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const infinity)) (i32.const 2147483647)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -infinity)) (i32.const -2147483648)) -(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const nan)) (i32.const 0)) - -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1.0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1.5)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1.9)) (i32.const 1)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 2.0)) (i32.const 2)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 4294967295.0)) (i32.const -1)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1e8)) (i32.const 100000000)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 4294967296.0)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -1.0)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1e16)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1e30)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 9223372036854775808)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const infinity)) (i32.const 4294967295)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const nan)) (i32.const 0)) - -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 0x1.19999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -1.0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -0x1.19999ap+0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -1.5)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -1.9)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -2.0)) (i64.const -2)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 9223371487098961920.0)) (i64.const 9223371487098961920)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -9223372036854775808.0)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 9223372036854775808.0)) (i64.const 9223372036854775807)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -9223373136366403584.0)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const infinity)) (i64.const 9223372036854775807)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -infinity)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const nan)) (i64.const 0)) - -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0x1p-149)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 0x1.19999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 4294967296)) (i64.const 4294967296)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 18446742974197923840.0)) (i64.const -1099511627776)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0x1.ccccccp-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0x1.fffffep-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 18446744073709551616.0)) (i64.const 18446744073709551615)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -1.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const infinity)) (i64.const 18446744073709551615)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -infinity)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const nan)) (i64.const 0)) - -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -1.0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -0x1.199999999999ap+0)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -1.5)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -1.9)) (i64.const -1)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -2.0)) (i64.const -2)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 9223372036854774784.0)) (i64.const 9223372036854774784)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -9223372036854775808.0)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 9223372036854775808.0)) (i64.const 9223372036854775807)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -9223372036854777856.0)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const infinity)) (i64.const 9223372036854775807)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -infinity)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const nan)) (i64.const 0)) - -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1.0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1.5)) (i64.const 1)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 4294967295)) (i64.const 0xffffffff)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 4294967296)) (i64.const 0x100000000)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 18446744073709549568.0)) (i64.const -2048)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0x1.ccccccccccccdp-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0x1.fffffffffffffp-1)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1e8)) (i64.const 100000000)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1e16)) (i64.const 10000000000000000)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 9223372036854775808)) (i64.const -9223372036854775808)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 18446744073709551616.0)) (i64.const 18446744073709551615)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -1.0)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const infinity)) (i64.const 18446744073709551615)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -infinity)) (i64.const 0)) -(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const nan)) (i64.const 0)) - -(assert_return (invoke "f32.convert_s_i32" (i32.const 1)) (f32.const 1.0)) -(assert_return (invoke "f32.convert_s_i32" (i32.const -1)) (f32.const -1.0)) -(assert_return (invoke "f32.convert_s_i32" (i32.const 0)) (f32.const 0.0)) -(assert_return (invoke "f32.convert_s_i32" (i32.const 2147483647)) (f32.const 2147483648)) -(assert_return (invoke "f32.convert_s_i32" (i32.const -2147483648)) (f32.const -2147483648)) -(assert_return (invoke "f32.convert_s_i32" (i32.const 1234567890)) (f32.const 0x1.26580cp+30)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const 0x1.19999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -1.0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -0x1.19999ap+0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -1.5)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -1.9)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -2.0)) (i32.const -2)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const 2147483520.0)) (i32.const 2147483520)) +(assert_return (invoke "i32.trunc_f32_s" (f32.const -2147483648.0)) (i32.const -2147483648)) +(assert_trap (invoke "i32.trunc_f32_s" (f32.const 2147483648.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const -2147483904.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const -inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const nan:0x200000)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f32_s" (f32.const -nan:0x200000)) "invalid conversion to integer") + +(assert_return (invoke "i32.trunc_f32_u" (f32.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 0x1.19999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 1.9)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 2.0)) (i32.const 2)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 +(assert_return (invoke "i32.trunc_f32_u" (f32.const 4294967040.0)) (i32.const -256)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1.ccccccp-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f32_u" (f32.const -0x1.fffffep-1)) (i32.const 0)) +(assert_trap (invoke "i32.trunc_f32_u" (f32.const 4294967296.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const -1.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const -inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const nan:0x200000)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f32_u" (f32.const -nan:0x200000)) "invalid conversion to integer") + +(assert_return (invoke "i32.trunc_f64_s" (f64.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -1.0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -0x1.199999999999ap+0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -1.5)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -1.9)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -2.0)) (i32.const -2)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const 2147483647.0)) (i32.const 2147483647)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const -2147483648.0)) (i32.const -2147483648)) +(assert_trap (invoke "i32.trunc_f64_s" (f64.const 2147483648.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const -2147483649.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const -inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const nan:0x4000000000000)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f64_s" (f64.const -nan:0x4000000000000)) "invalid conversion to integer") + +(assert_return (invoke "i32.trunc_f64_u" (f64.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 1.9)) (i32.const 1)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 2.0)) (i32.const 2)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 +(assert_return (invoke "i32.trunc_f64_u" (f64.const 4294967295.0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_f64_u" (f64.const 1e8)) (i32.const 100000000)) +(assert_trap (invoke "i32.trunc_f64_u" (f64.const 4294967296.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const -1.0)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e16)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e30)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const 9223372036854775808)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const -inf)) "integer overflow") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const nan:0x4000000000000)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i32.trunc_f64_u" (f64.const -nan:0x4000000000000)) "invalid conversion to integer") + +(assert_return (invoke "i64.trunc_f32_s" (f32.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const 0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const 0x1.19999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -1.0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -0x1.19999ap+0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -1.5)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -1.9)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -2.0)) (i64.const -2)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 +(assert_return (invoke "i64.trunc_f32_s" (f32.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 +(assert_return (invoke "i64.trunc_f32_s" (f32.const 9223371487098961920.0)) (i64.const 9223371487098961920)) +(assert_return (invoke "i64.trunc_f32_s" (f32.const -9223372036854775808.0)) (i64.const -9223372036854775808)) +(assert_trap (invoke "i64.trunc_f32_s" (f32.const 9223372036854775808.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const -9223373136366403584.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const -inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const nan:0x200000)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f32_s" (f32.const -nan:0x200000)) "invalid conversion to integer") + +(assert_return (invoke "i64.trunc_f32_u" (f32.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const 0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const 0x1.19999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const 4294967296)) (i64.const 4294967296)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const 18446742974197923840.0)) (i64.const -1099511627776)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1.ccccccp-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f32_u" (f32.const -0x1.fffffep-1)) (i64.const 0)) +(assert_trap (invoke "i64.trunc_f32_u" (f32.const 18446744073709551616.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const -1.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const -inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const nan:0x200000)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f32_u" (f32.const -nan:0x200000)) "invalid conversion to integer") + +(assert_return (invoke "i64.trunc_f64_s" (f64.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -1.0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -0x1.199999999999ap+0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -1.5)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -1.9)) (i64.const -1)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -2.0)) (i64.const -2)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 +(assert_return (invoke "i64.trunc_f64_s" (f64.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 +(assert_return (invoke "i64.trunc_f64_s" (f64.const 9223372036854774784.0)) (i64.const 9223372036854774784)) +(assert_return (invoke "i64.trunc_f64_s" (f64.const -9223372036854775808.0)) (i64.const -9223372036854775808)) +(assert_trap (invoke "i64.trunc_f64_s" (f64.const 9223372036854775808.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const -9223372036854777856.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const -inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const nan:0x4000000000000)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f64_s" (f64.const -nan:0x4000000000000)) "invalid conversion to integer") + +(assert_return (invoke "i64.trunc_f64_u" (f64.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 4294967295)) (i64.const 0xffffffff)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 4294967296)) (i64.const 0x100000000)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 18446744073709549568.0)) (i64.const -2048)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 1e8)) (i64.const 100000000)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 1e16)) (i64.const 10000000000000000)) +(assert_return (invoke "i64.trunc_f64_u" (f64.const 9223372036854775808)) (i64.const -9223372036854775808)) +(assert_trap (invoke "i64.trunc_f64_u" (f64.const 18446744073709551616.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const -1.0)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const -inf)) "integer overflow") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const nan:0x4000000000000)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const -nan)) "invalid conversion to integer") +(assert_trap (invoke "i64.trunc_f64_u" (f64.const -nan:0x4000000000000)) "invalid conversion to integer") + +(assert_return (invoke "f32.convert_i32_s" (i32.const 1)) (f32.const 1.0)) +(assert_return (invoke "f32.convert_i32_s" (i32.const -1)) (f32.const -1.0)) +(assert_return (invoke "f32.convert_i32_s" (i32.const 0)) (f32.const 0.0)) +(assert_return (invoke "f32.convert_i32_s" (i32.const 2147483647)) (f32.const 2147483648)) +(assert_return (invoke "f32.convert_i32_s" (i32.const -2147483648)) (f32.const -2147483648)) +(assert_return (invoke "f32.convert_i32_s" (i32.const 1234567890)) (f32.const 0x1.26580cp+30)) ;; Test rounding directions. -(assert_return (invoke "f32.convert_s_i32" (i32.const 16777217)) (f32.const 16777216.0)) -(assert_return (invoke "f32.convert_s_i32" (i32.const -16777217)) (f32.const -16777216.0)) -(assert_return (invoke "f32.convert_s_i32" (i32.const 16777219)) (f32.const 16777220.0)) -(assert_return (invoke "f32.convert_s_i32" (i32.const -16777219)) (f32.const -16777220.0)) - -(assert_return (invoke "f32.convert_s_i64" (i64.const 1)) (f32.const 1.0)) -(assert_return (invoke "f32.convert_s_i64" (i64.const -1)) (f32.const -1.0)) -(assert_return (invoke "f32.convert_s_i64" (i64.const 0)) (f32.const 0.0)) -(assert_return (invoke "f32.convert_s_i64" (i64.const 9223372036854775807)) (f32.const 9223372036854775807)) -(assert_return (invoke "f32.convert_s_i64" (i64.const -9223372036854775808)) (f32.const -9223372036854775808)) -(assert_return (invoke "f32.convert_s_i64" (i64.const 314159265358979)) (f32.const 0x1.1db9e8p+48)) ;; PI +(assert_return (invoke "f32.convert_i32_s" (i32.const 16777217)) (f32.const 16777216.0)) +(assert_return (invoke "f32.convert_i32_s" (i32.const -16777217)) (f32.const -16777216.0)) +(assert_return (invoke "f32.convert_i32_s" (i32.const 16777219)) (f32.const 16777220.0)) +(assert_return (invoke "f32.convert_i32_s" (i32.const -16777219)) (f32.const -16777220.0)) + +(assert_return (invoke "f32.convert_i64_s" (i64.const 1)) (f32.const 1.0)) +(assert_return (invoke "f32.convert_i64_s" (i64.const -1)) (f32.const -1.0)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 0)) (f32.const 0.0)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 9223372036854775807)) (f32.const 9223372036854775807)) +(assert_return (invoke "f32.convert_i64_s" (i64.const -9223372036854775808)) (f32.const -9223372036854775808)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 314159265358979)) (f32.const 0x1.1db9e8p+48)) ;; PI ;; Test rounding directions. -(assert_return (invoke "f32.convert_s_i64" (i64.const 16777217)) (f32.const 16777216.0)) -(assert_return (invoke "f32.convert_s_i64" (i64.const -16777217)) (f32.const -16777216.0)) -(assert_return (invoke "f32.convert_s_i64" (i64.const 16777219)) (f32.const 16777220.0)) -(assert_return (invoke "f32.convert_s_i64" (i64.const -16777219)) (f32.const -16777220.0)) - -(assert_return (invoke "f64.convert_s_i32" (i32.const 1)) (f64.const 1.0)) -(assert_return (invoke "f64.convert_s_i32" (i32.const -1)) (f64.const -1.0)) -(assert_return (invoke "f64.convert_s_i32" (i32.const 0)) (f64.const 0.0)) -(assert_return (invoke "f64.convert_s_i32" (i32.const 2147483647)) (f64.const 2147483647)) -(assert_return (invoke "f64.convert_s_i32" (i32.const -2147483648)) (f64.const -2147483648)) -(assert_return (invoke "f64.convert_s_i32" (i32.const 987654321)) (f64.const 987654321)) - -(assert_return (invoke "f64.convert_s_i64" (i64.const 1)) (f64.const 1.0)) -(assert_return (invoke "f64.convert_s_i64" (i64.const -1)) (f64.const -1.0)) -(assert_return (invoke "f64.convert_s_i64" (i64.const 0)) (f64.const 0.0)) -(assert_return (invoke "f64.convert_s_i64" (i64.const 9223372036854775807)) (f64.const 9223372036854775807)) -(assert_return (invoke "f64.convert_s_i64" (i64.const -9223372036854775808)) (f64.const -9223372036854775808)) -(assert_return (invoke "f64.convert_s_i64" (i64.const 4669201609102990)) (f64.const 4669201609102990)) ;; Feigenbaum +(assert_return (invoke "f32.convert_i64_s" (i64.const 16777217)) (f32.const 16777216.0)) +(assert_return (invoke "f32.convert_i64_s" (i64.const -16777217)) (f32.const -16777216.0)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 16777219)) (f32.const 16777220.0)) +(assert_return (invoke "f32.convert_i64_s" (i64.const -16777219)) (f32.const -16777220.0)) + +(assert_return (invoke "f32.convert_i64_s" (i64.const 0x7fffff4000000001)) (f32.const 0x1.fffffep+62)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 0x8000004000000001)) (f32.const -0x1.fffffep+62)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 0x0020000020000001)) (f32.const 0x1.000002p+53)) +(assert_return (invoke "f32.convert_i64_s" (i64.const 0xffdfffffdfffffff)) (f32.const -0x1.000002p+53)) + +(assert_return (invoke "f64.convert_i32_s" (i32.const 1)) (f64.const 1.0)) +(assert_return (invoke "f64.convert_i32_s" (i32.const -1)) (f64.const -1.0)) +(assert_return (invoke "f64.convert_i32_s" (i32.const 0)) (f64.const 0.0)) +(assert_return (invoke "f64.convert_i32_s" (i32.const 2147483647)) (f64.const 2147483647)) +(assert_return (invoke "f64.convert_i32_s" (i32.const -2147483648)) (f64.const -2147483648)) +(assert_return (invoke "f64.convert_i32_s" (i32.const 987654321)) (f64.const 987654321)) + +(assert_return (invoke "f64.convert_i64_s" (i64.const 1)) (f64.const 1.0)) +(assert_return (invoke "f64.convert_i64_s" (i64.const -1)) (f64.const -1.0)) +(assert_return (invoke "f64.convert_i64_s" (i64.const 0)) (f64.const 0.0)) +(assert_return (invoke "f64.convert_i64_s" (i64.const 9223372036854775807)) (f64.const 9223372036854775807)) +(assert_return (invoke "f64.convert_i64_s" (i64.const -9223372036854775808)) (f64.const -9223372036854775808)) +(assert_return (invoke "f64.convert_i64_s" (i64.const 4669201609102990)) (f64.const 4669201609102990)) ;; Feigenbaum ;; Test rounding directions. -(assert_return (invoke "f64.convert_s_i64" (i64.const 9007199254740993)) (f64.const 9007199254740992)) -(assert_return (invoke "f64.convert_s_i64" (i64.const -9007199254740993)) (f64.const -9007199254740992)) -(assert_return (invoke "f64.convert_s_i64" (i64.const 9007199254740995)) (f64.const 9007199254740996)) -(assert_return (invoke "f64.convert_s_i64" (i64.const -9007199254740995)) (f64.const -9007199254740996)) - -(assert_return (invoke "f32.convert_u_i32" (i32.const 1)) (f32.const 1.0)) -(assert_return (invoke "f32.convert_u_i32" (i32.const 0)) (f32.const 0.0)) -(assert_return (invoke "f32.convert_u_i32" (i32.const 2147483647)) (f32.const 2147483648)) -(assert_return (invoke "f32.convert_u_i32" (i32.const -2147483648)) (f32.const 2147483648)) -(assert_return (invoke "f32.convert_u_i32" (i32.const 0x12345678)) (f32.const 0x1.234568p+28)) -(assert_return (invoke "f32.convert_u_i32" (i32.const 0xffffffff)) (f32.const 4294967296.0)) +(assert_return (invoke "f64.convert_i64_s" (i64.const 9007199254740993)) (f64.const 9007199254740992)) +(assert_return (invoke "f64.convert_i64_s" (i64.const -9007199254740993)) (f64.const -9007199254740992)) +(assert_return (invoke "f64.convert_i64_s" (i64.const 9007199254740995)) (f64.const 9007199254740996)) +(assert_return (invoke "f64.convert_i64_s" (i64.const -9007199254740995)) (f64.const -9007199254740996)) + +(assert_return (invoke "f32.convert_i32_u" (i32.const 1)) (f32.const 1.0)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0)) (f32.const 0.0)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 2147483647)) (f32.const 2147483648)) +(assert_return (invoke "f32.convert_i32_u" (i32.const -2147483648)) (f32.const 2147483648)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0x12345678)) (f32.const 0x1.234568p+28)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0xffffffff)) (f32.const 4294967296.0)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000080)) (f32.const 0x1.000000p+31)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000081)) (f32.const 0x1.000002p+31)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0x80000082)) (f32.const 0x1.000002p+31)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe80)) (f32.const 0x1.fffffcp+31)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe81)) (f32.const 0x1.fffffep+31)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 0xfffffe82)) (f32.const 0x1.fffffep+31)) ;; Test rounding directions. -(assert_return (invoke "f32.convert_u_i32" (i32.const 16777217)) (f32.const 16777216.0)) -(assert_return (invoke "f32.convert_u_i32" (i32.const 16777219)) (f32.const 16777220.0)) - -(assert_return (invoke "f32.convert_u_i64" (i64.const 1)) (f32.const 1.0)) -(assert_return (invoke "f32.convert_u_i64" (i64.const 0)) (f32.const 0.0)) -(assert_return (invoke "f32.convert_u_i64" (i64.const 9223372036854775807)) (f32.const 9223372036854775807)) -(assert_return (invoke "f32.convert_u_i64" (i64.const -9223372036854775808)) (f32.const 9223372036854775808)) -(assert_return (invoke "f32.convert_u_i64" (i64.const 0xffffffffffffffff)) (f32.const 18446744073709551616.0)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 16777217)) (f32.const 16777216.0)) +(assert_return (invoke "f32.convert_i32_u" (i32.const 16777219)) (f32.const 16777220.0)) + +(assert_return (invoke "f32.convert_i64_u" (i64.const 1)) (f32.const 1.0)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 0)) (f32.const 0.0)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 9223372036854775807)) (f32.const 9223372036854775807)) +(assert_return (invoke "f32.convert_i64_u" (i64.const -9223372036854775808)) (f32.const 9223372036854775808)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 0xffffffffffffffff)) (f32.const 18446744073709551616.0)) ;; Test rounding directions. -(assert_return (invoke "f32.convert_u_i64" (i64.const 16777217)) (f32.const 16777216.0)) -(assert_return (invoke "f32.convert_u_i64" (i64.const 16777219)) (f32.const 16777220.0)) - -(assert_return (invoke "f64.convert_u_i32" (i32.const 1)) (f64.const 1.0)) -(assert_return (invoke "f64.convert_u_i32" (i32.const 0)) (f64.const 0.0)) -(assert_return (invoke "f64.convert_u_i32" (i32.const 2147483647)) (f64.const 2147483647)) -(assert_return (invoke "f64.convert_u_i32" (i32.const -2147483648)) (f64.const 2147483648)) -(assert_return (invoke "f64.convert_u_i32" (i32.const 0xffffffff)) (f64.const 4294967295.0)) - -(assert_return (invoke "f64.convert_u_i64" (i64.const 1)) (f64.const 1.0)) -(assert_return (invoke "f64.convert_u_i64" (i64.const 0)) (f64.const 0.0)) -(assert_return (invoke "f64.convert_u_i64" (i64.const 9223372036854775807)) (f64.const 9223372036854775807)) -(assert_return (invoke "f64.convert_u_i64" (i64.const -9223372036854775808)) (f64.const 9223372036854775808)) -(assert_return (invoke "f64.convert_u_i64" (i64.const 0xffffffffffffffff)) (f64.const 18446744073709551616.0)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 16777217)) (f32.const 16777216.0)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 16777219)) (f32.const 16777220.0)) + +(assert_return (invoke "f32.convert_i64_u" (i64.const 0x0020000020000001)) (f32.const 0x1.000002p+53)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 0x7fffffbfffffffff)) (f32.const 0x1.fffffep+62)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 0x8000008000000001)) (f32.const 0x1.000002p+63)) +(assert_return (invoke "f32.convert_i64_u" (i64.const 0xfffffe8000000001)) (f32.const 0x1.fffffep+63)) + +(assert_return (invoke "f64.convert_i32_u" (i32.const 1)) (f64.const 1.0)) +(assert_return (invoke "f64.convert_i32_u" (i32.const 0)) (f64.const 0.0)) +(assert_return (invoke "f64.convert_i32_u" (i32.const 2147483647)) (f64.const 2147483647)) +(assert_return (invoke "f64.convert_i32_u" (i32.const -2147483648)) (f64.const 2147483648)) +(assert_return (invoke "f64.convert_i32_u" (i32.const 0xffffffff)) (f64.const 4294967295.0)) + +(assert_return (invoke "f64.convert_i64_u" (i64.const 1)) (f64.const 1.0)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0)) (f64.const 0.0)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 9223372036854775807)) (f64.const 9223372036854775807)) +(assert_return (invoke "f64.convert_i64_u" (i64.const -9223372036854775808)) (f64.const 9223372036854775808)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0xffffffffffffffff)) (f64.const 18446744073709551616.0)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000400)) (f64.const 0x1.0000000000000p+63)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000401)) (f64.const 0x1.0000000000001p+63)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0x8000000000000402)) (f64.const 0x1.0000000000001p+63)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff400)) (f64.const 0x1.ffffffffffffep+63)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff401)) (f64.const 0x1.fffffffffffffp+63)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 0xfffffffffffff402)) (f64.const 0x1.fffffffffffffp+63)) ;; Test rounding directions. -(assert_return (invoke "f64.convert_u_i64" (i64.const 9007199254740993)) (f64.const 9007199254740992)) -(assert_return (invoke "f64.convert_u_i64" (i64.const 9007199254740995)) (f64.const 9007199254740996)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 9007199254740993)) (f64.const 9007199254740992)) +(assert_return (invoke "f64.convert_i64_u" (i64.const 9007199254740995)) (f64.const 9007199254740996)) (assert_return (invoke "f64.promote_f32" (f32.const 0.0)) (f64.const 0.0)) (assert_return (invoke "f64.promote_f32" (f32.const -0.0)) (f64.const -0.0)) @@ -478,9 +352,12 @@ (assert_return (invoke "f64.promote_f32" (f32.const 0x1p-119)) (f64.const 0x1p-119)) ;; Generated randomly by picking a random float. (assert_return (invoke "f64.promote_f32" (f32.const 0x1.8f867ep+125)) (f64.const 6.6382536710104395e+37)) -(assert_return (invoke "f64.promote_f32" (f32.const infinity)) (f64.const infinity)) -(assert_return (invoke "f64.promote_f32" (f32.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "f64.promote_f32" (f32.const nan)) (f64.const nan)) +(assert_return (invoke "f64.promote_f32" (f32.const inf)) (f64.const inf)) +(assert_return (invoke "f64.promote_f32" (f32.const -inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "f64.promote_f32" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "f64.promote_f32" (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "f64.promote_f32" (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "f64.promote_f32" (f32.const -nan:0x200000))) (assert_return (invoke "f32.demote_f64" (f64.const 0.0)) (f32.const 0.0)) (assert_return (invoke "f32.demote_f64" (f64.const -0.0)) (f32.const -0.0)) @@ -502,12 +379,12 @@ (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffefffffffp+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "f32.demote_f64" (f64.const -0x1.fffffefffffffp+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "f32.demote_f64" (f64.const 0x1.ffffffp+127)) (f32.const infinity)) -(assert_return (invoke "f32.demote_f64" (f64.const -0x1.ffffffp+127)) (f32.const -infinity)) +(assert_return (invoke "f32.demote_f64" (f64.const 0x1.ffffffp+127)) (f32.const inf)) +(assert_return (invoke "f32.demote_f64" (f64.const -0x1.ffffffp+127)) (f32.const -inf)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1p-119)) (f32.const 0x1p-119)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1.8f867ep+125)) (f32.const 0x1.8f867ep+125)) -(assert_return (invoke "f32.demote_f64" (f64.const infinity)) (f32.const infinity)) -(assert_return (invoke "f32.demote_f64" (f64.const -infinity)) (f32.const -infinity)) +(assert_return (invoke "f32.demote_f64" (f64.const inf)) (f32.const inf)) +(assert_return (invoke "f32.demote_f64" (f64.const -inf)) (f32.const -inf)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000000000001p+0)) (f32.const 1.0)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1.fffffffffffffp-1)) (f32.const 1.0)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0000010000000p+0)) (f32.const 0x1.000000p+0)) @@ -524,7 +401,10 @@ (assert_return (invoke "f32.demote_f64" (f64.const 0x1.cb98354d521ffp-127)) (f32.const 0x1.cb9834p-127)) (assert_return (invoke "f32.demote_f64" (f64.const -0x1.6972b30cfb562p+1)) (f32.const -0x1.6972b4p+1)) (assert_return (invoke "f32.demote_f64" (f64.const -0x1.bedbe4819d4c4p+112)) (f32.const -0x1.bedbe4p+112)) -(assert_return (invoke "f32.demote_f64" (f64.const nan)) (f32.const nan)) +(assert_return_canonical_nan (invoke "f32.demote_f64" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "f32.demote_f64" (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "f32.demote_f64" (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "f32.demote_f64" (f64.const -nan:0x4000000000000))) (assert_return (invoke "f32.demote_f64" (f64.const 0x1p-1022)) (f32.const 0.0)) (assert_return (invoke "f32.demote_f64" (f64.const -0x1p-1022)) (f32.const -0.0)) (assert_return (invoke "f32.demote_f64" (f64.const 0x1.0p-150)) (f32.const 0.0)) @@ -538,8 +418,8 @@ (assert_return (invoke "f32.reinterpret_i32" (i32.const -1)) (f32.const -nan:0x7fffff)) (assert_return (invoke "f32.reinterpret_i32" (i32.const 123456789)) (f32.const 0x1.b79a2ap-113)) (assert_return (invoke "f32.reinterpret_i32" (i32.const -2147483647)) (f32.const -0x1p-149)) -(assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7f800000)) (f32.const infinity)) -(assert_return (invoke "f32.reinterpret_i32" (i32.const 0xff800000)) (f32.const -infinity)) +(assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7f800000)) (f32.const inf)) +(assert_return (invoke "f32.reinterpret_i32" (i32.const 0xff800000)) (f32.const -inf)) (assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7fc00000)) (f32.const nan)) (assert_return (invoke "f32.reinterpret_i32" (i32.const 0xffc00000)) (f32.const -nan)) (assert_return (invoke "f32.reinterpret_i32" (i32.const 0x7fa00000)) (f32.const nan:0x200000)) @@ -551,8 +431,8 @@ (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x8000000000000000)) (f64.const -0.0)) (assert_return (invoke "f64.reinterpret_i64" (i64.const 1234567890)) (f64.const 0x0.00000499602d2p-1022)) (assert_return (invoke "f64.reinterpret_i64" (i64.const -9223372036854775807)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff0000000000000)) (f64.const infinity)) -(assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff0000000000000)) (f64.const -infinity)) +(assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff0000000000000)) (f64.const inf)) +(assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff0000000000000)) (f64.const -inf)) (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff8000000000000)) (f64.const nan)) (assert_return (invoke "f64.reinterpret_i64" (i64.const 0xfff8000000000000)) (f64.const -nan)) (assert_return (invoke "f64.reinterpret_i64" (i64.const 0x7ff4000000000000)) (f64.const nan:0x4000000000000)) @@ -567,8 +447,8 @@ (assert_return (invoke "i32.reinterpret_f32" (f32.const 3.1415926)) (i32.const 1078530010)) (assert_return (invoke "i32.reinterpret_f32" (f32.const 0x1.fffffep+127)) (i32.const 2139095039)) (assert_return (invoke "i32.reinterpret_f32" (f32.const -0x1.fffffep+127)) (i32.const -8388609)) -(assert_return (invoke "i32.reinterpret_f32" (f32.const infinity)) (i32.const 0x7f800000)) -(assert_return (invoke "i32.reinterpret_f32" (f32.const -infinity)) (i32.const 0xff800000)) +(assert_return (invoke "i32.reinterpret_f32" (f32.const inf)) (i32.const 0x7f800000)) +(assert_return (invoke "i32.reinterpret_f32" (f32.const -inf)) (i32.const 0xff800000)) (assert_return (invoke "i32.reinterpret_f32" (f32.const nan)) (i32.const 0x7fc00000)) (assert_return (invoke "i32.reinterpret_f32" (f32.const -nan)) (i32.const 0xffc00000)) (assert_return (invoke "i32.reinterpret_f32" (f32.const nan:0x200000)) (i32.const 0x7fa00000)) @@ -583,9 +463,37 @@ (assert_return (invoke "i64.reinterpret_f64" (f64.const 3.14159265358979)) (i64.const 4614256656552045841)) (assert_return (invoke "i64.reinterpret_f64" (f64.const 0x1.fffffffffffffp+1023)) (i64.const 9218868437227405311)) (assert_return (invoke "i64.reinterpret_f64" (f64.const -0x1.fffffffffffffp+1023)) (i64.const -4503599627370497)) -(assert_return (invoke "i64.reinterpret_f64" (f64.const infinity)) (i64.const 0x7ff0000000000000)) -(assert_return (invoke "i64.reinterpret_f64" (f64.const -infinity)) (i64.const 0xfff0000000000000)) +(assert_return (invoke "i64.reinterpret_f64" (f64.const inf)) (i64.const 0x7ff0000000000000)) +(assert_return (invoke "i64.reinterpret_f64" (f64.const -inf)) (i64.const 0xfff0000000000000)) (assert_return (invoke "i64.reinterpret_f64" (f64.const nan)) (i64.const 0x7ff8000000000000)) (assert_return (invoke "i64.reinterpret_f64" (f64.const -nan)) (i64.const 0xfff8000000000000)) (assert_return (invoke "i64.reinterpret_f64" (f64.const nan:0x4000000000000)) (i64.const 0x7ff4000000000000)) (assert_return (invoke "i64.reinterpret_f64" (f64.const -nan:0x4000000000000)) (i64.const 0xfff4000000000000)) + +;; Type check + +(assert_invalid (module (func (result i32) (i32.wrap_i64 (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.trunc_f32_s (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.trunc_f32_u (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.trunc_f64_s (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.trunc_f64_u (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.reinterpret_f32 (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.extend_i32_s (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.extend_i32_u (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.trunc_f32_s (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.trunc_f32_u (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.trunc_f64_s (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.trunc_f64_u (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.reinterpret_f64 (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.convert_i32_s (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.convert_i32_u (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.convert_i64_s (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.convert_i64_u (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.demote_f64 (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.reinterpret_i32 (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.convert_i32_s (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.convert_i32_u (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.convert_i64_s (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.convert_i64_u (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.promote_f32 (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.reinterpret_i64 (i32.const 0)))) "type mismatch") diff --git a/test/spec/custom.wast b/test/spec/custom.wast new file mode 100644 index 000000000..fb04f2f6b --- /dev/null +++ b/test/spec/custom.wast @@ -0,0 +1,120 @@ +(module binary + "\00asm" "\01\00\00\00" + "\00\24\10" "a custom section" "this is the payload" + "\00\20\10" "a custom section" "this is payload" + "\00\11\10" "a custom section" "" + "\00\10\00" "" "this is payload" + "\00\01\00" "" "" + "\00\24\10" "\00\00custom sectio\00" "this is the payload" + "\00\24\10" "\ef\bb\bfa custom sect" "this is the payload" + "\00\24\10" "a custom sect\e2\8c\a3" "this is the payload" + "\00\1f\16" "module within a module" "\00asm" "\01\00\00\00" +) + +(module binary + "\00asm" "\01\00\00\00" + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\01\01\00" ;; type section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\02\01\00" ;; import section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\03\01\00" ;; function section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\04\01\00" ;; table section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\05\01\00" ;; memory section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\06\01\00" ;; global section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\07\01\00" ;; export section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\09\01\00" ;; element section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\0a\01\00" ;; code section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" + "\0b\01\00" ;; data section + "\00\0e\06" "custom" "payload" + "\00\0e\06" "custom" "payload" +) + +(module binary + "\00asm" "\01\00\00\00" + "\01\07\01\60\02\7f\7f\01\7f" ;; type section + "\00\1a\06" "custom" "this is the payload" ;; custom section + "\03\02\01\00" ;; function section + "\07\0a\01\06\61\64\64\54\77\6f\00\00" ;; export section + "\0a\09\01\07\00\20\00\20\01\6a\0b" ;; code section + "\00\1b\07" "custom2" "this is the payload" ;; custom section +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00" + ) + "unexpected end" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\00" + ) + "unexpected end" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\00\00\05\01\00\07\00\00" + ) + "unexpected end" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\26\10" "a custom section" "this is the payload" + ) + "unexpected end" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\25\10" "a custom section" "this is the payload" + "\00\24\10" "a custom section" "this is the payload" + ) + "invalid section id" +) + +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\01\07\01\60\02\7f\7f\01\7f" ;; type section + "\00\25\10" "a custom section" "this is the payload" ;; invalid length! + "\03\02\01\00" ;; function section + "\0a\09\01\07\00\20\00\20\01\6a\0b" ;; code section + "\00\1b\07" "custom2" "this is the payload" ;; custom section + ) + "function and code section have inconsistent lengths" +) + +;; Test concatenated modules. +(assert_malformed + (module binary + "\00asm\01\00\00\00" + "\00asm\01\00\00\00" + ) + "length out of bounds" +) diff --git a/test/spec/data.wast b/test/spec/data.wast new file mode 100644 index 000000000..7d6945417 --- /dev/null +++ b/test/spec/data.wast @@ -0,0 +1,335 @@ +;; Test the data section + +;; Syntax + +(module + (memory $m 1) + (data (i32.const 0)) + (data (i32.const 1) "a" "" "bcd") + (data (offset (i32.const 0))) + (data (offset (i32.const 0)) "" "a" "bc" "") + (data 0 (i32.const 0)) + (data 0x0 (i32.const 1) "a" "" "bcd") + (data 0x000 (offset (i32.const 0))) + (data 0 (offset (i32.const 0)) "" "a" "bc" "") + (data $m (i32.const 0)) + (data $m (i32.const 1) "a" "" "bcd") + (data $m (offset (i32.const 0))) + (data $m (offset (i32.const 0)) "" "a" "bc" "") +) + +;; Basic use + +(module + (memory 1) + (data (i32.const 0) "a") +) +(module + (import "spectest" "memory" (memory 1)) + (data (i32.const 0) "a") +) + +(module + (memory 1) + (data (i32.const 0) "a") + (data (i32.const 3) "b") + (data (i32.const 100) "cde") + (data (i32.const 5) "x") + (data (i32.const 3) "c") +) +(module + (import "spectest" "memory" (memory 1)) + (data (i32.const 0) "a") + (data (i32.const 1) "b") + (data (i32.const 2) "cde") + (data (i32.const 3) "f") + (data (i32.const 2) "g") + (data (i32.const 1) "h") +) + +(module + (global (import "spectest" "global_i32") i32) + (memory 1) + (data (global.get 0) "a") +) +(module + (global (import "spectest" "global_i32") i32) + (import "spectest" "memory" (memory 1)) + (data (global.get 0) "a") +) + +(module + (global $g (import "spectest" "global_i32") i32) + (memory 1) + (data (global.get $g) "a") +) +(module + (global $g (import "spectest" "global_i32") i32) + (import "spectest" "memory" (memory 1)) + (data (global.get $g) "a") +) + +;; Use of internal globals in constant expressions is not allowed in MVP. +;; (module (memory 1) (data (global.get 0) "a") (global i32 (i32.const 0))) +;; (module (memory 1) (data (global.get $g) "a") (global $g i32 (i32.const 0))) + +;; Corner cases + +(module + (memory 1) + (data (i32.const 0) "a") + (data (i32.const 0xffff) "b") +) +(module + (import "spectest" "memory" (memory 1)) + (data (i32.const 0) "a") + (data (i32.const 0xffff) "b") +) + +(module + (memory 2) + (data (i32.const 0x1_ffff) "a") +) + +(module + (memory 0) + (data (i32.const 0)) +) +(module + (import "spectest" "memory" (memory 0)) + (data (i32.const 0)) +) + +(module + (memory 0 0) + (data (i32.const 0)) +) + +(module + (memory 1) + (data (i32.const 0x1_0000) "") +) + +(module + (memory 0) + (data (i32.const 0) "" "") +) +(module + (import "spectest" "memory" (memory 0)) + (data (i32.const 0) "" "") +) + +(module + (memory 0 0) + (data (i32.const 0) "" "") +) + +(module + (import "spectest" "memory" (memory 0)) + (data (i32.const 0) "a") +) + +(module + (import "spectest" "memory" (memory 0 3)) + (data (i32.const 0) "a") +) + +(module + (global (import "spectest" "global_i32") i32) + (import "spectest" "memory" (memory 0)) + (data (global.get 0) "a") +) + +(module + (global (import "spectest" "global_i32") i32) + (import "spectest" "memory" (memory 0 3)) + (data (global.get 0) "a") +) + +(module + (import "spectest" "memory" (memory 0)) + (data (i32.const 1) "a") +) + +(module + (import "spectest" "memory" (memory 0 3)) + (data (i32.const 1) "a") +) + +;; Invalid bounds for data + +(assert_unlinkable + (module + (memory 0) + (data (i32.const 0) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 0 0) + (data (i32.const 0) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 0 1) + (data (i32.const 0) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 0) + (data (i32.const 1)) + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 0 1) + (data (i32.const 1)) + ) + "data segment does not fit" +) + +;; This seems to cause a time-out on Travis. +(;assert_unlinkable + (module + (memory 0x10000) + (data (i32.const 0xffffffff) "ab") + ) + "" ;; either out of memory or segment does not fit +;) + +(assert_unlinkable + (module + (global (import "spectest" "global_i32") i32) + (memory 0) + (data (global.get 0) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 1 2) + (data (i32.const 0x1_0000) "a") + ) + "data segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "memory" (memory 1)) + (data (i32.const 0x1_0000) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 2) + (data (i32.const 0x2_0000) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 2 3) + (data (i32.const 0x2_0000) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 1) + (data (i32.const -1) "a") + ) + "data segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "memory" (memory 1)) + (data (i32.const -1) "a") + ) + "data segment does not fit" +) + +(assert_unlinkable + (module + (memory 2) + (data (i32.const -100) "a") + ) + "data segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "memory" (memory 1)) + (data (i32.const -100) "a") + ) + "data segment does not fit" +) + +;; Data without memory + +(assert_invalid + (module + (data (i32.const 0) "") + ) + "unknown memory" +) + +;; Invalid offsets + +(assert_invalid + (module + (memory 1) + (data (i64.const 0)) + ) + "type mismatch" +) + +(assert_invalid + (module + (memory 1) + (data (i32.ctz (i32.const 0))) + ) + "constant expression required" +) + +(assert_invalid + (module + (memory 1) + (data (nop)) + ) + "constant expression required" +) + +(assert_invalid + (module + (memory 1) + (data (offset (nop) (i32.const 0))) + ) + "constant expression required" +) + +(assert_invalid + (module + (memory 1) + (data (offset (i32.const 0) (nop))) + ) + "constant expression required" +) + +;; Use of internal globals in constant expressions is not allowed in MVP. +;; (assert_invalid +;; (module (memory 1) (data (global.get $g)) (global $g (mut i32) (i32.const 0))) +;; "constant expression required" +;; ) diff --git a/test/spec/elem.wast b/test/spec/elem.wast new file mode 100644 index 000000000..1ea2b0618 --- /dev/null +++ b/test/spec/elem.wast @@ -0,0 +1,381 @@ +;; Test the element section + +;; Syntax +(module + (table $t 10 funcref) + (func $f) + (elem (i32.const 0)) + (elem (i32.const 0) $f $f) + (elem (offset (i32.const 0))) + (elem (offset (i32.const 0)) $f $f) + (elem 0 (i32.const 0)) + (elem 0x0 (i32.const 0) $f $f) + (elem 0x000 (offset (i32.const 0))) + (elem 0 (offset (i32.const 0)) $f $f) + (elem $t (i32.const 0)) + (elem $t (i32.const 0) $f $f) + (elem $t (offset (i32.const 0))) + (elem $t (offset (i32.const 0)) $f $f) +) + +;; Basic use + +(module + (table 10 funcref) + (func $f) + (elem (i32.const 0) $f) +) +(module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const 0) $f) +) + +(module + (table 10 funcref) + (func $f) + (elem (i32.const 0) $f) + (elem (i32.const 3) $f) + (elem (i32.const 7) $f) + (elem (i32.const 5) $f) + (elem (i32.const 3) $f) +) +(module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const 9) $f) + (elem (i32.const 3) $f) + (elem (i32.const 7) $f) + (elem (i32.const 3) $f) + (elem (i32.const 5) $f) +) + +(module + (global (import "spectest" "global_i32") i32) + (table 1000 funcref) + (func $f) + (elem (global.get 0) $f) +) + +(module + (global $g (import "spectest" "global_i32") i32) + (table 1000 funcref) + (func $f) + (elem (global.get $g) $f) +) + +(module + (type $out-i32 (func (result i32))) + (table 10 funcref) + (elem (i32.const 7) $const-i32-a) + (elem (i32.const 9) $const-i32-b) + (func $const-i32-a (type $out-i32) (i32.const 65)) + (func $const-i32-b (type $out-i32) (i32.const 66)) + (func (export "call-7") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 7)) + ) + (func (export "call-9") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 9)) + ) +) +(assert_return (invoke "call-7") (i32.const 65)) +(assert_return (invoke "call-9") (i32.const 66)) + +;; Corner cases + +(module + (table 10 funcref) + (func $f) + (elem (i32.const 9) $f) +) +(module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const 9) $f) +) + +(module + (table 0 funcref) + (elem (i32.const 0)) +) +(module + (import "spectest" "table" (table 0 funcref)) + (elem (i32.const 0)) +) + +(module + (table 0 0 funcref) + (elem (i32.const 0)) +) + +(module + (table 20 funcref) + (elem (i32.const 20)) +) + +(module + (import "spectest" "table" (table 0 funcref)) + (func $f) + (elem (i32.const 0) $f) +) + +(module + (import "spectest" "table" (table 0 100 funcref)) + (func $f) + (elem (i32.const 0) $f) +) + +(module + (import "spectest" "table" (table 0 funcref)) + (func $f) + (elem (i32.const 1) $f) +) + +(module + (import "spectest" "table" (table 0 30 funcref)) + (func $f) + (elem (i32.const 1) $f) +) + +;; Invalid bounds for elements + +(assert_unlinkable + (module + (table 0 funcref) + (func $f) + (elem (i32.const 0) $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 0 0 funcref) + (func $f) + (elem (i32.const 0) $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 0 1 funcref) + (func $f) + (elem (i32.const 0) $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 0 funcref) + (elem (i32.const 1)) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 10 funcref) + (func $f) + (elem (i32.const 10) $f) + ) + "elements segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const 10) $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 10 20 funcref) + (func $f) + (elem (i32.const 10) $f) + ) + "elements segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const 10) $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 10 funcref) + (func $f) + (elem (i32.const -1) $f) + ) + "elements segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const -1) $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table 10 funcref) + (func $f) + (elem (i32.const -10) $f) + ) + "elements segment does not fit" +) +(assert_unlinkable + (module + (import "spectest" "table" (table 10 funcref)) + (func $f) + (elem (i32.const -10) $f) + ) + "elements segment does not fit" +) + +;; Element without table + +(assert_invalid + (module + (func $f) + (elem (i32.const 0) $f) + ) + "unknown table" +) + +;; Invalid offsets + +(assert_invalid + (module + (table 1 funcref) + (elem (i64.const 0)) + ) + "type mismatch" +) + +(assert_invalid + (module + (table 1 funcref) + (elem (i32.ctz (i32.const 0))) + ) + "constant expression required" +) + +(assert_invalid + (module + (table 1 funcref) + (elem (nop)) + ) + "constant expression required" +) + +(assert_invalid + (module + (table 1 funcref) + (elem (offset (nop) (i32.const 0))) + ) + "constant expression required" +) + +(assert_invalid + (module + (table 1 funcref) + (elem (offset (i32.const 0) (nop))) + ) + "constant expression required" +) + +;; Use of internal globals in constant expressions is not allowed in MVP. +;; (assert_invalid +;; (module (memory 1) (data (global.get $g)) (global $g (mut i32) (i32.const 0))) +;; "constant expression required" +;; ) + +;; Two elements target the same slot + +(module + (type $out-i32 (func (result i32))) + (table 10 funcref) + (elem (i32.const 9) $const-i32-a) + (elem (i32.const 9) $const-i32-b) + (func $const-i32-a (type $out-i32) (i32.const 65)) + (func $const-i32-b (type $out-i32) (i32.const 66)) + (func (export "call-overwritten") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 9)) + ) +) +(assert_return (invoke "call-overwritten") (i32.const 66)) + +(module + (type $out-i32 (func (result i32))) + (import "spectest" "table" (table 10 funcref)) + (elem (i32.const 9) $const-i32-a) + (elem (i32.const 9) $const-i32-b) + (func $const-i32-a (type $out-i32) (i32.const 65)) + (func $const-i32-b (type $out-i32) (i32.const 66)) + (func (export "call-overwritten-element") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 9)) + ) +) +(assert_return (invoke "call-overwritten-element") (i32.const 66)) + +;; Element sections across multiple modules change the same table + +(module $module1 + (type $out-i32 (func (result i32))) + (table (export "shared-table") 10 funcref) + (elem (i32.const 8) $const-i32-a) + (elem (i32.const 9) $const-i32-b) + (func $const-i32-a (type $out-i32) (i32.const 65)) + (func $const-i32-b (type $out-i32) (i32.const 66)) + (func (export "call-7") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 7)) + ) + (func (export "call-8") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 8)) + ) + (func (export "call-9") (type $out-i32) + (call_indirect (type $out-i32) (i32.const 9)) + ) +) + +(register "module1" $module1) + +(assert_trap (invoke $module1 "call-7") "uninitialized element") +(assert_return (invoke $module1 "call-8") (i32.const 65)) +(assert_return (invoke $module1 "call-9") (i32.const 66)) + +(module $module2 + (type $out-i32 (func (result i32))) + (import "module1" "shared-table" (table 10 funcref)) + (elem (i32.const 7) $const-i32-c) + (elem (i32.const 8) $const-i32-d) + (func $const-i32-c (type $out-i32) (i32.const 67)) + (func $const-i32-d (type $out-i32) (i32.const 68)) +) + +(assert_return (invoke $module1 "call-7") (i32.const 67)) +(assert_return (invoke $module1 "call-8") (i32.const 68)) +(assert_return (invoke $module1 "call-9") (i32.const 66)) + +(module $module3 + (type $out-i32 (func (result i32))) + (import "module1" "shared-table" (table 10 funcref)) + (elem (i32.const 8) $const-i32-e) + (elem (i32.const 9) $const-i32-f) + (func $const-i32-e (type $out-i32) (i32.const 69)) + (func $const-i32-f (type $out-i32) (i32.const 70)) +) + +(assert_return (invoke $module1 "call-7") (i32.const 67)) +(assert_return (invoke $module1 "call-8") (i32.const 69)) +(assert_return (invoke $module1 "call-9") (i32.const 70)) diff --git a/test/spec/expected-output/address.wast.log b/test/spec/expected-output/address.wast.log deleted file mode 100644 index c2e443367..000000000 --- a/test/spec/expected-output/address.wast.log +++ /dev/null @@ -1,38 +0,0 @@ -97 : i32 -98 : i32 -99 : i32 -122 : i32 -25185 : i32 -25185 : i32 -25442 : i32 -25699 : i32 -122 : i32 -1684234849 : i32 -1701077858 : i32 -1717920867 : i32 -122 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 -0 : i32 diff --git a/test/spec/expected-output/imports.wast.log b/test/spec/expected-output/old_imports.wast.log index 59c70fea9..59c70fea9 100644 --- a/test/spec/expected-output/imports.wast.log +++ b/test/spec/expected-output/old_imports.wast.log diff --git a/test/spec/expected-output/start.wast.log b/test/spec/expected-output/old_start.wast.log index f74aa5848..f74aa5848 100644 --- a/test/spec/expected-output/start.wast.log +++ b/test/spec/expected-output/old_start.wast.log diff --git a/test/spec/exports.wast b/test/spec/exports.wast index 487103b89..ef1c4c17e 100644 --- a/test/spec/exports.wast +++ b/test/spec/exports.wast @@ -5,7 +5,13 @@ (module (func) (func) (export "a" (func 0)) (export "b" (func 1))) (module (func (export "a"))) +(module (func (export "a") (export "b") (export "c"))) +(module (func (export "a") (export "b") (param i32))) +(module (func) (export "a" (func 0))) (module (func $a (export "a"))) +(module (func $a) (export "a" (func $a))) +(module (export "a" (func 0)) (func)) +(module (export "a" (func $a)) (func $a)) (module $Func (export "e" (func $f)) @@ -52,7 +58,11 @@ (module (global i32 (i32.const 0)) (global i32 (i32.const 0)) (export "a" (global 0)) (export "b" (global 1))) (module (global (export "a") i32 (i32.const 0))) +(module (global i32 (i32.const 0)) (export "a" (global 0))) (module (global $a (export "a") i32 (i32.const 0))) +(module (global $a i32 (i32.const 0)) (export "a" (global $a))) +(module (export "a" (global 0)) (global i32 (i32.const 0))) +(module (export "a" (global $a)) (global $a i32 (i32.const 0))) (module $Global (export "e" (global $g)) @@ -99,8 +109,16 @@ (module (table (export "a") 0 funcref)) (module (table (export "a") 0 1 funcref)) +(module (table 0 funcref) (export "a" (table 0))) +(module (table 0 1 funcref) (export "a" (table 0))) (module (table $a (export "a") 0 funcref)) (module (table $a (export "a") 0 1 funcref)) +(module (table $a 0 funcref) (export "a" (table $a))) +(module (table $a 0 1 funcref) (export "a" (table $a))) +(module (export "a" (table 0)) (table 0 funcref)) +(module (export "a" (table 0)) (table 0 1 funcref)) +(module (export "a" (table $a)) (table $a 0 funcref)) +(module (export "a" (table $a)) (table $a 0 1 funcref)) (; TODO: access table ;) @@ -140,8 +158,16 @@ (module (memory (export "a") 0)) (module (memory (export "a") 0 1)) +(module (memory 0) (export "a" (memory 0))) +(module (memory 0 1) (export "a" (memory 0))) (module (memory $a (export "a") 0)) (module (memory $a (export "a") 0 1)) +(module (memory $a 0) (export "a" (memory $a))) +(module (memory $a 0 1) (export "a" (memory $a))) +(module (export "a" (memory 0)) (memory 0)) +(module (export "a" (memory 0)) (memory 0 1)) +(module (export "a" (memory $a)) (memory $a 0)) +(module (export "a" (memory $a)) (memory $a 0 1)) (; TODO: access memory ;) diff --git a/test/spec/f32.wast b/test/spec/f32.wast index aba05d0ac..4f0881c25 100644 --- a/test/spec/f32.wast +++ b/test/spec/f32.wast @@ -1,5 +1,6 @@ ;; Test all the f32 operators on major boundary values and all special -;; values (except comparison operators, which are tested in f32_cmp.wast). +;; values (except comparison and bitwise operators, which are tested in +;; f32_bitwise.wast and f32_cmp.wast). (module (func (export "add") (param $x f32) (param $y f32) (result f32) (f32.add (local.get $x) (local.get $y))) @@ -13,9 +14,6 @@ (func (export "floor") (param $x f32) (result f32) (f32.floor (local.get $x))) (func (export "trunc") (param $x f32) (result f32) (f32.trunc (local.get $x))) (func (export "nearest") (param $x f32) (result f32) (f32.nearest (local.get $x))) - (func (export "abs") (param $x f32) (result f32) (f32.abs (local.get $x))) - (func (export "neg") (param $x f32) (result f32) (f32.neg (local.get $x))) - (func (export "copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (local.get $x) (local.get $y))) ) (assert_return (invoke "add" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -46,14 +44,18 @@ (assert_return (invoke "add" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x0p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x0p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x0p+0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x0p+0) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x0p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x0p+0) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x0p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x0p+0) (f32.const nan:0x200000))) (assert_return (invoke "add" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) (assert_return (invoke "add" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const -0x1p-149)) (assert_return (invoke "add" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const 0x1p-149)) @@ -82,14 +84,18 @@ (assert_return (invoke "add" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x1p-149) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x1p-149) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x1p-149) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x1p-149) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const -0x1p-149) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x1p-149) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x1p-149) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x1p-149) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p-149) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p-149) (f32.const nan:0x200000))) (assert_return (invoke "add" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) (assert_return (invoke "add" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const -0x1p-126)) (assert_return (invoke "add" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const 0x1p-126)) @@ -118,14 +124,18 @@ (assert_return (invoke "add" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x1p-126) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x1p-126) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x1p-126) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x1p-126) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const -0x1p-126) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x1p-126) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x1p-126) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x1p-126) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p-126) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p-126) (f32.const nan:0x200000))) (assert_return (invoke "add" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) (assert_return (invoke "add" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const -0x1p-1)) (assert_return (invoke "add" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const 0x1p-1)) @@ -154,14 +164,18 @@ (assert_return (invoke "add" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x1p-1) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x1p-1) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x1p-1) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x1p-1) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const -0x1p-1) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x1p-1) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x1p-1) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x1p-1) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p-1) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p-1) (f32.const nan:0x200000))) (assert_return (invoke "add" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) (assert_return (invoke "add" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const -0x1p+0)) (assert_return (invoke "add" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const 0x1p+0)) @@ -190,14 +204,18 @@ (assert_return (invoke "add" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x1p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x1p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x1p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x1p+0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const -0x1p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x1p+0) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x1p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x1p+0) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1p+0) (f32.const nan:0x200000))) (assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const 0x1.921fb6p+2)) @@ -226,14 +244,18 @@ (assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000))) (assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const 0x1.fffffep+127)) @@ -258,90 +280,142 @@ (assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) +(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -inf)) (assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) (assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x1p-1)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x1p+0)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return_nan (invoke "add" (f32.const -infinity) (f32.const infinity))) -(assert_return_nan (invoke "add" (f32.const infinity) (f32.const -infinity))) -(assert_return (invoke "add" (f32.const infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x0p+0)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x0p+0)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x0p+0)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x0p+0)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x1p-149)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x1p-149)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x1p-149)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x1p-149)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x1p-126)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x1p-126)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x1p-126)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x1p-126)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x1p-1)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x1p-1)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x1p-1)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x1p-1)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x1p+0)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x1p+0)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x1p+0)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x1p+0)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const 0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -infinity)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const infinity)) (f32.const -nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const -infinity)) (f32.const nan)) -(assert_return (invoke "add" (f32.const nan) (f32.const infinity)) (f32.const nan)) -(assert_return (invoke "add" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) -(assert_return_nan (invoke "add" (f32.const -nan) (f32.const nan))) -(assert_return_nan (invoke "add" (f32.const nan) (f32.const -nan))) -(assert_return (invoke "add" (f32.const nan) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const 0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x1p-1)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x1p-1)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x1p+0)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x1p+0)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "add" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "add" (f32.const -inf) (f32.const -inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -inf) (f32.const inf))) +(assert_return_canonical_nan (invoke "add" (f32.const inf) (f32.const -inf))) +(assert_return (invoke "add" (f32.const inf) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "add" (f32.const -inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const -nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "add" (f32.const -nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "add" (f32.const nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "add" (f32.const nan:0x200000) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const -0x0p+0)) (f32.const 0x0p+0)) @@ -370,14 +444,18 @@ (assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x0p+0) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x0p+0) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x0p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x0p+0) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) (assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const -0x1p-149)) (assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const 0x1p-149)) @@ -406,14 +484,18 @@ (assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x1p-149) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x1p-149) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p-149) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p-149) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) (assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const -0x1p-126)) (assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const 0x1p-126)) @@ -442,14 +524,18 @@ (assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x1p-126) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x1p-126) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p-126) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p-126) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) (assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const -0x1p-1)) (assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const 0x1p-1)) @@ -478,14 +564,18 @@ (assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x1p-1) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x1p-1) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p-1) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p-1) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) (assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const -0x1p+0)) (assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const 0x1p+0)) @@ -514,14 +604,18 @@ (assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x1p+0) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x1p+0) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1p+0) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const 0x1.921fb6p+2)) @@ -550,14 +644,18 @@ (assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000))) (assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const 0x1.fffffep+127)) @@ -583,89 +681,141 @@ (assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const infinity)) +(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const inf)) (assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x1p-1)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x1p+0)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return_nan (invoke "sub" (f32.const -infinity) (f32.const -infinity))) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -infinity)) (f32.const infinity)) -(assert_return_nan (invoke "sub" (f32.const infinity) (f32.const infinity))) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x0p+0)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x0p+0)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x0p+0)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x0p+0)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x1p-149)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x1p-149)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x1p-149)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x1p-149)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x1p-126)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x1p-126)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x1p-126)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x1p-126)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x1p-1)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x1p-1)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x1p-1)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x1p-1)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x1p+0)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x1p+0)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x1p+0)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x1p+0)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const 0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -infinity)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const infinity)) (f32.const -nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const -infinity)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const nan) (f32.const infinity)) (f32.const nan)) -(assert_return (invoke "sub" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) -(assert_return_nan (invoke "sub" (f32.const -nan) (f32.const nan))) -(assert_return_nan (invoke "sub" (f32.const nan) (f32.const -nan))) -(assert_return (invoke "sub" (f32.const nan) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x1p-1)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x1p-1)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x1p+0)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x1p+0)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const -inf) (f32.const -inf))) +(assert_return (invoke "sub" (f32.const -inf) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "sub" (f32.const inf) (f32.const -inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "sub" (f32.const inf) (f32.const inf))) +(assert_return_canonical_nan (invoke "sub" (f32.const -inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const -nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const -nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sub" (f32.const nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "sub" (f32.const nan:0x200000) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x0p+0) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -694,14 +844,18 @@ (assert_return (invoke "mul" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return_nan (invoke "mul" (f32.const -0x0p+0) (f32.const -infinity))) -(assert_return_nan (invoke "mul" (f32.const -0x0p+0) (f32.const infinity))) -(assert_return_nan (invoke "mul" (f32.const 0x0p+0) (f32.const -infinity))) -(assert_return_nan (invoke "mul" (f32.const 0x0p+0) (f32.const infinity))) -(assert_return (invoke "mul" (f32.const -0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x0p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x0p+0) (f32.const nan)) (f32.const nan)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x0p+0) (f32.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x0p+0) (f32.const inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x0p+0) (f32.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x0p+0) (f32.const inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x0p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x0p+0) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -730,14 +884,18 @@ (assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep-22)) (assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep-22)) (assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep-22)) -(assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1p-149) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p-149) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p-149) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p-149) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -766,14 +924,18 @@ (assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+1)) (assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+1)) (assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+1)) -(assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1p-126) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p-126) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p-126) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p-126) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -802,14 +964,18 @@ (assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+126)) (assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+126)) (assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+126)) -(assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1p-1) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p-1) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p-1) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p-1) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -838,14 +1004,18 @@ (assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1p+0) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1p+0) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1p+0) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -870,18 +1040,22 @@ (assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const 0x1.921fb6p+2)) (f32.const -0x1.3bd3cep+5)) (assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.3bd3cep+5)) (assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.3bd3cep+5)) -(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000))) (assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -902,98 +1076,150 @@ (assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return_nan (invoke "mul" (f32.const -infinity) (f32.const -0x0p+0))) -(assert_return_nan (invoke "mul" (f32.const -infinity) (f32.const 0x0p+0))) -(assert_return_nan (invoke "mul" (f32.const infinity) (f32.const -0x0p+0))) -(assert_return_nan (invoke "mul" (f32.const infinity) (f32.const 0x0p+0))) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x0p+0)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x0p+0)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x0p+0)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x0p+0)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x1p-149)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x1p-149)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x1p-149)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x1p-149)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x1p-126)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x1p-126)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x1p-126)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x1p-126)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x1p-1)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x1p-1)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x1p-1)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x1p-1)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x1p+0)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x1p+0)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x1p+0)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x1p+0)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const 0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -infinity)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const infinity)) (f32.const -nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const -infinity)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const nan) (f32.const infinity)) (f32.const nan)) -(assert_return (invoke "mul" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) -(assert_return_nan (invoke "mul" (f32.const -nan) (f32.const nan))) -(assert_return_nan (invoke "mul" (f32.const nan) (f32.const -nan))) -(assert_return (invoke "mul" (f32.const nan) (f32.const nan)) (f32.const nan)) -(assert_return_nan (invoke "div" (f32.const -0x0p+0) (f32.const -0x0p+0))) -(assert_return_nan (invoke "div" (f32.const -0x0p+0) (f32.const 0x0p+0))) -(assert_return_nan (invoke "div" (f32.const 0x0p+0) (f32.const -0x0p+0))) -(assert_return_nan (invoke "div" (f32.const 0x0p+0) (f32.const 0x0p+0))) +(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -inf) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const -inf) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const inf) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const inf) (f32.const 0x0p+0))) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -0x1p-1)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const 0x1p-1)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -0x1p+0)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const 0x1p+0)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "mul" (f32.const -inf) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "mul" (f32.const inf) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "mul" (f32.const -inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const -nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const -nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "mul" (f32.const nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "mul" (f32.const nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x0p+0) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x0p+0) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x0p+0) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x0p+0) (f32.const 0x0p+0))) (assert_return (invoke "div" (f32.const -0x0p+0) (f32.const -0x1p-149)) (f32.const 0x0p+0)) (assert_return (invoke "div" (f32.const -0x0p+0) (f32.const 0x1p-149)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x0p+0) (f32.const -0x1p-149)) (f32.const -0x0p+0)) @@ -1018,18 +1244,22 @@ (assert_return (invoke "div" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x0p+0) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x0p+0) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x0p+0) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x0p+0) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x0p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x0p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x0p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const 0x0p+0)) (f32.const infinity)) +(assert_return (invoke "div" (f32.const -0x0p+0) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x0p+0) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x0p+0) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x0p+0) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x0p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x0p+0) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const 0x0p+0)) (f32.const inf)) (assert_return (invoke "div" (f32.const -0x1p-149) (f32.const -0x1p-149)) (f32.const 0x1p+0)) (assert_return (invoke "div" (f32.const -0x1p-149) (f32.const 0x1p-149)) (f32.const -0x1p+0)) (assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -0x1p-149)) (f32.const -0x1p+0)) @@ -1054,18 +1284,22 @@ (assert_return (invoke "div" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const 0x0p+0)) (f32.const infinity)) +(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x1p-149) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p-149) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p-149) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p-149) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const 0x0p+0)) (f32.const inf)) (assert_return (invoke "div" (f32.const -0x1p-126) (f32.const -0x1p-149)) (f32.const 0x1p+23)) (assert_return (invoke "div" (f32.const -0x1p-126) (f32.const 0x1p-149)) (f32.const -0x1p+23)) (assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -0x1p-149)) (f32.const -0x1p+23)) @@ -1090,22 +1324,26 @@ (assert_return (invoke "div" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "div" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const 0x1p-149)) (f32.const infinity)) +(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x1p-126) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p-126) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p-126) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p-126) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const 0x1p-149)) (f32.const inf)) (assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -0x1p-126)) (f32.const 0x1p+125)) (assert_return (invoke "div" (f32.const -0x1p-1) (f32.const 0x1p-126)) (f32.const -0x1p+125)) (assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -0x1p-126)) (f32.const -0x1p+125)) @@ -1126,22 +1364,26 @@ (assert_return (invoke "div" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const -0x1p-129)) (assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-129)) (assert_return (invoke "div" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-129)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const 0x1p-149)) (f32.const infinity)) +(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x1p-1) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p-1) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p-1) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p-1) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const 0x1p-149)) (f32.const inf)) (assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -0x1p-126)) (f32.const 0x1p+126)) (assert_return (invoke "div" (f32.const -0x1p+0) (f32.const 0x1p-126)) (f32.const -0x1p+126)) (assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -0x1p-126)) (f32.const -0x1p+126)) @@ -1162,26 +1404,30 @@ (assert_return (invoke "div" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1p-128)) (assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-128)) (assert_return (invoke "div" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-128)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const infinity)) +(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x1p+0) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1p+0) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1p+0) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const inf)) (assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-1)) (f32.const 0x1.921fb6p+3)) (assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-1)) (f32.const -0x1.921fb6p+3)) (assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-1)) (f32.const -0x1.921fb6p+3)) @@ -1198,30 +1444,34 @@ (assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const -0x1.921fb8p-126)) (assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.921fb8p-126)) (assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.921fb8p-126)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const infinity)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const inf)) (assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const -0x1.fffffep+127)) @@ -1234,86 +1484,138 @@ (assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const -0x1p+0)) (assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -0x1p+0)) (assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1p+0)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "div" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return_nan (invoke "div" (f32.const -infinity) (f32.const -infinity))) -(assert_return_nan (invoke "div" (f32.const -infinity) (f32.const infinity))) -(assert_return_nan (invoke "div" (f32.const infinity) (f32.const -infinity))) -(assert_return_nan (invoke "div" (f32.const infinity) (f32.const infinity))) -(assert_return (invoke "div" (f32.const -infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const infinity) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const infinity) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x0p+0)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x0p+0)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x0p+0)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x0p+0)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x1p-149)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x1p-149)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x1p-149)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x1p-149)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x1p-126)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x1p-126)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x1p-126)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x1p-126)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x1p-1)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x1p-1)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x1p-1)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x1p-1)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x1p+0)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x1p+0)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x1p+0)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x1p+0)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const 0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -infinity)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const infinity)) (f32.const -nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const -infinity)) (f32.const nan)) -(assert_return (invoke "div" (f32.const nan) (f32.const infinity)) (f32.const nan)) -(assert_return (invoke "div" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) -(assert_return_nan (invoke "div" (f32.const -nan) (f32.const nan))) -(assert_return_nan (invoke "div" (f32.const nan) (f32.const -nan))) -(assert_return (invoke "div" (f32.const nan) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "div" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "div" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const 0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x1p-1)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x1p-1)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x1p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x1p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "div" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "div" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return_canonical_nan (invoke "div" (f32.const -inf) (f32.const -inf))) +(assert_return_canonical_nan (invoke "div" (f32.const -inf) (f32.const inf))) +(assert_return_canonical_nan (invoke "div" (f32.const inf) (f32.const -inf))) +(assert_return_canonical_nan (invoke "div" (f32.const inf) (f32.const inf))) +(assert_return_canonical_nan (invoke "div" (f32.const -inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const -nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "div" (f32.const -nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "div" (f32.const nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "div" (f32.const nan:0x200000) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "min" (f32.const -0x0p+0) (f32.const 0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "min" (f32.const 0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1342,14 +1644,18 @@ (assert_return (invoke "min" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x0p+0)) (assert_return (invoke "min" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "min" (f32.const -0x0p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x0p+0) (f32.const infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "min" (f32.const 0x0p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x0p+0) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return_nan (invoke "min" (f32.const -0x0p+0) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x0p+0) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x0p+0) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x0p+0) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x0p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x0p+0) (f32.const inf)) (f32.const -0x0p+0)) +(assert_return (invoke "min" (f32.const 0x0p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x0p+0) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x0p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x0p+0) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) (assert_return (invoke "min" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const -0x1p-149)) (assert_return (invoke "min" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1378,14 +1684,18 @@ (assert_return (invoke "min" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const -0x1p-149)) (assert_return (invoke "min" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-149)) -(assert_return (invoke "min" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x1p-149) (f32.const infinity)) (f32.const -0x1p-149)) -(assert_return (invoke "min" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x1p-149) (f32.const infinity)) (f32.const 0x1p-149)) -(assert_return_nan (invoke "min" (f32.const -0x1p-149) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x1p-149) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p-149) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p-149) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x1p-149) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x1p-149) (f32.const inf)) (f32.const -0x1p-149)) +(assert_return (invoke "min" (f32.const 0x1p-149) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x1p-149) (f32.const inf)) (f32.const 0x1p-149)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p-149) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p-149) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) (assert_return (invoke "min" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const -0x1p-126)) (assert_return (invoke "min" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1414,14 +1724,18 @@ (assert_return (invoke "min" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const -0x1p-126)) (assert_return (invoke "min" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-126)) -(assert_return (invoke "min" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x1p-126) (f32.const infinity)) (f32.const -0x1p-126)) -(assert_return (invoke "min" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x1p-126) (f32.const infinity)) (f32.const 0x1p-126)) -(assert_return_nan (invoke "min" (f32.const -0x1p-126) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x1p-126) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p-126) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p-126) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x1p-126) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x1p-126) (f32.const inf)) (f32.const -0x1p-126)) +(assert_return (invoke "min" (f32.const 0x1p-126) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x1p-126) (f32.const inf)) (f32.const 0x1p-126)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p-126) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p-126) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) (assert_return (invoke "min" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const -0x1p-1)) (assert_return (invoke "min" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1450,14 +1764,18 @@ (assert_return (invoke "min" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const -0x1p-1)) (assert_return (invoke "min" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-1)) -(assert_return (invoke "min" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x1p-1) (f32.const infinity)) (f32.const -0x1p-1)) -(assert_return (invoke "min" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x1p-1) (f32.const infinity)) (f32.const 0x1p-1)) -(assert_return_nan (invoke "min" (f32.const -0x1p-1) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x1p-1) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p-1) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p-1) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x1p-1) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x1p-1) (f32.const inf)) (f32.const -0x1p-1)) +(assert_return (invoke "min" (f32.const 0x1p-1) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x1p-1) (f32.const inf)) (f32.const 0x1p-1)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p-1) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p-1) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) (assert_return (invoke "min" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const -0x1p+0)) (assert_return (invoke "min" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1486,14 +1804,18 @@ (assert_return (invoke "min" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const -0x1p+0)) (assert_return (invoke "min" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1p+0)) -(assert_return (invoke "min" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x1p+0) (f32.const infinity)) (f32.const -0x1p+0)) -(assert_return (invoke "min" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x1p+0) (f32.const infinity)) (f32.const 0x1p+0)) -(assert_return_nan (invoke "min" (f32.const -0x1p+0) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x1p+0) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p+0) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x1p+0) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x1p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x1p+0) (f32.const inf)) (f32.const -0x1p+0)) +(assert_return (invoke "min" (f32.const 0x1p+0) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x1p+0) (f32.const inf)) (f32.const 0x1p+0)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1p+0) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1522,14 +1844,18 @@ (assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const -0x1.921fb6p+2)) (assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const 0x1.921fb6p+2)) -(assert_return_nan (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const 0x1.921fb6p+2)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000))) (assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x0p+0)) @@ -1558,86 +1884,138 @@ (assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const 0x1.fffffep+127)) -(assert_return_nan (invoke "min" (f32.const -0x1.fffffep+127) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -0x1.fffffep+127) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const 0x1.fffffep+127) (f32.const nan))) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x0p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x1p-149)) (f32.const -0x1p-149)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x1p-126)) (f32.const -0x1p-126)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x1p-1)) (f32.const -0x1p-1)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x1p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "min" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const -infinity) (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "min" (f32.const infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "min" (f32.const -infinity) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -infinity) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const infinity) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const infinity) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x0p+0))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x0p+0))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x0p+0))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x0p+0))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-149))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-149))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p-149))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p-149))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-126))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-126))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p-126))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p-126))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-1))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-1))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p-1))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p-1))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p+0))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p+0))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p+0))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p+0))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1.921fb6p+2))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1.921fb6p+2))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1.921fb6p+2))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1.921fb6p+2))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1.fffffep+127))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1.fffffep+127))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1.fffffep+127))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1.fffffep+127))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -infinity))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const infinity))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -infinity))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const infinity))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const -nan) (f32.const nan))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const -nan))) -(assert_return_nan (invoke "min" (f32.const nan) (f32.const nan))) +(assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const 0x1.fffffep+127)) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const 0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x0p+0)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x1p-149)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x1p-149)) (f32.const -0x1p-149)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x1p-126)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x1p-126)) (f32.const -0x1p-126)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x1p-1)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x1p-1)) (f32.const -0x1p-1)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x1p+0)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x1p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "min" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "min" (f32.const -inf) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const -inf) (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "min" (f32.const inf) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "min" (f32.const -inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const -nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "min" (f32.const -nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "min" (f32.const nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "min" (f32.const nan:0x200000) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x0p+0) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x0p+0) (f32.const -0x0p+0)) (f32.const 0x0p+0)) @@ -1666,14 +2044,18 @@ (assert_return (invoke "max" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x0p+0) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "max" (f32.const -0x0p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x0p+0) (f32.const -infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "max" (f32.const 0x0p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x0p+0) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x0p+0) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x0p+0) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x0p+0) (f32.const nan))) +(assert_return (invoke "max" (f32.const -0x0p+0) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "max" (f32.const -0x0p+0) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x0p+0) (f32.const -inf)) (f32.const 0x0p+0)) +(assert_return (invoke "max" (f32.const 0x0p+0) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x0p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x0p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x0p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x0p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x0p+0) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const 0x1p-149)) @@ -1702,14 +2084,18 @@ (assert_return (invoke "max" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const 0x1p-149)) (assert_return (invoke "max" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const -0x1p-149)) -(assert_return (invoke "max" (f32.const -0x1p-149) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const 0x1p-149)) -(assert_return (invoke "max" (f32.const 0x1p-149) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x1p-149) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x1p-149) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p-149) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p-149) (f32.const nan))) +(assert_return (invoke "max" (f32.const -0x1p-149) (f32.const -inf)) (f32.const -0x1p-149)) +(assert_return (invoke "max" (f32.const -0x1p-149) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x1p-149) (f32.const -inf)) (f32.const 0x1p-149)) +(assert_return (invoke "max" (f32.const 0x1p-149) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p-149) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p-149) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p-149) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p-149) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p-149) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const 0x1p-126)) @@ -1738,14 +2124,18 @@ (assert_return (invoke "max" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const 0x1p-126)) (assert_return (invoke "max" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const -0x1p-126)) -(assert_return (invoke "max" (f32.const -0x1p-126) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const 0x1p-126)) -(assert_return (invoke "max" (f32.const 0x1p-126) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x1p-126) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x1p-126) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p-126) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p-126) (f32.const nan))) +(assert_return (invoke "max" (f32.const -0x1p-126) (f32.const -inf)) (f32.const -0x1p-126)) +(assert_return (invoke "max" (f32.const -0x1p-126) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x1p-126) (f32.const -inf)) (f32.const 0x1p-126)) +(assert_return (invoke "max" (f32.const 0x1p-126) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p-126) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p-126) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p-126) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p-126) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p-126) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const 0x1p-1)) @@ -1774,14 +2164,18 @@ (assert_return (invoke "max" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const 0x1p-1)) (assert_return (invoke "max" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const -0x1p-1)) -(assert_return (invoke "max" (f32.const -0x1p-1) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const 0x1p-1)) -(assert_return (invoke "max" (f32.const 0x1p-1) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x1p-1) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x1p-1) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p-1) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p-1) (f32.const nan))) +(assert_return (invoke "max" (f32.const -0x1p-1) (f32.const -inf)) (f32.const -0x1p-1)) +(assert_return (invoke "max" (f32.const -0x1p-1) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x1p-1) (f32.const -inf)) (f32.const 0x1p-1)) +(assert_return (invoke "max" (f32.const 0x1p-1) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p-1) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p-1) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p-1) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p-1) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p-1) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const 0x1p+0)) @@ -1810,14 +2204,18 @@ (assert_return (invoke "max" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const 0x1p+0)) (assert_return (invoke "max" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const -0x1p+0)) -(assert_return (invoke "max" (f32.const -0x1p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const 0x1p+0)) -(assert_return (invoke "max" (f32.const 0x1p+0) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x1p+0) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x1p+0) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p+0) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x1p+0) (f32.const nan))) +(assert_return (invoke "max" (f32.const -0x1p+0) (f32.const -inf)) (f32.const -0x1p+0)) +(assert_return (invoke "max" (f32.const -0x1p+0) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x1p+0) (f32.const -inf)) (f32.const 0x1p+0)) +(assert_return (invoke "max" (f32.const 0x1p+0) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1p+0) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p+0) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p+0) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1p+0) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1p+0) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const 0x1.921fb6p+2)) @@ -1846,14 +2244,18 @@ (assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const 0x1.921fb6p+2)) (assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000))) (assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const 0x1.fffffep+127)) @@ -1882,428 +2284,158 @@ (assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -0x1.fffffep+127) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -0x1.fffffep+127) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const 0x1.fffffep+127) (f32.const nan))) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x0p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x0p+0)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const -0x1p-149)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x1p-149)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const -0x1p-126)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x1p-126)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const -0x1p-1)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x1p-1)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x1p+0)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "max" (f32.const -infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "max" (f32.const infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return_nan (invoke "max" (f32.const -infinity) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -infinity) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const infinity) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const infinity) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x0p+0))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x0p+0))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x0p+0))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x0p+0))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x1p-149))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x1p-149))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x1p-149))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x1p-149))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x1p-126))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x1p-126))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x1p-126))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x1p-126))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x1p-1))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x1p-1))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x1p-1))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x1p-1))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x1p+0))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x1p+0))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x1p+0))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x1p+0))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x1.921fb6p+2))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x1.921fb6p+2))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x1.921fb6p+2))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x1.921fb6p+2))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -0x1.fffffep+127))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const 0x1.fffffep+127))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -0x1.fffffep+127))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const 0x1.fffffep+127))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -infinity))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const infinity))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -infinity))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const infinity))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const -nan) (f32.const nan))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const -nan))) -(assert_return_nan (invoke "max" (f32.const nan) (f32.const nan))) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p-149)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p-149)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p-149)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p-149)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p-126)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p-126)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p-126)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p-126)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p-1)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p-1)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p-1)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p-1)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -infinity)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const infinity)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -nan)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const nan)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -nan)) (f32.const -0x0p+0)) -(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const nan)) (f32.const 0x0p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x0p+0)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p-149)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p-149)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p-126)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p-126)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p-126)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p-126)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p-1)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p-1)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p-1)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p-1)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p+0)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p+0)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p+0)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p+0)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -infinity)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const infinity)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -infinity)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const infinity)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -nan)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const nan)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -nan)) (f32.const -0x1p-149)) -(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const nan)) (f32.const 0x1p-149)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x0p+0)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p-149)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p-149)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p-149)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p-149)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p-126)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p-126)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p-1)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p-1)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p-1)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p-1)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p+0)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p+0)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p+0)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p+0)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -infinity)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const infinity)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -infinity)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const infinity)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -nan)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const nan)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -nan)) (f32.const -0x1p-126)) -(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const nan)) (f32.const 0x1p-126)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x0p+0)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p-149)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p-149)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p-149)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p-149)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p-126)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p-126)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p-126)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p-126)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p-1)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p-1)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p+0)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p+0)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p+0)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p+0)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -infinity)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const infinity)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -infinity)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const infinity)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -nan)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const nan)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -nan)) (f32.const -0x1p-1)) -(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const nan)) (f32.const 0x1p-1)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x0p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p-149)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p-149)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p-149)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p-149)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p-126)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p-126)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p-126)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p-126)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p-1)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p-1)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p-1)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p-1)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -infinity)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const infinity)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -infinity)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const infinity)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -nan)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const nan)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -nan)) (f32.const -0x1p+0)) -(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const nan)) (f32.const 0x1p+0)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-1)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-1)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-1)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-1)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p+0)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p+0)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p+0)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p+0)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const nan)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const nan)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const infinity)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const infinity)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -nan)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const nan)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -nan)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const nan)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x0p+0)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x0p+0)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x1p-149)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x1p-149)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x1p-126)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x1p-126)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x1p-1)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x1p-1)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x1p+0)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x1p+0)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -0x1.fffffep+127)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const 0x1.fffffep+127)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const -nan)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const -infinity) (f32.const nan)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const -nan)) (f32.const -infinity)) -(assert_return (invoke "copysign" (f32.const infinity) (f32.const nan)) (f32.const infinity)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x0p+0)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x0p+0)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x0p+0)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x0p+0)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p-149)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p-149)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p-149)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p-149)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p-126)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p-126)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p-126)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p-126)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p-1)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p-1)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p-1)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p-1)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p+0)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p+0)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p+0)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p+0)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -infinity)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const infinity)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -infinity)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const infinity)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const -nan) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "copysign" (f32.const nan) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "max" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "max" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const 0x1.fffffep+127) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000))) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x0p+0)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x1p-149)) (f32.const -0x1p-149)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x1p-149)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x1p-126)) (f32.const -0x1p-126)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x1p-126)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x1p-1)) (f32.const -0x1p-1)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x1p-1)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x1p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x1p+0)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "max" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "max" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "max" (f32.const -inf) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "max" (f32.const inf) (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "max" (f32.const -inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const inf) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const inf) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const inf) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const inf) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x1p-149))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x1p-149))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x1p-149))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x1p-126))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x1p-126))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x1p-126))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x1.921fb6p+2))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const 0x1.fffffep+127))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -inf))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -inf))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const inf))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const inf))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const -nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "max" (f32.const -nan:0x200000) (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan) (f32.const -nan:0x200000))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "max" (f32.const nan) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan) (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "max" (f32.const nan:0x200000) (f32.const nan:0x200000))) (assert_return (invoke "sqrt" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "sqrt" (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return_nan (invoke "sqrt" (f32.const -0x1p-149))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -0x1p-149))) (assert_return (invoke "sqrt" (f32.const 0x1p-149)) (f32.const 0x1.6a09e6p-75)) -(assert_return_nan (invoke "sqrt" (f32.const -0x1p-126))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -0x1p-126))) (assert_return (invoke "sqrt" (f32.const 0x1p-126)) (f32.const 0x1p-63)) -(assert_return_nan (invoke "sqrt" (f32.const -0x1p-1))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -0x1p-1))) (assert_return (invoke "sqrt" (f32.const 0x1p-1)) (f32.const 0x1.6a09e6p-1)) -(assert_return_nan (invoke "sqrt" (f32.const -0x1p+0))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -0x1p+0))) (assert_return (invoke "sqrt" (f32.const 0x1p+0)) (f32.const 0x1p+0)) -(assert_return_nan (invoke "sqrt" (f32.const -0x1.921fb6p+2))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -0x1.921fb6p+2))) (assert_return (invoke "sqrt" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.40d932p+1)) -(assert_return_nan (invoke "sqrt" (f32.const -0x1.fffffep+127))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -0x1.fffffep+127))) (assert_return (invoke "sqrt" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+63)) -(assert_return_nan (invoke "sqrt" (f32.const -infinity))) -(assert_return (invoke "sqrt" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "sqrt" (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "sqrt" (f32.const nan)) (f32.const nan)) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -inf))) +(assert_return (invoke "sqrt" (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "sqrt" (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "sqrt" (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "sqrt" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "sqrt" (f32.const nan:0x200000))) (assert_return (invoke "floor" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "floor" (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "floor" (f32.const -0x1p-149)) (f32.const -0x1p+0)) @@ -2318,10 +2450,12 @@ (assert_return (invoke "floor" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.8p+2)) (assert_return (invoke "floor" (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "floor" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "floor" (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "floor" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "floor" (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "floor" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "floor" (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "floor" (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "floor" (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "floor" (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "floor" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "floor" (f32.const nan:0x200000))) (assert_return (invoke "ceil" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "ceil" (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "ceil" (f32.const -0x1p-149)) (f32.const -0x0p+0)) @@ -2336,10 +2470,12 @@ (assert_return (invoke "ceil" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.cp+2)) (assert_return (invoke "ceil" (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "ceil" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "ceil" (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "ceil" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "ceil" (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "ceil" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "ceil" (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "ceil" (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "ceil" (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "ceil" (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "ceil" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "ceil" (f32.const nan:0x200000))) (assert_return (invoke "trunc" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "trunc" (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "trunc" (f32.const -0x1p-149)) (f32.const -0x0p+0)) @@ -2354,10 +2490,12 @@ (assert_return (invoke "trunc" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.8p+2)) (assert_return (invoke "trunc" (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "trunc" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "trunc" (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "trunc" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "trunc" (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "trunc" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "trunc" (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "trunc" (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "trunc" (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "trunc" (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "trunc" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "trunc" (f32.const nan:0x200000))) (assert_return (invoke "nearest" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "nearest" (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "nearest" (f32.const -0x1p-149)) (f32.const -0x0p+0)) @@ -2372,43 +2510,24 @@ (assert_return (invoke "nearest" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.8p+2)) (assert_return (invoke "nearest" (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) (assert_return (invoke "nearest" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "nearest" (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "nearest" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "nearest" (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "nearest" (f32.const nan)) (f32.const nan)) -(assert_return (invoke "abs" (f32.const -0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "abs" (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "abs" (f32.const -0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "abs" (f32.const 0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "abs" (f32.const -0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "abs" (f32.const 0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "abs" (f32.const -0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "abs" (f32.const 0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "abs" (f32.const -0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "abs" (f32.const 0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "abs" (f32.const -0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "abs" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "abs" (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "abs" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "abs" (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "abs" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "abs" (f32.const -nan)) (f32.const nan)) -(assert_return (invoke "abs" (f32.const nan)) (f32.const nan)) -(assert_return (invoke "neg" (f32.const -0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "neg" (f32.const 0x0p+0)) (f32.const -0x0p+0)) -(assert_return (invoke "neg" (f32.const -0x1p-149)) (f32.const 0x1p-149)) -(assert_return (invoke "neg" (f32.const 0x1p-149)) (f32.const -0x1p-149)) -(assert_return (invoke "neg" (f32.const -0x1p-126)) (f32.const 0x1p-126)) -(assert_return (invoke "neg" (f32.const 0x1p-126)) (f32.const -0x1p-126)) -(assert_return (invoke "neg" (f32.const -0x1p-1)) (f32.const 0x1p-1)) -(assert_return (invoke "neg" (f32.const 0x1p-1)) (f32.const -0x1p-1)) -(assert_return (invoke "neg" (f32.const -0x1p+0)) (f32.const 0x1p+0)) -(assert_return (invoke "neg" (f32.const 0x1p+0)) (f32.const -0x1p+0)) -(assert_return (invoke "neg" (f32.const -0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) -(assert_return (invoke "neg" (f32.const 0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) -(assert_return (invoke "neg" (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) -(assert_return (invoke "neg" (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "neg" (f32.const -infinity)) (f32.const infinity)) -(assert_return (invoke "neg" (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "neg" (f32.const -nan)) (f32.const nan)) -(assert_return (invoke "neg" (f32.const nan)) (f32.const -nan)) +(assert_return (invoke "nearest" (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "nearest" (f32.const inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "nearest" (f32.const -nan))) +(assert_return_arithmetic_nan (invoke "nearest" (f32.const -nan:0x200000))) +(assert_return_canonical_nan (invoke "nearest" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "nearest" (f32.const nan:0x200000))) + + +;; Type check + +(assert_invalid (module (func (result f32) (f32.add (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.div (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.max (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.min (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.mul (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.sub (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.ceil (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.floor (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.nearest (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.sqrt (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.trunc (i64.const 0)))) "type mismatch") diff --git a/test/spec/f32_bitwise.wast b/test/spec/f32_bitwise.wast new file mode 100644 index 000000000..8554d6741 --- /dev/null +++ b/test/spec/f32_bitwise.wast @@ -0,0 +1,376 @@ +;; Test all the f32 bitwise operators on major boundary values and all special +;; values. + +(module + (func (export "abs") (param $x f32) (result f32) (f32.abs (local.get $x))) + (func (export "neg") (param $x f32) (result f32) (f32.neg (local.get $x))) + (func (export "copysign") (param $x f32) (param $y f32) (result f32) (f32.copysign (local.get $x) (local.get $y))) +) + +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p-149)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p-149)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p-149)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p-149)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p-126)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p-126)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p-126)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p-126)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p-1)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p-1)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p-1)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p-1)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -inf)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const inf)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const -nan)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x0p+0) (f32.const nan)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const -nan)) (f32.const -0x0p+0)) +(assert_return (invoke "copysign" (f32.const 0x0p+0) (f32.const nan)) (f32.const 0x0p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x0p+0)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x0p+0)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x0p+0)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p-149)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p-149)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p-126)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p-126)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p-126)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p-126)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p-1)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p-1)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p-1)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p-1)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1p+0)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1p+0)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1p+0)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1p+0)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -inf)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const inf)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -inf)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const inf)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const -nan)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-149) (f32.const nan)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const -nan)) (f32.const -0x1p-149)) +(assert_return (invoke "copysign" (f32.const 0x1p-149) (f32.const nan)) (f32.const 0x1p-149)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x0p+0)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x0p+0)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x0p+0)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p-149)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p-149)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p-149)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p-149)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p-126)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p-126)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p-1)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p-1)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p-1)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p-1)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1p+0)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1p+0)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1p+0)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1p+0)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -inf)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const inf)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -inf)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const inf)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const -nan)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-126) (f32.const nan)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const -nan)) (f32.const -0x1p-126)) +(assert_return (invoke "copysign" (f32.const 0x1p-126) (f32.const nan)) (f32.const 0x1p-126)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x0p+0)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x0p+0)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x0p+0)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p-149)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p-149)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p-149)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p-149)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p-126)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p-126)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p-126)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p-126)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p-1)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p-1)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1p+0)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1p+0)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1p+0)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1p+0)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -inf)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const inf)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -inf)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const inf)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const -nan)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p-1) (f32.const nan)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const -nan)) (f32.const -0x1p-1)) +(assert_return (invoke "copysign" (f32.const 0x1p-1) (f32.const nan)) (f32.const 0x1p-1)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x0p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x0p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x0p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p-149)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p-149)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p-149)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p-149)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p-126)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p-126)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p-126)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p-126)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p-1)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p-1)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p-1)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p-1)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1.921fb6p+2)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1.921fb6p+2)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -inf)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const inf)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -inf)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const inf)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const -nan)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1p+0) (f32.const nan)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const -nan)) (f32.const -0x1p+0)) +(assert_return (invoke "copysign" (f32.const 0x1p+0) (f32.const nan)) (f32.const 0x1p+0)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x0p+0)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-149)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-149)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-126)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-126)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p-1)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p-1)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p-1)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p-1)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1p+0)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1p+0)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1p+0)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1p+0)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const inf)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const inf)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.921fb6p+2) (f32.const nan)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const 0x1.921fb6p+2) (f32.const nan)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x0p+0)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p-149)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p-149)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p-126)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p-126)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p-1)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p-1)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1p+0)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1p+0)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1.921fb6p+2)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1.921fb6p+2)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -inf)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const inf)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -inf)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const inf)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const -nan)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -0x1.fffffep+127) (f32.const nan)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const -nan)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const 0x1.fffffep+127) (f32.const nan)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x0p+0)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x0p+0)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x1p-149)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x1p-149)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x1p-126)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x1p-126)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x1p-1)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x1p-1)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x1p+0)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x1p+0)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x1.921fb6p+2)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x1.921fb6p+2)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -0x1.fffffep+127)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const 0x1.fffffep+127)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const inf)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const -nan)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const -inf) (f32.const nan)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const -nan)) (f32.const -inf)) +(assert_return (invoke "copysign" (f32.const inf) (f32.const nan)) (f32.const inf)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x0p+0)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x0p+0)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x0p+0)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x0p+0)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p-149)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p-149)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p-149)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p-149)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p-126)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p-126)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p-126)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p-126)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p-1)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p-1)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p-1)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p-1)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1p+0)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1p+0)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1p+0)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1p+0)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1.921fb6p+2)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1.921fb6p+2)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -0x1.fffffep+127)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const 0x1.fffffep+127)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -inf)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const inf)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -inf)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const inf)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const -nan) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const -nan)) (f32.const -nan)) +(assert_return (invoke "copysign" (f32.const nan) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "abs" (f32.const -0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "abs" (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "abs" (f32.const -0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "abs" (f32.const 0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "abs" (f32.const -0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "abs" (f32.const 0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "abs" (f32.const -0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "abs" (f32.const 0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "abs" (f32.const -0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "abs" (f32.const 0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "abs" (f32.const -0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "abs" (f32.const 0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "abs" (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "abs" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "abs" (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "abs" (f32.const inf)) (f32.const inf)) +(assert_return (invoke "abs" (f32.const -nan)) (f32.const nan)) +(assert_return (invoke "abs" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "neg" (f32.const -0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "neg" (f32.const 0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "neg" (f32.const -0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "neg" (f32.const 0x1p-149)) (f32.const -0x1p-149)) +(assert_return (invoke "neg" (f32.const -0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "neg" (f32.const 0x1p-126)) (f32.const -0x1p-126)) +(assert_return (invoke "neg" (f32.const -0x1p-1)) (f32.const 0x1p-1)) +(assert_return (invoke "neg" (f32.const 0x1p-1)) (f32.const -0x1p-1)) +(assert_return (invoke "neg" (f32.const -0x1p+0)) (f32.const 0x1p+0)) +(assert_return (invoke "neg" (f32.const 0x1p+0)) (f32.const -0x1p+0)) +(assert_return (invoke "neg" (f32.const -0x1.921fb6p+2)) (f32.const 0x1.921fb6p+2)) +(assert_return (invoke "neg" (f32.const 0x1.921fb6p+2)) (f32.const -0x1.921fb6p+2)) +(assert_return (invoke "neg" (f32.const -0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "neg" (f32.const 0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "neg" (f32.const -inf)) (f32.const inf)) +(assert_return (invoke "neg" (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "neg" (f32.const -nan)) (f32.const nan)) +(assert_return (invoke "neg" (f32.const nan)) (f32.const -nan)) + + +;; Type check + +(assert_invalid (module (func (result f32) (f32.copysign (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.abs (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.neg (i64.const 0)))) "type mismatch") diff --git a/test/spec/f32_cmp.wast b/test/spec/f32_cmp.wast index 469bd1146..0dd7167c0 100644 --- a/test/spec/f32_cmp.wast +++ b/test/spec/f32_cmp.wast @@ -38,14 +38,18 @@ (assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const -0x0p+0)) (i32.const 0)) @@ -74,14 +78,18 @@ (assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const -0x0p+0)) (i32.const 0)) @@ -110,14 +118,18 @@ (assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const -0x0p+0)) (i32.const 0)) @@ -146,14 +158,18 @@ (assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const -0x0p+0)) (i32.const 0)) @@ -182,14 +198,18 @@ (assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 0)) @@ -218,14 +238,18 @@ (assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 0)) @@ -254,86 +278,138 @@ (assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x1p-126)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x1p-126)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x1p-126)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x1p-126)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -infinity) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const infinity) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -inf) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const inf) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const -nan) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f32.const nan) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const -nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const -nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "eq" (f32.const nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "eq" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const -0x0p+0)) (i32.const 0)) @@ -362,14 +438,18 @@ (assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x0p+0) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x0p+0) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const -0x0p+0)) (i32.const 1)) @@ -398,14 +478,18 @@ (assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-149) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-149) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const -0x0p+0)) (i32.const 1)) @@ -434,14 +518,18 @@ (assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-126) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-126) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const -0x0p+0)) (i32.const 1)) @@ -470,14 +558,18 @@ (assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p-1) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p-1) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const -0x0p+0)) (i32.const 1)) @@ -506,14 +598,18 @@ (assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1p+0) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1p+0) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 1)) @@ -542,14 +638,18 @@ (assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 1)) @@ -578,86 +678,138 @@ (assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const nan)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x1p-149)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x1p-149)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x1p-149)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x1p-149)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x1p-126)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x1p-126)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x1p-126)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x1p-126)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const -nan)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -infinity) (f32.const nan)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const -nan)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const infinity) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const -nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -inf) (f32.const nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const -nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const inf) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x1p-149)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x1p-149)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x1p-149)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x1p-149)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x1p-126)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x1p-126)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x1p-126)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x1p-126)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -nan) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const -nan) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const nan) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f32.const nan) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan) (f32.const -nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const -nan) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan) (f32.const nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const -nan:0x200000) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan) (f32.const -nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const -nan:0x200000)) (i32.const 1)) (assert_return (invoke "ne" (f32.const nan) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan) (f32.const nan:0x200000)) (i32.const 1)) +(assert_return (invoke "ne" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const -0x0p+0)) (i32.const 0)) @@ -686,14 +838,18 @@ (assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const -0x0p+0)) (i32.const 0)) @@ -722,14 +878,18 @@ (assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const -0x0p+0)) (i32.const 0)) @@ -758,14 +918,18 @@ (assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const -0x0p+0)) (i32.const 0)) @@ -794,14 +958,18 @@ (assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const -0x0p+0)) (i32.const 0)) @@ -830,14 +998,18 @@ (assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 0)) @@ -866,14 +1038,18 @@ (assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 0)) @@ -902,86 +1078,138 @@ (assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x1p-149)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x1p-149)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x1p-126)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x1p-126)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x1p-126)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x1p-126)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -infinity) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const infinity) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -inf) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const inf) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const -nan) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f32.const nan) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const inf)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const -nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const -nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "lt" (f32.const nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "lt" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x0p+0) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x0p+0) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x0p+0) (f32.const -0x0p+0)) (i32.const 1)) @@ -1010,14 +1238,18 @@ (assert_return (invoke "le" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x0p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x0p+0) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x0p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x0p+0) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x0p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x0p+0) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x0p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x0p+0) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p-149) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p-149) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p-149) (f32.const -0x0p+0)) (i32.const 0)) @@ -1046,14 +1278,18 @@ (assert_return (invoke "le" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x1p-149) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x1p-149) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x1p-149) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x1p-149) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x1p-149) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-149) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x1p-149) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-149) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p-126) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p-126) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p-126) (f32.const -0x0p+0)) (i32.const 0)) @@ -1082,14 +1318,18 @@ (assert_return (invoke "le" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x1p-126) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x1p-126) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x1p-126) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x1p-126) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x1p-126) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-126) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x1p-126) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-126) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p-1) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p-1) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p-1) (f32.const -0x0p+0)) (i32.const 0)) @@ -1118,14 +1358,18 @@ (assert_return (invoke "le" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x1p-1) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x1p-1) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x1p-1) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x1p-1) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x1p-1) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-1) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x1p-1) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-1) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p+0) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p+0) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p+0) (f32.const -0x0p+0)) (i32.const 0)) @@ -1154,14 +1398,18 @@ (assert_return (invoke "le" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x1p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x1p+0) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x1p+0) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x1p+0) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x1p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p+0) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x1p+0) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p+0) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 0)) @@ -1190,14 +1438,18 @@ (assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 0)) @@ -1226,86 +1478,138 @@ (assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const inf)) (i32.const 1)) (assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x1p-149)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x1p-149)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x1p-126)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x1p-126)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x1p-126)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x1p-126)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -infinity) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "le" (f32.const infinity) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const inf) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -inf) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const inf) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const -nan) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f32.const nan) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const inf)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const -nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const -nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "le" (f32.const nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const -0x0p+0)) (i32.const 0)) @@ -1334,14 +1638,18 @@ (assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const -0x0p+0)) (i32.const 1)) @@ -1370,14 +1678,18 @@ (assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const -0x0p+0)) (i32.const 1)) @@ -1406,14 +1718,18 @@ (assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const -0x0p+0)) (i32.const 1)) @@ -1442,14 +1758,18 @@ (assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const -0x0p+0)) (i32.const 1)) @@ -1478,14 +1798,18 @@ (assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 1)) @@ -1514,14 +1838,18 @@ (assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 1)) @@ -1550,86 +1878,138 @@ (assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x1p-149)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x1p-149)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x1p-126)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x1p-126)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x1p-126)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x1p-126)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -infinity) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const infinity) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f32.const inf) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -inf) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const inf) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const -nan) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f32.const nan) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const -nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const -nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "gt" (f32.const nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "gt" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const -0x0p+0)) (i32.const 1)) @@ -1658,14 +2038,18 @@ (assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x0p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const -0x0p+0)) (i32.const 1)) @@ -1694,14 +2078,18 @@ (assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-149) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const -0x0p+0)) (i32.const 1)) @@ -1730,14 +2118,18 @@ (assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-126) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const -0x0p+0)) (i32.const 1)) @@ -1766,14 +2158,18 @@ (assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p-1) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const -0x0p+0)) (i32.const 1)) @@ -1802,14 +2198,18 @@ (assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1p+0) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const -0x0p+0)) (i32.const 1)) @@ -1838,14 +2238,18 @@ (assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1.921fb6p+2) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const -0x0p+0)) (i32.const 1)) @@ -1874,83 +2278,145 @@ (assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const -0x1.fffffep+127)) (i32.const 1)) (assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x1p-149)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x1p-149)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x1p-149)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x1p-149)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x1p-126)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x1p-126)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x1p-126)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x1p-126)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x1.921fb6p+2)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x1.921fb6p+2)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const 0x1.fffffep+127)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -infinity) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const -nan)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const infinity) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const 0x1.fffffep+127) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x1p-149)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x1p-149)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x1p-126)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x1p-126)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x1.921fb6p+2)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const 0x1.fffffep+127)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const inf) (f32.const inf)) (i32.const 1)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -inf) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const inf) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x1p-149)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x1p-149)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x1p-126)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x1p-126)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x1p-126)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x1p-126)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x1.921fb6p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x1.921fb6p+2)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -0x1.fffffep+127)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const 0x1.fffffep+127)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const -nan) (f32.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const nan) (f32.const -infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f32.const nan) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const 0x1.fffffep+127)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan) (f32.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const -nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const -nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan) (f32.const -nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const -nan:0x200000)) (i32.const 0)) (assert_return (invoke "ge" (f32.const nan) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan) (f32.const nan:0x200000)) (i32.const 0)) +(assert_return (invoke "ge" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0)) + + +;; Type check + +(assert_invalid (module (func (result f32) (f32.eq (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.ge (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.gt (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.le (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.lt (i64.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f32) (f32.ne (i64.const 0) (f64.const 0)))) "type mismatch") diff --git a/test/spec/f64.wast b/test/spec/f64.wast index 6f6d91199..85c8834b7 100644 --- a/test/spec/f64.wast +++ b/test/spec/f64.wast @@ -1,5 +1,6 @@ ;; Test all the f64 operators on major boundary values and all special -;; values (except comparison operators, which are tested in f64_cmp.wast). +;; values (except comparison and bitwise operators, which are tested in +;; f64_bitwise.wast and f64_cmp.wast). (module (func (export "add") (param $x f64) (param $y f64) (result f64) (f64.add (local.get $x) (local.get $y))) @@ -13,9 +14,6 @@ (func (export "floor") (param $x f64) (result f64) (f64.floor (local.get $x))) (func (export "trunc") (param $x f64) (result f64) (f64.trunc (local.get $x))) (func (export "nearest") (param $x f64) (result f64) (f64.nearest (local.get $x))) - (func (export "abs") (param $x f64) (result f64) (f64.abs (local.get $x))) - (func (export "neg") (param $x f64) (result f64) (f64.neg (local.get $x))) - (func (export "copysign") (param $x f64) (param $y f64) (result f64) (f64.copysign (local.get $x) (local.get $y))) ) (assert_return (invoke "add" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -46,14 +44,18 @@ (assert_return (invoke "add" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x0p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x0p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x0p+0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x0p+0) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x0p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x0p+0) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x0p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const 0x0.0000000000001p-1022)) @@ -82,14 +84,18 @@ (assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) (assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const -0x1p-1022)) (assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const 0x1p-1022)) @@ -118,14 +124,18 @@ (assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x1p-1022) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x1p-1022) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "add" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) (assert_return (invoke "add" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const -0x1p-1)) (assert_return (invoke "add" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const 0x1p-1)) @@ -154,14 +164,18 @@ (assert_return (invoke "add" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x1p-1) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x1p-1) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x1p-1) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x1p-1) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const -0x1p-1) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x1p-1) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x1p-1) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x1p-1) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1p-1) (f64.const nan:0x4000000000000))) (assert_return (invoke "add" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) (assert_return (invoke "add" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const -0x1p+0)) (assert_return (invoke "add" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const 0x1p+0)) @@ -190,14 +204,18 @@ (assert_return (invoke "add" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x1p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x1p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x1p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x1p+0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const -0x1p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x1p+0) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x1p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x1p+0) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) @@ -226,14 +244,18 @@ (assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) (assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) @@ -258,90 +280,142 @@ (assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) +(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) (assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) (assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x1p-1)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x1p+0)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return_nan (invoke "add" (f64.const -infinity) (f64.const infinity))) -(assert_return_nan (invoke "add" (f64.const infinity) (f64.const -infinity))) -(assert_return (invoke "add" (f64.const infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x0p+0)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x0p+0)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x0p+0)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x0p+0)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x1p-1022)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x1p-1022)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x1p-1)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x1p-1)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x1p-1)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x1p-1)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x1p+0)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x1p+0)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x1p+0)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x1p+0)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -infinity)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const infinity)) (f64.const -nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const -infinity)) (f64.const nan)) -(assert_return (invoke "add" (f64.const nan) (f64.const infinity)) (f64.const nan)) -(assert_return (invoke "add" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) -(assert_return_nan (invoke "add" (f64.const -nan) (f64.const nan))) -(assert_return_nan (invoke "add" (f64.const nan) (f64.const -nan))) -(assert_return (invoke "add" (f64.const nan) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x1p-1)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x1p-1)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x1p+0)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x1p+0)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "add" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "add" (f64.const -inf) (f64.const -inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -inf) (f64.const inf))) +(assert_return_canonical_nan (invoke "add" (f64.const inf) (f64.const -inf))) +(assert_return (invoke "add" (f64.const inf) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "add" (f64.const -inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const -nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "add" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "add" (f64.const nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "add" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const -0x0p+0)) (f64.const 0x0p+0)) @@ -370,14 +444,18 @@ (assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x0p+0) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x0p+0) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x0p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const 0x0.0000000000001p-1022)) @@ -406,14 +484,18 @@ (assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) (assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const -0x1p-1022)) (assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const 0x1p-1022)) @@ -442,14 +524,18 @@ (assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x1p-1022) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x1p-1022) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) (assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const -0x1p-1)) (assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const 0x1p-1)) @@ -478,14 +564,18 @@ (assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x1p-1) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x1p-1) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1p-1) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) (assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const -0x1p+0)) (assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const 0x1p+0)) @@ -514,14 +604,18 @@ (assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x1p+0) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x1p+0) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) @@ -550,14 +644,18 @@ (assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) (assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) @@ -583,89 +681,141 @@ (assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) +(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) (assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x1p-1)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x1p+0)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return_nan (invoke "sub" (f64.const -infinity) (f64.const -infinity))) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -infinity)) (f64.const infinity)) -(assert_return_nan (invoke "sub" (f64.const infinity) (f64.const infinity))) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x0p+0)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x0p+0)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x0p+0)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x0p+0)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x1p-1022)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x1p-1022)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x1p-1)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x1p-1)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x1p-1)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x1p-1)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x1p+0)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x1p+0)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x1p+0)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x1p+0)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -infinity)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const infinity)) (f64.const -nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const -infinity)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const nan) (f64.const infinity)) (f64.const nan)) -(assert_return (invoke "sub" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) -(assert_return_nan (invoke "sub" (f64.const -nan) (f64.const nan))) -(assert_return_nan (invoke "sub" (f64.const nan) (f64.const -nan))) -(assert_return (invoke "sub" (f64.const nan) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x1p-1)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x1p-1)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x1p+0)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x1p+0)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const -inf) (f64.const -inf))) +(assert_return (invoke "sub" (f64.const -inf) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "sub" (f64.const inf) (f64.const -inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "sub" (f64.const inf) (f64.const inf))) +(assert_return_canonical_nan (invoke "sub" (f64.const -inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const -nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sub" (f64.const nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "sub" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x0p+0) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -694,14 +844,18 @@ (assert_return (invoke "mul" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return_nan (invoke "mul" (f64.const -0x0p+0) (f64.const -infinity))) -(assert_return_nan (invoke "mul" (f64.const -0x0p+0) (f64.const infinity))) -(assert_return_nan (invoke "mul" (f64.const 0x0p+0) (f64.const -infinity))) -(assert_return_nan (invoke "mul" (f64.const 0x0p+0) (f64.const infinity))) -(assert_return (invoke "mul" (f64.const -0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x0p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x0p+0) (f64.const nan)) (f64.const nan)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x0p+0) (f64.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x0p+0) (f64.const inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x0p+0) (f64.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x0p+0) (f64.const inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x0p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -730,14 +884,18 @@ (assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp-51)) (assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp-51)) (assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp-51)) -(assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -766,14 +924,18 @@ (assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1)) (assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1)) (assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1)) -(assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1p-1022) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1p-1022) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -802,14 +964,18 @@ (assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1022)) (assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1022)) (assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1022)) -(assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1p-1) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1p-1) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1p-1) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -838,14 +1004,18 @@ (assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1p+0) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1p+0) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -870,18 +1040,22 @@ (assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.921fb54442d18p+2)) (f64.const -0x1.3bd3cc9be45dep+5)) (assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.3bd3cc9be45dep+5)) (assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.3bd3cc9be45dep+5)) -(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) (assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -902,98 +1076,150 @@ (assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return_nan (invoke "mul" (f64.const -infinity) (f64.const -0x0p+0))) -(assert_return_nan (invoke "mul" (f64.const -infinity) (f64.const 0x0p+0))) -(assert_return_nan (invoke "mul" (f64.const infinity) (f64.const -0x0p+0))) -(assert_return_nan (invoke "mul" (f64.const infinity) (f64.const 0x0p+0))) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x0p+0)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x0p+0)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x0p+0)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x0p+0)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x1p-1022)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x1p-1022)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x1p-1)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x1p-1)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x1p-1)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x1p-1)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x1p+0)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x1p+0)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x1p+0)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x1p+0)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -infinity)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const infinity)) (f64.const -nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const -infinity)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const nan) (f64.const infinity)) (f64.const nan)) -(assert_return (invoke "mul" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) -(assert_return_nan (invoke "mul" (f64.const -nan) (f64.const nan))) -(assert_return_nan (invoke "mul" (f64.const nan) (f64.const -nan))) -(assert_return (invoke "mul" (f64.const nan) (f64.const nan)) (f64.const nan)) -(assert_return_nan (invoke "div" (f64.const -0x0p+0) (f64.const -0x0p+0))) -(assert_return_nan (invoke "div" (f64.const -0x0p+0) (f64.const 0x0p+0))) -(assert_return_nan (invoke "div" (f64.const 0x0p+0) (f64.const -0x0p+0))) -(assert_return_nan (invoke "div" (f64.const 0x0p+0) (f64.const 0x0p+0))) +(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -inf) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const -inf) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const inf) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const inf) (f64.const 0x0p+0))) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -0x1p-1)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const 0x1p-1)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -0x1p+0)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const 0x1p+0)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "mul" (f64.const -inf) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "mul" (f64.const inf) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "mul" (f64.const -inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const -nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "mul" (f64.const nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "mul" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x0p+0) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x0p+0) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x0p+0) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x0p+0) (f64.const 0x0p+0))) (assert_return (invoke "div" (f64.const -0x0p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const 0x0p+0)) (assert_return (invoke "div" (f64.const -0x0p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x0p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) @@ -1018,18 +1244,22 @@ (assert_return (invoke "div" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x0p+0) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x0p+0) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x0p+0) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x0p+0) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x0p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x0p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x0p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const infinity)) +(assert_return (invoke "div" (f64.const -0x0p+0) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x0p+0) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x0p+0) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x0p+0) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const inf)) (assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const 0x1p+0)) (assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const -0x1p+0)) (assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+0)) @@ -1054,18 +1284,22 @@ (assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const 0x0p+0)) (f64.const infinity)) +(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const 0x0p+0)) (f64.const inf)) (assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const 0x1p+52)) (assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const -0x1p+52)) (assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+52)) @@ -1090,22 +1324,26 @@ (assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) +(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x1p-1022) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1p-1022) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) (assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -0x1p-1022)) (f64.const 0x1p+1021)) (assert_return (invoke "div" (f64.const -0x1p-1) (f64.const 0x1p-1022)) (f64.const -0x1p+1021)) (assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -0x1p-1022)) (f64.const -0x1p+1021)) @@ -1126,22 +1364,26 @@ (assert_return (invoke "div" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0.2p-1022)) (assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0.2p-1022)) (assert_return (invoke "div" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.2p-1022)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) +(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x1p-1) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1p-1) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) (assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -0x1p-1022)) (f64.const 0x1p+1022)) (assert_return (invoke "div" (f64.const -0x1p+0) (f64.const 0x1p-1022)) (f64.const -0x1p+1022)) (assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -0x1p-1022)) (f64.const -0x1p+1022)) @@ -1162,26 +1404,30 @@ (assert_return (invoke "div" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0.4p-1022)) (assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0.4p-1022)) (assert_return (invoke "div" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.4p-1022)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const infinity)) +(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x1p+0) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1p+0) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const inf)) (assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1)) (f64.const 0x1.921fb54442d18p+3)) (assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1)) (f64.const -0x1.921fb54442d18p+3)) (assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1)) (f64.const -0x1.921fb54442d18p+3)) @@ -1198,30 +1444,34 @@ (assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d19p-1022)) (assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d19p-1022)) (assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d19p-1022)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const infinity)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const inf)) (assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) @@ -1234,86 +1484,138 @@ (assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) (assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) (assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "div" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return_nan (invoke "div" (f64.const -infinity) (f64.const -infinity))) -(assert_return_nan (invoke "div" (f64.const -infinity) (f64.const infinity))) -(assert_return_nan (invoke "div" (f64.const infinity) (f64.const -infinity))) -(assert_return_nan (invoke "div" (f64.const infinity) (f64.const infinity))) -(assert_return (invoke "div" (f64.const -infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const infinity) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const infinity) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x0p+0)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x0p+0)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x0p+0)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x0p+0)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x1p-1022)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x1p-1022)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x1p-1)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x1p-1)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x1p-1)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x1p-1)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x1p+0)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x1p+0)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x1p+0)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x1p+0)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -infinity)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const infinity)) (f64.const -nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const -infinity)) (f64.const nan)) -(assert_return (invoke "div" (f64.const nan) (f64.const infinity)) (f64.const nan)) -(assert_return (invoke "div" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) -(assert_return_nan (invoke "div" (f64.const -nan) (f64.const nan))) -(assert_return_nan (invoke "div" (f64.const nan) (f64.const -nan))) -(assert_return (invoke "div" (f64.const nan) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x1p-1)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x1p-1)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x1p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x1p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "div" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "div" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return_canonical_nan (invoke "div" (f64.const -inf) (f64.const -inf))) +(assert_return_canonical_nan (invoke "div" (f64.const -inf) (f64.const inf))) +(assert_return_canonical_nan (invoke "div" (f64.const inf) (f64.const -inf))) +(assert_return_canonical_nan (invoke "div" (f64.const inf) (f64.const inf))) +(assert_return_canonical_nan (invoke "div" (f64.const -inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const -nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "div" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "div" (f64.const nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "div" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "min" (f64.const -0x0p+0) (f64.const 0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "min" (f64.const 0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1342,14 +1644,18 @@ (assert_return (invoke "min" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) (assert_return (invoke "min" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "min" (f64.const -0x0p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x0p+0) (f64.const infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "min" (f64.const 0x0p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x0p+0) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return_nan (invoke "min" (f64.const -0x0p+0) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x0p+0) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x0p+0) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x0p+0) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x0p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x0p+0) (f64.const inf)) (f64.const -0x0p+0)) +(assert_return (invoke "min" (f64.const 0x0p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x0p+0) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x0p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1378,14 +1684,18 @@ (assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x0.0000000000001p-1022)) (assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const 0x0.0000000000001p-1022)) -(assert_return_nan (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const 0x0.0000000000001p-1022)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) (assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const -0x1p-1022)) (assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1414,14 +1724,18 @@ (assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1p-1022)) (assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1022)) -(assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const -0x1p-1022)) -(assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const 0x1p-1022)) -(assert_return_nan (invoke "min" (f64.const -0x1p-1022) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x1p-1022) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x1p-1022) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x1p-1022) (f64.const inf)) (f64.const -0x1p-1022)) +(assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x1p-1022) (f64.const inf)) (f64.const 0x1p-1022)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) (assert_return (invoke "min" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const -0x1p-1)) (assert_return (invoke "min" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1450,14 +1764,18 @@ (assert_return (invoke "min" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1p-1)) (assert_return (invoke "min" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1)) -(assert_return (invoke "min" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x1p-1) (f64.const infinity)) (f64.const -0x1p-1)) -(assert_return (invoke "min" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x1p-1) (f64.const infinity)) (f64.const 0x1p-1)) -(assert_return_nan (invoke "min" (f64.const -0x1p-1) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x1p-1) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x1p-1) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x1p-1) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x1p-1) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x1p-1) (f64.const inf)) (f64.const -0x1p-1)) +(assert_return (invoke "min" (f64.const 0x1p-1) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x1p-1) (f64.const inf)) (f64.const 0x1p-1)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1p-1) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) (assert_return (invoke "min" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const -0x1p+0)) (assert_return (invoke "min" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1486,14 +1804,18 @@ (assert_return (invoke "min" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) (assert_return (invoke "min" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) -(assert_return (invoke "min" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x1p+0) (f64.const infinity)) (f64.const -0x1p+0)) -(assert_return (invoke "min" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x1p+0) (f64.const infinity)) (f64.const 0x1p+0)) -(assert_return_nan (invoke "min" (f64.const -0x1p+0) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x1p+0) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x1p+0) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x1p+0) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x1p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x1p+0) (f64.const inf)) (f64.const -0x1p+0)) +(assert_return (invoke "min" (f64.const 0x1p+0) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x1p+0) (f64.const inf)) (f64.const 0x1p+0)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1522,14 +1844,18 @@ (assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d18p+2)) (assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return_nan (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) (assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x0p+0)) @@ -1558,86 +1884,138 @@ (assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return_nan (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x0p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x1p-1)) (f64.const -0x1p-1)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x1p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "min" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const -infinity) (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "min" (f64.const infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "min" (f64.const -infinity) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -infinity) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const infinity) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const infinity) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x0p+0))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x0p+0))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x0p+0))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x0p+0))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x1p-1022))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x1p-1022))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x1p-1022))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x1p-1022))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x1p-1))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x1p-1))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x1p-1))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x1p-1))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x1p+0))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x1p+0))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x1p+0))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x1p+0))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -infinity))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const infinity))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -infinity))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const infinity))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const -nan) (f64.const nan))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const -nan))) -(assert_return_nan (invoke "min" (f64.const nan) (f64.const nan))) +(assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x0p+0)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x0p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x1p-1)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x1p-1)) (f64.const -0x1p-1)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x1p+0)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x1p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "min" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "min" (f64.const -inf) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const -inf) (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "min" (f64.const inf) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "min" (f64.const -inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const -nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "min" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "min" (f64.const nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "min" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x0p+0) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x0p+0) (f64.const -0x0p+0)) (f64.const 0x0p+0)) @@ -1666,14 +2044,18 @@ (assert_return (invoke "max" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x0p+0) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "max" (f64.const -0x0p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x0p+0) (f64.const -infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "max" (f64.const 0x0p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x0p+0) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x0p+0) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x0p+0) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x0p+0) (f64.const nan))) +(assert_return (invoke "max" (f64.const -0x0p+0) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "max" (f64.const -0x0p+0) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x0p+0) (f64.const -inf)) (f64.const 0x0p+0)) +(assert_return (invoke "max" (f64.const 0x0p+0) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x0p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x0p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x0p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x0p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const 0x0.0000000000001p-1022)) @@ -1702,14 +2084,18 @@ (assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) (assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const 0x1p-1022)) @@ -1738,14 +2124,18 @@ (assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1p-1022)) (assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const -0x1p-1022)) -(assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const 0x1p-1022)) -(assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x1p-1022) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x1p-1022) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x1p-1022) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const -0x1p-1022)) +(assert_return (invoke "max" (f64.const -0x1p-1022) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const 0x1p-1022)) +(assert_return (invoke "max" (f64.const 0x1p-1022) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1p-1022) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1p-1022) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const 0x1p-1)) @@ -1774,14 +2164,18 @@ (assert_return (invoke "max" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1p-1)) (assert_return (invoke "max" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const -0x1p-1)) -(assert_return (invoke "max" (f64.const -0x1p-1) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const 0x1p-1)) -(assert_return (invoke "max" (f64.const 0x1p-1) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x1p-1) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x1p-1) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x1p-1) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x1p-1) (f64.const nan))) +(assert_return (invoke "max" (f64.const -0x1p-1) (f64.const -inf)) (f64.const -0x1p-1)) +(assert_return (invoke "max" (f64.const -0x1p-1) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x1p-1) (f64.const -inf)) (f64.const 0x1p-1)) +(assert_return (invoke "max" (f64.const 0x1p-1) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1p-1) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1p-1) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1p-1) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1p-1) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const 0x1p+0)) @@ -1810,14 +2204,18 @@ (assert_return (invoke "max" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) (assert_return (invoke "max" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const -0x1p+0)) -(assert_return (invoke "max" (f64.const -0x1p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const 0x1p+0)) -(assert_return (invoke "max" (f64.const 0x1p+0) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x1p+0) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x1p+0) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x1p+0) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x1p+0) (f64.const nan))) +(assert_return (invoke "max" (f64.const -0x1p+0) (f64.const -inf)) (f64.const -0x1p+0)) +(assert_return (invoke "max" (f64.const -0x1p+0) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x1p+0) (f64.const -inf)) (f64.const 0x1p+0)) +(assert_return (invoke "max" (f64.const 0x1p+0) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1p+0) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1p+0) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1p+0) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1p+0) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) @@ -1846,14 +2244,18 @@ (assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d18p+2)) (assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000))) (assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) @@ -1882,428 +2284,158 @@ (assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) (assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x0p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x0p+0)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const -0x1p-1)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x1p-1)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x1p+0)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "max" (f64.const -infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "max" (f64.const infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return_nan (invoke "max" (f64.const -infinity) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -infinity) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const infinity) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const infinity) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x0p+0))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x0p+0))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x0p+0))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x0p+0))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x1p-1022))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x1p-1022))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x1p-1022))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x1p-1022))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x1p-1))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x1p-1))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x1p-1))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x1p-1))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x1p+0))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x1p+0))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x1p+0))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x1p+0))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -infinity))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const infinity))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -infinity))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const infinity))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const -nan) (f64.const nan))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const -nan))) -(assert_return_nan (invoke "max" (f64.const nan) (f64.const nan))) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1p-1022)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1p-1022)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1p-1022)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1p-1022)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1p-1)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1p-1)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1p-1)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1p-1)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -infinity)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const infinity)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -nan)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const nan)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -nan)) (f64.const -0x0p+0)) -(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const nan)) (f64.const 0x0p+0)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p-1)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1p-1)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1p-1)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1p-1)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p+0)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1p+0)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1p+0)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1p+0)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x0p+0)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1p-1)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1p-1)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1p-1)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1p-1)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1p+0)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1p+0)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1p+0)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1p+0)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -infinity)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const infinity)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -infinity)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const infinity)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -nan)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const nan)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -nan)) (f64.const -0x1p-1022)) -(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const nan)) (f64.const 0x1p-1022)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x0p+0)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1p-1022)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1p-1022)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1p-1022)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1p-1022)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1p-1)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1p-1)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1p+0)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1p+0)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1p+0)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1p+0)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -infinity)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const infinity)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -infinity)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const infinity)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -nan)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const nan)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -nan)) (f64.const -0x1p-1)) -(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const nan)) (f64.const 0x1p-1)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x0p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1p-1022)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1p-1022)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1p-1022)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1p-1022)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1p-1)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1p-1)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1p-1)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1p-1)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -infinity)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const infinity)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -infinity)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const infinity)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -nan)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const nan)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -nan)) (f64.const -0x1p+0)) -(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const nan)) (f64.const 0x1p+0)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p-1)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p+0)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p+0)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p+0)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p+0)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x0p+0)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x0p+0)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x1p-1022)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x1p-1022)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x1p-1)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x1p-1)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x1p+0)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x1p+0)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const -nan)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const -infinity) (f64.const nan)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const -nan)) (f64.const -infinity)) -(assert_return (invoke "copysign" (f64.const infinity) (f64.const nan)) (f64.const infinity)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x0p+0)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x0p+0)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x0p+0)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x0p+0)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1p-1022)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1p-1022)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1p-1022)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1p-1)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1p-1)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1p-1)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1p-1)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1p+0)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1p+0)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1p+0)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1p+0)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -infinity)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const infinity)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -infinity)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const infinity)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const -nan) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "copysign" (f64.const nan) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000))) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x0p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x0p+0)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x1p-1022)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x1p-1)) (f64.const -0x1p-1)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x1p-1)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x1p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x1p+0)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "max" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "max" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "max" (f64.const -inf) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "max" (f64.const inf) (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "max" (f64.const -inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const inf) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const inf) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const inf) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const inf) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x0p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x0p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x0.0000000000001p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x1p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x1p-1022))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x1p-1))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x1p-1))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x1p+0))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x1p+0))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -inf))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -inf))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const inf))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const inf))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const -nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "max" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan) (f64.const -nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "max" (f64.const nan) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const nan))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan) (f64.const nan:0x4000000000000))) +(assert_return_arithmetic_nan (invoke "max" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000))) (assert_return (invoke "sqrt" (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "sqrt" (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return_nan (invoke "sqrt" (f64.const -0x0.0000000000001p-1022))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -0x0.0000000000001p-1022))) (assert_return (invoke "sqrt" (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-537)) -(assert_return_nan (invoke "sqrt" (f64.const -0x1p-1022))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -0x1p-1022))) (assert_return (invoke "sqrt" (f64.const 0x1p-1022)) (f64.const 0x1p-511)) -(assert_return_nan (invoke "sqrt" (f64.const -0x1p-1))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -0x1p-1))) (assert_return (invoke "sqrt" (f64.const 0x1p-1)) (f64.const 0x1.6a09e667f3bcdp-1)) -(assert_return_nan (invoke "sqrt" (f64.const -0x1p+0))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -0x1p+0))) (assert_return (invoke "sqrt" (f64.const 0x1p+0)) (f64.const 0x1p+0)) -(assert_return_nan (invoke "sqrt" (f64.const -0x1.921fb54442d18p+2))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -0x1.921fb54442d18p+2))) (assert_return (invoke "sqrt" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.40d931ff62705p+1)) -(assert_return_nan (invoke "sqrt" (f64.const -0x1.fffffffffffffp+1023))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -0x1.fffffffffffffp+1023))) (assert_return (invoke "sqrt" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+511)) -(assert_return_nan (invoke "sqrt" (f64.const -infinity))) -(assert_return (invoke "sqrt" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "sqrt" (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "sqrt" (f64.const nan)) (f64.const nan)) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -inf))) +(assert_return (invoke "sqrt" (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "sqrt" (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "sqrt" (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "sqrt" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "sqrt" (f64.const nan:0x4000000000000))) (assert_return (invoke "floor" (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "floor" (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "floor" (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+0)) @@ -2318,10 +2450,12 @@ (assert_return (invoke "floor" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.8p+2)) (assert_return (invoke "floor" (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "floor" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "floor" (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "floor" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "floor" (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "floor" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "floor" (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "floor" (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "floor" (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "floor" (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "floor" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "floor" (f64.const nan:0x4000000000000))) (assert_return (invoke "ceil" (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "ceil" (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "ceil" (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) @@ -2336,10 +2470,12 @@ (assert_return (invoke "ceil" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.cp+2)) (assert_return (invoke "ceil" (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "ceil" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "ceil" (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "ceil" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "ceil" (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "ceil" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "ceil" (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "ceil" (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "ceil" (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "ceil" (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "ceil" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "ceil" (f64.const nan:0x4000000000000))) (assert_return (invoke "trunc" (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "trunc" (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "trunc" (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) @@ -2354,10 +2490,12 @@ (assert_return (invoke "trunc" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.8p+2)) (assert_return (invoke "trunc" (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "trunc" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "trunc" (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "trunc" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "trunc" (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "trunc" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "trunc" (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "trunc" (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "trunc" (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "trunc" (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "trunc" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "trunc" (f64.const nan:0x4000000000000))) (assert_return (invoke "nearest" (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "nearest" (f64.const 0x0p+0)) (f64.const 0x0p+0)) (assert_return (invoke "nearest" (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) @@ -2372,43 +2510,24 @@ (assert_return (invoke "nearest" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.8p+2)) (assert_return (invoke "nearest" (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) (assert_return (invoke "nearest" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "nearest" (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "nearest" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "nearest" (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "nearest" (f64.const nan)) (f64.const nan)) -(assert_return (invoke "abs" (f64.const -0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "abs" (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "abs" (f64.const -0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "abs" (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "abs" (f64.const -0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "abs" (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "abs" (f64.const -0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "abs" (f64.const 0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "abs" (f64.const -0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "abs" (f64.const 0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "abs" (f64.const -0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "abs" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "abs" (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "abs" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "abs" (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "abs" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "abs" (f64.const -nan)) (f64.const nan)) -(assert_return (invoke "abs" (f64.const nan)) (f64.const nan)) -(assert_return (invoke "neg" (f64.const -0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "neg" (f64.const 0x0p+0)) (f64.const -0x0p+0)) -(assert_return (invoke "neg" (f64.const -0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) -(assert_return (invoke "neg" (f64.const 0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) -(assert_return (invoke "neg" (f64.const -0x1p-1022)) (f64.const 0x1p-1022)) -(assert_return (invoke "neg" (f64.const 0x1p-1022)) (f64.const -0x1p-1022)) -(assert_return (invoke "neg" (f64.const -0x1p-1)) (f64.const 0x1p-1)) -(assert_return (invoke "neg" (f64.const 0x1p-1)) (f64.const -0x1p-1)) -(assert_return (invoke "neg" (f64.const -0x1p+0)) (f64.const 0x1p+0)) -(assert_return (invoke "neg" (f64.const 0x1p+0)) (f64.const -0x1p+0)) -(assert_return (invoke "neg" (f64.const -0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) -(assert_return (invoke "neg" (f64.const 0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) -(assert_return (invoke "neg" (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) -(assert_return (invoke "neg" (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) -(assert_return (invoke "neg" (f64.const -infinity)) (f64.const infinity)) -(assert_return (invoke "neg" (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "neg" (f64.const -nan)) (f64.const nan)) -(assert_return (invoke "neg" (f64.const nan)) (f64.const -nan)) +(assert_return (invoke "nearest" (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "nearest" (f64.const inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "nearest" (f64.const -nan))) +(assert_return_arithmetic_nan (invoke "nearest" (f64.const -nan:0x4000000000000))) +(assert_return_canonical_nan (invoke "nearest" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "nearest" (f64.const nan:0x4000000000000))) + + +;; Type check + +(assert_invalid (module (func (result f64) (f64.add (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.div (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.max (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.min (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.mul (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.sub (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.ceil (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.floor (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.nearest (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.sqrt (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.trunc (i64.const 0)))) "type mismatch") diff --git a/test/spec/f64_bitwise.wast b/test/spec/f64_bitwise.wast new file mode 100644 index 000000000..f268a3e18 --- /dev/null +++ b/test/spec/f64_bitwise.wast @@ -0,0 +1,376 @@ +;; Test all the f64 bitwise operators on major boundary values and all special +;; values. + +(module + (func (export "abs") (param $x f64) (result f64) (f64.abs (local.get $x))) + (func (export "neg") (param $x f64) (result f64) (f64.neg (local.get $x))) + (func (export "copysign") (param $x f64) (param $y f64) (result f64) (f64.copysign (local.get $x) (local.get $y))) +) + +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x0p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1p-1022)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1p-1022)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1p-1022)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1p-1022)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1p-1)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1p-1)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1p-1)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1p-1)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -inf)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const inf)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const -nan)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0p+0) (f64.const nan)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const -nan)) (f64.const -0x0p+0)) +(assert_return (invoke "copysign" (f64.const 0x0p+0) (f64.const nan)) (f64.const 0x0p+0)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0p+0)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p-1)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1p-1)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1p-1)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1p-1)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1p+0)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1p+0)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1p+0)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1p+0)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x0p+0)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1p-1)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1p-1)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1p-1)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1p-1)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1p+0)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1p+0)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1p+0)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1p+0)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -inf)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const inf)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -inf)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const inf)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const -nan)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1022) (f64.const nan)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const -nan)) (f64.const -0x1p-1022)) +(assert_return (invoke "copysign" (f64.const 0x1p-1022) (f64.const nan)) (f64.const 0x1p-1022)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x0p+0)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x0p+0)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x0p+0)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1p-1022)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1p-1022)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1p-1022)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1p-1022)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1p-1)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1p-1)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1p+0)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1p+0)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1p+0)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1p+0)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -inf)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const inf)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -inf)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const inf)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const -nan)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p-1) (f64.const nan)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const -nan)) (f64.const -0x1p-1)) +(assert_return (invoke "copysign" (f64.const 0x1p-1) (f64.const nan)) (f64.const 0x1p-1)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x0p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x0p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x0p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1p-1022)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1p-1022)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1p-1022)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1p-1022)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1p-1)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1p-1)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1p-1)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1p-1)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -inf)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const inf)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -inf)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const inf)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const -nan)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1p+0) (f64.const nan)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const -nan)) (f64.const -0x1p+0)) +(assert_return (invoke "copysign" (f64.const 0x1p+0) (f64.const nan)) (f64.const 0x1p+0)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1022)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p-1022)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p-1)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p-1)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p-1)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p-1)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1p+0)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1p+0)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1p+0)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1p+0)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0.0000000000001p-1022)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1022)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1022)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p-1)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p-1)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1p+0)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p+0)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.921fb54442d18p+2)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x0p+0)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x0p+0)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x1p-1022)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x1p-1022)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x1p-1)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x1p-1)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x1p+0)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x1p+0)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const inf)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const -nan)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const -inf) (f64.const nan)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const -nan)) (f64.const -inf)) +(assert_return (invoke "copysign" (f64.const inf) (f64.const nan)) (f64.const inf)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x0p+0)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x0p+0)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x0p+0)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x0p+0)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1p-1022)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1p-1022)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1p-1022)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1p-1022)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1p-1)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1p-1)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1p-1)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1p-1)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1p+0)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1p+0)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1p+0)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1p+0)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -inf)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const inf)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -inf)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const inf)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const -nan) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const -nan)) (f64.const -nan)) +(assert_return (invoke "copysign" (f64.const nan) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "abs" (f64.const -0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "abs" (f64.const 0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "abs" (f64.const -0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "abs" (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "abs" (f64.const -0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "abs" (f64.const 0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "abs" (f64.const -0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "abs" (f64.const 0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "abs" (f64.const -0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "abs" (f64.const 0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "abs" (f64.const -0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "abs" (f64.const 0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "abs" (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "abs" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "abs" (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "abs" (f64.const inf)) (f64.const inf)) +(assert_return (invoke "abs" (f64.const -nan)) (f64.const nan)) +(assert_return (invoke "abs" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "neg" (f64.const -0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "neg" (f64.const 0x0p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "neg" (f64.const -0x0.0000000000001p-1022)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "neg" (f64.const 0x0.0000000000001p-1022)) (f64.const -0x0.0000000000001p-1022)) +(assert_return (invoke "neg" (f64.const -0x1p-1022)) (f64.const 0x1p-1022)) +(assert_return (invoke "neg" (f64.const 0x1p-1022)) (f64.const -0x1p-1022)) +(assert_return (invoke "neg" (f64.const -0x1p-1)) (f64.const 0x1p-1)) +(assert_return (invoke "neg" (f64.const 0x1p-1)) (f64.const -0x1p-1)) +(assert_return (invoke "neg" (f64.const -0x1p+0)) (f64.const 0x1p+0)) +(assert_return (invoke "neg" (f64.const 0x1p+0)) (f64.const -0x1p+0)) +(assert_return (invoke "neg" (f64.const -0x1.921fb54442d18p+2)) (f64.const 0x1.921fb54442d18p+2)) +(assert_return (invoke "neg" (f64.const 0x1.921fb54442d18p+2)) (f64.const -0x1.921fb54442d18p+2)) +(assert_return (invoke "neg" (f64.const -0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "neg" (f64.const 0x1.fffffffffffffp+1023)) (f64.const -0x1.fffffffffffffp+1023)) +(assert_return (invoke "neg" (f64.const -inf)) (f64.const inf)) +(assert_return (invoke "neg" (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "neg" (f64.const -nan)) (f64.const nan)) +(assert_return (invoke "neg" (f64.const nan)) (f64.const -nan)) + + +;; Type check + +(assert_invalid (module (func (result f64) (f64.copysign (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.abs (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.neg (i64.const 0)))) "type mismatch") diff --git a/test/spec/f64_cmp.wast b/test/spec/f64_cmp.wast index aa9ac90cf..dd79929d2 100644 --- a/test/spec/f64_cmp.wast +++ b/test/spec/f64_cmp.wast @@ -38,14 +38,18 @@ (assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 0)) @@ -74,14 +78,18 @@ (assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (i32.const 0)) @@ -110,14 +118,18 @@ (assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const -0x0p+0)) (i32.const 0)) @@ -146,14 +158,18 @@ (assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const -0x0p+0)) (i32.const 0)) @@ -182,14 +198,18 @@ (assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 0)) @@ -218,14 +238,18 @@ (assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 0)) @@ -254,86 +278,138 @@ (assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x1p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x1p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x1p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x1p-1022)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -infinity) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const infinity) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -inf) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const inf) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const -nan) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "eq" (f64.const nan) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const inf)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const -nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "eq" (f64.const nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const -0x0p+0)) (i32.const 0)) @@ -362,14 +438,18 @@ (assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 1)) @@ -398,14 +478,18 @@ (assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (i32.const 1)) @@ -434,14 +518,18 @@ (assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const -0x0p+0)) (i32.const 1)) @@ -470,14 +558,18 @@ (assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const -0x0p+0)) (i32.const 1)) @@ -506,14 +598,18 @@ (assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 1)) @@ -542,14 +638,18 @@ (assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 1)) @@ -578,86 +678,138 @@ (assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x1p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x1p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x1p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x1p-1022)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const -nan)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -infinity) (f64.const nan)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const -nan)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const infinity) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const -nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -inf) (f64.const nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const -nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const inf) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -nan) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const -nan) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const nan) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ne" (f64.const nan) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const inf)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan) (f64.const -nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const -nan) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan) (f64.const nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan) (f64.const -nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "ne" (f64.const nan) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan) (f64.const nan:0x4000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const -0x0p+0)) (i32.const 0)) @@ -686,14 +838,18 @@ (assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 0)) @@ -722,14 +878,18 @@ (assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (i32.const 0)) @@ -758,14 +918,18 @@ (assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const -0x0p+0)) (i32.const 0)) @@ -794,14 +958,18 @@ (assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const -0x0p+0)) (i32.const 0)) @@ -830,14 +998,18 @@ (assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 0)) @@ -866,14 +1038,18 @@ (assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 0)) @@ -902,86 +1078,138 @@ (assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 1)) (assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x1p-1022)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x1p-1022)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x1p-1022)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x1p-1022)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -infinity) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const infinity) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -inf) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const inf) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const -nan) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "lt" (f64.const nan) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const inf)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const -nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "lt" (f64.const nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "lt" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x0p+0) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x0p+0) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x0p+0) (f64.const -0x0p+0)) (i32.const 1)) @@ -1010,14 +1238,18 @@ (assert_return (invoke "le" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x0p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x0p+0) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x0p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x0p+0) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x0p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x0p+0) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x0p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x0p+0) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 0)) @@ -1046,14 +1278,18 @@ (assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (i32.const 0)) @@ -1082,14 +1318,18 @@ (assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1p-1) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1p-1) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1p-1) (f64.const -0x0p+0)) (i32.const 0)) @@ -1118,14 +1358,18 @@ (assert_return (invoke "le" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x1p-1) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x1p-1) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x1p-1) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x1p-1) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x1p-1) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p-1) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x1p-1) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p-1) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1p+0) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1p+0) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1p+0) (f64.const -0x0p+0)) (i32.const 0)) @@ -1154,14 +1398,18 @@ (assert_return (invoke "le" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x1p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x1p+0) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x1p+0) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x1p+0) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x1p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p+0) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x1p+0) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p+0) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 0)) @@ -1190,14 +1438,18 @@ (assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 0)) @@ -1226,86 +1478,138 @@ (assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 1)) (assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x1p-1022)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x1p-1022)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x1p-1022)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x1p-1022)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -infinity) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "le" (f64.const infinity) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const inf) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -inf) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const inf) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const -nan) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "le" (f64.const nan) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const inf)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const -nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "le" (f64.const nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "le" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const -0x0p+0)) (i32.const 0)) @@ -1334,14 +1638,18 @@ (assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 1)) @@ -1370,14 +1678,18 @@ (assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (i32.const 1)) @@ -1406,14 +1718,18 @@ (assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const -0x0p+0)) (i32.const 1)) @@ -1442,14 +1758,18 @@ (assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const -0x0p+0)) (i32.const 1)) @@ -1478,14 +1798,18 @@ (assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 1)) @@ -1514,14 +1838,18 @@ (assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 1)) @@ -1550,86 +1878,138 @@ (assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x1p-1022)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x1p-1022)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x1p-1022)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x1p-1022)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -infinity) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const infinity) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "gt" (f64.const inf) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -inf) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const inf) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const -nan) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "gt" (f64.const nan) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const inf)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const -nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "gt" (f64.const nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "gt" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const -0x0p+0)) (i32.const 1)) (assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const 0x0p+0)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const -0x0p+0)) (i32.const 1)) @@ -1658,14 +2038,18 @@ (assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x0p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const -0x0p+0)) (i32.const 1)) @@ -1694,14 +2078,18 @@ (assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x0.0000000000001p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const -0x0p+0)) (i32.const 1)) @@ -1730,14 +2118,18 @@ (assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p-1022) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const -0x0p+0)) (i32.const 1)) @@ -1766,14 +2158,18 @@ (assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p-1) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const -0x0p+0)) (i32.const 1)) @@ -1802,14 +2198,18 @@ (assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1p+0) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x0p+0)) (i32.const 1)) @@ -1838,14 +2238,18 @@ (assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1.921fb54442d18p+2) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x0p+0)) (i32.const 1)) @@ -1874,83 +2278,145 @@ (assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) (assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x0p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x0p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x0p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x0p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x1p-1022)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x1p-1022)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x1p-1022)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x1p-1022)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x1p-1)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x1p-1)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x1p-1)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x1p-1)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x1p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x1p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x1p+0)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const infinity)) (i32.const 1)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -infinity) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const -nan)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const infinity) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const 0x1.fffffffffffffp+1023) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x0p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x0p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x0.0000000000001p-1022)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x1p-1022)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x1p-1)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x1p-1)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x1p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x1.921fb54442d18p+2)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const inf) (f64.const inf)) (i32.const 1)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -inf) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const inf) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x0p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x0p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x1p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x1p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x1p-1022)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x1p-1022)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x1p-1)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x1p-1)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x1p+0)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x1p+0)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x1.921fb54442d18p+2)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -0x1.fffffffffffffp+1023)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const -nan) (f64.const infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const nan) (f64.const -infinity)) (i32.const 0)) -(assert_return (invoke "ge" (f64.const nan) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const 0x1.fffffffffffffp+1023)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan) (f64.const inf)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const inf)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const -nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const -nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan) (f64.const -nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const -nan:0x4000000000000)) (i32.const 0)) (assert_return (invoke "ge" (f64.const nan) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan) (f64.const nan:0x4000000000000)) (i32.const 0)) +(assert_return (invoke "ge" (f64.const nan:0x4000000000000) (f64.const nan:0x4000000000000)) (i32.const 0)) + + +;; Type check + +(assert_invalid (module (func (result f64) (f64.eq (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.ge (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.gt (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.le (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.lt (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result f64) (f64.ne (i64.const 0) (f32.const 0)))) "type mismatch") diff --git a/test/spec/fac.wast b/test/spec/fac.wast index a9e437be2..ef10991a8 100644 --- a/test/spec/fac.wast +++ b/test/spec/fac.wast @@ -1,19 +1,23 @@ (module ;; Recursive factorial (func (export "fac-rec") (param i64) (result i64) - (if i64 (i64.eq (local.get 0) (i64.const 0)) - (i64.const 1) - (i64.mul (local.get 0) (call 0 (i64.sub (local.get 0) (i64.const 1)))) + (if (result i64) (i64.eq (local.get 0) (i64.const 0)) + (then (i64.const 1)) + (else + (i64.mul (local.get 0) (call 0 (i64.sub (local.get 0) (i64.const 1)))) + ) ) ) ;; Recursive factorial named (func $fac-rec-named (export "fac-rec-named") (param $n i64) (result i64) - (if i64 (i64.eq (local.get $n) (i64.const 0)) - (i64.const 1) - (i64.mul - (local.get $n) - (call $fac-rec-named (i64.sub (local.get $n) (i64.const 1))) + (if (result i64) (i64.eq (local.get $n) (i64.const 0)) + (then (i64.const 1)) + (else + (i64.mul + (local.get $n) + (call $fac-rec-named (i64.sub (local.get $n) (i64.const 1))) + ) ) ) ) @@ -27,8 +31,8 @@ (loop (if (i64.eq (local.get 1) (i64.const 0)) - (br 2) - (block + (then (br 2)) + (else (local.set 2 (i64.mul (local.get 1) (local.get 2))) (local.set 1 (i64.sub (local.get 1) (i64.const 1))) ) @@ -49,8 +53,8 @@ (loop $loop (if (i64.eq (local.get $i) (i64.const 0)) - (br $done) - (block + (then (br $done)) + (else (local.set $res (i64.mul (local.get $i) (local.get $res))) (local.set $i (i64.sub (local.get $i) (i64.const 1))) ) @@ -82,4 +86,4 @@ (assert_return (invoke "fac-rec-named" (i64.const 25)) (i64.const 7034535277573963776)) (assert_return (invoke "fac-iter-named" (i64.const 25)) (i64.const 7034535277573963776)) (assert_return (invoke "fac-opt" (i64.const 25)) (i64.const 7034535277573963776)) -(assert_trap (invoke "fac-rec" (i64.const 1073741824)) "call stack exhausted") +(assert_exhaustion (invoke "fac-rec" (i64.const 1073741824)) "call stack exhausted") diff --git a/test/spec/float_exprs.wast b/test/spec/float_exprs.wast index 7900832b0..e6583634f 100644 --- a/test/spec/float_exprs.wast +++ b/test/spec/float_exprs.wast @@ -46,8 +46,8 @@ (assert_return (invoke "f32.no_fold_add_zero" (f32.const -0.0)) (f32.const 0.0)) (assert_return (invoke "f64.no_fold_add_zero" (f64.const -0.0)) (f64.const 0.0)) -(assert_return (invoke "f32.no_fold_add_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_add_zero" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_add_zero" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_add_zero" (f64.const nan:0x4000000000000))) ;; Test that 0.0 - x is not folded to -x. @@ -60,8 +60,8 @@ (assert_return (invoke "f32.no_fold_zero_sub" (f32.const 0.0)) (f32.const 0.0)) (assert_return (invoke "f64.no_fold_zero_sub" (f64.const 0.0)) (f64.const 0.0)) -(assert_return (invoke "f32.no_fold_zero_sub" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_zero_sub" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_zero_sub" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_zero_sub" (f64.const nan:0x4000000000000))) ;; Test that x - 0.0 is not folded to x. @@ -72,8 +72,8 @@ (f64.sub (local.get $x) (f64.const 0.0))) ) -(assert_return (invoke "f32.no_fold_sub_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_sub_zero" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_sub_zero" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_sub_zero" (f64.const nan:0x4000000000000))) ;; Test that x*0.0 is not folded to 0.0. @@ -87,11 +87,11 @@ (assert_return (invoke "f32.no_fold_mul_zero" (f32.const -0.0)) (f32.const -0.0)) (assert_return (invoke "f32.no_fold_mul_zero" (f32.const -1.0)) (f32.const -0.0)) (assert_return (invoke "f32.no_fold_mul_zero" (f32.const -2.0)) (f32.const -0.0)) -(assert_return (invoke "f32.no_fold_mul_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_mul_zero" (f32.const nan:0x200000))) (assert_return (invoke "f64.no_fold_mul_zero" (f64.const -0.0)) (f64.const -0.0)) (assert_return (invoke "f64.no_fold_mul_zero" (f64.const -1.0)) (f64.const -0.0)) (assert_return (invoke "f64.no_fold_mul_zero" (f64.const -2.0)) (f64.const -0.0)) -(assert_return (invoke "f64.no_fold_mul_zero" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f64.no_fold_mul_zero" (f64.const nan:0x4000000000000))) ;; Test that x*1.0 is not folded to x. ;; See IEEE 754-2008 10.4 "Literal meaning and value-changing optimizations". @@ -103,8 +103,8 @@ (f64.mul (local.get $x) (f64.const 1.0))) ) -(assert_return (invoke "f32.no_fold_mul_one" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_mul_one" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_mul_one" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_mul_one" (f64.const nan:0x4000000000000))) ;; Test that 0.0/x is not folded to 0.0. @@ -115,14 +115,14 @@ (f64.div (f64.const 0.0) (local.get $x))) ) -(assert_return_nan (invoke "f32.no_fold_zero_div" (f32.const 0.0))) -(assert_return_nan (invoke "f32.no_fold_zero_div" (f32.const -0.0))) -(assert_return (invoke "f32.no_fold_zero_div" (f32.const nan)) (f32.const nan)) -(assert_return (invoke "f32.no_fold_zero_div" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return_nan (invoke "f64.no_fold_zero_div" (f64.const 0.0))) -(assert_return_nan (invoke "f64.no_fold_zero_div" (f64.const -0.0))) -(assert_return (invoke "f64.no_fold_zero_div" (f64.const nan)) (f64.const nan)) -(assert_return (invoke "f64.no_fold_zero_div" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_canonical_nan (invoke "f32.no_fold_zero_div" (f32.const 0.0))) +(assert_return_canonical_nan (invoke "f32.no_fold_zero_div" (f32.const -0.0))) +(assert_return_canonical_nan (invoke "f32.no_fold_zero_div" (f32.const nan))) +(assert_return_arithmetic_nan (invoke "f32.no_fold_zero_div" (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "f64.no_fold_zero_div" (f64.const 0.0))) +(assert_return_canonical_nan (invoke "f64.no_fold_zero_div" (f64.const -0.0))) +(assert_return_canonical_nan (invoke "f64.no_fold_zero_div" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_zero_div" (f64.const nan:0x4000000000000))) ;; Test that x/1.0 is not folded to x. @@ -133,8 +133,8 @@ (f64.div (local.get $x) (f64.const 1.0))) ) -(assert_return (invoke "f32.no_fold_div_one" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_div_one" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_div_one" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_div_one" (f64.const nan:0x4000000000000))) ;; Test that x/-1.0 is not folded to -x. @@ -145,8 +145,8 @@ (f64.div (local.get $x) (f64.const -1.0))) ) -(assert_return (invoke "f32.no_fold_div_neg1" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_div_neg1" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_div_neg1" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_div_neg1" (f64.const nan:0x4000000000000))) ;; Test that -0.0 - x is not folded to -x. @@ -157,8 +157,8 @@ (f64.sub (f64.const -0.0) (local.get $x))) ) -(assert_return (invoke "f32.no_fold_neg0_sub" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_neg0_sub" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_neg0_sub" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_neg0_sub" (f64.const nan:0x4000000000000))) ;; Test that -1.0 * x is not folded to -x. @@ -169,8 +169,8 @@ (f64.mul (f64.const -1.0) (local.get $x))) ) -(assert_return (invoke "f32.no_fold_neg1_mul" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.no_fold_neg1_mul" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return_arithmetic_nan (invoke "f32.no_fold_neg1_mul" (f32.const nan:0x200000))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_neg1_mul" (f64.const nan:0x4000000000000))) ;; Test that x == x is not folded to true. @@ -205,10 +205,28 @@ (f64.sub (local.get $x) (local.get $x))) ) -(assert_return_nan (invoke "f32.no_fold_sub_self" (f32.const infinity))) -(assert_return (invoke "f32.no_fold_sub_self" (f32.const nan)) (f32.const nan)) -(assert_return_nan (invoke "f64.no_fold_sub_self" (f64.const infinity))) -(assert_return (invoke "f64.no_fold_sub_self" (f64.const nan)) (f64.const nan)) +(assert_return_canonical_nan (invoke "f32.no_fold_sub_self" (f32.const inf))) +(assert_return_canonical_nan (invoke "f32.no_fold_sub_self" (f32.const nan))) +(assert_return_canonical_nan (invoke "f64.no_fold_sub_self" (f64.const inf))) +(assert_return_canonical_nan (invoke "f64.no_fold_sub_self" (f64.const nan))) + +;; Test that x / x is not folded to 1.0. + +(module + (func (export "f32.no_fold_div_self") (param $x f32) (result f32) + (f32.div (local.get $x) (local.get $x))) + (func (export "f64.no_fold_div_self") (param $x f64) (result f64) + (f64.div (local.get $x) (local.get $x))) +) + +(assert_return_canonical_nan (invoke "f32.no_fold_div_self" (f32.const inf))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_self" (f32.const nan))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_self" (f32.const 0.0))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_self" (f32.const -0.0))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_self" (f64.const inf))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_self" (f64.const nan))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_self" (f64.const 0.0))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_self" (f64.const -0.0))) ;; Test that x/3 is not folded to x*(1/3). @@ -230,7 +248,7 @@ (assert_return (invoke "f64.no_fold_div_3" (f64.const -0x1.0138bf530a53cp+1007)) (f64.const -0x1.56f6546eb86fbp+1005)) (assert_return (invoke "f64.no_fold_div_3" (f64.const 0x1.052b87f9d794dp+415)) (f64.const 0x1.5c3a0aa274c67p+413)) -;; Test that (x*z)+(y*z) is not folded to (x+y)*z +;; Test that (x*z)+(y*z) is not folded to (x+y)*z. (module (func (export "f32.no_factor") (param $x f32) (param $y f32) (param $z f32) (result f32) @@ -250,7 +268,7 @@ (assert_return (invoke "f64.no_factor" (f64.const -0x1.c4ded58a6f389p-289) (f64.const 0x1.ba6fdef5d59c9p-260) (f64.const -0x1.c1201c0470205p-253)) (f64.const -0x1.841ada2e0f184p-512)) (assert_return (invoke "f64.no_factor" (f64.const 0x1.9d3688f8e375ap-608) (f64.const 0x1.bf91311588256p-579) (f64.const -0x1.1605a6b5d5ff8p+489)) (f64.const -0x1.e6118ca76af53p-90)) -;; Test that (x+y)*z is not folded to (x*z)+(y*z) +;; Test that (x+y)*z is not folded to (x*z)+(y*z). (module (func (export "f32.no_distribute") (param $x f32) (param $y f32) (param $z f32) (result f32) @@ -270,7 +288,7 @@ (assert_return (invoke "f64.no_distribute" (f64.const -0x1.c4ded58a6f389p-289) (f64.const 0x1.ba6fdef5d59c9p-260) (f64.const -0x1.c1201c0470205p-253)) (f64.const -0x1.841ada2e0f183p-512)) (assert_return (invoke "f64.no_distribute" (f64.const 0x1.9d3688f8e375ap-608) (f64.const 0x1.bf91311588256p-579) (f64.const -0x1.1605a6b5d5ff8p+489)) (f64.const -0x1.e6118ca76af52p-90)) -;; Test that x*(y/z) is not folded to (x*y)/z +;; Test that x*(y/z) is not folded to (x*y)/z. (module (func (export "f32.no_regroup_div_mul") (param $x f32) (param $y f32) (param $z f32) (result f32) @@ -286,11 +304,11 @@ (assert_return (invoke "f32.no_regroup_div_mul" (f32.const 0x1.c6ae76p+112) (f32.const 0x1.fc953cp+24) (f32.const -0x1.60b3e8p+71)) (f32.const -0x1.47d0eap+66)) (assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.3c04b815e30bp-423) (f64.const -0x1.379646fd98127p-119) (f64.const 0x1.bddb158506031p-642)) (f64.const -0x1.b9b3301f2dd2dp+99)) (assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.46b3a402f86d5p+337) (f64.const 0x1.6fbf1b9e1798dp-447) (f64.const -0x1.bd9704a5a6a06p+797)) (f64.const -0x0p+0)) -(assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.6c9765bb4347fp-479) (f64.const 0x1.a4af42e34a141p+902) (f64.const 0x1.d2dde70eb68f9p-448)) (f64.const infinity)) +(assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.6c9765bb4347fp-479) (f64.const 0x1.a4af42e34a141p+902) (f64.const 0x1.d2dde70eb68f9p-448)) (f64.const inf)) (assert_return (invoke "f64.no_regroup_div_mul" (f64.const -0x1.706023645be72p+480) (f64.const -0x1.6c229f7d9101dp+611) (f64.const -0x1.4d50fa68d3d9ep+836)) (f64.const -0x1.926fa3cacc651p+255)) (assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.8cc63d8caf4c7p-599) (f64.const 0x1.8671ac4c35753p-878) (f64.const -0x1.ef35b1695e659p-838)) (f64.const -0x1.38d55f56406dp-639)) -;; Test that (x*y)/z is not folded to x*(y/z) +;; Test that (x*y)/z is not folded to x*(y/z). (module (func (export "f32.no_regroup_mul_div") (param $x f32) (param $y f32) (param $z f32) (result f32) @@ -303,11 +321,11 @@ (assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.454738p+91) (f32.const -0x1.b28a66p-115) (f32.const -0x1.f53908p+72)) (f32.const -0x1.1a00e8p-96)) (assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.6be56ep+16) (f32.const -0x1.b46fc6p-21) (f32.const -0x1.a51df6p-123)) (f32.const -0x1.79225ap+118)) (assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.c343f8p-94) (f32.const 0x1.e4d906p+73) (f32.const 0x1.be69f8p+68)) (f32.const -0x1.ea1df4p-89)) -(assert_return (invoke "f32.no_regroup_mul_div" (f32.const 0x1.c6ae76p+112) (f32.const 0x1.fc953cp+24) (f32.const -0x1.60b3e8p+71)) (f32.const -infinity)) +(assert_return (invoke "f32.no_regroup_mul_div" (f32.const 0x1.c6ae76p+112) (f32.const 0x1.fc953cp+24) (f32.const -0x1.60b3e8p+71)) (f32.const -inf)) (assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.3c04b815e30bp-423) (f64.const -0x1.379646fd98127p-119) (f64.const 0x1.bddb158506031p-642)) (f64.const -0x1.b9b3301f2dd2ep+99)) (assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.46b3a402f86d5p+337) (f64.const 0x1.6fbf1b9e1798dp-447) (f64.const -0x1.bd9704a5a6a06p+797)) (f64.const -0x1.0da0b6328e09p-907)) (assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.6c9765bb4347fp-479) (f64.const 0x1.a4af42e34a141p+902) (f64.const 0x1.d2dde70eb68f9p-448)) (f64.const 0x1.4886b6d9a9a79p+871)) -(assert_return (invoke "f64.no_regroup_mul_div" (f64.const -0x1.706023645be72p+480) (f64.const -0x1.6c229f7d9101dp+611) (f64.const -0x1.4d50fa68d3d9ep+836)) (f64.const -infinity)) +(assert_return (invoke "f64.no_regroup_mul_div" (f64.const -0x1.706023645be72p+480) (f64.const -0x1.6c229f7d9101dp+611) (f64.const -0x1.4d50fa68d3d9ep+836)) (f64.const -inf)) (assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.8cc63d8caf4c7p-599) (f64.const 0x1.8671ac4c35753p-878) (f64.const -0x1.ef35b1695e659p-838)) (f64.const -0x0p+0)) ;; Test that x+y+z+w is not reassociated. @@ -359,22 +377,22 @@ (f64.div (local.get $x) (f64.const 0.0))) ) -(assert_return (invoke "f32.no_fold_div_0" (f32.const 1.0)) (f32.const infinity)) -(assert_return (invoke "f32.no_fold_div_0" (f32.const -1.0)) (f32.const -infinity)) -(assert_return (invoke "f32.no_fold_div_0" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "f32.no_fold_div_0" (f32.const -infinity)) (f32.const -infinity)) -(assert_return_nan (invoke "f32.no_fold_div_0" (f32.const 0))) -(assert_return_nan (invoke "f32.no_fold_div_0" (f32.const -0))) -(assert_return (invoke "f32.no_fold_div_0" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f32.no_fold_div_0" (f32.const nan)) (f32.const nan)) -(assert_return (invoke "f64.no_fold_div_0" (f64.const 1.0)) (f64.const infinity)) -(assert_return (invoke "f64.no_fold_div_0" (f64.const -1.0)) (f64.const -infinity)) -(assert_return (invoke "f64.no_fold_div_0" (f64.const infinity)) (f64.const infinity)) -(assert_return (invoke "f64.no_fold_div_0" (f64.const -infinity)) (f64.const -infinity)) -(assert_return_nan (invoke "f64.no_fold_div_0" (f64.const 0))) -(assert_return_nan (invoke "f64.no_fold_div_0" (f64.const -0))) -(assert_return (invoke "f64.no_fold_div_0" (f64.const nan)) (f64.const nan)) -(assert_return (invoke "f64.no_fold_div_0" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const 1.0)) (f32.const inf)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const -1.0)) (f32.const -inf)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const inf)) (f32.const inf)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const -inf)) (f32.const -inf)) +(assert_return_canonical_nan (invoke "f32.no_fold_div_0" (f32.const 0))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_0" (f32.const -0))) +(assert_return_arithmetic_nan (invoke "f32.no_fold_div_0" (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_0" (f32.const nan))) +(assert_return (invoke "f64.no_fold_div_0" (f64.const 1.0)) (f64.const inf)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const -1.0)) (f64.const -inf)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const inf)) (f64.const inf)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const -inf)) (f64.const -inf)) +(assert_return_canonical_nan (invoke "f64.no_fold_div_0" (f64.const 0))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_0" (f64.const -0))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_0" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_div_0" (f64.const nan:0x4000000000000))) ;; Test that x/-0 is not folded away. @@ -385,22 +403,22 @@ (f64.div (local.get $x) (f64.const -0.0))) ) -(assert_return (invoke "f32.no_fold_div_neg0" (f32.const 1.0)) (f32.const -infinity)) -(assert_return (invoke "f32.no_fold_div_neg0" (f32.const -1.0)) (f32.const infinity)) -(assert_return (invoke "f32.no_fold_div_neg0" (f32.const infinity)) (f32.const -infinity)) -(assert_return (invoke "f32.no_fold_div_neg0" (f32.const -infinity)) (f32.const infinity)) -(assert_return_nan (invoke "f32.no_fold_div_neg0" (f32.const 0))) -(assert_return_nan (invoke "f32.no_fold_div_neg0" (f32.const -0))) -(assert_return (invoke "f32.no_fold_div_neg0" (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f32.no_fold_div_neg0" (f32.const nan)) (f32.const nan)) -(assert_return (invoke "f64.no_fold_div_neg0" (f64.const 1.0)) (f64.const -infinity)) -(assert_return (invoke "f64.no_fold_div_neg0" (f64.const -1.0)) (f64.const infinity)) -(assert_return (invoke "f64.no_fold_div_neg0" (f64.const infinity)) (f64.const -infinity)) -(assert_return (invoke "f64.no_fold_div_neg0" (f64.const -infinity)) (f64.const infinity)) -(assert_return_nan (invoke "f64.no_fold_div_neg0" (f64.const 0))) -(assert_return_nan (invoke "f64.no_fold_div_neg0" (f64.const -0))) -(assert_return (invoke "f64.no_fold_div_neg0" (f64.const nan)) (f64.const nan)) -(assert_return (invoke "f64.no_fold_div_neg0" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const 1.0)) (f32.const -inf)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const -1.0)) (f32.const inf)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const inf)) (f32.const -inf)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const -inf)) (f32.const inf)) +(assert_return_canonical_nan (invoke "f32.no_fold_div_neg0" (f32.const 0))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_neg0" (f32.const -0))) +(assert_return_arithmetic_nan (invoke "f32.no_fold_div_neg0" (f32.const nan:0x200000))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_neg0" (f32.const nan))) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const 1.0)) (f64.const -inf)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const -1.0)) (f64.const inf)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const inf)) (f64.const -inf)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const -inf)) (f64.const inf)) +(assert_return_canonical_nan (invoke "f64.no_fold_div_neg0" (f64.const 0))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_neg0" (f64.const -0))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_neg0" (f64.const nan))) +(assert_return_arithmetic_nan (invoke "f64.no_fold_div_neg0" (f64.const nan:0x4000000000000))) ;; Test that sqrt(x*x+y*y) is not folded to hypot. @@ -471,7 +489,7 @@ (assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.ba4c5p+13)) (f32.const 0x1.136f16p-7)) (assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.4a5be2p+104)) (f32.const 0x1.c2b5bp-53)) -;; Test that converting i32/i64 to f32/f64 and back isn't folded away +;; Test that converting i32/i64 to f32/f64 and back isn't folded away. (module (func (export "i32.no_fold_f32_s") (param i32) (result i32) @@ -584,6 +602,18 @@ (assert_return (invoke "f64.no_fold_div_mul" (f64.const -0x1.e75859d2f0765p-278) (f64.const -0x1.5f19b6ab497f9p+283)) (f64.const -0x1.e75859d2f0764p-278)) (assert_return (invoke "f64.no_fold_div_mul" (f64.const -0x1.515fe9c3b5f5p+620) (f64.const 0x1.36be869c99f7ap+989)) (f64.const -0x1.515fe9c3b5f4fp+620)) +;; Test that x/2*2 is not folded to x. + +(module + (func (export "f32.no_fold_div2_mul2") (param $x f32) (result f32) + (f32.mul (f32.div (local.get $x) (f32.const 2.0)) (f32.const 2.0))) + (func (export "f64.no_fold_div2_mul2") (param $x f64) (result f64) + (f64.mul (f64.div (local.get $x) (f64.const 2.0)) (f64.const 2.0))) +) + +(assert_return (invoke "f32.no_fold_div2_mul2" (f32.const 0x1.fffffep-126)) (f32.const 0x1p-125)) +(assert_return (invoke "f64.no_fold_div2_mul2" (f64.const 0x1.fffffffffffffp-1022)) (f64.const 0x1p-1021)) + ;; Test that promote(demote(x)) is not folded to x. (module @@ -605,7 +635,7 @@ (f32.demote_f64 (f64.promote_f32 (local.get $x)))) ) -(assert_return (invoke "no_fold_promote_demote" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return_arithmetic_nan (invoke "no_fold_promote_demote" (f32.const nan:0x200000))) (assert_return (invoke "no_fold_promote_demote" (f32.const 0x0p+0)) (f32.const 0x0p+0)) (assert_return (invoke "no_fold_promote_demote" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "no_fold_promote_demote" (f32.const 0x1p-149)) (f32.const 0x1p-149)) @@ -616,8 +646,8 @@ (assert_return (invoke "no_fold_promote_demote" (f32.const -0x1p-126)) (f32.const -0x1p-126)) (assert_return (invoke "no_fold_promote_demote" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "no_fold_promote_demote" (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) -(assert_return (invoke "no_fold_promote_demote" (f32.const infinity)) (f32.const infinity)) -(assert_return (invoke "no_fold_promote_demote" (f32.const -infinity)) (f32.const -infinity)) +(assert_return (invoke "no_fold_promote_demote" (f32.const inf)) (f32.const inf)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -inf)) (f32.const -inf)) ;; Test that demote(x+promote(y)) is not folded to demote(x)+y. @@ -795,8 +825,8 @@ (assert_return (invoke "check" (i32.const 16)) (f64.const 15.3)) (assert_return (invoke "check" (i32.const 24)) (f64.const 15.4)) (invoke "run" (i32.const 32) (f64.const 3.0)) -(assert_return (invoke "check" (i32.const 0)) (f64.const 0x1.4222222222222p+2)) -(assert_return (invoke "check" (i32.const 8)) (f64.const 0x1.4444444444444p+2)) +(assert_return (invoke "check" (i32.const 0)) (f64.const 0x1.4222222222222p+2)) +(assert_return (invoke "check" (i32.const 8)) (f64.const 0x1.4444444444444p+2)) (assert_return (invoke "check" (i32.const 16)) (f64.const 0x1.4666666666667p+2)) (assert_return (invoke "check" (i32.const 24)) (f64.const 0x1.4888888888889p+2)) @@ -897,15 +927,47 @@ ;; Test that x<y?x:y, etc. using if and else aren't folded to min, etc. (module - (func (export "f32.no_fold_lt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.lt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) - (func (export "f32.no_fold_le_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.le (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) - (func (export "f32.no_fold_gt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.gt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) - (func (export "f32.no_fold_ge_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.ge (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f32.no_fold_lt_if") (param $x f32) (param $y f32) (result f32) + (if (result f32) (f32.lt (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) + (func (export "f32.no_fold_le_if") (param $x f32) (param $y f32) (result f32) + (if (result f32) (f32.le (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) + (func (export "f32.no_fold_gt_if") (param $x f32) (param $y f32) (result f32) + (if (result f32) (f32.gt (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) + (func (export "f32.no_fold_ge_if") (param $x f32) (param $y f32) (result f32) + (if (result f32) (f32.ge (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) - (func (export "f64.no_fold_lt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.lt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) - (func (export "f64.no_fold_le_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.le (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) - (func (export "f64.no_fold_gt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.gt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) - (func (export "f64.no_fold_ge_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.ge (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f64.no_fold_lt_if") (param $x f64) (param $y f64) (result f64) + (if (result f64) (f64.lt (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) + (func (export "f64.no_fold_le_if") (param $x f64) (param $y f64) (result f64) + (if (result f64) (f64.le (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) + (func (export "f64.no_fold_gt_if") (param $x f64) (param $y f64) (result f64) + (if (result f64) (f64.gt (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) + (func (export "f64.no_fold_ge_if") (param $x f64) (param $y f64) (result f64) + (if (result f64) (f64.ge (local.get $x) (local.get $y)) + (then (local.get $x)) (else (local.get $y)) + ) + ) ) (assert_return (invoke "f32.no_fold_lt_if" (f32.const 0.0) (f32.const nan)) (f32.const nan)) @@ -941,7 +1003,7 @@ (assert_return (invoke "f64.no_fold_ge_if" (f64.const 0.0) (f64.const -0.0)) (f64.const 0.0)) (assert_return (invoke "f64.no_fold_ge_if" (f64.const -0.0) (f64.const 0.0)) (f64.const -0.0)) -;; Test that x<0?-x:0, etc. using select aren't folded to abs +;; Test that x<0?-x:x, etc. using select aren't folded to abs. (module (func (export "f32.no_fold_lt_select_to_abs") (param $x f32) (result f32) (select (f32.neg (local.get $x)) (local.get $x) (f32.lt (local.get $x) (f32.const 0.0)))) @@ -988,18 +1050,50 @@ (assert_return (invoke "f64.no_fold_ge_select_to_abs" (f64.const 0.0)) (f64.const 0.0)) (assert_return (invoke "f64.no_fold_ge_select_to_abs" (f64.const -0.0)) (f64.const -0.0)) -;; Test that x<0?-x:0, etc. using if aren't folded to abs +;; Test that x<0?-x:x, etc. using if aren't folded to abs. (module - (func (export "f32.no_fold_lt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.lt (local.get $x) (f32.const 0.0)) (f32.neg (local.get $x)) (local.get $x))) - (func (export "f32.no_fold_le_if_to_abs") (param $x f32) (result f32) (if f32 (f32.le (local.get $x) (f32.const -0.0)) (f32.neg (local.get $x)) (local.get $x))) - (func (export "f32.no_fold_gt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.gt (local.get $x) (f32.const -0.0)) (local.get $x) (f32.neg (local.get $x)))) - (func (export "f32.no_fold_ge_if_to_abs") (param $x f32) (result f32) (if f32 (f32.ge (local.get $x) (f32.const 0.0)) (local.get $x) (f32.neg (local.get $x)))) + (func (export "f32.no_fold_lt_if_to_abs") (param $x f32) (result f32) + (if (result f32) (f32.lt (local.get $x) (f32.const 0.0)) + (then (f32.neg (local.get $x))) (else (local.get $x)) + ) + ) + (func (export "f32.no_fold_le_if_to_abs") (param $x f32) (result f32) + (if (result f32) (f32.le (local.get $x) (f32.const -0.0)) + (then (f32.neg (local.get $x))) (else (local.get $x)) + ) + ) + (func (export "f32.no_fold_gt_if_to_abs") (param $x f32) (result f32) + (if (result f32) (f32.gt (local.get $x) (f32.const -0.0)) + (then (local.get $x)) (else (f32.neg (local.get $x))) + ) + ) + (func (export "f32.no_fold_ge_if_to_abs") (param $x f32) (result f32) + (if (result f32) (f32.ge (local.get $x) (f32.const 0.0)) + (then (local.get $x)) (else (f32.neg (local.get $x))) + ) + ) - (func (export "f64.no_fold_lt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.lt (local.get $x) (f64.const 0.0)) (f64.neg (local.get $x)) (local.get $x))) - (func (export "f64.no_fold_le_if_to_abs") (param $x f64) (result f64) (if f64 (f64.le (local.get $x) (f64.const -0.0)) (f64.neg (local.get $x)) (local.get $x))) - (func (export "f64.no_fold_gt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.gt (local.get $x) (f64.const -0.0)) (local.get $x) (f64.neg (local.get $x)))) - (func (export "f64.no_fold_ge_if_to_abs") (param $x f64) (result f64) (if f64 (f64.ge (local.get $x) (f64.const 0.0)) (local.get $x) (f64.neg (local.get $x)))) + (func (export "f64.no_fold_lt_if_to_abs") (param $x f64) (result f64) + (if (result f64) (f64.lt (local.get $x) (f64.const 0.0)) + (then (f64.neg (local.get $x))) (else (local.get $x)) + ) + ) + (func (export "f64.no_fold_le_if_to_abs") (param $x f64) (result f64) + (if (result f64) (f64.le (local.get $x) (f64.const -0.0)) + (then (f64.neg (local.get $x))) (else (local.get $x)) + ) + ) + (func (export "f64.no_fold_gt_if_to_abs") (param $x f64) (result f64) + (if (result f64) (f64.gt (local.get $x) (f64.const -0.0)) + (then (local.get $x)) (else (f64.neg (local.get $x))) + ) + ) + (func (export "f64.no_fold_ge_if_to_abs") (param $x f64) (result f64) + (if (result f64) (f64.ge (local.get $x) (f64.const 0.0)) + (then (local.get $x)) (else (f64.neg (local.get $x))) + ) + ) ) (assert_return (invoke "f32.no_fold_lt_if_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000)) @@ -1039,20 +1133,16 @@ ;; https://support.microsoft.com/en-us/kb/78113 (module - (func (export "incorrect_correction") (result f32) + (func (export "f32.incorrect_correction") (result f32) (f32.sub (f32.sub (f32.add (f32.const 1.333) (f32.const 1.225)) (f32.const 1.333)) (f32.const 1.225)) ) -) - -(assert_return (invoke "incorrect_correction") (f32.const 0x1p-23)) - -(module - (func (export "incorrect_correction") (result f64) + (func (export "f64.incorrect_correction") (result f64) (f64.sub (f64.sub (f64.add (f64.const 1.333) (f64.const 1.225)) (f64.const 1.333)) (f64.const 1.225)) ) ) -(assert_return (invoke "incorrect_correction") (f64.const -0x1p-52)) +(assert_return (invoke "f32.incorrect_correction") (f32.const 0x1p-23)) +(assert_return (invoke "f64.incorrect_correction") (f64.const -0x1p-52)) ;; Test for a historical calculator bug. ;; http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=735 @@ -1200,8 +1290,8 @@ (assert_return (invoke "f32.no_fold_recip_recip" (f32.const -0x0p+0)) (f32.const -0x0p+0)) (assert_return (invoke "f32.no_fold_recip_recip" (f32.const 0x0p+0)) (f32.const 0x0p+0)) -(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -infinity)) (f32.const -infinity)) -(assert_return (invoke "f32.no_fold_recip_recip" (f32.const infinity)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -inf)) (f32.const -inf)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const inf)) (f32.const inf)) (assert_return (invoke "f64.no_fold_recip_recip" (f64.const -0x1.d81248dda63dp+148)) (f64.const -0x1.d81248dda63d1p+148)) (assert_return (invoke "f64.no_fold_recip_recip" (f64.const -0x1.f4750312039e3p+66)) (f64.const -0x1.f4750312039e2p+66)) @@ -1211,8 +1301,8 @@ (assert_return (invoke "f64.no_fold_recip_recip" (f64.const -0x0p+0)) (f64.const -0x0p+0)) (assert_return (invoke "f64.no_fold_recip_recip" (f64.const 0x0p+0)) (f64.const 0x0p+0)) -(assert_return (invoke "f64.no_fold_recip_recip" (f64.const -infinity)) (f64.const -infinity)) -(assert_return (invoke "f64.no_fold_recip_recip" (f64.const infinity)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const -inf)) (f64.const -inf)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const inf)) (f64.const inf)) ;; Test that (x+y) * (x-y) is not optimized to x*x - y*y. @@ -1262,6 +1352,87 @@ (assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.be663e4c0e4b2p+182) (f64.const -0x1.da85703760d25p+166)) (f64.const 0x1.853434f1a2ffep+365)) (assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.230e09952df1cp-236) (f64.const -0x1.fa2752adfadc9p-237)) (f64.const 0x1.42e43156bd1b8p-474)) +;; Test that platforms where SIMD instructions flush subnormals don't implicitly +;; optimize using SIMD instructions. + +(module + (memory (data + "\01\00\00\00\01\00\00\80\01\00\00\00\01\00\00\80" + "\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00" + "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" + )) + + (func (export "f32.simple_x4_sum") + (param $i i32) + (param $j i32) + (param $k i32) + (local $x0 f32) (local $x1 f32) (local $x2 f32) (local $x3 f32) + (local $y0 f32) (local $y1 f32) (local $y2 f32) (local $y3 f32) + (local.set $x0 (f32.load offset=0 (local.get $i))) + (local.set $x1 (f32.load offset=4 (local.get $i))) + (local.set $x2 (f32.load offset=8 (local.get $i))) + (local.set $x3 (f32.load offset=12 (local.get $i))) + (local.set $y0 (f32.load offset=0 (local.get $j))) + (local.set $y1 (f32.load offset=4 (local.get $j))) + (local.set $y2 (f32.load offset=8 (local.get $j))) + (local.set $y3 (f32.load offset=12 (local.get $j))) + (f32.store offset=0 (local.get $k) (f32.add (local.get $x0) (local.get $y0))) + (f32.store offset=4 (local.get $k) (f32.add (local.get $x1) (local.get $y1))) + (f32.store offset=8 (local.get $k) (f32.add (local.get $x2) (local.get $y2))) + (f32.store offset=12 (local.get $k) (f32.add (local.get $x3) (local.get $y3))) + ) + + (func (export "f32.load") + (param $k i32) (result f32) + (f32.load (local.get $k)) + ) +) + +(assert_return (invoke "f32.simple_x4_sum" (i32.const 0) (i32.const 16) (i32.const 32))) +(assert_return (invoke "f32.load" (i32.const 32)) (f32.const 0x1p-148)) +(assert_return (invoke "f32.load" (i32.const 36)) (f32.const 0x0p+0)) +(assert_return (invoke "f32.load" (i32.const 40)) (f32.const 0x1p-149)) +(assert_return (invoke "f32.load" (i32.const 44)) (f32.const -0x1p-149)) + +(module + (memory (data + "\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\80\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\80" + "\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" + "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" + )) + + (func (export "f64.simple_x4_sum") + (param $i i32) + (param $j i32) + (param $k i32) + (local $x0 f64) (local $x1 f64) (local $x2 f64) (local $x3 f64) + (local $y0 f64) (local $y1 f64) (local $y2 f64) (local $y3 f64) + (local.set $x0 (f64.load offset=0 (local.get $i))) + (local.set $x1 (f64.load offset=8 (local.get $i))) + (local.set $x2 (f64.load offset=16 (local.get $i))) + (local.set $x3 (f64.load offset=24 (local.get $i))) + (local.set $y0 (f64.load offset=0 (local.get $j))) + (local.set $y1 (f64.load offset=8 (local.get $j))) + (local.set $y2 (f64.load offset=16 (local.get $j))) + (local.set $y3 (f64.load offset=24 (local.get $j))) + (f64.store offset=0 (local.get $k) (f64.add (local.get $x0) (local.get $y0))) + (f64.store offset=8 (local.get $k) (f64.add (local.get $x1) (local.get $y1))) + (f64.store offset=16 (local.get $k) (f64.add (local.get $x2) (local.get $y2))) + (f64.store offset=24 (local.get $k) (f64.add (local.get $x3) (local.get $y3))) + ) + + (func (export "f64.load") + (param $k i32) (result f64) + (f64.load (local.get $k)) + ) +) + +(assert_return (invoke "f64.simple_x4_sum" (i32.const 0) (i32.const 32) (i32.const 64))) +(assert_return (invoke "f64.load" (i32.const 64)) (f64.const 0x0.0000000000001p-1021)) +(assert_return (invoke "f64.load" (i32.const 72)) (f64.const 0x0p+0)) +(assert_return (invoke "f64.load" (i32.const 80)) (f64.const 0x0.0000000000001p-1022)) +(assert_return (invoke "f64.load" (i32.const 88)) (f64.const -0x0.0000000000001p-1022)) + ;; Test that plain summation is not reassociated, and that Kahan summation ;; isn't optimized into plain summation. @@ -1430,6 +1601,46 @@ (assert_return (invoke "f64.no_fold_neg_sub" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) (assert_return (invoke "f64.no_fold_neg_sub" (f64.const 0.0) (f64.const 0.0)) (f64.const -0.0)) +;; Test that -(x + y) is not folded to (-x + -y). + +(module + (func (export "f32.no_fold_neg_add") (param $x f32) (param $y f32) (result f32) + (f32.neg (f32.add (local.get $x) (local.get $y)))) + + (func (export "f64.no_fold_neg_add") (param $x f64) (param $y f64) (result f64) + (f64.neg (f64.add (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.no_fold_neg_add" (f32.const -0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_neg_add" (f32.const 0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_neg_add" (f32.const -0.0) (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_neg_add" (f32.const 0.0) (f32.const 0.0)) (f32.const -0.0)) + +(assert_return (invoke "f64.no_fold_neg_add" (f64.const -0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_neg_add" (f64.const 0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_neg_add" (f64.const -0.0) (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_neg_add" (f64.const 0.0) (f64.const 0.0)) (f64.const -0.0)) + +;; Test that (-x + -y) is not folded to -(x + y). + +(module + (func (export "f32.no_fold_add_neg_neg") (param $x f32) (param $y f32) (result f32) + (f32.add (f32.neg (local.get $x)) (f32.neg (local.get $y)))) + + (func (export "f64.no_fold_add_neg_neg") (param $x f64) (param $y f64) (result f64) + (f64.add (f64.neg (local.get $x)) (f64.neg (local.get $y)))) +) + +(assert_return (invoke "f32.no_fold_add_neg_neg" (f32.const -0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_add_neg_neg" (f32.const 0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_add_neg_neg" (f32.const -0.0) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_add_neg_neg" (f32.const 0.0) (f32.const 0.0)) (f32.const -0.0)) + +(assert_return (invoke "f64.no_fold_add_neg_neg" (f64.const -0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_add_neg_neg" (f64.const 0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_add_neg_neg" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_add_neg_neg" (f64.const 0.0) (f64.const 0.0)) (f64.const -0.0)) + ;; Test that -x + x is not folded to 0.0. (module @@ -1442,13 +1653,13 @@ (assert_return (invoke "f32.no_fold_add_neg" (f32.const 0.0)) (f32.const 0.0)) (assert_return (invoke "f32.no_fold_add_neg" (f32.const -0.0)) (f32.const 0.0)) -(assert_return_nan (invoke "f32.no_fold_add_neg" (f32.const infinity))) -(assert_return_nan (invoke "f32.no_fold_add_neg" (f32.const -infinity))) +(assert_return_canonical_nan (invoke "f32.no_fold_add_neg" (f32.const inf))) +(assert_return_canonical_nan (invoke "f32.no_fold_add_neg" (f32.const -inf))) (assert_return (invoke "f64.no_fold_add_neg" (f64.const 0.0)) (f64.const 0.0)) (assert_return (invoke "f64.no_fold_add_neg" (f64.const -0.0)) (f64.const 0.0)) -(assert_return_nan (invoke "f64.no_fold_add_neg" (f64.const infinity))) -(assert_return_nan (invoke "f64.no_fold_add_neg" (f64.const -infinity))) +(assert_return_canonical_nan (invoke "f64.no_fold_add_neg" (f64.const inf))) +(assert_return_canonical_nan (invoke "f64.no_fold_add_neg" (f64.const -inf))) ;; Test that x+x+x+x+x+x is not folded to x * 6. @@ -1491,14 +1702,14 @@ (assert_return (invoke "f32.no_fold_div_div" (f32.const -0x1.f70228p+78) (f32.const -0x1.fbc612p-16) (f32.const -0x1.8c379p+10)) (f32.const -0x1.47b43cp+83)) (assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.d29d2ep-70) (f32.const 0x1.f3a17ep+110) (f32.const -0x1.64d41p-112)) (f32.const -0x0p+0)) -(assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.867f98p+43) (f32.const 0x1.30acfcp-105) (f32.const 0x1.e210d8p+105)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.867f98p+43) (f32.const 0x1.30acfcp-105) (f32.const 0x1.e210d8p+105)) (f32.const inf)) (assert_return (invoke "f32.no_fold_div_div" (f32.const -0x1.c4001ap-14) (f32.const -0x1.9beb6cp+124) (f32.const -0x1.74f34cp-43)) (f32.const -0x1.819874p-96)) (assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.db0e6ep+46) (f32.const 0x1.55eea2p+56) (f32.const -0x1.f3134p+124)) (f32.const -0x1.6cep-135)) (assert_return (invoke "f64.no_fold_div_div" (f64.const 0x1.b4dc8ec3c7777p+337) (f64.const 0x1.9f95ac2d1863p+584) (f64.const -0x1.d4318abba341ep-782)) (f64.const -0x1.2649159d87e02p+534)) (assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.ac53af5eb445fp+791) (f64.const 0x1.8549c0a4ceb13p-29) (f64.const 0x1.64e384003c801p+316)) (f64.const -0x1.9417cdccbae91p+503)) (assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.d2685afb27327p+2) (f64.const -0x1.abb1eeed3dbebp+880) (f64.const 0x1.a543e2e6968a3p+170)) (f64.const 0x0.0000002a69a5fp-1022)) -(assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.47ddede78ad1cp+825) (f64.const 0x1.6d932d070a367p-821) (f64.const 0x1.79cf18cc64fp+961)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.47ddede78ad1cp+825) (f64.const 0x1.6d932d070a367p-821) (f64.const 0x1.79cf18cc64fp+961)) (f64.const -inf)) (assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.f73d4979a9379p-888) (f64.const 0x1.4d83b53e97788p-596) (f64.const -0x1.f8f86c9603b5bp-139)) (f64.const 0x1.87a7bd89c586cp-154)) ;; Test that (x/y)*(z/w) is not optimized to (x*z)/(y*w), example from @@ -1516,11 +1727,11 @@ (assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.c483bep-109) (f32.const 0x1.ee1c3cp-92) (f32.const 0x1.800756p-88) (f32.const -0x1.95b972p+4)) (f32.const 0x1.bbd30cp-110)) (assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.0f4262p+102) (f32.const 0x1.248498p+25) (f32.const 0x1.f66a7cp-17) (f32.const 0x1.897fc8p-3)) (f32.const -0x1.2f1aa4p+63)) (assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.df5f22p+33) (f32.const -0x1.fcee3ep+39) (f32.const -0x1.9ea914p+29) (f32.const -0x1.2c4d3p+10)) (f32.const 0x1.4cf51cp+13)) -(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.f568bcp+109) (f32.const 0x1.d9963p-34) (f32.const 0x1.37a87ap-16) (f32.const 0x1.a1524ap+78)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.f568bcp+109) (f32.const 0x1.d9963p-34) (f32.const 0x1.37a87ap-16) (f32.const 0x1.a1524ap+78)) (f32.const -inf)) (assert_return (invoke "f32.no_fold_mul_divs" (f32.const 0x1.3dd592p-53) (f32.const -0x1.332c22p-64) (f32.const 0x1.b01064p-91) (f32.const 0x1.92bb3ap-36)) (f32.const -0x1.1c2dbp-44)) (assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.363d6764f7b12p-819) (f64.const -0x1.ed5471f660b5fp-464) (f64.const -0x1.671b0a7f3a42p+547) (f64.const 0x1.0633be34ba1f2p+186)) (f64.const -0x1.b8fa2b76baeebp+5)) -(assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.37880182e0fa8p+115) (f64.const 0x1.f842631576147p-920) (f64.const -0x1.999372231d156p+362) (f64.const -0x1.d5db481ab9554p+467)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.37880182e0fa8p+115) (f64.const 0x1.f842631576147p-920) (f64.const -0x1.999372231d156p+362) (f64.const -0x1.d5db481ab9554p+467)) (f64.const -inf)) (assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.9a747c8d4b541p+308) (f64.const -0x1.99092ad6bbdc8p+192) (f64.const -0x1.cb23755c20101p-140) (f64.const -0x1.de8716f6b0b6ap+732)) (f64.const 0x1.ecf584c8466a5p-757)) (assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.c424b2ece903dp+129) (f64.const -0x1.568ce281db37fp-347) (f64.const 0x1.53900b99fd3dp-957) (f64.const 0x1.5c33952254dadp+223)) (f64.const 0x0p+0)) (assert_return (invoke "f64.no_fold_mul_divs" (f64.const 0x1.a8ec2cecb32a9p-18) (f64.const 0x1.58acab0051851p-277) (f64.const 0x1.35e87c9077f7fp-620) (f64.const -0x1.925ee37ffb386p+352)) (f64.const -0x1.e6286970b31bfp-714)) @@ -1561,13 +1772,13 @@ (assert_return (invoke "f32.no_fold_sqrt_square" (f32.const -0x1.b0f9e4p-73)) (f32.const 0x1.b211b2p-73)) (assert_return (invoke "f32.no_fold_sqrt_square" (f32.const -0x1.de417cp-71)) (f32.const 0x1.de65b8p-71)) (assert_return (invoke "f32.no_fold_sqrt_square" (f32.const 0x1.64c872p-86)) (f32.const 0x0p+0)) -(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const 0x1.e199e4p+108)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const 0x1.e199e4p+108)) (f32.const inf)) (assert_return (invoke "f64.no_fold_sqrt_square" (f64.const 0x1.1759d657203fdp-529)) (f64.const 0x1.1759dd57545f3p-529)) (assert_return (invoke "f64.no_fold_sqrt_square" (f64.const -0x1.4c68de1c78d83p-514)) (f64.const 0x1.4c68de1c78d81p-514)) (assert_return (invoke "f64.no_fold_sqrt_square" (f64.const -0x1.214736edb6e1ep-521)) (f64.const 0x1.214736ed9cf8dp-521)) (assert_return (invoke "f64.no_fold_sqrt_square" (f64.const -0x1.0864b9f68457p-616)) (f64.const 0x0p+0)) -(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const 0x1.b2a9855995abap+856)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const 0x1.b2a9855995abap+856)) (f64.const inf)) ;; Test that sqrt(x)*sqrt(y) is not optimized to sqrt(x*y). @@ -1579,13 +1790,13 @@ (f64.mul (f64.sqrt (local.get $x)) (f64.sqrt (local.get $y)))) ) -(assert_return_nan (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.dddda8p-125) (f32.const -0x1.25d22ap-83))) +(assert_return_canonical_nan (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.dddda8p-125) (f32.const -0x1.25d22ap-83))) (assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.418d14p-92) (f32.const 0x1.c6535cp-32)) (f32.const 0x1.7e373ap-62)) (assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.4de7ep-88) (f32.const 0x1.84ff18p+6)) (f32.const 0x1.686668p-41)) (assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.78091ep+101) (f32.const 0x1.81feb8p-9)) (f32.const 0x1.7cfb98p+46)) (assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.583ap-56) (f32.const 0x1.14ba2ap-9)) (f32.const 0x1.b47a8ep-33)) -(assert_return_nan (invoke "f64.no_fold_mul_sqrts" (f64.const -0x1.d1144cc28cdbep-635) (f64.const -0x1.bf9bc373d3b6ap-8))) +(assert_return_canonical_nan (invoke "f64.no_fold_mul_sqrts" (f64.const -0x1.d1144cc28cdbep-635) (f64.const -0x1.bf9bc373d3b6ap-8))) (assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.5a7eb976bebc9p-643) (f64.const 0x1.f30cb8865a4cap-404)) (f64.const 0x1.260a1032d6e76p-523)) (assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.711a0c1707935p-89) (f64.const 0x1.6fb5de51a20d3p-913)) (f64.const 0x1.7067ca28e31ecp-501)) (assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.fb0bbea33b076p-363) (f64.const 0x1.d963b34894158p-573)) (f64.const 0x1.e9edc1fa624afp-468)) @@ -1601,13 +1812,13 @@ (f64.div (f64.sqrt (local.get $x)) (f64.sqrt (local.get $y)))) ) -(assert_return_nan (invoke "f32.no_fold_div_sqrts" (f32.const -0x1.bea9bap+25) (f32.const -0x1.db776ep-58))) +(assert_return_canonical_nan (invoke "f32.no_fold_div_sqrts" (f32.const -0x1.bea9bap+25) (f32.const -0x1.db776ep-58))) (assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.b983b6p+32) (f32.const 0x1.901f1ep+27)) (f32.const 0x1.7c4df6p+2)) (assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.d45e72p-120) (f32.const 0x1.ab49ccp+15)) (f32.const 0x1.7b0b04p-68)) (assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.b2e444p+59) (f32.const 0x1.5b8b16p-30)) (f32.const 0x1.94fca8p+44)) (assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.835aa6p-112) (f32.const 0x1.d17128p-103)) (f32.const 0x1.4a468p-5)) -(assert_return_nan (invoke "f64.no_fold_div_sqrts" (f64.const -0x1.509fc16411167p-711) (f64.const -0x1.9c4255f5d6517p-187))) +(assert_return_canonical_nan (invoke "f64.no_fold_div_sqrts" (f64.const -0x1.509fc16411167p-711) (f64.const -0x1.9c4255f5d6517p-187))) (assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.b6897bddac76p-587) (f64.const 0x1.104578b4c91f3p+541)) (f64.const 0x1.44e4f21f26cc9p-564)) (assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.ac83451b08989p+523) (f64.const 0x1.8da575c6d12b8p-109)) (f64.const 0x1.09c003991ce17p+316)) (assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.bab7836456417p-810) (f64.const 0x1.1ff60d03ba607p+291)) (f64.const 0x1.c0e6c833bf657p-551)) @@ -1623,13 +1834,13 @@ (f64.div (f64.mul (local.get $x) (f64.sqrt (local.get $y))) (local.get $y))) ) -(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.f4a7cap+81) (f32.const 0x1.c09adep+92)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.f4a7cap+81) (f32.const 0x1.c09adep+92)) (f32.const -inf)) (assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.90bf1cp-120) (f32.const 0x1.8dbe88p-97)) (f32.const -0x0p+0)) (assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const 0x1.8570e8p+29) (f32.const 0x1.217d3p-128)) (f32.const 0x1.6e391ap+93)) (assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.5b4652p+43) (f32.const 0x1.a9d71cp+112)) (f32.const -0x1.0d423ap-13)) (assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.910604p+8) (f32.const 0x1.0ca912p+7)) (f32.const -0x1.14cdecp+5)) -(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const 0x1.1dcdeb857305fp+698) (f64.const 0x1.a066171c40eb9p+758)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const 0x1.1dcdeb857305fp+698) (f64.const 0x1.a066171c40eb9p+758)) (f64.const inf)) (assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const -0x1.8b4f1c218e2abp-827) (f64.const 0x1.5e1ee65953b0bp-669)) (f64.const -0x0p+0)) (assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const 0x1.74ee531ddba38p-425) (f64.const 0x1.f370f758857f3p+560)) (f64.const 0x1.0aff34269583ep-705)) (assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const -0x1.27f216b0da6c5p+352) (f64.const 0x1.8e0b4e0b9fd7ep-483)) (f64.const -0x1.4fa558aad514ep+593)) @@ -1675,17 +1886,17 @@ (f32.mul (f32.demote_f64 (local.get $x)) (local.get $y))) ) -(assert_return (invoke "f32.recoding_eq" (f32.const -infinity) (f32.const 3.0)) (i32.const 1)) -(assert_return (invoke "f32.recoding_le" (f32.const -infinity) (f32.const 3.0)) (i32.const 1)) -(assert_return (invoke "f32.recoding_lt" (f32.const -infinity) (f32.const 3.0)) (i32.const 0)) +(assert_return (invoke "f32.recoding_eq" (f32.const -inf) (f32.const 3.0)) (i32.const 1)) +(assert_return (invoke "f32.recoding_le" (f32.const -inf) (f32.const 3.0)) (i32.const 1)) +(assert_return (invoke "f32.recoding_lt" (f32.const -inf) (f32.const 3.0)) (i32.const 0)) (assert_return (invoke "f32.recoding_eq" (f32.const 0x0p+0) (f32.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "f32.recoding_le" (f32.const 0x0p+0) (f32.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "f32.recoding_lt" (f32.const 0x0p+0) (f32.const 0x1p+0)) (i32.const 0)) -(assert_return (invoke "f64.recoding_eq" (f64.const -infinity) (f64.const 3.0)) (i32.const 1)) -(assert_return (invoke "f64.recoding_le" (f64.const -infinity) (f64.const 3.0)) (i32.const 1)) -(assert_return (invoke "f64.recoding_lt" (f64.const -infinity) (f64.const 3.0)) (i32.const 0)) +(assert_return (invoke "f64.recoding_eq" (f64.const -inf) (f64.const 3.0)) (i32.const 1)) +(assert_return (invoke "f64.recoding_le" (f64.const -inf) (f64.const 3.0)) (i32.const 1)) +(assert_return (invoke "f64.recoding_lt" (f64.const -inf) (f64.const 3.0)) (i32.const 0)) (assert_return (invoke "f64.recoding_eq" (f64.const 0x0p+0) (f64.const 0x1p+0)) (i32.const 1)) (assert_return (invoke "f64.recoding_le" (f64.const 0x0p+0) (f64.const 0x1p+0)) (i32.const 1)) @@ -1890,9 +2101,9 @@ ) (assert_return (invoke "f32.no_fold_add_le_monotonicity" (f32.const 0.0) (f32.const 0.0) (f32.const nan)) (i32.const 0)) -(assert_return (invoke "f32.no_fold_add_le_monotonicity" (f32.const infinity) (f32.const -infinity) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "f32.no_fold_add_le_monotonicity" (f32.const inf) (f32.const -inf) (f32.const inf)) (i32.const 0)) (assert_return (invoke "f64.no_fold_add_le_monotonicity" (f64.const 0.0) (f64.const 0.0) (f64.const nan)) (i32.const 0)) -(assert_return (invoke "f64.no_fold_add_le_monotonicity" (f64.const infinity) (f64.const -infinity) (f64.const infinity)) (i32.const 0)) +(assert_return (invoke "f64.no_fold_add_le_monotonicity" (f64.const inf) (f64.const -inf) (f64.const inf)) (i32.const 0)) ;; Test that !(x < y) and friends are not optimized to x >= y and friends. @@ -1946,6 +2157,61 @@ (assert_return (invoke "f32.epsilon") (f32.const -0x1p-23)) (assert_return (invoke "f64.epsilon") (f64.const 0x1p-52)) +;; Test that a method for computing a "machine epsilon" produces the expected +;; result. +;; https://www.math.utah.edu/~beebe/software/ieee/ + +(module + (func (export "f32.epsilon") (result f32) + (local $x f32) + (local $result f32) + (local.set $x (f32.const 1)) + (loop $loop + (br_if $loop + (f32.gt + (f32.add + (local.tee $x + (f32.mul + (local.tee $result (local.get $x)) + (f32.const 0.5) + ) + ) + (f32.const 1) + ) + (f32.const 1) + ) + ) + ) + (local.get $result) + ) + + (func (export "f64.epsilon") (result f64) + (local $x f64) + (local $result f64) + (local.set $x (f64.const 1)) + (loop $loop + (br_if $loop + (f64.gt + (f64.add + (local.tee $x + (f64.mul + (local.tee $result (local.get $x)) + (f64.const 0.5) + ) + ) + (f64.const 1) + ) + (f64.const 1) + ) + ) + ) + (local.get $result) + ) +) + +(assert_return (invoke "f32.epsilon") (f32.const 0x1p-23)) +(assert_return (invoke "f64.epsilon") (f64.const 0x1p-52)) + ;; Test that floating-point numbers are not optimized as if they form a ;; trichotomy. @@ -1977,3 +2243,328 @@ (assert_return (invoke "f64.no_trichotomy_le" (f64.const 0.0) (f64.const nan)) (i32.const 0)) (assert_return (invoke "f64.no_trichotomy_gt" (f64.const 0.0) (f64.const nan)) (i32.const 0)) (assert_return (invoke "f64.no_trichotomy_ge" (f64.const 0.0) (f64.const nan)) (i32.const 0)) + +;; Some test harnesses which can run this testsuite are unable to perform tests +;; of NaN bitpatterns. The following tests whether the underlying platform is +;; generally producing the kinds of NaNs expected. +(module + (func (export "f32.arithmetic_nan_bitpattern") + (param $x i32) (param $y i32) (result i32) + (i32.and (i32.reinterpret_f32 + (f32.div + (f32.reinterpret_i32 (local.get $x)) + (f32.reinterpret_i32 (local.get $y)))) + (i32.const 0x7fc00000))) + (func (export "f32.canonical_nan_bitpattern") + (param $x i32) (param $y i32) (result i32) + (i32.and (i32.reinterpret_f32 + (f32.div + (f32.reinterpret_i32 (local.get $x)) + (f32.reinterpret_i32 (local.get $y)))) + (i32.const 0x7fffffff))) + (func (export "f32.nonarithmetic_nan_bitpattern") + (param $x i32) (result i32) + (i32.reinterpret_f32 (f32.neg (f32.reinterpret_i32 (local.get $x))))) + + (func (export "f64.arithmetic_nan_bitpattern") + (param $x i64) (param $y i64) (result i64) + (i64.and (i64.reinterpret_f64 + (f64.div + (f64.reinterpret_i64 (local.get $x)) + (f64.reinterpret_i64 (local.get $y)))) + (i64.const 0x7ff8000000000000))) + (func (export "f64.canonical_nan_bitpattern") + (param $x i64) (param $y i64) (result i64) + (i64.and (i64.reinterpret_f64 + (f64.div + (f64.reinterpret_i64 (local.get $x)) + (f64.reinterpret_i64 (local.get $y)))) + (i64.const 0x7fffffffffffffff))) + (func (export "f64.nonarithmetic_nan_bitpattern") + (param $x i64) (result i64) + (i64.reinterpret_f64 (f64.neg (f64.reinterpret_i64 (local.get $x))))) + + ;; Versions of no_fold testcases that only care about NaN bitpatterns. + (func (export "f32.no_fold_sub_zero") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.sub (f32.reinterpret_i32 (local.get $x)) (f32.const 0.0))) + (i32.const 0x7fc00000))) + (func (export "f32.no_fold_neg0_sub") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.sub (f32.const -0.0) (f32.reinterpret_i32 (local.get $x)))) + (i32.const 0x7fc00000))) + (func (export "f32.no_fold_mul_one") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.mul (f32.reinterpret_i32 (local.get $x)) (f32.const 1.0))) + (i32.const 0x7fc00000))) + (func (export "f32.no_fold_neg1_mul") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.mul (f32.const -1.0) (f32.reinterpret_i32 (local.get $x)))) + (i32.const 0x7fc00000))) + (func (export "f32.no_fold_div_one") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.div (f32.reinterpret_i32 (local.get $x)) (f32.const 1.0))) + (i32.const 0x7fc00000))) + (func (export "f32.no_fold_div_neg1") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.div (f32.reinterpret_i32 (local.get $x)) (f32.const -1.0))) + (i32.const 0x7fc00000))) + (func (export "f64.no_fold_sub_zero") (param $x i64) (result i64) + (i64.and (i64.reinterpret_f64 (f64.sub (f64.reinterpret_i64 (local.get $x)) (f64.const 0.0))) + (i64.const 0x7ff8000000000000))) + (func (export "f64.no_fold_neg0_sub") (param $x i64) (result i64) + (i64.and (i64.reinterpret_f64 (f64.sub (f64.const -0.0) (f64.reinterpret_i64 (local.get $x)))) + (i64.const 0x7ff8000000000000))) + (func (export "f64.no_fold_mul_one") (param $x i64) (result i64) + (i64.and (i64.reinterpret_f64 (f64.mul (f64.reinterpret_i64 (local.get $x)) (f64.const 1.0))) + (i64.const 0x7ff8000000000000))) + (func (export "f64.no_fold_neg1_mul") (param $x i64) (result i64) + (i64.and (i64.reinterpret_f64 (f64.mul (f64.const -1.0) (f64.reinterpret_i64 (local.get $x)))) + (i64.const 0x7ff8000000000000))) + (func (export "f64.no_fold_div_one") (param $x i64) (result i64) + (i64.and (i64.reinterpret_f64 (f64.div (f64.reinterpret_i64 (local.get $x)) (f64.const 1.0))) + (i64.const 0x7ff8000000000000))) + (func (export "f64.no_fold_div_neg1") (param $x i64) (result i64) + (i64.and (i64.reinterpret_f64 (f64.div (f64.reinterpret_i64 (local.get $x)) (f64.const -1.0))) + (i64.const 0x7ff8000000000000))) + (func (export "no_fold_promote_demote") (param $x i32) (result i32) + (i32.and (i32.reinterpret_f32 (f32.demote_f64 (f64.promote_f32 (f32.reinterpret_i32 (local.get $x))))) + (i32.const 0x7fc00000))) +) + +(assert_return (invoke "f32.arithmetic_nan_bitpattern" (i32.const 0x7f803210) (i32.const 0x7f803210)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.canonical_nan_bitpattern" (i32.const 0) (i32.const 0)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.canonical_nan_bitpattern" (i32.const 0x7fc00000) (i32.const 0x7fc00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.canonical_nan_bitpattern" (i32.const 0xffc00000) (i32.const 0x7fc00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.canonical_nan_bitpattern" (i32.const 0x7fc00000) (i32.const 0xffc00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.canonical_nan_bitpattern" (i32.const 0xffc00000) (i32.const 0xffc00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.nonarithmetic_nan_bitpattern" (i32.const 0x7fc03210)) (i32.const 0xffc03210)) +(assert_return (invoke "f32.nonarithmetic_nan_bitpattern" (i32.const 0xffc03210)) (i32.const 0x7fc03210)) +(assert_return (invoke "f32.nonarithmetic_nan_bitpattern" (i32.const 0x7f803210)) (i32.const 0xff803210)) +(assert_return (invoke "f32.nonarithmetic_nan_bitpattern" (i32.const 0xff803210)) (i32.const 0x7f803210)) +(assert_return (invoke "f64.arithmetic_nan_bitpattern" (i64.const 0x7ff0000000003210) (i64.const 0x7ff0000000003210)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.canonical_nan_bitpattern" (i64.const 0) (i64.const 0)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.canonical_nan_bitpattern" (i64.const 0x7ff8000000000000) (i64.const 0x7ff8000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.canonical_nan_bitpattern" (i64.const 0xfff8000000000000) (i64.const 0x7ff8000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.canonical_nan_bitpattern" (i64.const 0x7ff8000000000000) (i64.const 0xfff8000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.canonical_nan_bitpattern" (i64.const 0xfff8000000000000) (i64.const 0xfff8000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.nonarithmetic_nan_bitpattern" (i64.const 0x7ff8000000003210)) (i64.const 0xfff8000000003210)) +(assert_return (invoke "f64.nonarithmetic_nan_bitpattern" (i64.const 0xfff8000000003210)) (i64.const 0x7ff8000000003210)) +(assert_return (invoke "f64.nonarithmetic_nan_bitpattern" (i64.const 0x7ff0000000003210)) (i64.const 0xfff0000000003210)) +(assert_return (invoke "f64.nonarithmetic_nan_bitpattern" (i64.const 0xfff0000000003210)) (i64.const 0x7ff0000000003210)) +(assert_return (invoke "f32.no_fold_sub_zero" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.no_fold_neg0_sub" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.no_fold_mul_one" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.no_fold_neg1_mul" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.no_fold_div_one" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f32.no_fold_div_neg1" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) +(assert_return (invoke "f64.no_fold_sub_zero" (i64.const 0x7ff4000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.no_fold_neg0_sub" (i64.const 0x7ff4000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.no_fold_mul_one" (i64.const 0x7ff4000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.no_fold_neg1_mul" (i64.const 0x7ff4000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.no_fold_div_one" (i64.const 0x7ff4000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.no_fold_div_neg1" (i64.const 0x7ff4000000000000)) (i64.const 0x7ff8000000000000)) +(assert_return (invoke "no_fold_promote_demote" (i32.const 0x7fa00000)) (i32.const 0x7fc00000)) + +;; Test that IEEE 754 double precision does, in fact, compute a certain dot +;; product correctly. + +(module + (func (export "dot_product_example") + (param $x0 f64) (param $x1 f64) (param $x2 f64) (param $x3 f64) + (param $y0 f64) (param $y1 f64) (param $y2 f64) (param $y3 f64) + (result f64) + (f64.add (f64.add (f64.add + (f64.mul (local.get $x0) (local.get $y0)) + (f64.mul (local.get $x1) (local.get $y1))) + (f64.mul (local.get $x2) (local.get $y2))) + (f64.mul (local.get $x3) (local.get $y3))) + ) + + (func (export "with_binary_sum_collapse") + (param $x0 f64) (param $x1 f64) (param $x2 f64) (param $x3 f64) + (param $y0 f64) (param $y1 f64) (param $y2 f64) (param $y3 f64) + (result f64) + (f64.add (f64.add (f64.mul (local.get $x0) (local.get $y0)) + (f64.mul (local.get $x1) (local.get $y1))) + (f64.add (f64.mul (local.get $x2) (local.get $y2)) + (f64.mul (local.get $x3) (local.get $y3)))) + ) +) + +(assert_return (invoke "dot_product_example" + (f64.const 3.2e7) (f64.const 1.0) (f64.const -1.0) (f64.const 8.0e7) + (f64.const 4.0e7) (f64.const 1.0) (f64.const -1.0) (f64.const -1.6e7)) + (f64.const 2.0)) +(assert_return (invoke "with_binary_sum_collapse" + (f64.const 3.2e7) (f64.const 1.0) (f64.const -1.0) (f64.const 8.0e7) + (f64.const 4.0e7) (f64.const 1.0) (f64.const -1.0) (f64.const -1.6e7)) + (f64.const 2.0)) + +;; http://www.vinc17.org/research/fptest.en.html#contract2fma + +(module + (func (export "f32.contract2fma") + (param $x f32) (param $y f32) (result f32) + (f32.sqrt (f32.sub (f32.mul (local.get $x) (local.get $x)) + (f32.mul (local.get $y) (local.get $y))))) + (func (export "f64.contract2fma") + (param $x f64) (param $y f64) (result f64) + (f64.sqrt (f64.sub (f64.mul (local.get $x) (local.get $x)) + (f64.mul (local.get $y) (local.get $y))))) +) + +(assert_return (invoke "f32.contract2fma" (f32.const 1.0) (f32.const 1.0)) (f32.const 0.0)) +(assert_return (invoke "f32.contract2fma" (f32.const 0x1.19999ap+0) (f32.const 0x1.19999ap+0)) (f32.const 0.0)) +(assert_return (invoke "f32.contract2fma" (f32.const 0x1.333332p+0) (f32.const 0x1.333332p+0)) (f32.const 0.0)) +(assert_return (invoke "f64.contract2fma" (f64.const 1.0) (f64.const 1.0)) (f64.const 0.0)) +(assert_return (invoke "f64.contract2fma" (f64.const 0x1.199999999999ap+0) (f64.const 0x1.199999999999ap+0)) (f64.const 0.0)) +(assert_return (invoke "f64.contract2fma" (f64.const 0x1.3333333333333p+0) (f64.const 0x1.3333333333333p+0)) (f64.const 0.0)) + +;; Test that floating-point isn't implemented with QuickBasic for MS-DOS. +;; https://support.microsoft.com/en-us/help/42980/-complete-tutorial-to-understand-ieee-floating-point-errors + +(module + (func (export "f32.division_by_small_number") + (param $a f32) (param $b f32) (param $c f32) (result f32) + (f32.sub (local.get $a) (f32.div (local.get $b) (local.get $c)))) + (func (export "f64.division_by_small_number") + (param $a f64) (param $b f64) (param $c f64) (result f64) + (f64.sub (local.get $a) (f64.div (local.get $b) (local.get $c)))) +) + +(assert_return (invoke "f32.division_by_small_number" (f32.const 112000000) (f32.const 100000) (f32.const 0.0009)) (f32.const 888888)) +(assert_return (invoke "f64.division_by_small_number" (f64.const 112000000) (f64.const 100000) (f64.const 0.0009)) (f64.const 888888.8888888806)) + +;; Test a simple golden ratio computation. +;; http://mathworld.wolfram.com/GoldenRatio.html + +(module + (func (export "f32.golden_ratio") (param $a f32) (param $b f32) (param $c f32) (result f32) + (f32.mul (local.get 0) (f32.add (local.get 1) (f32.sqrt (local.get 2))))) + (func (export "f64.golden_ratio") (param $a f64) (param $b f64) (param $c f64) (result f64) + (f64.mul (local.get 0) (f64.add (local.get 1) (f64.sqrt (local.get 2))))) +) + +(assert_return (invoke "f32.golden_ratio" (f32.const 0.5) (f32.const 1.0) (f32.const 5.0)) (f32.const 1.618034)) +(assert_return (invoke "f64.golden_ratio" (f64.const 0.5) (f64.const 1.0) (f64.const 5.0)) (f64.const 1.618033988749895)) + +;; Test some silver means computations. +;; http://mathworld.wolfram.com/SilverRatio.html + +(module + (func (export "f32.silver_means") (param $n f32) (result f32) + (f32.mul (f32.const 0.5) + (f32.add (local.get $n) + (f32.sqrt (f32.add (f32.mul (local.get $n) (local.get $n)) + (f32.const 4.0)))))) + (func (export "f64.silver_means") (param $n f64) (result f64) + (f64.mul (f64.const 0.5) + (f64.add (local.get $n) + (f64.sqrt (f64.add (f64.mul (local.get $n) (local.get $n)) + (f64.const 4.0)))))) +) + +(assert_return (invoke "f32.silver_means" (f32.const 0.0)) (f32.const 1.0)) +(assert_return (invoke "f32.silver_means" (f32.const 1.0)) (f32.const 1.6180340)) +(assert_return (invoke "f32.silver_means" (f32.const 2.0)) (f32.const 2.4142136)) +(assert_return (invoke "f32.silver_means" (f32.const 3.0)) (f32.const 3.3027756)) +(assert_return (invoke "f32.silver_means" (f32.const 4.0)) (f32.const 4.2360680)) +(assert_return (invoke "f32.silver_means" (f32.const 5.0)) (f32.const 5.1925821)) +(assert_return (invoke "f64.silver_means" (f64.const 0.0)) (f64.const 1.0)) +(assert_return (invoke "f64.silver_means" (f64.const 1.0)) (f64.const 1.618033988749895)) +(assert_return (invoke "f64.silver_means" (f64.const 2.0)) (f64.const 2.414213562373095)) +(assert_return (invoke "f64.silver_means" (f64.const 3.0)) (f64.const 3.302775637731995)) +(assert_return (invoke "f64.silver_means" (f64.const 4.0)) (f64.const 4.236067977499790)) +(assert_return (invoke "f64.silver_means" (f64.const 5.0)) (f64.const 5.192582403567252)) + +;; Test that an f64 0.4 isn't double-rounded as via extended precision. +;; https://bugs.llvm.org/show_bug.cgi?id=11200 + +(module + (func (export "point_four") (param $four f64) (param $ten f64) (result i32) + (f64.lt (f64.div (local.get $four) (local.get $ten)) (f64.const 0.4))) +) + +(assert_return (invoke "point_four" (f64.const 4.0) (f64.const 10.0)) (i32.const 0)) + +;; Test an approximation function for tau; it should produces the correctly +;; rounded result after (and only after) the expected number of iterations. + +(module + (func (export "tau") (param i32) (result f64) + (local f64 f64 f64 f64) + f64.const 0x0p+0 + local.set 1 + block + local.get 0 + i32.const 1 + i32.lt_s + br_if 0 + f64.const 0x1p+0 + local.set 2 + f64.const 0x0p+0 + local.set 3 + loop + local.get 1 + local.get 2 + f64.const 0x1p+3 + local.get 3 + f64.const 0x1p+3 + f64.mul + local.tee 4 + f64.const 0x1p+0 + f64.add + f64.div + f64.const 0x1p+2 + local.get 4 + f64.const 0x1p+2 + f64.add + f64.div + f64.sub + f64.const 0x1p+1 + local.get 4 + f64.const 0x1.4p+2 + f64.add + f64.div + f64.sub + f64.const 0x1p+1 + local.get 4 + f64.const 0x1.8p+2 + f64.add + f64.div + f64.sub + f64.mul + f64.add + local.set 1 + local.get 3 + f64.const 0x1p+0 + f64.add + local.set 3 + local.get 2 + f64.const 0x1p-4 + f64.mul + local.set 2 + local.get 0 + i32.const -1 + i32.add + local.tee 0 + br_if 0 + end + end + local.get 1 + ) +) + +(assert_return (invoke "tau" (i32.const 10)) (f64.const 0x1.921fb54442d14p+2)) +(assert_return (invoke "tau" (i32.const 11)) (f64.const 0x1.921fb54442d18p+2)) + +;; Test that y < 0 ? x : (x + 1) is not folded to x + (y < 0). + +(module + (func (export "f32.no_fold_conditional_inc") (param $x f32) (param $y f32) (result f32) + (select (local.get $x) + (f32.add (local.get $x) (f32.const 1.0)) + (f32.lt (local.get $y) (f32.const 0.0)))) + (func (export "f64.no_fold_conditional_inc") (param $x f64) (param $y f64) (result f64) + (select (local.get $x) + (f64.add (local.get $x) (f64.const 1.0)) + (f64.lt (local.get $y) (f64.const 0.0)))) +) + +(assert_return (invoke "f32.no_fold_conditional_inc" (f32.const -0.0) (f32.const -1.0)) (f32.const -0.0)) +(assert_return (invoke "f64.no_fold_conditional_inc" (f64.const -0.0) (f64.const -1.0)) (f64.const -0.0)) diff --git a/test/spec/float_literals.wast b/test/spec/float_literals.wast index 6f890affd..fefb91fbb 100644 --- a/test/spec/float_literals.wast +++ b/test/spec/float_literals.wast @@ -11,9 +11,9 @@ (func (export "f32.misc_nan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x012345))) (func (export "f32.misc_positive_nan") (result i32) (i32.reinterpret_f32 (f32.const +nan:0x304050))) (func (export "f32.misc_negative_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan:0x2abcde))) - (func (export "f32.infinity") (result i32) (i32.reinterpret_f32 (f32.const infinity))) - (func (export "f32.positive_infinity") (result i32) (i32.reinterpret_f32 (f32.const +infinity))) - (func (export "f32.negative_infinity") (result i32) (i32.reinterpret_f32 (f32.const -infinity))) + (func (export "f32.infinity") (result i32) (i32.reinterpret_f32 (f32.const inf))) + (func (export "f32.positive_infinity") (result i32) (i32.reinterpret_f32 (f32.const +inf))) + (func (export "f32.negative_infinity") (result i32) (i32.reinterpret_f32 (f32.const -inf))) ;; f32 numbers (func (export "f32.zero") (result i32) (i32.reinterpret_f32 (f32.const 0x0.0p0))) @@ -37,6 +37,9 @@ (func (export "f32_dec.max_finite") (result i32) (i32.reinterpret_f32 (f32.const 3.4028234e+38))) (func (export "f32_dec.trailing_dot") (result i32) (i32.reinterpret_f32 (f32.const 1.e10))) + ;; https://twitter.com/Archivd/status/994637336506912768 + (func (export "f32_dec.root_beer_float") (result i32) (i32.reinterpret_f32 (f32.const 1.000000119))) + ;; f64 special values (func (export "f64.nan") (result i64) (i64.reinterpret_f64 (f64.const nan))) (func (export "f64.positive_nan") (result i64) (i64.reinterpret_f64 (f64.const +nan))) @@ -47,9 +50,9 @@ (func (export "f64.misc_nan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x0123456789abc))) (func (export "f64.misc_positive_nan") (result i64) (i64.reinterpret_f64 (f64.const +nan:0x3040506070809))) (func (export "f64.misc_negative_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan:0x2abcdef012345))) - (func (export "f64.infinity") (result i64) (i64.reinterpret_f64 (f64.const infinity))) - (func (export "f64.positive_infinity") (result i64) (i64.reinterpret_f64 (f64.const +infinity))) - (func (export "f64.negative_infinity") (result i64) (i64.reinterpret_f64 (f64.const -infinity))) + (func (export "f64.infinity") (result i64) (i64.reinterpret_f64 (f64.const inf))) + (func (export "f64.positive_infinity") (result i64) (i64.reinterpret_f64 (f64.const +inf))) + (func (export "f64.negative_infinity") (result i64) (i64.reinterpret_f64 (f64.const -inf))) ;; f64 numbers (func (export "f64.zero") (result i64) (i64.reinterpret_f64 (f64.const 0x0.0p0))) @@ -72,6 +75,31 @@ (func (export "f64_dec.max_subnormal") (result i64) (i64.reinterpret_f64 (f64.const 2.2250738585072011e-308))) (func (export "f64_dec.max_finite") (result i64) (i64.reinterpret_f64 (f64.const 1.7976931348623157e+308))) (func (export "f64_dec.trailing_dot") (result i64) (i64.reinterpret_f64 (f64.const 1.e100))) + + ;; https://twitter.com/Archivd/status/994637336506912768 + (func (export "f64_dec.root_beer_float") (result i64) (i64.reinterpret_f64 (f64.const 1.000000119))) + + (func (export "f32-dec-sep1") (result f32) (f32.const 1_000_000)) + (func (export "f32-dec-sep2") (result f32) (f32.const 1_0_0_0)) + (func (export "f32-dec-sep3") (result f32) (f32.const 100_3.141_592)) + (func (export "f32-dec-sep4") (result f32) (f32.const 99e+1_3)) + (func (export "f32-dec-sep5") (result f32) (f32.const 122_000.11_3_54E0_2_3)) + (func (export "f32-hex-sep1") (result f32) (f32.const 0xa_0f_00_99)) + (func (export "f32-hex-sep2") (result f32) (f32.const 0x1_a_A_0_f)) + (func (export "f32-hex-sep3") (result f32) (f32.const 0xa0_ff.f141_a59a)) + (func (export "f32-hex-sep4") (result f32) (f32.const 0xf0P+1_3)) + (func (export "f32-hex-sep5") (result f32) (f32.const 0x2a_f00a.1f_3_eep2_3)) + + (func (export "f64-dec-sep1") (result f64) (f64.const 1_000_000)) + (func (export "f64-dec-sep2") (result f64) (f64.const 1_0_0_0)) + (func (export "f64-dec-sep3") (result f64) (f64.const 100_3.141_592)) + (func (export "f64-dec-sep4") (result f64) (f64.const 99e-1_23)) + (func (export "f64-dec-sep5") (result f64) (f64.const 122_000.11_3_54e0_2_3)) + (func (export "f64-hex-sep1") (result f64) (f64.const 0xa_f00f_0000_9999)) + (func (export "f64-hex-sep2") (result f64) (f64.const 0x1_a_A_0_f)) + (func (export "f64-hex-sep3") (result f64) (f64.const 0xa0_ff.f141_a59a)) + (func (export "f64-hex-sep4") (result f64) (f64.const 0xf0P+1_3)) + (func (export "f64-hex-sep5") (result f64) (f64.const 0x2a_f00a.1f_3_eep2_3)) ) (assert_return (invoke "f32.nan") (i32.const 0x7fc00000)) @@ -104,6 +132,7 @@ (assert_return (invoke "f32_dec.max_subnormal") (i32.const 0x7fffff)) (assert_return (invoke "f32_dec.max_finite") (i32.const 0x7f7fffff)) (assert_return (invoke "f32_dec.trailing_dot") (i32.const 0x501502f9)) +(assert_return (invoke "f32_dec.root_beer_float") (i32.const 0x3f800001)) (assert_return (invoke "f64.nan") (i64.const 0x7ff8000000000000)) (assert_return (invoke "f64.positive_nan") (i64.const 0x7ff8000000000000)) @@ -135,3 +164,344 @@ (assert_return (invoke "f64_dec.max_subnormal") (i64.const 0xfffffffffffff)) (assert_return (invoke "f64_dec.max_finite") (i64.const 0x7fefffffffffffff)) (assert_return (invoke "f64_dec.trailing_dot") (i64.const 0x54b249ad2594c37d)) +(assert_return (invoke "f64_dec.root_beer_float") (i64.const 0x3ff000001ff19e24)) + +(assert_return (invoke "f32-dec-sep1") (f32.const 1000000)) +(assert_return (invoke "f32-dec-sep2") (f32.const 1000)) +(assert_return (invoke "f32-dec-sep3") (f32.const 1003.141592)) +(assert_return (invoke "f32-dec-sep4") (f32.const 99e+13)) +(assert_return (invoke "f32-dec-sep5") (f32.const 122000.11354e23)) +(assert_return (invoke "f32-hex-sep1") (f32.const 0xa0f0099)) +(assert_return (invoke "f32-hex-sep2") (f32.const 0x1aa0f)) +(assert_return (invoke "f32-hex-sep3") (f32.const 0xa0ff.f141a59a)) +(assert_return (invoke "f32-hex-sep4") (f32.const 0xf0P+13)) +(assert_return (invoke "f32-hex-sep5") (f32.const 0x2af00a.1f3eep23)) + +(assert_return (invoke "f64-dec-sep1") (f64.const 1000000)) +(assert_return (invoke "f64-dec-sep2") (f64.const 1000)) +(assert_return (invoke "f64-dec-sep3") (f64.const 1003.141592)) +(assert_return (invoke "f64-dec-sep4") (f64.const 99e-123)) +(assert_return (invoke "f64-dec-sep5") (f64.const 122000.11354e23)) +(assert_return (invoke "f64-hex-sep1") (f64.const 0xaf00f00009999)) +(assert_return (invoke "f64-hex-sep2") (f64.const 0x1aa0f)) +(assert_return (invoke "f64-hex-sep3") (f64.const 0xa0ff.f141a59a)) +(assert_return (invoke "f64-hex-sep4") (f64.const 0xf0P+13)) +(assert_return (invoke "f64-hex-sep5") (f64.const 0x2af00a.1f3eep23)) + +;; Test parsing a float from binary +(module binary + ;; (func (export "4294967249") (result f64) (f64.const 4294967249)) + "\00\61\73\6d\01\00\00\00\01\85\80\80\80\00\01\60" + "\00\01\7c\03\82\80\80\80\00\01\00\07\8e\80\80\80" + "\00\01\0a\34\32\39\34\39\36\37\32\34\39\00\00\0a" + "\91\80\80\80\00\01\8b\80\80\80\00\00\44\00\00\20" + "\fa\ff\ff\ef\41\0b" +) + +(assert_return (invoke "4294967249") (f64.const 4294967249)) + +(assert_malformed + (module quote "(global f32 (f32.const _100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const +_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const -_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 99_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1__000))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const _1.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1.0_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1_.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1._0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const _1e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1e1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1_e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1e_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const _1.0e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1.0e1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1.0_e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1.0e_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1.0e+_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 1.0e_+1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const _0x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0_x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x00_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0xff__ffff))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x_1.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1.0_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1_.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1._0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x_1p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1p1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1_p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1p_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x_1.0p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1.0p1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1.0_p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1.0p_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1.0p+_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f32 (f32.const 0x1.0p_+1))") + "unknown operator" +) + +(assert_malformed + (module quote "(global f64 (f64.const _100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const +_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const -_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 99_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1__000))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const _1.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1.0_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1_.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1._0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const _1e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1e1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1_e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1e_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const _1.0e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1.0e1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1.0_e1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1.0e_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1.0e+_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 1.0e_+1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const _0x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0_x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x00_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0xff__ffff))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x_1.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1.0_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1_.0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1._0))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x_1p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1p1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1_p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1p_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x_1.0p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1.0p1_))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1.0_p1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1.0p_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1.0p+_1))") + "unknown operator" +) +(assert_malformed + (module quote "(global f64 (f64.const 0x1.0p_+1))") + "unknown operator" +) diff --git a/test/spec/float_misc.wast b/test/spec/float_misc.wast index ae223aba0..1aad1a35a 100644 --- a/test/spec/float_misc.wast +++ b/test/spec/float_misc.wast @@ -10,9 +10,9 @@ ;; value-changing optimizations, and (d) that the WebAssembly implementation ;; doesn't exhibit any known implementation bugs. ;; -;; This file supplements f32.wast, f64.wast, f32_cmp.wast, and f64_cmp.wast with -;; additional single-instruction tests covering additional miscellaneous -;; interesting cases. +;; This file supplements f32.wast, f64.wast, f32_bitwise.wast, f64_bitwise.wast, +;; f32_cmp.wast, and f64_cmp.wast with additional single-instruction tests +;; covering additional miscellaneous interesting cases. (module (func (export "f32.add") (param $x f32) (param $y f32) (result f32) (f32.add (local.get $x) (local.get $y))) @@ -57,11 +57,7 @@ (assert_return (invoke "f64.add" (f64.const 1.0) (f64.const 0x1p-53)) (f64.const 0x1.0p+0)) (assert_return (invoke "f64.add" (f64.const 1.0) (f64.const 0x1.0000000000001p-53)) (f64.const 0x1.0000000000001p+0)) -;; Test that what some systems call signaling NaN behaves as a quiet NaN. -(assert_return (invoke "f32.add" (f32.const nan:0x200000) (f32.const 1.0)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.add" (f64.const nan:0x4000000000000) (f64.const 1.0)) (f64.const nan:0xc000000000000)) - -;; Max subnornmal + min subnormal = min normal. +;; Max subnormal + min subnormal = min normal. (assert_return (invoke "f32.add" (f32.const 0x1p-149) (f32.const 0x1.fffffcp-127)) (f32.const 0x1p-126)) (assert_return (invoke "f64.add" (f64.const 0x0.0000000000001p-1022) (f64.const 0x0.fffffffffffffp-1022)) (f64.const 0x1p-1022)) @@ -75,6 +71,12 @@ ;; http://mmix.cs.hm.edu/bugs/bug_rounding.html (assert_return (invoke "f64.add" (f64.const -0x1p-1008) (f64.const 0x0.0000000001716p-1022)) (f64.const -0x1.fffffffffffffp-1009)) +;; http://www.vinc17.org/software/tst-ieee754.xsl +(assert_return (invoke "f64.add" (f64.const 9007199254740992) (f64.const 1.00001)) (f64.const 9007199254740994)) + +;; http://www.vinc17.org/software/test.java +(assert_return (invoke "f64.add" (f64.const 9007199254740994) (f64.const 0x1.fffep-1)) (f64.const 9007199254740994)) + ;; Computations that round differently in ties-to-odd mode. (assert_return (invoke "f32.add" (f32.const 0x1p23) (f32.const 0x1p-1)) (f32.const 0x1p23)) (assert_return (invoke "f32.add" (f32.const 0x1.000002p+23) (f32.const 0x1p-1)) (f32.const 0x1.000004p+23)) @@ -160,6 +162,16 @@ (assert_return (invoke "f32.add" (f32.const 0x1.fffffcp+127) (f32.const 0x1p+104)) (f32.const 0x1.fffffep+127)) (assert_return (invoke "f64.add" (f64.const 0x1.ffffffffffffep+1023) (f64.const 0x1p+971)) (f64.const 0x1.fffffffffffffp+1023)) +;; http://news.harvard.edu/gazette/story/2013/09/dawn-of-a-revolution/ +(assert_return (invoke "f32.add" (f32.const 2.0) (f32.const 2.0)) (f32.const 4.0)) +(assert_return (invoke "f64.add" (f64.const 2.0) (f64.const 2.0)) (f64.const 4.0)) + +;; Test rounding above the greatest finite value. +(assert_return (invoke "f32.add" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+102)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "f32.add" (f32.const 0x1.fffffep+127) (f32.const 0x1p+103)) (f32.const inf)) +(assert_return (invoke "f64.add" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+969)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "f64.add" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p+970)) (f64.const inf)) + ;; Test for a historic spreadsheet bug. ;; https://blogs.office.com/2007/09/25/calculation-issue-update/ (assert_return (invoke "f32.sub" (f32.const 65536.0) (f32.const 0x1p-37)) (f32.const 65536.0)) @@ -223,7 +235,7 @@ (assert_return (invoke "f64.sub" (f64.const 0x1.5e423fe8571f4p-57) (f64.const 0x1.9624ed7c162dfp-618)) (f64.const 0x1.5e423fe8571f4p-57)) ;; pow(e, π) - π -;; https://xkcd.com/217 +;; https://xkcd.com/217/ (assert_return (invoke "f32.sub" (f32.const 0x1.724046p+4) (f32.const 0x1.921fb6p+1)) (f32.const 0x1.3ffc5p+4)) (assert_return (invoke "f64.sub" (f64.const 0x1.724046eb0933ap+4) (f64.const 0x1.921fb54442d18p+1)) (f64.const 0x1.3ffc504280d97p+4)) @@ -239,18 +251,29 @@ (assert_return (invoke "f64.sub" (f64.const 400000000000002) (f64.const 400000000000001)) (f64.const 1.0)) (assert_return (invoke "f64.sub" (f64.const 400000000000002) (f64.const 400000000000000)) (f64.const 2.0)) -;; Min normal - min subnormal = max subnornmal. -(assert_return (invoke "f32.sub" (f32.const 0x1p-126) (f32.const 0x1p-149)) (f32.const 0x1.fffffcp-127)) -(assert_return (invoke "f64.sub" (f64.const 0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x0.fffffffffffffp-1022)) - -;; Min normal - max subnormal = min subnornmal. +;; Min normal - max subnormal = min subnormal. (assert_return (invoke "f32.sub" (f32.const 0x1p-126) (f32.const 0x1.fffffcp-127)) (f32.const 0x1p-149)) (assert_return (invoke "f64.sub" (f64.const 0x1p-1022) (f64.const 0x0.fffffffffffffp-1022)) (f64.const 0x0.0000000000001p-1022)) +;; Test subtraction of numbers very close to 1. +(assert_return (invoke "f32.sub" (f32.const 0x1.000002p+0) (f32.const 0x1.fffffep-1)) (f32.const 0x1.8p-23)) +(assert_return (invoke "f32.sub" (f32.const 0x1.000002p+0) (f32.const 0x1.0p+0)) (f32.const 0x1p-23)) +(assert_return (invoke "f32.sub" (f32.const 0x1p+0) (f32.const 0x1.fffffep-1)) (f32.const 0x1p-24)) +(assert_return (invoke "f64.sub" (f64.const 0x1.0000000000001p+0) (f64.const 0x1.fffffffffffffp-1)) (f64.const 0x1.8p-52)) +(assert_return (invoke "f64.sub" (f64.const 0x1.0000000000001p+0) (f64.const 0x1.0p+0)) (f64.const 0x1p-52)) +(assert_return (invoke "f64.sub" (f64.const 0x1p+0) (f64.const 0x1.fffffffffffffp-1)) (f64.const 0x1p-53)) + +;; Test the least value that can be subtracted from the max value to produce a +;; different value. +(assert_return (invoke "f32.sub" (f32.const 0x1.fffffep+127) (f32.const 0x1.fffffep+102)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "f32.sub" (f32.const 0x1.fffffep+127) (f32.const 0x1p+103)) (f32.const 0x1.fffffcp+127)) +(assert_return (invoke "f64.sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1.fffffffffffffp+969)) (f64.const 0x1.fffffffffffffp+1023)) +(assert_return (invoke "f64.sub" (f64.const 0x1.fffffffffffffp+1023) (f64.const 0x1p+970)) (f64.const 0x1.ffffffffffffep+1023)) + ;; Miscellaneous values. (assert_return (invoke "f32.mul" (f32.const 1e15) (f32.const 1e15)) (f32.const 0x1.93e592p+99)) -(assert_return (invoke "f32.mul" (f32.const 1e20) (f32.const 1e20)) (f32.const infinity)) -(assert_return (invoke "f32.mul" (f32.const 1e25) (f32.const 1e25)) (f32.const infinity)) +(assert_return (invoke "f32.mul" (f32.const 1e20) (f32.const 1e20)) (f32.const inf)) +(assert_return (invoke "f32.mul" (f32.const 1e25) (f32.const 1e25)) (f32.const inf)) (assert_return (invoke "f64.mul" (f64.const 1e15) (f64.const 1e15)) (f64.const 0x1.93e5939a08ceap+99)) (assert_return (invoke "f64.mul" (f64.const 1e20) (f64.const 1e20)) (f64.const 0x1.d6329f1c35ca5p+132)) (assert_return (invoke "f64.mul" (f64.const 1e25) (f64.const 1e25)) (f64.const 0x1.11b0ec57e649bp+166)) @@ -272,7 +295,7 @@ (assert_return (invoke "f32.mul" (f32.const -0x1.b17694p+92) (f32.const -0x1.e4b56ap-97)) (f32.const 0x1.9a5baep-4)) (assert_return (invoke "f32.mul" (f32.const -0x1.1626a6p+79) (f32.const -0x1.c57d7p-75)) (f32.const 0x1.ecbaaep+4)) (assert_return (invoke "f32.mul" (f32.const 0x1.7acf72p+53) (f32.const 0x1.6c89acp+5)) (f32.const 0x1.0db556p+59)) -(assert_return (invoke "f64.mul" (f64.const -0x1.25c293f6f37e4p+425) (f64.const 0x1.f5fd4fa41c6d8p+945)) (f64.const -infinity)) +(assert_return (invoke "f64.mul" (f64.const -0x1.25c293f6f37e4p+425) (f64.const 0x1.f5fd4fa41c6d8p+945)) (f64.const -inf)) (assert_return (invoke "f64.mul" (f64.const -0x1.cc1ae79fffc5bp-986) (f64.const -0x1.c36ccc2861ca6p-219)) (f64.const 0x0p+0)) (assert_return (invoke "f64.mul" (f64.const 0x1.c0232b3e64b56p+606) (f64.const -0x1.f6939cf3affaap+106)) (f64.const -0x1.b7e3aedf190d3p+713)) (assert_return (invoke "f64.mul" (f64.const -0x1.60f289966b271p-313) (f64.const 0x1.28a5497f0c259p+583)) (f64.const -0x1.98fc50bcec259p+270)) @@ -286,12 +309,12 @@ (assert_return (invoke "f32.mul" (f32.const 0x1.936742p+30) (f32.const -0x1.a7a19p+66)) (f32.const -0x1.4dc71ap+97)) (assert_return (invoke "f64.mul" (f64.const -0x1.ba737b4ca3b13p-639) (f64.const 0x1.8923309857438p-314)) (f64.const -0x1.53bc0d07baa37p-952)) (assert_return (invoke "f64.mul" (f64.const 0x1.7c1932e610219p-276) (f64.const -0x1.2605db646489fp-635)) (f64.const -0x1.b48da2b0d2ae3p-911)) -(assert_return (invoke "f64.mul" (f64.const -0x1.e43cdf3b2108p+329) (f64.const -0x1.99d96abbd61d1p+835)) (f64.const infinity)) +(assert_return (invoke "f64.mul" (f64.const -0x1.e43cdf3b2108p+329) (f64.const -0x1.99d96abbd61d1p+835)) (f64.const inf)) (assert_return (invoke "f64.mul" (f64.const 0x1.4c19466551da3p+947) (f64.const 0x1.0bdcd6c7646e9p-439)) (f64.const 0x1.5b7cd8c3f638ap+508)) (assert_return (invoke "f64.mul" (f64.const 0x1.ff1da1726e3dfp+339) (f64.const -0x1.043c44f52b158p+169)) (f64.const -0x1.03c9364bb585cp+509)) ;; Computations that round differently in round-toward-zero mode. -(assert_return (invoke "f32.mul" (f32.const -0x1.907e8ap+46) (f32.const -0x1.5d3668p+95)) (f32.const infinity)) +(assert_return (invoke "f32.mul" (f32.const -0x1.907e8ap+46) (f32.const -0x1.5d3668p+95)) (f32.const inf)) (assert_return (invoke "f32.mul" (f32.const -0x1.8c9f74p-3) (f32.const 0x1.e2b452p-99)) (f32.const -0x1.75edccp-101)) (assert_return (invoke "f32.mul" (f32.const -0x1.cc605ap-19) (f32.const 0x1.ec321ap+105)) (f32.const -0x1.ba91a4p+87)) (assert_return (invoke "f32.mul" (f32.const -0x1.5fbb7ap+56) (f32.const 0x1.a8965ep-96)) (f32.const -0x1.23ae8ep-39)) @@ -299,7 +322,7 @@ (assert_return (invoke "f64.mul" (f64.const -0x1.5b0266454c26bp-496) (f64.const -0x1.af5787e3e0399p+433)) (f64.const 0x1.2457d81949e0bp-62)) (assert_return (invoke "f64.mul" (f64.const 0x1.0d54a82393d45p+478) (f64.const -0x1.425760807ceaep-764)) (f64.const -0x1.532068c8d0d5dp-286)) (assert_return (invoke "f64.mul" (f64.const -0x1.b532af981786p+172) (f64.const 0x1.ada95085ba36fp+359)) (f64.const -0x1.6ee38c1e01864p+532)) -(assert_return (invoke "f64.mul" (f64.const 0x1.e132f4d49d1cep+768) (f64.const -0x1.a75afe9a7d864p+374)) (f64.const -infinity)) +(assert_return (invoke "f64.mul" (f64.const 0x1.e132f4d49d1cep+768) (f64.const -0x1.a75afe9a7d864p+374)) (f64.const -inf)) (assert_return (invoke "f64.mul" (f64.const 0x1.68bbf1cfff90ap+81) (f64.const 0x1.09cd17d652c5p+70)) (f64.const 0x1.768b8d67d794p+151)) ;; Computations that round differently on x87. @@ -331,15 +354,30 @@ ;; Test the greatest positive value with a finite square. (assert_return (invoke "f32.mul" (f32.const 0x1.fffffep+63) (f32.const 0x1.fffffep+63)) (f32.const 0x1.fffffcp+127)) -(assert_return (invoke "f32.mul" (f32.const 0x1p+64) (f32.const 0x1p+64)) (f32.const infinity)) +(assert_return (invoke "f32.mul" (f32.const 0x1p+64) (f32.const 0x1p+64)) (f32.const inf)) (assert_return (invoke "f64.mul" (f64.const 0x1.fffffffffffffp+511) (f64.const 0x1.fffffffffffffp+511)) (f64.const 0x1.ffffffffffffep+1023)) -(assert_return (invoke "f64.mul" (f64.const 0x1p+512) (f64.const 0x1p+512)) (f64.const infinity)) +(assert_return (invoke "f64.mul" (f64.const 0x1p+512) (f64.const 0x1p+512)) (f64.const inf)) + +;; Test the squares of values very close to 1. +(assert_return (invoke "f32.mul" (f32.const 0x1.000002p+0) (f32.const 0x1.000002p+0)) (f32.const 0x1.000004p+0)) +(assert_return (invoke "f32.mul" (f32.const 0x1.fffffep-1) (f32.const 0x1.fffffep-1)) (f32.const 0x1.fffffcp-1)) +(assert_return (invoke "f64.mul" (f64.const 0x1.0000000000001p+0) (f64.const 0x1.0000000000001p+0)) (f64.const 0x1.0000000000002p+0)) +(assert_return (invoke "f64.mul" (f64.const 0x1.fffffffffffffp-1) (f64.const 0x1.fffffffffffffp-1)) (f64.const 0x1.ffffffffffffep-1)) + +;; Test multiplication of numbers very close to 1. +(assert_return (invoke "f32.mul" (f32.const 0x1.000002p+0) (f32.const 0x1.fffffep-1)) (f32.const 0x1p+0)) +(assert_return (invoke "f32.mul" (f32.const 0x1.000004p+0) (f32.const 0x1.fffffcp-1)) (f32.const 0x1.000002p+0)) +(assert_return (invoke "f64.mul" (f64.const 0x1.0000000000001p+0) (f64.const 0x1.fffffffffffffp-1)) (f64.const 0x1p+0)) +(assert_return (invoke "f64.mul" (f64.const 0x1.0000000000002p+0) (f64.const 0x1.ffffffffffffep-1)) (f64.const 0x1.0000000000001p+0)) ;; Test MIN * EPSILON. ;; http://www.mpfr.org/mpfr-2.0.1/patch2 (assert_return (invoke "f32.mul" (f32.const 0x1p-126) (f32.const 0x1p-23)) (f32.const 0x1p-149)) (assert_return (invoke "f64.mul" (f64.const 0x1p-1022) (f64.const 0x1p-52)) (f64.const 0x0.0000000000001p-1022)) +;; http://opencores.org/bug,view,2454 +(assert_return (invoke "f32.mul" (f32.const -0x1.0006p+4) (f32.const 0x1.ap-132)) (f32.const -0x1.a009cp-128)) + ;; Miscellaneous values. (assert_return (invoke "f32.div" (f32.const 1.123456789) (f32.const 100)) (f32.const 0x1.702264p-7)) (assert_return (invoke "f32.div" (f32.const 8391667.0) (f32.const 12582905.0)) (f32.const 0x1.55754p-1)) @@ -370,7 +408,7 @@ (assert_return (invoke "f64.div" (f64.const -0x1.44ca7539cc851p+540) (f64.const 0x1.58501bccc58fep+453)) (f64.const -0x1.e2f8657e0924ep+86)) ;; Computations that round differently in round-downward mode. -(assert_return (invoke "f32.div" (f32.const -0x1.c2c54ap+69) (f32.const -0x1.00d142p-86)) (f32.const infinity)) +(assert_return (invoke "f32.div" (f32.const -0x1.c2c54ap+69) (f32.const -0x1.00d142p-86)) (f32.const inf)) (assert_return (invoke "f32.div" (f32.const 0x1.e35abep-46) (f32.const 0x1.c69dfp+44)) (f32.const 0x1.102eb4p-90)) (assert_return (invoke "f32.div" (f32.const 0x1.45ff2ap+0) (f32.const -0x1.1e8754p+89)) (f32.const -0x1.23434ep-89)) (assert_return (invoke "f32.div" (f32.const 0x1.8db18ap-51) (f32.const 0x1.47c678p-128)) (f32.const 0x1.369b96p+77)) @@ -382,13 +420,13 @@ (assert_return (invoke "f64.div" (f64.const -0x1.91f58d7ed1237p+236) (f64.const -0x1.f190d808383c8p+55)) (f64.const 0x1.9d9eb0836f906p+180)) ;; Computations that round differently in round-toward-zero mode. -(assert_return (invoke "f32.div" (f32.const 0x1.64b2a4p+26) (f32.const 0x1.e95752p-119)) (f32.const infinity)) +(assert_return (invoke "f32.div" (f32.const 0x1.64b2a4p+26) (f32.const 0x1.e95752p-119)) (f32.const inf)) (assert_return (invoke "f32.div" (f32.const -0x1.53c9b6p+77) (f32.const 0x1.d689ap+27)) (f32.const -0x1.71baa4p+49)) (assert_return (invoke "f32.div" (f32.const 0x1.664a8ap+38) (f32.const -0x1.59dba2p+96)) (f32.const -0x1.0933f4p-58)) (assert_return (invoke "f32.div" (f32.const -0x1.99e0fap+111) (f32.const -0x1.c2b5a8p+9)) (f32.const 0x1.d19de6p+101)) (assert_return (invoke "f32.div" (f32.const -0x1.5a815ap+92) (f32.const -0x1.b5820ap+13)) (f32.const 0x1.9580b8p+78)) (assert_return (invoke "f64.div" (f64.const -0x1.81fd1e2af7bebp-655) (f64.const 0x1.edefc4eae536cp-691)) (f64.const -0x1.901abdd91b661p+35)) -(assert_return (invoke "f64.div" (f64.const -0x1.47cf932953c43p+782) (f64.const -0x1.bc40496b1f2a1p-553)) (f64.const infinity)) +(assert_return (invoke "f64.div" (f64.const -0x1.47cf932953c43p+782) (f64.const -0x1.bc40496b1f2a1p-553)) (f64.const inf)) (assert_return (invoke "f64.div" (f64.const -0x1.2bd2e8fbdcad7p-746) (f64.const 0x1.b115674cc476ep-65)) (f64.const -0x1.62752bf19fa81p-682)) (assert_return (invoke "f64.div" (f64.const -0x1.f923e3fea9efep+317) (f64.const -0x1.8044c74d27a39p-588)) (f64.const 0x1.5086518cc7186p+905)) (assert_return (invoke "f64.div" (f64.const 0x1.516ed2051d6bbp+181) (f64.const -0x1.c9f455eb9c2eep+214)) (f64.const -0x1.79414d67f2889p-34)) @@ -440,9 +478,9 @@ (assert_return (invoke "f64.div" (f64.const 0x1p-51) (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x0.0000000000001p-1022)) ;; Test the least positive value with a finite reciprocal. -(assert_return (invoke "f32.div" (f32.const 1.0) (f32.const 0x1p-128)) (f32.const infinity)) +(assert_return (invoke "f32.div" (f32.const 1.0) (f32.const 0x1p-128)) (f32.const inf)) (assert_return (invoke "f32.div" (f32.const 1.0) (f32.const 0x1.000008p-128)) (f32.const 0x1.fffffp+127)) -(assert_return (invoke "f64.div" (f64.const 1.0) (f64.const 0x0.4p-1022)) (f64.const infinity)) +(assert_return (invoke "f64.div" (f64.const 1.0) (f64.const 0x0.4p-1022)) (f64.const inf)) (assert_return (invoke "f64.div" (f64.const 1.0) (f64.const 0x0.4000000000001p-1022)) (f64.const 0x1.ffffffffffff8p+1023)) ;; Test the least positive value that has a subnormal reciprocal. @@ -451,11 +489,6 @@ (assert_return (invoke "f64.div" (f64.const 1.0) (f64.const 0x1.0000000000001p+1022)) (f64.const 0x0.fffffffffffffp-1022)) (assert_return (invoke "f64.div" (f64.const 1.0) (f64.const 0x1p+1022)) (f64.const 0x1p-1022)) -;; Test the minimum positive normal number divided by the minimum positive -;; subnormal number. -(assert_return (invoke "f32.div" (f32.const 0x1p-126) (f32.const 0x1p-149)) (f32.const 0x1p+23)) -(assert_return (invoke "f64.div" (f64.const 0x1p-1022) (f64.const 0x0.0000000000001p-1022)) (f64.const 0x1p+52)) - ;; Test that the last binary digit of 1.0/3.0 is even in f32, ;; https://en.wikipedia.org/wiki/Single-precision_floating-point_format#Single-precision_examples ;; @@ -471,6 +504,16 @@ (assert_return (invoke "f64.div" (f64.const 0x3p+0) (f64.const 0x1.2p+3)) (f64.const 0x1.5555555555555p-2)) (assert_return (invoke "f64.div" (f64.const 0x1.2p+3) (f64.const 0x1.bp+4)) (f64.const 0x1.5555555555555p-2)) +;; Test division of numbers very close to 1. +(assert_return (invoke "f32.div" (f32.const 0x1.000002p+0) (f32.const 0x1.fffffep-1)) (f32.const 0x1.000004p+0)) +(assert_return (invoke "f32.div" (f32.const 0x1.fffffep-1) (f32.const 0x1.000002p+0)) (f32.const 0x1.fffffap-1)) +(assert_return (invoke "f32.div" (f32.const 0x1.0p+0) (f32.const 0x1.fffffep-1)) (f32.const 0x1.000002p+0)) +(assert_return (invoke "f32.div" (f32.const 0x1.0p+0) (f32.const 0x1.000002p+0)) (f32.const 0x1.fffffcp-1)) +(assert_return (invoke "f64.div" (f64.const 0x1.0000000000001p+0) (f64.const 0x1.fffffffffffffp-1)) (f64.const 0x1.0000000000002p+0)) +(assert_return (invoke "f64.div" (f64.const 0x1.fffffffffffffp-1) (f64.const 0x1.0000000000001p+0)) (f64.const 0x1.ffffffffffffdp-1)) +(assert_return (invoke "f64.div" (f64.const 0x1.0p+0) (f64.const 0x1.fffffffffffffp-1)) (f64.const 0x1.0000000000001p+0)) +(assert_return (invoke "f64.div" (f64.const 0x1.0p+0) (f64.const 0x1.0000000000001p+0)) (f64.const 0x1.ffffffffffffep-1)) + ;; Test for bugs found in an early RISC-V implementation. ;; https://github.com/riscv/riscv-tests/pull/8 (assert_return (invoke "f32.sqrt" (f32.const 0x1.56p+7)) (f32.const 0x1.a2744cp+3)) @@ -526,60 +569,50 @@ (assert_return (invoke "f64.sqrt" (f64.const 0x1.c201b94757145p-492)) (f64.const 0x1.5369ee6bf2967p-246)) ;; Computations that round differently when computed via f32. -(assert_return_nan (invoke "f64.sqrt" (f64.const -0x1.360e8d0032adp-963))) +(assert_return_canonical_nan (invoke "f64.sqrt" (f64.const -0x1.360e8d0032adp-963))) (assert_return (invoke "f64.sqrt" (f64.const 0x1.d9a6f5eef0503p+103)) (f64.const 0x1.ec73f56c166f6p+51)) (assert_return (invoke "f64.sqrt" (f64.const 0x1.aa051a5c4ec27p-760)) (f64.const 0x1.4a3e771ff5149p-380)) (assert_return (invoke "f64.sqrt" (f64.const 0x1.e5522a741babep-276)) (f64.const 0x1.607ae2b6feb7dp-138)) (assert_return (invoke "f64.sqrt" (f64.const 0x1.4832badc0c061p+567)) (f64.const 0x1.99ec7934139b2p+283)) -;; Test the least greatest value with a sqrt that rounds to one. +;; Test the least value with a sqrt that rounds to one. (assert_return (invoke "f32.sqrt" (f32.const 0x1.000002p+0)) (f32.const 0x1p+0)) (assert_return (invoke "f32.sqrt" (f32.const 0x1.000004p+0)) (f32.const 0x1.000002p+0)) (assert_return (invoke "f64.sqrt" (f64.const 0x1.0000000000001p+0)) (f64.const 0x1p+0)) (assert_return (invoke "f64.sqrt" (f64.const 0x1.0000000000002p+0)) (f64.const 0x1.0000000000001p+0)) +;; Test the greatest value less than one for which sqrt is not an identity. +(assert_return (invoke "f32.sqrt" (f32.const 0x1.fffffcp-1)) (f32.const 0x1.fffffep-1)) +(assert_return (invoke "f32.sqrt" (f32.const 0x1.fffffap-1)) (f32.const 0x1.fffffcp-1)) +(assert_return (invoke "f64.sqrt" (f64.const 0x1.ffffffffffffep-1)) (f64.const 0x1.fffffffffffffp-1)) +(assert_return (invoke "f64.sqrt" (f64.const 0x1.ffffffffffffdp-1)) (f64.const 0x1.ffffffffffffep-1)) + ;; Test that the bitwise floating point operators are bitwise on NaN. -(assert_return (invoke "f32.abs" (f32.const nan)) (f32.const nan)) -(assert_return (invoke "f32.abs" (f32.const -nan)) (f32.const nan)) (assert_return (invoke "f32.abs" (f32.const nan:0x0f1e2)) (f32.const nan:0x0f1e2)) (assert_return (invoke "f32.abs" (f32.const -nan:0x0f1e2)) (f32.const nan:0x0f1e2)) -(assert_return (invoke "f64.abs" (f64.const nan)) (f64.const nan)) -(assert_return (invoke "f64.abs" (f64.const -nan)) (f64.const nan)) (assert_return (invoke "f64.abs" (f64.const nan:0x0f1e27a6b)) (f64.const nan:0x0f1e27a6b)) (assert_return (invoke "f64.abs" (f64.const -nan:0x0f1e27a6b)) (f64.const nan:0x0f1e27a6b)) -(assert_return (invoke "f32.neg" (f32.const nan)) (f32.const -nan)) -(assert_return (invoke "f32.neg" (f32.const -nan)) (f32.const nan)) (assert_return (invoke "f32.neg" (f32.const nan:0x0f1e2)) (f32.const -nan:0x0f1e2)) (assert_return (invoke "f32.neg" (f32.const -nan:0x0f1e2)) (f32.const nan:0x0f1e2)) -(assert_return (invoke "f64.neg" (f64.const nan)) (f64.const -nan)) -(assert_return (invoke "f64.neg" (f64.const -nan)) (f64.const nan)) (assert_return (invoke "f64.neg" (f64.const nan:0x0f1e27a6b)) (f64.const -nan:0x0f1e27a6b)) (assert_return (invoke "f64.neg" (f64.const -nan:0x0f1e27a6b)) (f64.const nan:0x0f1e27a6b)) -(assert_return (invoke "f32.copysign" (f32.const nan) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "f32.copysign" (f32.const nan) (f32.const -nan)) (f32.const -nan)) -(assert_return (invoke "f32.copysign" (f32.const -nan) (f32.const nan)) (f32.const nan)) -(assert_return (invoke "f32.copysign" (f32.const -nan) (f32.const -nan)) (f32.const -nan)) (assert_return (invoke "f32.copysign" (f32.const nan:0x0f1e2) (f32.const nan)) (f32.const nan:0x0f1e2)) (assert_return (invoke "f32.copysign" (f32.const nan:0x0f1e2) (f32.const -nan)) (f32.const -nan:0x0f1e2)) (assert_return (invoke "f32.copysign" (f32.const -nan:0x0f1e2) (f32.const nan)) (f32.const nan:0x0f1e2)) (assert_return (invoke "f32.copysign" (f32.const -nan:0x0f1e2) (f32.const -nan)) (f32.const -nan:0x0f1e2)) -(assert_return (invoke "f64.copysign" (f64.const nan) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "f64.copysign" (f64.const nan) (f64.const -nan)) (f64.const -nan)) -(assert_return (invoke "f64.copysign" (f64.const -nan) (f64.const nan)) (f64.const nan)) -(assert_return (invoke "f64.copysign" (f64.const -nan) (f64.const -nan)) (f64.const -nan)) (assert_return (invoke "f64.copysign" (f64.const nan:0x0f1e27a6b) (f64.const nan)) (f64.const nan:0x0f1e27a6b)) (assert_return (invoke "f64.copysign" (f64.const nan:0x0f1e27a6b) (f64.const -nan)) (f64.const -nan:0x0f1e27a6b)) (assert_return (invoke "f64.copysign" (f64.const -nan:0x0f1e27a6b) (f64.const nan)) (f64.const nan:0x0f1e27a6b)) (assert_return (invoke "f64.copysign" (f64.const -nan:0x0f1e27a6b) (f64.const -nan)) (f64.const -nan:0x0f1e27a6b)) -;; Test that ceil isn't implemented as adding 0.5 and rounding to nearest. +;; Test values close to 1.0. (assert_return (invoke "f32.ceil" (f32.const 0x1.fffffep-1)) (f32.const 1.0)) -(assert_return (invoke "f32.ceil" (f32.const 0x1p-126)) (f32.const 1.0)) +(assert_return (invoke "f32.ceil" (f32.const 0x1.000002p+0)) (f32.const 2.0)) (assert_return (invoke "f64.ceil" (f64.const 0x1.fffffffffffffp-1)) (f64.const 1.0)) -(assert_return (invoke "f64.ceil" (f64.const 0x1p-1022)) (f64.const 1.0)) +(assert_return (invoke "f64.ceil" (f64.const 0x1.0000000000001p+0)) (f64.const 2.0)) ;; Test the maximum and minimum value for which ceil is not an identity operator. (assert_return (invoke "f32.ceil" (f32.const 0x1.fffffep+22)) (f32.const 0x1p+23)) @@ -587,11 +620,18 @@ (assert_return (invoke "f64.ceil" (f64.const 0x1.fffffffffffffp+51)) (f64.const 0x1p+52)) (assert_return (invoke "f64.ceil" (f64.const -0x1.fffffffffffffp+51)) (f64.const -0x1.ffffffffffffep+51)) -;; Test that floor isn't implemented as subtracting 0.5 and rounding to nearest. +;; Test that implementations don't do the x+0x1p52-0x1p52 trick outside the +;; range where it's safe. +(assert_return (invoke "f32.ceil" (f32.const 0x1.fffffep+23)) (f32.const 0x1.fffffep+23)) +(assert_return (invoke "f32.ceil" (f32.const -0x1.fffffep+23)) (f32.const -0x1.fffffep+23)) +(assert_return (invoke "f64.ceil" (f64.const 0x1.fffffffffffffp+52)) (f64.const 0x1.fffffffffffffp+52)) +(assert_return (invoke "f64.ceil" (f64.const -0x1.fffffffffffffp+52)) (f64.const -0x1.fffffffffffffp+52)) + +;; Test values close to -1.0. (assert_return (invoke "f32.floor" (f32.const -0x1.fffffep-1)) (f32.const -1.0)) -(assert_return (invoke "f32.floor" (f32.const -0x1p-126)) (f32.const -1.0)) +(assert_return (invoke "f32.floor" (f32.const -0x1.000002p+0)) (f32.const -2.0)) (assert_return (invoke "f64.floor" (f64.const -0x1.fffffffffffffp-1)) (f64.const -1.0)) -(assert_return (invoke "f64.floor" (f64.const -0x1p-1022)) (f64.const -1.0)) +(assert_return (invoke "f64.floor" (f64.const -0x1.0000000000001p+0)) (f64.const -2.0)) ;; Test the maximum and minimum value for which floor is not an identity operator. (assert_return (invoke "f32.floor" (f32.const -0x1.fffffep+22)) (f32.const -0x1p+23)) @@ -599,6 +639,11 @@ (assert_return (invoke "f64.floor" (f64.const -0x1.fffffffffffffp+51)) (f64.const -0x1p+52)) (assert_return (invoke "f64.floor" (f64.const 0x1.fffffffffffffp+51)) (f64.const 0x1.ffffffffffffep+51)) +;; Test that floor isn't implemented as XMVectorFloor. +;; http://dss.stephanierct.com/DevBlog/?p=8#comment-4 +(assert_return (invoke "f32.floor" (f32.const 88607.0)) (f32.const 88607.0)) +(assert_return (invoke "f64.floor" (f64.const 88607.0)) (f64.const 88607.0)) + ;; Test the maximum and minimum value for which trunc is not an identity operator. (assert_return (invoke "f32.trunc" (f32.const -0x1.fffffep+22)) (f32.const -0x1.fffffcp+22)) (assert_return (invoke "f32.trunc" (f32.const 0x1.fffffep+22)) (f32.const 0x1.fffffcp+22)) @@ -631,13 +676,3 @@ (assert_return (invoke "f32.nearest" (f32.const 0x1.fffffep+22)) (f32.const 0x1p+23)) (assert_return (invoke "f64.nearest" (f64.const -0x1.fffffffffffffp+51)) (f64.const -0x1p+52)) (assert_return (invoke "f64.nearest" (f64.const 0x1.fffffffffffffp+51)) (f64.const 0x1p+52)) - -;; Test that min and max behave properly with signaling NaNs. -(assert_return (invoke "f32.min" (f32.const 0.0) (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f32.min" (f32.const nan:0x200000) (f32.const 0.0)) (f32.const nan:0x600000)) -(assert_return (invoke "f32.max" (f32.const 0.0) (f32.const nan:0x200000)) (f32.const nan:0x600000)) -(assert_return (invoke "f32.max" (f32.const nan:0x200000) (f32.const 0.0)) (f32.const nan:0x600000)) -(assert_return (invoke "f64.min" (f64.const 0.0) (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) -(assert_return (invoke "f64.min" (f64.const nan:0x4000000000000) (f64.const 0.0)) (f64.const nan:0xc000000000000)) -(assert_return (invoke "f64.max" (f64.const 0.0) (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) -(assert_return (invoke "f64.max" (f64.const nan:0x4000000000000) (f64.const 0.0)) (f64.const nan:0xc000000000000)) diff --git a/test/spec/forward.wast b/test/spec/forward.wast index 6cf94dc9e..7bb3770d7 100644 --- a/test/spec/forward.wast +++ b/test/spec/forward.wast @@ -1,15 +1,15 @@ (module (func $even (export "even") (param $n i32) (result i32) - (if i32 (i32.eq (local.get $n) (i32.const 0)) - (i32.const 1) - (call $odd (i32.sub (local.get $n) (i32.const 1))) + (if (result i32) (i32.eq (local.get $n) (i32.const 0)) + (then (i32.const 1)) + (else (call $odd (i32.sub (local.get $n) (i32.const 1)))) ) ) (func $odd (export "odd") (param $n i32) (result i32) - (if i32 (i32.eq (local.get $n) (i32.const 0)) - (i32.const 0) - (call $even (i32.sub (local.get $n) (i32.const 1))) + (if (result i32) (i32.eq (local.get $n) (i32.const 0)) + (then (i32.const 0)) + (else (call $even (i32.sub (local.get $n) (i32.const 1)))) ) ) ) diff --git a/test/spec/func.wast b/test/spec/func.wast index 83fb1aff3..a6b05f53c 100644 --- a/test/spec/func.wast +++ b/test/spec/func.wast @@ -30,11 +30,27 @@ (func (result i32) (unreachable)) + (type $sig-1 (func)) + (type $sig-2 (func (result i32))) + (type $sig-3 (func (param $x i32))) + (type $sig-4 (func (param i32 f64 i32) (result i32))) + + (func (export "type-use-1") (type $sig-1)) + (func (export "type-use-2") (type $sig-2) (i32.const 0)) + (func (export "type-use-3") (type $sig-3)) + (func (export "type-use-4") (type $sig-4) (i32.const 0)) + (func (export "type-use-5") (type $sig-2) (result i32) (i32.const 0)) + (func (export "type-use-6") (type $sig-3) (param i32)) + (func (export "type-use-7") + (type $sig-4) (param i32) (param f64 i32) (result i32) (i32.const 0) + ) + (func (type $sig)) + (func (type $forward)) ;; forward reference (func $complex (param i32 f32) (param $x i64) (param) (param i32) - (result i32) + (result) (result i32) (result) (local f32) (local $y i32) (local i64 i32) (local) (local f64 i32) (unreachable) (unreachable) ) @@ -44,6 +60,7 @@ (unreachable) (unreachable) ) + (type $forward (func)) ;; Typing of locals @@ -97,7 +114,7 @@ (func (export "value-f64") (result f64) (f64.const 77.77)) (func (export "value-block-void") (block (call $dummy) (call $dummy))) (func (export "value-block-i32") (result i32) - (block i32 (call $dummy) (i32.const 77)) + (block (result i32) (call $dummy) (i32.const 77)) ) (func (export "return-empty") (return)) @@ -106,7 +123,7 @@ (func (export "return-f32") (result f32) (return (f32.const 78.7))) (func (export "return-f64") (result f64) (return (f64.const 78.78))) (func (export "return-block-i32") (result i32) - (return (block i32 (call $dummy) (i32.const 77))) + (return (block (result i32) (call $dummy) (i32.const 77))) ) (func (export "break-empty") (br 0)) @@ -115,7 +132,7 @@ (func (export "break-f32") (result f32) (br 0 (f32.const 79.9))) (func (export "break-f64") (result f64) (br 0 (f64.const 79.79))) (func (export "break-block-i32") (result i32) - (br 0 (block i32 (call $dummy) (i32.const 77))) + (br 0 (block (result i32) (call $dummy) (i32.const 77))) ) (func (export "break-br_if-empty") (param i32) @@ -136,7 +153,9 @@ ) (func (export "break-br_table-nested-num") (param i32) (result i32) (i32.add - (block i32 (br_table 0 1 0 (i32.const 50) (local.get 0)) (i32.const 51)) + (block (result i32) + (br_table 0 1 0 (i32.const 50) (local.get 0)) (i32.const 51) + ) (i32.const 2) ) ) @@ -147,59 +166,20 @@ (func (export "init-local-i64") (result i64) (local i64) (local.get 0)) (func (export "init-local-f32") (result f32) (local f32) (local.get 0)) (func (export "init-local-f64") (result f64) (local f64) (local.get 0)) +) - - ;; Desugaring of implicit type signature - (func $empty-sig-1) ;; should be assigned type $sig - (func $complex-sig-1 (param f64 i64 f64 i64 f64 i64 f32 i32)) - (func $empty-sig-2) ;; should be assigned type $sig - (func $complex-sig-2 (param f64 i64 f64 i64 f64 i64 f32 i32)) - (func $complex-sig-3 (param f64 i64 f64 i64 f64 i64 f32 i32)) - - (type $empty-sig-duplicate (func)) - (type $complex-sig-duplicate (func (param f64 i64 f64 i64 f64 i64 f32 i32))) - (table funcref - (elem - $complex-sig-3 $empty-sig-2 $complex-sig-1 $complex-sig-3 $empty-sig-1 - ) - ) - - (func (export "signature-explicit-reused") - (call_indirect (type $sig) (i32.const 1)) - (call_indirect (type $sig) (i32.const 4)) - ) - - (func (export "signature-implicit-reused") - ;; The implicit index 16 in this test depends on the function and - ;; type definitions, and may need adapting if they change. - (call_indirect (type 16) - (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) - (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) - (i32.const 0) - ) - (call_indirect (type 16) - (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) - (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) - (i32.const 2) - ) - (call_indirect (type 16) - (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) - (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) - (i32.const 3) - ) - ) - - (func (export "signature-explicit-duplicate") - (call_indirect (type $empty-sig-duplicate) (i32.const 1)) - ) - - (func (export "signature-implicit-duplicate") - (call_indirect (type $complex-sig-duplicate) - (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) - (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) - (i32.const 0) - ) - ) +(assert_return (invoke "type-use-1")) +(assert_return (invoke "type-use-2") (i32.const 0)) +(assert_return (invoke "type-use-3" (i32.const 1))) +(assert_return + (invoke "type-use-4" (i32.const 1) (f64.const 1) (i32.const 1)) + (i32.const 0) +) +(assert_return (invoke "type-use-5") (i32.const 0)) +(assert_return (invoke "type-use-6" (i32.const 1))) +(assert_return + (invoke "type-use-7" (i32.const 1) (f64.const 1) (i32.const 1)) + (i32.const 0) ) (assert_return (invoke "local-first-i32") (i32.const 0)) @@ -303,12 +283,178 @@ (assert_return (invoke "init-local-f32") (f32.const 0)) (assert_return (invoke "init-local-f64") (f64.const 0)) + +;; Expansion of inline function types + +(module + (func $f (result f64) (f64.const 0)) ;; adds implicit type definition + (func $g (param i32)) ;; reuses explicit type definition + (type $t (func (param i32))) + + (func $i32->void (type 0)) ;; (param i32) + (func $void->f64 (type 1) (f64.const 0)) ;; (result f64) + (func $check + (call $i32->void (i32.const 0)) + (drop (call $void->f64)) + ) +) + +(assert_invalid + (module + (func $f (result f64) (f64.const 0)) ;; adds implicit type definition + (func $g (param i32)) ;; reuses explicit type definition + (func $h (result f64) (f64.const 1)) ;; reuses implicit type definition + (type $t (func (param i32))) + + (func (type 2)) ;; does not exist + ) + "unknown type" +) + + +(module + (type $sig (func)) + + (func $empty-sig-1) ;; should be assigned type $sig + (func $complex-sig-1 (param f64 i64 f64 i64 f64 i64 f32 i32)) + (func $empty-sig-2) ;; should be assigned type $sig + (func $complex-sig-2 (param f64 i64 f64 i64 f64 i64 f32 i32)) + (func $complex-sig-3 (param f64 i64 f64 i64 f64 i64 f32 i32)) + (func $complex-sig-4 (param i64 i64 f64 i64 f64 i64 f32 i32)) + (func $complex-sig-5 (param i64 i64 f64 i64 f64 i64 f32 i32)) + + (type $empty-sig-duplicate (func)) + (type $complex-sig-duplicate (func (param i64 i64 f64 i64 f64 i64 f32 i32))) + (table funcref + (elem + $complex-sig-3 $empty-sig-2 $complex-sig-1 $complex-sig-3 $empty-sig-1 + $complex-sig-4 $complex-sig-5 + ) + ) + + (func (export "signature-explicit-reused") + (call_indirect (type $sig) (i32.const 1)) + (call_indirect (type $sig) (i32.const 4)) + ) + + (func (export "signature-implicit-reused") + ;; The implicit index 3 in this test depends on the function and + ;; type definitions, and may need adapting if they change. + (call_indirect (type 3) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 0) + ) + (call_indirect (type 3) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 2) + ) + (call_indirect (type 3) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 3) + ) + ) + + (func (export "signature-explicit-duplicate") + (call_indirect (type $empty-sig-duplicate) (i32.const 1)) + ) + + (func (export "signature-implicit-duplicate") + (call_indirect (type $complex-sig-duplicate) + (i64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 5) + ) + (call_indirect (type $complex-sig-duplicate) + (i64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 6) + ) + ) +) + (assert_return (invoke "signature-explicit-reused")) (assert_return (invoke "signature-implicit-reused")) (assert_return (invoke "signature-explicit-duplicate")) (assert_return (invoke "signature-implicit-duplicate")) +;; Malformed type use + +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (type $sig) (result i32) (param i32) (i32.const 0))" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (param i32) (type $sig) (result i32) (i32.const 0))" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (param i32) (result i32) (type $sig) (i32.const 0))" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (result i32) (type $sig) (param i32) (i32.const 0))" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (result i32) (param i32) (type $sig) (i32.const 0))" + ) + "unexpected token" +) +(assert_malformed + (module quote + "(func (result i32) (param i32) (i32.const 0))" + ) + "unexpected token" +) + +(assert_malformed + (module quote + "(type $sig (func))" + "(func (type $sig) (result i32) (i32.const 0))" + ) + "inline function type" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (type $sig) (result i32) (i32.const 0))" + ) + "inline function type" +) +(assert_malformed + (module quote + "(type $sig (func (param i32) (result i32)))" + "(func (type $sig) (param i32) (i32.const 0))" + ) + "inline function type" +) +(assert_malformed + (module quote + "(type $sig (func (param i32 i32) (result i32)))" + "(func (type $sig) (param i32) (result i32) (unreachable))" + ) + "inline function type" +) + + ;; Invalid typing of locals (assert_invalid @@ -392,33 +538,6 @@ "type mismatch" ) -(; TODO(stack): Should these become legal? -(assert_invalid - (module (func $type-value-void-vs-num-after-return (result i32) - (return (i32.const 1)) (nop) - )) - "type mismatch" -) -(assert_invalid - (module (func $type-value-num-vs-num-after-return (result i32) - (return (i32.const 1)) (f32.const 0) - )) - "type mismatch" -) -(assert_invalid - (module (func $type-value-void-vs-num-after-break (result i32) - (br 0 (i32.const 1)) (nop) - )) - "type mismatch" -) -(assert_invalid - (module (func $type-value-num-vs-num-after-break (result i32) - (br 0 (i32.const 1)) (f32.const 0) - )) - "arity mismatch" -) -;) - (assert_invalid (module (func $type-return-last-empty-vs-num (result i32) (return) @@ -462,14 +581,6 @@ )) "type mismatch" ) -(; TODO(stack): Should this become legal? -(assert_invalid - (module (func $type-return-second-num-vs-num (result i32) - (return (i32.const 1)) (return (f64.const 1)) - )) - "type mismatch" -) -;) (assert_invalid (module (func $type-break-last-void-vs-num (result i32) @@ -502,15 +613,6 @@ "type mismatch" ) -(; TODO(stack): soft failure -(assert_invalid - (module (func $type-break-second-num-vs-num (result i32) - (br 0 (i32.const 1)) (br 0 (f64.const 1)) - )) - "type mismatch" -) -;) - (assert_invalid (module (func $type-break-nested-empty-vs-num (result i32) (block (br 1)) (br 0 (i32.const 1)) @@ -530,3 +632,30 @@ "type mismatch" ) + +;; Syntax errors + +(assert_malformed + (module quote "(func (nop) (local i32))") + "unexpected token" +) +(assert_malformed + (module quote "(func (nop) (param i32))") + "unexpected token" +) +(assert_malformed + (module quote "(func (nop) (result i32))") + "unexpected token" +) +(assert_malformed + (module quote "(func (local i32) (param i32))") + "unexpected token" +) +(assert_malformed + (module quote "(func (local i32) (result i32) (local.get 0))") + "unexpected token" +) +(assert_malformed + (module quote "(func (result i32) (param i32) (local.get 0))") + "unexpected token" +) diff --git a/test/spec/func_ptrs.wast b/test/spec/func_ptrs.wast index 1844462b8..f6f8e2c42 100644 --- a/test/spec/func_ptrs.wast +++ b/test/spec/func_ptrs.wast @@ -7,7 +7,7 @@ (type $T (func (param i32) (result i32))) ;; 5: i32 -> i32 (type $U (func (param i32))) ;; 6: i32 -> void - (func $print (import "spectest" "print") (type 6)) + (func $print (import "spectest" "print_i32") (type 6)) (func (type 0)) (func (type $S)) @@ -23,6 +23,7 @@ (func (export "four") (type $U) (call $print (local.get 0))) ) + (assert_return (invoke "one") (i32.const 13)) (assert_return (invoke "two" (i32.const 13)) (i32.const 14)) (assert_return (invoke "three" (i32.const 13)) (i32.const 11)) @@ -45,7 +46,7 @@ ) (assert_invalid (module (func (type 42))) "unknown type") -(assert_invalid (module (import "spectest" "print" (func (type 43)))) "unknown type") +(assert_invalid (module (import "spectest" "print_i32" (func (type 43)))) "unknown type") (module (type $T (func (param) (result i32))) diff --git a/test/spec/globals.wast b/test/spec/globals.wast index ca3100a64..0c8f6fbda 100644 --- a/test/spec/globals.wast +++ b/test/spec/globals.wast @@ -24,6 +24,158 @@ (func (export "get-6") (result f64) (global.get 6)) (func (export "set-5") (param f32) (global.set 5 (local.get 0))) (func (export "set-6") (param f64) (global.set 6 (local.get 0))) + + ;; As the argument of control constructs and instructions + + (memory 1) + + (func $dummy) + + (func (export "as-select-first") (result i32) + (select (global.get $x) (i32.const 2) (i32.const 3)) + ) + (func (export "as-select-mid") (result i32) + (select (i32.const 2) (global.get $x) (i32.const 3)) + ) + (func (export "as-select-last") (result i32) + (select (i32.const 2) (i32.const 3) (global.get $x)) + ) + + (func (export "as-loop-first") (result i32) + (loop (result i32) + (global.get $x) (call $dummy) (call $dummy) + ) + ) + (func (export "as-loop-mid") (result i32) + (loop (result i32) + (call $dummy) (global.get $x) (call $dummy) + ) + ) + (func (export "as-loop-last") (result i32) + (loop (result i32) + (call $dummy) (call $dummy) (global.get $x) + ) + ) + + (func (export "as-if-condition") (result i32) + (if (result i32) (global.get $x) + (then (call $dummy) (i32.const 2)) + (else (call $dummy) (i32.const 3)) + ) + ) + (func (export "as-if-then") (result i32) + (if (result i32) (i32.const 1) + (then (global.get $x)) (else (i32.const 2)) + ) + ) + (func (export "as-if-else") (result i32) + (if (result i32) (i32.const 0) + (then (i32.const 2)) (else (global.get $x)) + ) + ) + + (func (export "as-br_if-first") (result i32) + (block (result i32) + (br_if 0 (global.get $x) (i32.const 2)) + (return (i32.const 3)) + ) + ) + (func (export "as-br_if-last") (result i32) + (block (result i32) + (br_if 0 (i32.const 2) (global.get $x)) + (return (i32.const 3)) + ) + ) + + (func (export "as-br_table-first") (result i32) + (block (result i32) + (global.get $x) (i32.const 2) (br_table 0 0) + ) + ) + (func (export "as-br_table-last") (result i32) + (block (result i32) + (i32.const 2) (global.get $x) (br_table 0 0) + ) + ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (result i32) + (block (result i32) + (call_indirect (type $check) + (global.get $x) (i32.const 2) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) (global.get $x) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) (i32.const 0) (global.get $x) + ) + ) + ) + + (func (export "as-store-first") + (global.get $x) (i32.const 1) (i32.store) + ) + (func (export "as-store-last") + (i32.const 0) (global.get $x) (i32.store) + ) + (func (export "as-load-operand") (result i32) + (i32.load (global.get $x)) + ) + (func (export "as-memory.grow-value") (result i32) + (memory.grow (global.get $x)) + ) + + (func $f (param i32) (result i32) (local.get 0)) + (func (export "as-call-value") (result i32) + (call $f (global.get $x)) + ) + + (func (export "as-return-value") (result i32) + (global.get $x) (return) + ) + (func (export "as-drop-operand") + (drop (global.get $x)) + ) + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (global.get $x))) + ) + + (func (export "as-local.set-value") (param i32) (result i32) + (local.set 0 (global.get $x)) + (local.get 0) + ) + (func (export "as-local.tee-value") (param i32) (result i32) + (local.tee 0 (global.get $x)) + ) + (func (export "as-global.set-value") (result i32) + (global.set $x (global.get $x)) + (global.get $x) + ) + + (func (export "as-unary-operand") (result i32) + (i32.eqz (global.get $x)) + ) + (func (export "as-binary-operand") (result i32) + (i32.mul + (global.get $x) (global.get $x) + ) + ) + (func (export "as-compare-operand") (result i32) + (i32.gt_u + (global.get 0) (i32.const 1) + ) + ) ) (assert_return (invoke "get-a") (i32.const -2)) @@ -46,11 +198,56 @@ (assert_return (invoke "get-5") (f32.const 8)) (assert_return (invoke "get-6") (f64.const 9)) +(assert_return (invoke "as-select-first") (i32.const 6)) +(assert_return (invoke "as-select-mid") (i32.const 2)) +(assert_return (invoke "as-select-last") (i32.const 2)) + +(assert_return (invoke "as-loop-first") (i32.const 6)) +(assert_return (invoke "as-loop-mid") (i32.const 6)) +(assert_return (invoke "as-loop-last") (i32.const 6)) + +(assert_return (invoke "as-if-condition") (i32.const 2)) +(assert_return (invoke "as-if-then") (i32.const 6)) +(assert_return (invoke "as-if-else") (i32.const 6)) + +(assert_return (invoke "as-br_if-first") (i32.const 6)) +(assert_return (invoke "as-br_if-last") (i32.const 2)) + +(assert_return (invoke "as-br_table-first") (i32.const 6)) +(assert_return (invoke "as-br_table-last") (i32.const 2)) + +(assert_return (invoke "as-call_indirect-first") (i32.const 6)) +(assert_return (invoke "as-call_indirect-mid") (i32.const 2)) +(assert_trap (invoke "as-call_indirect-last") "undefined element") + +(assert_return (invoke "as-store-first")) +(assert_return (invoke "as-store-last")) +(assert_return (invoke "as-load-operand") (i32.const 1)) +(assert_return (invoke "as-memory.grow-value") (i32.const 1)) + +(assert_return (invoke "as-call-value") (i32.const 6)) + +(assert_return (invoke "as-return-value") (i32.const 6)) +(assert_return (invoke "as-drop-operand")) +(assert_return (invoke "as-br-value") (i32.const 6)) + +(assert_return (invoke "as-local.set-value" (i32.const 1)) (i32.const 6)) +(assert_return (invoke "as-local.tee-value" (i32.const 1)) (i32.const 6)) +(assert_return (invoke "as-global.set-value") (i32.const 6)) + +(assert_return (invoke "as-unary-operand") (i32.const 0)) +(assert_return (invoke "as-binary-operand") (i32.const 36)) +(assert_return (invoke "as-compare-operand") (i32.const 1)) + (assert_invalid - (module (global f32 (f32.const 0)) (func (global.set 0 (i32.const 1)))) + (module (global f32 (f32.const 0)) (func (global.set 0 (f32.const 1)))) "global is immutable" ) +;; mutable globals can be exported +(module (global (mut f32) (f32.const 0)) (export "a" (global 0))) +(module (global (export "a") (mut f32) (f32.const 0))) + (assert_invalid (module (global f32 (f32.neg (f32.const 0)))) "constant expression required" @@ -62,11 +259,224 @@ ) (assert_invalid + (module (global f32 (f32.neg (f32.const 1)))) + "constant expression required" +) + +(assert_invalid + (module (global i32 (i32.const 0) (nop))) + "constant expression required" +) + +(assert_invalid + (module (global i32 (nop))) + "constant expression required" +) + +(assert_invalid (module (global i32 (f32.const 0))) "type mismatch" ) (assert_invalid + (module (global i32 (i32.const 0) (i32.const 0))) + "type mismatch" +) + +(assert_invalid + (module (global i32 (;empty instruction sequence;))) + "type mismatch" +) + +(assert_invalid (module (global i32 (global.get 0))) "unknown global" ) + +(assert_invalid + (module (global i32 (global.get 1)) (global i32 (i32.const 0))) + "unknown global" +) + +(module + (import "spectest" "global_i32" (global i32)) +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\98\80\80\80\00" ;; import section + "\01" ;; length 1 + "\08\73\70\65\63\74\65\73\74" ;; "spectest" + "\0a\67\6c\6f\62\61\6c\5f\69\33\32" ;; "global_i32" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\02" ;; invalid mutability + ) + "invalid mutability" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\98\80\80\80\00" ;; import section + "\01" ;; length 1 + "\08\73\70\65\63\74\65\73\74" ;; "spectest" + "\0a\67\6c\6f\62\61\6c\5f\69\33\32" ;; "global_i32" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\ff" ;; invalid mutability + ) + "invalid mutability" +) + +(module + (global i32 (i32.const 0)) +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\86\80\80\80\00" ;; global section + "\01" ;; length 1 + "\7f" ;; i32 + "\02" ;; invalid mutability + "\41\00" ;; i32.const 0 + "\0b" ;; end + ) + "invalid mutability" +) +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\06\86\80\80\80\00" ;; global section + "\01" ;; length 1 + "\7f" ;; i32 + "\ff" ;; invalid mutability + "\41\00" ;; i32.const 0 + "\0b" ;; end + ) + "invalid mutability" +) + + +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty + (global.set $x) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-block + (i32.const 0) + (block (global.set $x)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-loop + (i32.const 0) + (loop (global.set $x)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (global.set $x))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-else + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (global.set $x))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-br + (i32.const 0) + (block (br 0 (global.set $x))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-br_if + (i32.const 0) + (block (br_if 0 (global.set $x))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-br_table + (i32.const 0) + (block (br_table 0 (global.set $x))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-return + (return (global.set $x)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-select + (select (global.set $x) (i32.const 1) (i32.const 2)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-global.set-value-empty-in-call + (call 1 (global.set $x)) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-global.set-value-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (global.set $x) (i32.const 0) + ) + ) + ) + ) + "type mismatch" +) diff --git a/test/spec/i32.wast b/test/spec/i32.wast index b1d9977a4..58c853a6b 100644 --- a/test/spec/i32.wast +++ b/test/spec/i32.wast @@ -57,12 +57,15 @@ (assert_return (invoke "mul" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000)) (assert_return (invoke "mul" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000001)) (assert_return (invoke "mul" (i32.const 0x01234567) (i32.const 0x76543210)) (i32.const 0x358e7470)) +(assert_return (invoke "mul" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) (assert_trap (invoke "div_s" (i32.const 1) (i32.const 0)) "integer divide by zero") (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") +(assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const 0)) "integer divide by zero") (assert_return (invoke "div_s" (i32.const 1) (i32.const 1)) (i32.const 1)) (assert_return (invoke "div_s" (i32.const 0) (i32.const 1)) (i32.const 0)) +(assert_return (invoke "div_s" (i32.const 0) (i32.const -1)) (i32.const 0)) (assert_return (invoke "div_s" (i32.const -1) (i32.const -1)) (i32.const 1)) (assert_return (invoke "div_s" (i32.const 0x80000000) (i32.const 2)) (i32.const 0xc0000000)) (assert_return (invoke "div_s" (i32.const 0x80000001) (i32.const 1000)) (i32.const 0xffdf3b65)) @@ -99,6 +102,7 @@ (assert_return (invoke "rem_s" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0)) (assert_return (invoke "rem_s" (i32.const 1) (i32.const 1)) (i32.const 0)) (assert_return (invoke "rem_s" (i32.const 0) (i32.const 1)) (i32.const 0)) +(assert_return (invoke "rem_s" (i32.const 0) (i32.const -1)) (i32.const 0)) (assert_return (invoke "rem_s" (i32.const -1) (i32.const -1)) (i32.const 0)) (assert_return (invoke "rem_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) (assert_return (invoke "rem_s" (i32.const 0x80000000) (i32.const 2)) (i32.const 0)) @@ -208,19 +212,32 @@ (assert_return (invoke "shr_u" (i32.const -1) (i32.const 0x7fffffff)) (i32.const 1)) (assert_return (invoke "shr_u" (i32.const -1) (i32.const 0x80000000)) (i32.const -1)) -(assert_return (invoke "rotl" (i32.const 0xfe00dc00) (i32.const 4)) (i32.const 0xe00dc00f)) +(assert_return (invoke "rotl" (i32.const 1) (i32.const 1)) (i32.const 2)) +(assert_return (invoke "rotl" (i32.const 1) (i32.const 0)) (i32.const 1)) +(assert_return (invoke "rotl" (i32.const -1) (i32.const 1)) (i32.const -1)) +(assert_return (invoke "rotl" (i32.const 1) (i32.const 32)) (i32.const 1)) (assert_return (invoke "rotl" (i32.const 0xabcd9876) (i32.const 1)) (i32.const 0x579b30ed)) +(assert_return (invoke "rotl" (i32.const 0xfe00dc00) (i32.const 4)) (i32.const 0xe00dc00f)) +(assert_return (invoke "rotl" (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x183a5c76)) (assert_return (invoke "rotl" (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00100000)) +(assert_return (invoke "rotl" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x183a5c76)) +(assert_return (invoke "rotl" (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0x579beed3)) (assert_return (invoke "rotl" (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0x579beed3)) (assert_return (invoke "rotl" (i32.const 1) (i32.const 31)) (i32.const 0x80000000)) (assert_return (invoke "rotl" (i32.const 0x80000000) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 0x0005)) (i32.const 0x1d860e97)) -(assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x1d860e97)) +(assert_return (invoke "rotr" (i32.const 1) (i32.const 1)) (i32.const 0x80000000)) +(assert_return (invoke "rotr" (i32.const 1) (i32.const 0)) (i32.const 1)) +(assert_return (invoke "rotr" (i32.const -1) (i32.const 1)) (i32.const -1)) +(assert_return (invoke "rotr" (i32.const 1) (i32.const 32)) (i32.const 1)) (assert_return (invoke "rotr" (i32.const 0xff00cc00) (i32.const 1)) (i32.const 0x7f806600)) (assert_return (invoke "rotr" (i32.const 0x00080000) (i32.const 4)) (i32.const 0x00008000)) +(assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x1d860e97)) +(assert_return (invoke "rotr" (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00000400)) +(assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x1d860e97)) (assert_return (invoke "rotr" (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0xe6fbb4d5)) -(assert_return (invoke "rotr" (i32.const 1) (i32.const 1)) (i32.const 0x80000000)) +(assert_return (invoke "rotr" (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0xe6fbb4d5)) +(assert_return (invoke "rotr" (i32.const 1) (i32.const 31)) (i32.const 2)) (assert_return (invoke "rotr" (i32.const 0x80000000) (i32.const 31)) (i32.const 1)) (assert_return (invoke "clz" (i32.const 0xffffffff)) (i32.const 0)) @@ -252,6 +269,7 @@ (assert_return (invoke "eqz" (i32.const 1)) (i32.const 0)) (assert_return (invoke "eqz" (i32.const 0x80000000)) (i32.const 0)) (assert_return (invoke "eqz" (i32.const 0x7fffffff)) (i32.const 0)) +(assert_return (invoke "eqz" (i32.const 0xffffffff)) (i32.const 0)) (assert_return (invoke "eq" (i32.const 0) (i32.const 0)) (i32.const 1)) (assert_return (invoke "eq" (i32.const 1) (i32.const 1)) (i32.const 1)) @@ -402,3 +420,539 @@ (assert_return (invoke "ge_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) (assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) (assert_return (invoke "ge_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) + + +(assert_invalid + (module + (func $type-unary-operand-empty + (i32.eqz) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-block + (i32.const 0) + (block (i32.eqz) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-loop + (i32.const 0) + (loop (i32.eqz) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-if + (i32.const 0) (i32.const 0) + (if (then (i32.eqz) (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-else + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (i32.eqz))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-br + (i32.const 0) + (block (br 0 (i32.eqz)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-br_if + (i32.const 0) + (block (br_if 0 (i32.eqz) (i32.const 1)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-br_table + (i32.const 0) + (block (br_table 0 (i32.eqz)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-return + (return (i32.eqz)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-select + (select (i32.eqz) (i32.const 1) (i32.const 2)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-call + (call 1 (i32.eqz)) (drop) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-unary-operand-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (i32.eqz) (i32.const 0) + ) + (drop) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-local.set + (local i32) + (local.set 0 (i32.eqz)) (local.get 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-unary-operand-empty-in-local.tee + (local i32) + (local.tee 0 (i32.eqz)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-unary-operand-empty-in-global.set + (global.set $x (i32.eqz)) (global.get $x) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-unary-operand-empty-in-memory.grow + (memory.grow (i32.eqz)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-unary-operand-empty-in-load + (i32.load (i32.eqz)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-unary-operand-empty-in-store + (i32.store (i32.eqz) (i32.const 1)) + ) + ) + "type mismatch" +) + +(assert_invalid + (module + (func $type-binary-1st-operand-empty + (i32.add) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty + (i32.const 0) (i32.add) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-block + (i32.const 0) (i32.const 0) + (block (i32.add) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-block + (i32.const 0) + (block (i32.const 0) (i32.add) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-loop + (i32.const 0) (i32.const 0) + (loop (i32.add) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-loop + (i32.const 0) + (loop (i32.const 0) (i32.add) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-if + (i32.const 0) (i32.const 0) (i32.const 0) + (if (i32.add) (then (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-if + (i32.const 0) (i32.const 0) + (if (i32.const 0) (then (i32.add)) (else (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-else + (i32.const 0) (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (i32.add) (i32.const 0))) + (drop) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-else + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (i32.add))) + (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-br + (i32.const 0) (i32.const 0) + (block (br 0 (i32.add)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-br + (i32.const 0) + (block (br 0 (i32.const 0) (i32.add)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-br_if + (i32.const 0) (i32.const 0) + (block (br_if 0 (i32.add) (i32.const 1)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-br_if + (i32.const 0) + (block (br_if 0 (i32.const 0) (i32.add) (i32.const 1)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-br_table + (i32.const 0) (i32.const 0) + (block (br_table 0 (i32.add)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-br_table + (i32.const 0) + (block (br_table 0 (i32.const 0) (i32.add)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-return + (return (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-return + (return (i32.const 0) (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-select + (select (i32.add) (i32.const 1) (i32.const 2)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-select + (select (i32.const 0) (i32.add) (i32.const 1) (i32.const 2)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-call + (call 1 (i32.add)) (drop) + ) + (func (param i32 i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-call + (call 1 (i32.const 0) (i32.add)) (drop) + ) + (func (param i32 i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-binary-1st-operand-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (i32.add) (i32.const 0) + ) + (drop) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-binary-2nd-operand-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (i32.const 0) (i32.add) (i32.const 0) + ) + (drop) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-local.set + (local i32) + (local.set 0 (i32.add)) (local.get 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-local.set + (local i32) + (local.set 0 (i32.const 0) (i32.add)) (local.get 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-1st-operand-empty-in-local.tee + (local i32) + (local.tee 0 (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-binary-2nd-operand-empty-in-local.tee + (local i32) + (local.tee 0 (i32.const 0) (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-binary-1st-operand-empty-in-global.set + (global.set $x (i32.add)) (global.get $x) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-binary-2nd-operand-empty-in-global.set + (global.set $x (i32.const 0) (i32.add)) (global.get $x) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-binary-1st-operand-empty-in-memory.grow + (memory.grow (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-binary-2nd-operand-empty-in-memory.grow + (memory.grow (i32.const 0) (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-binary-1st-operand-empty-in-load + (i32.load (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-binary-2nd-operand-empty-in-load + (i32.load (i32.const 0) (i32.add)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-binary-1st-operand-empty-in-store + (i32.store (i32.add) (i32.const 1)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-binary-2nd-operand-empty-in-store + (i32.store (i32.const 1) (i32.add) (i32.const 0)) + ) + ) + "type mismatch" +) + + +;; Type check + +(assert_invalid (module (func (result i32) (i32.add (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.and (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.div_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.div_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.mul (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.or (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.rem_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.rem_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.rotl (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.rotr (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.shl (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.shr_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.shr_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.sub (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.xor (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.eqz (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.clz (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.ctz (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.popcnt (i64.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.eq (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.ge_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.ge_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.gt_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.gt_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.le_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.le_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.lt_s (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.lt_u (i64.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i32) (i32.ne (i64.const 0) (f32.const 0)))) "type mismatch") diff --git a/test/spec/i64.wast b/test/spec/i64.wast index 021c26cb8..5a8c1d662 100644 --- a/test/spec/i64.wast +++ b/test/spec/i64.wast @@ -57,12 +57,15 @@ (assert_return (invoke "mul" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0x8000000000000000)) (assert_return (invoke "mul" (i64.const 0x7fffffffffffffff) (i64.const -1)) (i64.const 0x8000000000000001)) (assert_return (invoke "mul" (i64.const 0x0123456789abcdef) (i64.const 0xfedcba9876543210)) (i64.const 0x2236d88fe5618cf0)) +(assert_return (invoke "mul" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i64.const 1)) (assert_trap (invoke "div_s" (i64.const 1) (i64.const 0)) "integer divide by zero") (assert_trap (invoke "div_s" (i64.const 0) (i64.const 0)) "integer divide by zero") (assert_trap (invoke "div_s" (i64.const 0x8000000000000000) (i64.const -1)) "integer overflow") +(assert_trap (invoke "div_s" (i64.const 0x8000000000000000) (i64.const 0)) "integer divide by zero") (assert_return (invoke "div_s" (i64.const 1) (i64.const 1)) (i64.const 1)) (assert_return (invoke "div_s" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "div_s" (i64.const 0) (i64.const -1)) (i64.const 0)) (assert_return (invoke "div_s" (i64.const -1) (i64.const -1)) (i64.const 1)) (assert_return (invoke "div_s" (i64.const 0x8000000000000000) (i64.const 2)) (i64.const 0xc000000000000000)) (assert_return (invoke "div_s" (i64.const 0x8000000000000001) (i64.const 1000)) (i64.const 0xffdf3b645a1cac09)) @@ -99,6 +102,7 @@ (assert_return (invoke "rem_s" (i64.const 0x7fffffffffffffff) (i64.const -1)) (i64.const 0)) (assert_return (invoke "rem_s" (i64.const 1) (i64.const 1)) (i64.const 0)) (assert_return (invoke "rem_s" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 0) (i64.const -1)) (i64.const 0)) (assert_return (invoke "rem_s" (i64.const -1) (i64.const -1)) (i64.const 0)) (assert_return (invoke "rem_s" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0)) (assert_return (invoke "rem_s" (i64.const 0x8000000000000000) (i64.const 2)) (i64.const 0)) @@ -211,7 +215,13 @@ (assert_return (invoke "rotl" (i64.const 1) (i64.const 1)) (i64.const 2)) (assert_return (invoke "rotl" (i64.const 1) (i64.const 0)) (i64.const 1)) (assert_return (invoke "rotl" (i64.const -1) (i64.const 1)) (i64.const -1)) +(assert_return (invoke "rotl" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "rotl" (i64.const 0xabcd987602468ace) (i64.const 1)) (i64.const 0x579b30ec048d159d)) +(assert_return (invoke "rotl" (i64.const 0xfe000000dc000000) (i64.const 4)) (i64.const 0xe000000dc000000f)) +(assert_return (invoke "rotl" (i64.const 0xabcd1234ef567809) (i64.const 53)) (i64.const 0x013579a2469deacf)) (assert_return (invoke "rotl" (i64.const 0xabd1234ef567809c) (i64.const 63)) (i64.const 0x55e891a77ab3c04e)) +(assert_return (invoke "rotl" (i64.const 0xabcd1234ef567809) (i64.const 0xf5)) (i64.const 0x013579a2469deacf)) +(assert_return (invoke "rotl" (i64.const 0xabcd7294ef567809) (i64.const 0xffffffffffffffed)) (i64.const 0xcf013579ae529dea)) (assert_return (invoke "rotl" (i64.const 0xabd1234ef567809c) (i64.const 0x800000000000003f)) (i64.const 0x55e891a77ab3c04e)) (assert_return (invoke "rotl" (i64.const 1) (i64.const 63)) (i64.const 0x8000000000000000)) (assert_return (invoke "rotl" (i64.const 0x8000000000000000) (i64.const 1)) (i64.const 1)) @@ -219,10 +229,15 @@ (assert_return (invoke "rotr" (i64.const 1) (i64.const 1)) (i64.const 0x8000000000000000)) (assert_return (invoke "rotr" (i64.const 1) (i64.const 0)) (i64.const 1)) (assert_return (invoke "rotr" (i64.const -1) (i64.const 1)) (i64.const -1)) +(assert_return (invoke "rotr" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "rotr" (i64.const 0xabcd987602468ace) (i64.const 1)) (i64.const 0x55e6cc3b01234567)) +(assert_return (invoke "rotr" (i64.const 0xfe000000dc000000) (i64.const 4)) (i64.const 0x0fe000000dc00000)) (assert_return (invoke "rotr" (i64.const 0xabcd1234ef567809) (i64.const 53)) (i64.const 0x6891a77ab3c04d5e)) -(assert_return (invoke "rotr" (i64.const 0xabcd1234ef567809) (i64.const 0x35)) (i64.const 0x6891a77ab3c04d5e)) +(assert_return (invoke "rotr" (i64.const 0xabd1234ef567809c) (i64.const 63)) (i64.const 0x57a2469deacf0139)) (assert_return (invoke "rotr" (i64.const 0xabcd1234ef567809) (i64.const 0xf5)) (i64.const 0x6891a77ab3c04d5e)) -(assert_return (invoke "rotr" (i64.const 1) (i64.const 1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "rotr" (i64.const 0xabcd7294ef567809) (i64.const 0xffffffffffffffed)) (i64.const 0x94a77ab3c04d5e6b)) +(assert_return (invoke "rotr" (i64.const 0xabd1234ef567809c) (i64.const 0x800000000000003f)) (i64.const 0x57a2469deacf0139)) +(assert_return (invoke "rotr" (i64.const 1) (i64.const 63)) (i64.const 2)) (assert_return (invoke "rotr" (i64.const 0x8000000000000000) (i64.const 63)) (i64.const 1)) (assert_return (invoke "clz" (i64.const 0xffffffffffffffff)) (i64.const 0)) @@ -254,6 +269,7 @@ (assert_return (invoke "eqz" (i64.const 1)) (i32.const 0)) (assert_return (invoke "eqz" (i64.const 0x8000000000000000)) (i32.const 0)) (assert_return (invoke "eqz" (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "eqz" (i64.const 0xffffffffffffffff)) (i32.const 0)) (assert_return (invoke "eq" (i64.const 0) (i64.const 0)) (i32.const 1)) (assert_return (invoke "eq" (i64.const 1) (i64.const 1)) (i32.const 1)) @@ -404,3 +420,36 @@ (assert_return (invoke "ge_u" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 1)) (assert_return (invoke "ge_u" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 1)) (assert_return (invoke "ge_u" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 0)) + + +;; Type check + +(assert_invalid (module (func (result i64) (i64.add (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.and (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.div_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.div_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.mul (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.or (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rem_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rem_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rotl (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rotr (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.shl (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.shr_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.shr_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.sub (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.xor (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.eqz (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.clz (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ctz (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.popcnt (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.eq (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ge_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ge_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.gt_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.gt_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.le_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.le_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.lt_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.lt_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ne (i32.const 0) (f32.const 0)))) "type mismatch") diff --git a/test/spec/if.wast b/test/spec/if.wast new file mode 100644 index 000000000..ae7f7b385 --- /dev/null +++ b/test/spec/if.wast @@ -0,0 +1,933 @@ +;; Test `if` operator + +(module + ;; Auxiliary definition + (memory 1) + + (func $dummy) + + (func (export "empty") (param i32) + (if (local.get 0) (then)) + (if (local.get 0) (then) (else)) + (if $l (local.get 0) (then)) + (if $l (local.get 0) (then) (else)) + ) + + (func (export "singular") (param i32) (result i32) + (if (local.get 0) (then (nop))) + (if (local.get 0) (then (nop)) (else (nop))) + (if (result i32) (local.get 0) (then (i32.const 7)) (else (i32.const 8))) + ) + + (func (export "multi") (param i32) (result i32) + (if (local.get 0) (then (call $dummy) (call $dummy) (call $dummy))) + (if (local.get 0) (then) (else (call $dummy) (call $dummy) (call $dummy))) + (if (result i32) (local.get 0) + (then (call $dummy) (call $dummy) (i32.const 8)) + (else (call $dummy) (call $dummy) (i32.const 9)) + ) + ) + + (func (export "nested") (param i32 i32) (result i32) + (if (result i32) (local.get 0) + (then + (if (local.get 1) (then (call $dummy) (block) (nop))) + (if (local.get 1) (then) (else (call $dummy) (block) (nop))) + (if (result i32) (local.get 1) + (then (call $dummy) (i32.const 9)) + (else (call $dummy) (i32.const 10)) + ) + ) + (else + (if (local.get 1) (then (call $dummy) (block) (nop))) + (if (local.get 1) (then) (else (call $dummy) (block) (nop))) + (if (result i32) (local.get 1) + (then (call $dummy) (i32.const 10)) + (else (call $dummy) (i32.const 11)) + ) + ) + ) + ) + + (func (export "as-select-first") (param i32) (result i32) + (select + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 2) (i32.const 3) + ) + ) + (func (export "as-select-mid") (param i32) (result i32) + (select + (i32.const 2) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 3) + ) + ) + (func (export "as-select-last") (param i32) (result i32) + (select + (i32.const 2) (i32.const 3) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + ) + ) + + (func (export "as-loop-first") (param i32) (result i32) + (loop (result i32) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (call $dummy) (call $dummy) + ) + ) + (func (export "as-loop-mid") (param i32) (result i32) + (loop (result i32) + (call $dummy) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (call $dummy) + ) + ) + (func (export "as-loop-last") (param i32) (result i32) + (loop (result i32) + (call $dummy) (call $dummy) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + ) + ) + + (func (export "as-if-condition") (param i32) (result i32) + (if (result i32) + (if (result i32) (local.get 0) + (then (i32.const 1)) (else (i32.const 0)) + ) + (then (call $dummy) (i32.const 2)) + (else (call $dummy) (i32.const 3)) + ) + ) + + (func (export "as-br_if-first") (param i32) (result i32) + (block (result i32) + (br_if 0 + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 2) + ) + (return (i32.const 3)) + ) + ) + (func (export "as-br_if-last") (param i32) (result i32) + (block (result i32) + (br_if 0 + (i32.const 2) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + ) + (return (i32.const 3)) + ) + ) + + (func (export "as-br_table-first") (param i32) (result i32) + (block (result i32) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 2) + (br_table 0 0) + ) + ) + (func (export "as-br_table-last") (param i32) (result i32) + (block (result i32) + (i32.const 2) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (br_table 0 0) + ) + ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (param i32) (result i32) + (block (result i32) + (call_indirect (type $check) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 2) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (param i32) (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (param i32) (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) (i32.const 0) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + ) + ) + ) + + (func (export "as-store-first") (param i32) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.const 2) + (i32.store) + ) + (func (export "as-store-last") (param i32) + (i32.const 2) + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 1)) + (else (call $dummy) (i32.const 0)) + ) + (i32.store) + ) + + (func (export "as-memory.grow-value") (param i32) (result i32) + (memory.grow + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) + ) + + (func $f (param i32) (result i32) (local.get 0)) + + (func (export "as-call-value") (param i32) (result i32) + (call $f + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) + ) + (func (export "as-return-value") (param i32) (result i32) + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0))) + (return) + ) + (func (export "as-drop-operand") (param i32) + (drop + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) + ) + (func (export "as-br-value") (param i32) (result i32) + (block (result i32) + (br 0 + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) + ) + ) + (func (export "as-local.set-value") (param i32) (result i32) + (local i32) + (local.set 0 + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) + (local.get 0) + ) + (func (export "as-local.tee-value") (param i32) (result i32) + (local.tee 0 + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (param i32) (result i32) + (global.set $a + (if (result i32) (local.get 0) + (then (i32.const 1)) + (else (i32.const 0)) + ) + ) (global.get $a) + ) + (func (export "as-load-operand") (param i32) (result i32) + (i32.load + (if (result i32) (local.get 0) + (then (i32.const 11)) + (else (i32.const 10)) + ) + ) + ) + + (func (export "as-unary-operand") (param i32) (result i32) + (i32.ctz + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 13)) + (else (call $dummy) (i32.const -13)) + ) + ) + ) + (func (export "as-binary-operand") (param i32 i32) (result i32) + (i32.mul + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 3)) + (else (call $dummy) (i32.const -3)) + ) + (if (result i32) (local.get 1) + (then (call $dummy) (i32.const 4)) + (else (call $dummy) (i32.const -5)) + ) + ) + ) + (func (export "as-test-operand") (param i32) (result i32) + (i32.eqz + (if (result i32) (local.get 0) + (then (call $dummy) (i32.const 13)) + (else (call $dummy) (i32.const 0)) + ) + ) + ) + (func (export "as-compare-operand") (param i32 i32) (result i32) + (f32.gt + (if (result f32) (local.get 0) + (then (call $dummy) (f32.const 3)) + (else (call $dummy) (f32.const -3)) + ) + (if (result f32) (local.get 1) + (then (call $dummy) (f32.const 4)) + (else (call $dummy) (f32.const -4)) + ) + ) + ) + + (func (export "break-bare") (result i32) + (if (i32.const 1) (then (br 0) (unreachable))) + (if (i32.const 1) (then (br 0) (unreachable)) (else (unreachable))) + (if (i32.const 0) (then (unreachable)) (else (br 0) (unreachable))) + (if (i32.const 1) (then (br_if 0 (i32.const 1)) (unreachable))) + (if (i32.const 1) (then (br_if 0 (i32.const 1)) (unreachable)) (else (unreachable))) + (if (i32.const 0) (then (unreachable)) (else (br_if 0 (i32.const 1)) (unreachable))) + (if (i32.const 1) (then (br_table 0 (i32.const 0)) (unreachable))) + (if (i32.const 1) (then (br_table 0 (i32.const 0)) (unreachable)) (else (unreachable))) + (if (i32.const 0) (then (unreachable)) (else (br_table 0 (i32.const 0)) (unreachable))) + (i32.const 19) + ) + + (func (export "break-value") (param i32) (result i32) + (if (result i32) (local.get 0) + (then (br 0 (i32.const 18)) (i32.const 19)) + (else (br 0 (i32.const 21)) (i32.const 20)) + ) + ) + + (func (export "effects") (param i32) (result i32) + (local i32) + (if + (block (result i32) (local.set 1 (i32.const 1)) (local.get 0)) + (then + (local.set 1 (i32.mul (local.get 1) (i32.const 3))) + (local.set 1 (i32.sub (local.get 1) (i32.const 5))) + (local.set 1 (i32.mul (local.get 1) (i32.const 7))) + (br 0) + (local.set 1 (i32.mul (local.get 1) (i32.const 100))) + ) + (else + (local.set 1 (i32.mul (local.get 1) (i32.const 5))) + (local.set 1 (i32.sub (local.get 1) (i32.const 7))) + (local.set 1 (i32.mul (local.get 1) (i32.const 3))) + (br 0) + (local.set 1 (i32.mul (local.get 1) (i32.const 1000))) + ) + ) + (local.get 1) + ) +) + +(assert_return (invoke "empty" (i32.const 0))) +(assert_return (invoke "empty" (i32.const 1))) +(assert_return (invoke "empty" (i32.const 100))) +(assert_return (invoke "empty" (i32.const -2))) + +(assert_return (invoke "singular" (i32.const 0)) (i32.const 8)) +(assert_return (invoke "singular" (i32.const 1)) (i32.const 7)) +(assert_return (invoke "singular" (i32.const 10)) (i32.const 7)) +(assert_return (invoke "singular" (i32.const -10)) (i32.const 7)) + +(assert_return (invoke "multi" (i32.const 0)) (i32.const 9)) +(assert_return (invoke "multi" (i32.const 1)) (i32.const 8)) +(assert_return (invoke "multi" (i32.const 13)) (i32.const 8)) +(assert_return (invoke "multi" (i32.const -5)) (i32.const 8)) + +(assert_return (invoke "nested" (i32.const 0) (i32.const 0)) (i32.const 11)) +(assert_return (invoke "nested" (i32.const 1) (i32.const 0)) (i32.const 10)) +(assert_return (invoke "nested" (i32.const 0) (i32.const 1)) (i32.const 10)) +(assert_return (invoke "nested" (i32.const 3) (i32.const 2)) (i32.const 9)) +(assert_return (invoke "nested" (i32.const 0) (i32.const -100)) (i32.const 10)) +(assert_return (invoke "nested" (i32.const 10) (i32.const 10)) (i32.const 9)) +(assert_return (invoke "nested" (i32.const 0) (i32.const -1)) (i32.const 10)) +(assert_return (invoke "nested" (i32.const -111) (i32.const -2)) (i32.const 9)) + +(assert_return (invoke "as-select-first" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-select-first" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-select-mid" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-select-mid" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-select-last" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-select-last" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-loop-first" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-loop-first" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-loop-mid" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-loop-mid" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-loop-last" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-loop-last" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-if-condition" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-if-condition" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-br_if-first" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-br_if-first" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-br_if-last" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-br_if-last" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-br_table-first" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-br_table-first" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-br_table-last" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-br_table-last" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-call_indirect-first" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-call_indirect-first" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-call_indirect-mid" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-call_indirect-mid" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-call_indirect-last" (i32.const 0)) (i32.const 2)) +(assert_trap (invoke "as-call_indirect-last" (i32.const 1)) "undefined element") + +(assert_return (invoke "as-store-first" (i32.const 0))) +(assert_return (invoke "as-store-first" (i32.const 1))) +(assert_return (invoke "as-store-last" (i32.const 0))) +(assert_return (invoke "as-store-last" (i32.const 1))) + +(assert_return (invoke "as-memory.grow-value" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-memory.grow-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-call-value" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-call-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-return-value" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-return-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-drop-operand" (i32.const 0))) +(assert_return (invoke "as-drop-operand" (i32.const 1))) + +(assert_return (invoke "as-br-value" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-br-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-local.set-value" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-local.set-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-local.tee-value" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-local.tee-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-global.set-value" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-global.set-value" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-load-operand" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-load-operand" (i32.const 1)) (i32.const 0)) + +(assert_return (invoke "as-unary-operand" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-unary-operand" (i32.const 1)) (i32.const 0)) +(assert_return (invoke "as-unary-operand" (i32.const -1)) (i32.const 0)) + +(assert_return (invoke "as-binary-operand" (i32.const 0) (i32.const 0)) (i32.const 15)) +(assert_return (invoke "as-binary-operand" (i32.const 0) (i32.const 1)) (i32.const -12)) +(assert_return (invoke "as-binary-operand" (i32.const 1) (i32.const 0)) (i32.const -15)) +(assert_return (invoke "as-binary-operand" (i32.const 1) (i32.const 1)) (i32.const 12)) + +(assert_return (invoke "as-test-operand" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-test-operand" (i32.const 1)) (i32.const 0)) + +(assert_return (invoke "as-compare-operand" (i32.const 0) (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-compare-operand" (i32.const 0) (i32.const 1)) (i32.const 0)) +(assert_return (invoke "as-compare-operand" (i32.const 1) (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-compare-operand" (i32.const 1) (i32.const 1)) (i32.const 0)) + +(assert_return (invoke "break-bare") (i32.const 19)) +(assert_return (invoke "break-value" (i32.const 1)) (i32.const 18)) +(assert_return (invoke "break-value" (i32.const 0)) (i32.const 21)) + +(assert_return (invoke "effects" (i32.const 1)) (i32.const -14)) +(assert_return (invoke "effects" (i32.const 0)) (i32.const -6)) + +(assert_invalid + (module (func $type-empty-i32 (result i32) (if (i32.const 0) (then)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-i64 (result i64) (if (i32.const 0) (then)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f32 (result f32) (if (i32.const 0) (then)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f64 (result f64) (if (i32.const 0) (then)))) + "type mismatch" +) + +(assert_invalid + (module (func $type-empty-i32 (result i32) (if (i32.const 0) (then) (else)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-i64 (result i64) (if (i32.const 0) (then) (else)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f32 (result f32) (if (i32.const 0) (then) (else)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f64 (result f64) (if (i32.const 0) (then) (else)))) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-value-num-vs-void + (if (i32.const 1) (then (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-then-value-num-vs-void + (if (i32.const 1) (then (i32.const 1)) (else)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-value-num-vs-void + (if (i32.const 1) (then) (else (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-both-value-num-vs-void + (if (i32.const 1) (then (i32.const 1)) (else (i32.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-value-empty-vs-num (result i32) + (if (result i32) (i32.const 1) (then) (else (i32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-then-value-empty-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i32.const 0)) (else)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-both-value-empty-vs-num (result i32) + (if (result i32) (i32.const 1) (then) (else)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-no-else-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i32.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-value-void-vs-num (result i32) + (if (result i32) (i32.const 1) (then (nop)) (else (i32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-then-value-void-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i32.const 0)) (else (nop))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-both-value-void-vs-num (result i32) + (if (result i32) (i32.const 1) (then (nop)) (else (nop))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-value-num-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i64.const 1)) (else (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-then-value-num-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i32.const 1)) (else (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-both-value-num-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i64.const 1)) (else (i64.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-both-different-value-num-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i64.const 1)) (else (f64.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-value-unreached-select (result i32) + (if (result i64) + (i32.const 0) + (then (select (unreachable) (unreachable) (unreachable))) + (else (i64.const 0)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-value-unreached-select (result i32) + (if (result i64) + (i32.const 1) + (then (i64.const 0)) + (else (select (unreachable) (unreachable) (unreachable))) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-value-unreached-select (result i32) + (if (result i64) + (i32.const 1) + (then (select (unreachable) (unreachable) (unreachable))) + (else (select (unreachable) (unreachable) (unreachable))) + ) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-break-last-void-vs-num (result i32) + (if (result i32) (i32.const 1) (then (br 0)) (else (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-break-last-void-vs-num (result i32) + (if (result i32) (i32.const 1) (then (i32.const 1)) (else (br 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-then-break-empty-vs-num (result i32) + (if (result i32) (i32.const 1) + (then (br 0) (i32.const 1)) + (else (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-break-empty-vs-num (result i32) + (if (result i32) (i32.const 1) + (then (i32.const 1)) + (else (br 0) (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-then-break-void-vs-num (result i32) + (if (result i32) (i32.const 1) + (then (br 0 (nop)) (i32.const 1)) + (else (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-break-void-vs-num (result i32) + (if (result i32) (i32.const 1) + (then (i32.const 1)) + (else (br 0 (nop)) (i32.const 1)) + ) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-then-break-num-vs-num (result i32) + (if (result i32) (i32.const 1) + (then (br 0 (i64.const 1)) (i32.const 1)) + (else (i32.const 1)) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-else-break-num-vs-num (result i32) + (if (result i32) (i32.const 1) + (then (i32.const 1)) + (else (br 0 (i64.const 1)) (i32.const 1)) + ) + )) + "type mismatch" +) + +(assert_invalid + (module + (func $type-condition-empty + (if (then)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-block + (i32.const 0) + (block (if (then))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-loop + (i32.const 0) + (loop (if (then))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (if (then)))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-else + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (if (then)) (i32.const 0))) + (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-br + (i32.const 0) + (block (br 0 (if(then))) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-br_if + (i32.const 0) + (block (br_if 0 (if(then)) (i32.const 1)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-br_table + (i32.const 0) + (block (br_table 0 (if(then))) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-return + (return (if(then))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-select + (select (if(then)) (i32.const 1) (i32.const 2)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-call + (call 1 (if(then))) (drop) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-condition-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (if(then)) (i32.const 0) + ) + (drop) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-local.set + (local i32) + (local.set 0 (if(then))) (local.get 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-condition-empty-in-local.tee + (local i32) + (local.tee 0 (if(then))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-condition-empty-in-global.set + (global.set $x (if(then))) (global.get $x) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-condition-empty-in-memory.grow + (memory.grow (if(then))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-condition-empty-in-load + (i32.load (if(then))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-condition-empty-in-store + (i32.store (if(then)) (i32.const 1)) + ) + ) + "type mismatch" +) + + +(assert_malformed + (module quote "(func i32.const 0 if end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if $a end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if else $l end)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if $a else $l end)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if else end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if else $l end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if else $l1 end $l2)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if $a else end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if $a else $a end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func i32.const 0 if $a else $l end $l)") + "mismatching label" +)
\ No newline at end of file diff --git a/test/spec/imports.wast b/test/spec/imports.wast index 19ea25202..2f0200dc3 100644 --- a/test/spec/imports.wast +++ b/test/spec/imports.wast @@ -1,18 +1,61 @@ -;; Functions +;; Auxiliary module to import from (module - (import "spectest" "print" (func (param i32))) - (func (import "spectest" "print") (param i64)) + (func (export "func")) + (func (export "func-i32") (param i32)) + (func (export "func-f32") (param f32)) + (func (export "func->i32") (result i32) (i32.const 22)) + (func (export "func->f32") (result f32) (f32.const 11)) + (func (export "func-i32->i32") (param i32) (result i32) (local.get 0)) + (func (export "func-i64->i64") (param i64) (result i64) (local.get 0)) + (global (export "global-i32") i32 (i32.const 55)) + (global (export "global-f32") f32 (f32.const 44)) + (table (export "table-10-inf") 10 funcref) + ;; (table (export "table-10-20") 10 20 funcref) + (memory (export "memory-2-inf") 2) + ;; (memory (export "memory-2-4") 2 4) +) + +(register "test") - (import "spectest" "print" (func $print_i32 (param i32))) - (import "spectest" "print" (func $print_i64 (param i64))) - (import "spectest" "print" (func $print_i32_f32 (param i32 f32))) - (import "spectest" "print" (func $print_i64_f64 (param i64 f64))) - (func $print_i32-2 (import "spectest" "print") (param i32)) - (func $print_i64-2 (import "spectest" "print") (param i64)) +;; Functions + +(module + (type $func_i32 (func (param i32))) + (type $func_i64 (func (param i64))) + (type $func_f32 (func (param f32))) + (type $func_f64 (func (param f64))) + + (import "spectest" "print_i32" (func (param i32))) + ;; JavaScript can't handle i64 yet. + ;; (func (import "spectest" "print_i64") (param i64)) + (import "spectest" "print_i32" (func $print_i32 (param i32))) + ;; JavaScript can't handle i64 yet. + ;; (import "spectest" "print_i64" (func $print_i64 (param i64))) + (import "spectest" "print_f32" (func $print_f32 (param f32))) + (import "spectest" "print_f64" (func $print_f64 (param f64))) + (import "spectest" "print_i32_f32" (func $print_i32_f32 (param i32 f32))) + (import "spectest" "print_f64_f64" (func $print_f64_f64 (param f64 f64))) + (func $print_i32-2 (import "spectest" "print_i32") (param i32)) + (func $print_f64-2 (import "spectest" "print_f64") (param f64)) + (import "test" "func-i64->i64" (func $i64->i64 (param i64) (result i64))) + + (func (export "p1") (import "spectest" "print_i32") (param i32)) + (func $p (export "p2") (import "spectest" "print_i32") (param i32)) + (func (export "p3") (export "p4") (import "spectest" "print_i32") (param i32)) + (func (export "p5") (import "spectest" "print_i32") (type 0)) + (func (export "p6") (import "spectest" "print_i32") (type 0) (param i32) (result)) + + (import "spectest" "print_i32" (func (type $forward))) + (func (import "spectest" "print_i32") (type $forward)) + (type $forward (func (param i32))) + + (table funcref (elem $print_i32 $print_f64)) (func (export "print32") (param $i i32) + (local $x f32) + (local.set $x (f32.convert_i32_s (local.get $i))) (call 0 (local.get $i)) (call $print_i32_f32 (i32.add (local.get $i) (i32.const 1)) @@ -20,56 +63,164 @@ ) (call $print_i32 (local.get $i)) (call $print_i32-2 (local.get $i)) + (call $print_f32 (local.get $x)) + (call_indirect (type $func_i32) (local.get $i) (i32.const 0)) ) (func (export "print64") (param $i i64) - (call 1 (local.get $i)) - (call $print_i64_f64 - (i64.add (local.get $i) (i64.const 1)) + (local $x f64) + (local.set $x (f64.convert_i64_s (call $i64->i64 (local.get $i)))) + ;; JavaScript can't handle i64 yet. + ;; (call 1 (local.get $i)) + (call $print_f64_f64 + (f64.add (local.get $x) (f64.const 1)) (f64.const 53) ) - (call $print_i64 (local.get $i)) - (call $print_i64-2 (local.get $i)) + ;; JavaScript can't handle i64 yet. + ;; (call $print_i64 (local.get $i)) + (call $print_f64 (local.get $x)) + (call $print_f64-2 (local.get $x)) + (call_indirect (type $func_f64) (local.get $x) (i32.const 1)) ) ) (assert_return (invoke "print32" (i32.const 13))) (assert_return (invoke "print64" (i64.const 24))) +(assert_invalid + (module + (type (func (result i32))) + (import "test" "func" (func (type 1))) + ) + "unknown type" +) + +(module (import "test" "func" (func))) +(module (import "test" "func-i32" (func (param i32)))) +(module (import "test" "func-f32" (func (param f32)))) +(module (import "test" "func->i32" (func (result i32)))) +(module (import "test" "func->f32" (func (result f32)))) +(module (import "test" "func-i32->i32" (func (param i32) (result i32)))) +(module (import "test" "func-i64->i64" (func (param i64) (result i64)))) + +(assert_unlinkable + (module (import "test" "unknown" (func))) + "unknown import" +) (assert_unlinkable (module (import "spectest" "unknown" (func))) "unknown import" ) + (assert_unlinkable - (module (import "spectest" "table" (func))) - "type mismatch" + (module (import "test" "func" (func (param i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func" (func (result i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func" (func (param i32) (result i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32" (func (result i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32" (func (param f32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32" (func (param i64)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32" (func (param i32) (result i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func->i32" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func->i32" (func (param i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func->i32" (func (result f32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func->i32" (func (result i64)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func->i32" (func (param i32) (result i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32->i32" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32->i32" (func (param i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "func-i32->i32" (func (result i32)))) + "incompatible import type" ) (assert_unlinkable - (module (import "spectest" "print" (func)) (table funcref (elem 0))) - "invalid use of host function" + (module (import "test" "global-i32" (func (result i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "table-10-inf" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "memory-2-inf" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "global_i32" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "table" (func))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "memory" (func))) + "incompatible import type" ) ;; Globals (module - (import "spectest" "global" (global i32)) - (global (import "spectest" "global") i32) + (import "spectest" "global_i32" (global i32)) + (global (import "spectest" "global_i32") i32) + + (import "spectest" "global_i32" (global $x i32)) + (global $y (import "spectest" "global_i32") i32) - (import "spectest" "global" (global $x i32)) - (global $y (import "spectest" "global") i32) + ;; JavaScript can't handle i64 yet. + ;; (import "spectest" "global_i64" (global i64)) + (import "spectest" "global_f32" (global f32)) + (import "spectest" "global_f64" (global f64)) (func (export "get-0") (result i32) (global.get 0)) (func (export "get-1") (result i32) (global.get 1)) (func (export "get-x") (result i32) (global.get $x)) (func (export "get-y") (result i32) (global.get $y)) - - ;; TODO: mutable globals - ;; (func (export "set-0") (param i32) (global.set 0 (local.get 0))) - ;; (func (export "set-1") (param i32) (global.set 1 (local.get 0))) - ;; (func (export "set-x") (param i32) (global.set $x (local.get 0))) - ;; (func (export "set-y") (param i32) (global.set $y (local.get 0))) ) (assert_return (invoke "get-0") (i32.const 666)) @@ -77,18 +228,42 @@ (assert_return (invoke "get-x") (i32.const 666)) (assert_return (invoke "get-y") (i32.const 666)) +(module (import "test" "global-i32" (global i32))) +(module (import "test" "global-f32" (global f32))) + (assert_unlinkable - (module (import "spectest" "unknown" (global i32))) + (module (import "test" "unknown" (global i32))) "unknown import" ) (assert_unlinkable - (module (import "spectest" "print" (global i32))) - "type mismatch" + (module (import "spectest" "unknown" (global i32))) + "unknown import" ) -(module (import "spectest" "global" (global i64))) -(module (import "spectest" "global" (global f32))) -(module (import "spectest" "global" (global f64))) +(assert_unlinkable + (module (import "test" "func" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "table-10-inf" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "memory-2-inf" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "print_i32" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "table" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "memory" (global i32))) + "incompatible import type" +) ;; Tables @@ -98,7 +273,9 @@ (import "spectest" "table" (table 10 20 funcref)) (elem 0 (i32.const 1) $f $g) - (func (export "call") (param i32) (result i32) (call_indirect (type 0) (local.get 0))) + (func (export "call") (param i32) (result i32) + (call_indirect (type 0) (local.get 0)) + ) (func $f (result i32) (i32.const 11)) (func $g (result i32) (i32.const 22)) ) @@ -115,7 +292,9 @@ (table (import "spectest" "table") 10 20 funcref) (elem 0 (i32.const 1) $f $g) - (func (export "call") (param i32) (result i32) (call_indirect (type 0) (local.get 0))) + (func (export "call") (param i32) (result i32) + (call_indirect (type 0) (local.get 0)) + ) (func $f (result i32) (i32.const 11)) (func $g (result i32) (i32.const 22)) ) @@ -140,24 +319,63 @@ "multiple tables" ) +(module (import "test" "table-10-inf" (table 10 funcref))) +(module (import "test" "table-10-inf" (table 5 funcref))) +(module (import "test" "table-10-inf" (table 0 funcref))) +(module (import "spectest" "table" (table 10 funcref))) +(module (import "spectest" "table" (table 5 funcref))) +(module (import "spectest" "table" (table 0 funcref))) +(module (import "spectest" "table" (table 10 20 funcref))) +(module (import "spectest" "table" (table 5 20 funcref))) +(module (import "spectest" "table" (table 0 20 funcref))) +(module (import "spectest" "table" (table 10 25 funcref))) +(module (import "spectest" "table" (table 5 25 funcref))) + +(assert_unlinkable + (module (import "test" "unknown" (table 10 funcref))) + "unknown import" +) (assert_unlinkable (module (import "spectest" "unknown" (table 10 funcref))) "unknown import" ) + +(assert_unlinkable + (module (import "test" "table-10-inf" (table 12 funcref))) + "incompatible import type" +) (assert_unlinkable - (module (import "spectest" "print" (table 10 funcref))) - "type mismatch" + (module (import "test" "table-10-inf" (table 10 20 funcref))) + "incompatible import type" ) (assert_unlinkable (module (import "spectest" "table" (table 12 funcref))) - "actual size smaller than declared" + "incompatible import type" ) (assert_unlinkable (module (import "spectest" "table" (table 10 15 funcref))) - "maximum size larger than declared" + "incompatible import type" +) + +(assert_unlinkable + (module (import "test" "func" (table 10 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-i32" (table 10 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "memory-2-inf" (table 10 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "print_i32" (table 10 funcref))) + "incompatible import type" ) + ;; Memories (module @@ -196,21 +414,74 @@ "multiple memories" ) +(module (import "test" "memory-2-inf" (memory 2))) +(module (import "test" "memory-2-inf" (memory 1))) +(module (import "test" "memory-2-inf" (memory 0))) +(module (import "spectest" "memory" (memory 1))) +(module (import "spectest" "memory" (memory 0))) +(module (import "spectest" "memory" (memory 1 2))) +(module (import "spectest" "memory" (memory 0 2))) +(module (import "spectest" "memory" (memory 1 3))) +(module (import "spectest" "memory" (memory 0 3))) + +(assert_unlinkable + (module (import "test" "unknown" (memory 1))) + "unknown import" +) (assert_unlinkable (module (import "spectest" "unknown" (memory 1))) "unknown import" ) + +(assert_unlinkable + (module (import "test" "memory-2-inf" (memory 3))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "memory-2-inf" (memory 2 3))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "memory" (memory 2))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "memory" (memory 1 1))) + "incompatible import type" +) + +(assert_unlinkable + (module (import "test" "func-i32" (memory 1))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-i32" (memory 1))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "table-10-inf" (memory 1))) + "incompatible import type" +) (assert_unlinkable - (module (import "spectest" "print" (memory 1))) - "type mismatch" + (module (import "spectest" "print_i32" (memory 1))) + "incompatible import type" ) (assert_unlinkable + (module (import "spectest" "global_i32" (memory 1))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "table" (memory 1))) + "incompatible import type" +) + +(assert_unlinkable (module (import "spectest" "memory" (memory 2))) - "actual size smaller than declared" + "incompatible import type" ) (assert_unlinkable (module (import "spectest" "memory" (memory 1 1))) - "maximum size larger than declared" + "incompatible import type" ) (module @@ -222,3 +493,101 @@ (assert_return (invoke "grow" (i32.const 0)) (i32.const 2)) (assert_return (invoke "grow" (i32.const 1)) (i32.const -1)) (assert_return (invoke "grow" (i32.const 0)) (i32.const 2)) + + +;; Syntax errors + +(assert_malformed + (module quote "(func) (import \"\" \"\" (func))") + "import after function" +) +(assert_malformed + (module quote "(func) (import \"\" \"\" (global i64))") + "import after function" +) +(assert_malformed + (module quote "(func) (import \"\" \"\" (table 0 funcref))") + "import after function" +) +(assert_malformed + (module quote "(func) (import \"\" \"\" (memory 0))") + "import after function" +) + +(assert_malformed + (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (func))") + "import after global" +) +(assert_malformed + (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (global f32))") + "import after global" +) +(assert_malformed + (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (table 0 funcref))") + "import after global" +) +(assert_malformed + (module quote "(global i64 (i64.const 0)) (import \"\" \"\" (memory 0))") + "import after global" +) + +(assert_malformed + (module quote "(table 0 funcref) (import \"\" \"\" (func))") + "import after table" +) +(assert_malformed + (module quote "(table 0 funcref) (import \"\" \"\" (global i32))") + "import after table" +) +(assert_malformed + (module quote "(table 0 funcref) (import \"\" \"\" (table 0 funcref))") + "import after table" +) +(assert_malformed + (module quote "(table 0 funcref) (import \"\" \"\" (memory 0))") + "import after table" +) + +(assert_malformed + (module quote "(memory 0) (import \"\" \"\" (func))") + "import after memory" +) +(assert_malformed + (module quote "(memory 0) (import \"\" \"\" (global i32))") + "import after memory" +) +(assert_malformed + (module quote "(memory 0) (import \"\" \"\" (table 1 3 funcref))") + "import after memory" +) +(assert_malformed + (module quote "(memory 0) (import \"\" \"\" (memory 1 2))") + "import after memory" +) + +;; This module is required to validate, regardless of whether it can be +;; linked. Overloading is not possible in wasm itself, but it is possible +;; in modules from which wasm can import. +(module) +(register "not wasm") +(assert_unlinkable + (module + (import "not wasm" "overloaded" (func)) + (import "not wasm" "overloaded" (func (param i32))) + (import "not wasm" "overloaded" (func (param i32 i32))) + (import "not wasm" "overloaded" (func (param i64))) + (import "not wasm" "overloaded" (func (param f32))) + (import "not wasm" "overloaded" (func (param f64))) + (import "not wasm" "overloaded" (func (result i32))) + (import "not wasm" "overloaded" (func (result i64))) + (import "not wasm" "overloaded" (func (result f32))) + (import "not wasm" "overloaded" (func (result f64))) + (import "not wasm" "overloaded" (global i32)) + (import "not wasm" "overloaded" (global i64)) + (import "not wasm" "overloaded" (global f32)) + (import "not wasm" "overloaded" (global f64)) + (import "not wasm" "overloaded" (table 0 funcref)) + (import "not wasm" "overloaded" (memory 0)) + ) + "unknown import" +) diff --git a/test/spec/inline-module.wast b/test/spec/inline-module.wast new file mode 100644 index 000000000..dc7ead776 --- /dev/null +++ b/test/spec/inline-module.wast @@ -0,0 +1 @@ +(func) (memory 0) (func (export "f")) diff --git a/test/spec/int_exprs.wast b/test/spec/int_exprs.wast index aef0985f6..22e1fbcb5 100644 --- a/test/spec/int_exprs.wast +++ b/test/spec/int_exprs.wast @@ -1,7 +1,7 @@ ;; Test interesting integer "expressions". These tests contain code ;; patterns which tempt common value-changing optimizations. -;; Test that x+1<y+1 is not folded to x<y +;; Test that x+1<y+1 is not folded to x<y. (module (func (export "i32.no_fold_cmp_s_offset") (param $x i32) (param $y i32) (result i32) @@ -20,7 +20,7 @@ (assert_return (invoke "i64.no_fold_cmp_s_offset" (i64.const 0x7fffffffffffffff) (i64.const 0)) (i32.const 1)) (assert_return (invoke "i64.no_fold_cmp_u_offset" (i64.const 0xffffffffffffffff) (i64.const 0)) (i32.const 1)) -;; Test that wrap(extend_s(x)) is not folded to x +;; Test that wrap(extend_s(x)) is not folded to x. (module (func (export "i64.no_fold_wrap_extend_s") (param $x i64) (result i64) @@ -30,7 +30,7 @@ (assert_return (invoke "i64.no_fold_wrap_extend_s" (i64.const 0x0010203040506070)) (i64.const 0x0000000040506070)) (assert_return (invoke "i64.no_fold_wrap_extend_s" (i64.const 0x00a0b0c0d0e0f0a0)) (i64.const 0xffffffffd0e0f0a0)) -;; Test that wrap(extend_u(x)) is not folded to x +;; Test that wrap(extend_u(x)) is not folded to x. (module (func (export "i64.no_fold_wrap_extend_u") (param $x i64) (result i64) @@ -39,7 +39,7 @@ (assert_return (invoke "i64.no_fold_wrap_extend_u" (i64.const 0x0010203040506070)) (i64.const 0x0000000040506070)) -;; Test that x<<n>>n is not folded to x +;; Test that x<<n>>n is not folded to x. (module (func (export "i32.no_fold_shl_shr_s") (param $x i32) (result i32) @@ -58,7 +58,7 @@ (assert_return (invoke "i64.no_fold_shl_shr_s" (i64.const 0x8000000000000000)) (i64.const 0)) (assert_return (invoke "i64.no_fold_shl_shr_u" (i64.const 0x8000000000000000)) (i64.const 0)) -;; Test that x>>n<<n is not folded to x +;; Test that x>>n<<n is not folded to x. (module (func (export "i32.no_fold_shr_s_shl") (param $x i32) (result i32) @@ -77,7 +77,7 @@ (assert_return (invoke "i64.no_fold_shr_s_shl" (i64.const 1)) (i64.const 0)) (assert_return (invoke "i64.no_fold_shr_u_shl" (i64.const 1)) (i64.const 0)) -;; Test that x/n*n is not folded to x +;; Test that x/n*n is not folded to x. (module (func (export "i32.no_fold_div_s_mul") (param $x i32) (result i32) @@ -96,7 +96,45 @@ (assert_return (invoke "i64.no_fold_div_s_mul" (i64.const 1)) (i64.const 0)) (assert_return (invoke "i64.no_fold_div_u_mul" (i64.const 1)) (i64.const 0)) -;; Test that x*n/n is not folded to x +;; Test that x/x is not folded to 1. + +(module + (func (export "i32.no_fold_div_s_self") (param $x i32) (result i32) + (i32.div_s (local.get $x) (local.get $x))) + (func (export "i32.no_fold_div_u_self") (param $x i32) (result i32) + (i32.div_u (local.get $x) (local.get $x))) + + (func (export "i64.no_fold_div_s_self") (param $x i64) (result i64) + (i64.div_s (local.get $x) (local.get $x))) + (func (export "i64.no_fold_div_u_self") (param $x i64) (result i64) + (i64.div_u (local.get $x) (local.get $x))) +) + +(assert_trap (invoke "i32.no_fold_div_s_self" (i32.const 0)) "integer divide by zero") +(assert_trap (invoke "i32.no_fold_div_u_self" (i32.const 0)) "integer divide by zero") +(assert_trap (invoke "i64.no_fold_div_s_self" (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "i64.no_fold_div_u_self" (i64.const 0)) "integer divide by zero") + +;; Test that x%x is not folded to 0. + +(module + (func (export "i32.no_fold_rem_s_self") (param $x i32) (result i32) + (i32.rem_s (local.get $x) (local.get $x))) + (func (export "i32.no_fold_rem_u_self") (param $x i32) (result i32) + (i32.rem_u (local.get $x) (local.get $x))) + + (func (export "i64.no_fold_rem_s_self") (param $x i64) (result i64) + (i64.rem_s (local.get $x) (local.get $x))) + (func (export "i64.no_fold_rem_u_self") (param $x i64) (result i64) + (i64.rem_u (local.get $x) (local.get $x))) +) + +(assert_trap (invoke "i32.no_fold_rem_s_self" (i32.const 0)) "integer divide by zero") +(assert_trap (invoke "i32.no_fold_rem_u_self" (i32.const 0)) "integer divide by zero") +(assert_trap (invoke "i64.no_fold_rem_s_self" (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "i64.no_fold_rem_u_self" (i64.const 0)) "integer divide by zero") + +;; Test that x*n/n is not folded to x. (module (func (export "i32.no_fold_mul_div_s") (param $x i32) (result i32) @@ -115,7 +153,7 @@ (assert_return (invoke "i64.no_fold_mul_div_s" (i64.const 0x8000000000000000)) (i64.const 0)) (assert_return (invoke "i64.no_fold_mul_div_u" (i64.const 0x8000000000000000)) (i64.const 0)) -;; Test that x/n where n is a known power of 2 is not folded to shr_s +;; Test that x/n where n is a known power of 2 is not folded to shr_s. (module (func (export "i32.no_fold_div_s_2") (param $x i32) (result i32) @@ -128,7 +166,7 @@ (assert_return (invoke "i32.no_fold_div_s_2" (i32.const -11)) (i32.const -5)) (assert_return (invoke "i64.no_fold_div_s_2" (i64.const -11)) (i64.const -5)) -;; Test that x%n where n is a known power of 2 is not folded to and +;; Test that x%n where n is a known power of 2 is not folded to and. (module (func (export "i32.no_fold_rem_s_2") (param $x i32) (result i32) @@ -141,26 +179,26 @@ (assert_return (invoke "i32.no_fold_rem_s_2" (i32.const -11)) (i32.const -1)) (assert_return (invoke "i64.no_fold_rem_s_2" (i64.const -11)) (i64.const -1)) -;; Test that x/0 works +;; Test that x/0 works. (module - (func (export "i32.div_s_3") (param $x i32) (result i32) + (func (export "i32.div_s_0") (param $x i32) (result i32) (i32.div_s (local.get $x) (i32.const 0))) - (func (export "i32.div_u_3") (param $x i32) (result i32) + (func (export "i32.div_u_0") (param $x i32) (result i32) (i32.div_u (local.get $x) (i32.const 0))) - (func (export "i64.div_s_3") (param $x i64) (result i64) + (func (export "i64.div_s_0") (param $x i64) (result i64) (i64.div_s (local.get $x) (i64.const 0))) - (func (export "i64.div_u_3") (param $x i64) (result i64) + (func (export "i64.div_u_0") (param $x i64) (result i64) (i64.div_u (local.get $x) (i64.const 0))) ) -(assert_trap (invoke "i32.div_s_3" (i32.const 71)) "integer divide by zero") -(assert_trap (invoke "i32.div_u_3" (i32.const 71)) "integer divide by zero") -(assert_trap (invoke "i64.div_s_3" (i64.const 71)) "integer divide by zero") -(assert_trap (invoke "i64.div_u_3" (i64.const 71)) "integer divide by zero") +(assert_trap (invoke "i32.div_s_0" (i32.const 71)) "integer divide by zero") +(assert_trap (invoke "i32.div_u_0" (i32.const 71)) "integer divide by zero") +(assert_trap (invoke "i64.div_s_0" (i64.const 71)) "integer divide by zero") +(assert_trap (invoke "i64.div_u_0" (i64.const 71)) "integer divide by zero") -;; Test that x/3 works +;; Test that x/3 works. (module (func (export "i32.div_s_3") (param $x i32) (result i32) @@ -183,7 +221,7 @@ (assert_return (invoke "i64.div_u_3" (i64.const 71)) (i64.const 23)) (assert_return (invoke "i64.div_u_3" (i64.const 0xc000000000000000)) (i64.const 0x4000000000000000)) -;; Test that x/5 works +;; Test that x/5 works. (module (func (export "i32.div_s_5") (param $x i32) (result i32) @@ -206,7 +244,7 @@ (assert_return (invoke "i64.div_u_5" (i64.const 71)) (i64.const 14)) (assert_return (invoke "i64.div_u_5" (i64.const 0xa000000000000000)) (i64.const 0x2000000000000000)) -;; Test that x/7 works +;; Test that x/7 works. (module (func (export "i32.div_s_7") (param $x i32) (result i32) @@ -229,7 +267,7 @@ (assert_return (invoke "i64.div_u_7" (i64.const 71)) (i64.const 10)) (assert_return (invoke "i64.div_u_7" (i64.const 0xe000000000000000)) (i64.const 0x2000000000000000)) -;; Test that x%3 works +;; Test that x%3 works. (module (func (export "i32.rem_s_3") (param $x i32) (result i32) @@ -252,7 +290,7 @@ (assert_return (invoke "i64.rem_u_3" (i64.const 71)) (i64.const 2)) (assert_return (invoke "i64.rem_u_3" (i64.const 0xc000000000000000)) (i64.const 0)) -;; Test that x%5 works +;; Test that x%5 works. (module (func (export "i32.rem_s_5") (param $x i32) (result i32) @@ -275,7 +313,7 @@ (assert_return (invoke "i64.rem_u_5" (i64.const 71)) (i64.const 1)) (assert_return (invoke "i64.rem_u_5" (i64.const 0xa000000000000000)) (i64.const 0)) -;; Test that x%7 works +;; Test that x%7 works. (module (func (export "i32.rem_s_7") (param $x i32) (result i32) @@ -297,3 +335,16 @@ (assert_return (invoke "i64.rem_s_7" (i64.const 0x7000000000000000)) (i64.const 0)) (assert_return (invoke "i64.rem_u_7" (i64.const 71)) (i64.const 1)) (assert_return (invoke "i64.rem_u_7" (i64.const 0xe000000000000000)) (i64.const 0)) + +;; Test that x/-1 is not folded to -x. + +(module + (func (export "i32.no_fold_div_neg1") (param $x i32) (result i32) + (i32.div_s (local.get $x) (i32.const -1))) + + (func (export "i64.no_fold_div_neg1") (param $x i64) (result i64) + (i64.div_s (local.get $x) (i64.const -1))) +) + +(assert_trap (invoke "i32.no_fold_div_neg1" (i32.const 0x80000000)) "integer overflow") +(assert_trap (invoke "i64.no_fold_div_neg1" (i64.const 0x8000000000000000)) "integer overflow") diff --git a/test/spec/int_literals.wast b/test/spec/int_literals.wast index f0ec04178..73b37cc5a 100644 --- a/test/spec/int_literals.wast +++ b/test/spec/int_literals.wast @@ -22,6 +22,16 @@ (func (export "i64.not_octal") (result i64) (return (i64.const 010))) (func (export "i64.unsigned_decimal") (result i64) (return (i64.const 18446744073709551615))) (func (export "i64.plus_sign") (result i64) (return (i64.const +42))) + + (func (export "i32-dec-sep1") (result i32) (i32.const 1_000_000)) + (func (export "i32-dec-sep2") (result i32) (i32.const 1_0_0_0)) + (func (export "i32-hex-sep1") (result i32) (i32.const 0xa_0f_00_99)) + (func (export "i32-hex-sep2") (result i32) (i32.const 0x1_a_A_0_f)) + + (func (export "i64-dec-sep1") (result i64) (i64.const 1_000_000)) + (func (export "i64-dec-sep2") (result i64) (i64.const 1_0_0_0)) + (func (export "i64-hex-sep1") (result i64) (i64.const 0xa_f00f_0000_9999)) + (func (export "i64-hex-sep2") (result i64) (i64.const 0x1_a_A_0_f)) ) (assert_return (invoke "i32.test") (i32.const 195940365)) @@ -47,3 +57,95 @@ (assert_return (invoke "i64.not_octal") (i64.const 10)) (assert_return (invoke "i64.unsigned_decimal") (i64.const -1)) (assert_return (invoke "i64.plus_sign") (i64.const 42)) + +(assert_return (invoke "i32-dec-sep1") (i32.const 1000000)) +(assert_return (invoke "i32-dec-sep2") (i32.const 1000)) +(assert_return (invoke "i32-hex-sep1") (i32.const 0xa0f0099)) +(assert_return (invoke "i32-hex-sep2") (i32.const 0x1aa0f)) + +(assert_return (invoke "i64-dec-sep1") (i64.const 1000000)) +(assert_return (invoke "i64-dec-sep2") (i64.const 1000)) +(assert_return (invoke "i64-hex-sep1") (i64.const 0xaf00f00009999)) +(assert_return (invoke "i64-hex-sep2") (i64.const 0x1aa0f)) + +(assert_malformed + (module quote "(global i32 (i32.const _100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const +_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const -_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const 99_))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const 1__000))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const _0x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const 0_x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const 0x_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const 0x00_))") + "unknown operator" +) +(assert_malformed + (module quote "(global i32 (i32.const 0xff__ffff))") + "unknown operator" +) + +(assert_malformed + (module quote "(global i64 (i64.const _100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const +_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const -_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const 99_))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const 1__000))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const _0x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const 0_x100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const 0x_100))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const 0x00_))") + "unknown operator" +) +(assert_malformed + (module quote "(global i64 (i64.const 0xff__ffff))") + "unknown operator" +) diff --git a/test/spec/labels.wast b/test/spec/labels.wast index ccb164733..6fbf6292d 100644 --- a/test/spec/labels.wast +++ b/test/spec/labels.wast @@ -1,6 +1,6 @@ (module (func (export "block") (result i32) - (block $exit i32 + (block $exit (result i32) (br $exit (i32.const 1)) (i32.const 0) ) @@ -9,11 +9,11 @@ (func (export "loop1") (result i32) (local $i i32) (local.set $i (i32.const 0)) - (block $exit i32 - (loop $cont i32 + (block $exit (result i32) + (loop $cont (result i32) (local.set $i (i32.add (local.get $i) (i32.const 1))) (if (i32.eq (local.get $i) (i32.const 5)) - (br $exit (local.get $i)) + (then (br $exit (local.get $i))) ) (br $cont) ) @@ -23,14 +23,14 @@ (func (export "loop2") (result i32) (local $i i32) (local.set $i (i32.const 0)) - (block $exit i32 - (loop $cont i32 + (block $exit (result i32) + (loop $cont (result i32) (local.set $i (i32.add (local.get $i) (i32.const 1))) (if (i32.eq (local.get $i) (i32.const 5)) - (br $cont) + (then (br $cont)) ) (if (i32.eq (local.get $i) (i32.const 8)) - (br $exit (local.get $i)) + (then (br $exit (local.get $i))) ) (local.set $i (i32.add (local.get $i) (i32.const 1))) (br $cont) @@ -41,11 +41,11 @@ (func (export "loop3") (result i32) (local $i i32) (local.set $i (i32.const 0)) - (block $exit i32 - (loop $cont i32 + (block $exit (result i32) + (loop $cont (result i32) (local.set $i (i32.add (local.get $i) (i32.const 1))) (if (i32.eq (local.get $i) (i32.const 5)) - (br $exit (local.get $i)) + (then (br $exit (local.get $i))) ) (local.get $i) ) @@ -55,11 +55,11 @@ (func (export "loop4") (param $max i32) (result i32) (local $i i32) (local.set $i (i32.const 1)) - (block $exit i32 - (loop $cont i32 + (block $exit (result i32) + (loop $cont (result i32) (local.set $i (i32.add (local.get $i) (local.get $i))) (if (i32.gt_u (local.get $i) (local.get $max)) - (br $exit (local.get $i)) + (then (br $exit (local.get $i))) ) (br $cont) ) @@ -68,11 +68,18 @@ (func (export "loop5") (result i32) (i32.add - (loop $l i32 (i32.const 1)) + (loop $l (result i32) (i32.const 1)) (i32.const 1) ) ) + (func (export "loop6") (result i32) + (loop (result i32) + (br_if 0 (i32.const 0)) + (i32.const 3) + ) + ) + (func (export "if") (result i32) (local $i i32) (local.set $i (i32.const 0)) @@ -148,9 +155,9 @@ ) (func (export "switch") (param i32) (result i32) - (block $ret i32 + (block $ret (result i32) (i32.mul (i32.const 10) - (block $exit i32 + (block $exit (result i32) (block $0 (block $default (block $3 @@ -186,7 +193,7 @@ (func (export "br_if0") (result i32) (local $i i32) (local.set $i (i32.const 0)) - (block $outer i32 + (block $outer (result i32) (block $inner (br_if $inner (i32.const 0)) (local.set $i (i32.or (local.get $i) (i32.const 0x1))) @@ -194,7 +201,7 @@ (local.set $i (i32.or (local.get $i) (i32.const 0x2))) ) (drop (br_if $outer - (block i32 + (block (result i32) (local.set $i (i32.or (local.get $i) (i32.const 0x4))) (local.get $i) ) @@ -202,7 +209,7 @@ )) (local.set $i (i32.or (local.get $i) (i32.const 0x8))) (drop (br_if $outer - (block i32 + (block (result i32) (local.set $i (i32.or (local.get $i) (i32.const 0x10))) (local.get $i) ) @@ -213,18 +220,30 @@ ) (func (export "br_if1") (result i32) - (block $l0 i32 - (drop (br_if $l0 (block $l1 i32 (br $l1 (i32.const 1))) (i32.const 1))) - (i32.const 1) + (block $l0 (result i32) + (drop + (br_if $l0 + (block $l1 (result i32) (br $l1 (i32.const 1))) + (i32.const 1) + ) + ) + (i32.const 0) ) ) (func (export "br_if2") (result i32) - (block $l0 i32 + (block $l0 (result i32) (if (i32.const 1) - (br $l0 (block $l1 i32 (br $l1 (i32.const 1)))) + (then + (drop + (br_if $l0 + (block $l1 (result i32) (br $l1 (i32.const 1))) + (i32.const 1) + ) + ) + ) ) - (i32.const 1) + (i32.const 0) ) ) @@ -232,10 +251,10 @@ (local $i1 i32) (drop (i32.add - (block $l0 i32 + (block $l0 (result i32) (drop (br_if $l0 - (block i32 (local.set $i1 (i32.const 1)) (local.get $i1)) - (block i32 (local.set $i1 (i32.const 2)) (local.get $i1)) + (block (result i32) (local.set $i1 (i32.const 1)) (local.get $i1)) + (block (result i32) (local.set $i1 (i32.const 2)) (local.get $i1)) )) (i32.const 0) ) @@ -246,24 +265,24 @@ ) (func (export "br") (result i32) - (block $l0 i32 + (block $l0 (result i32) (if (i32.const 1) - (br $l0 (block $l1 i32 (br $l1 (i32.const 1)))) - (block (drop (block $l1 i32 (br $l1 (i32.const 1))))) + (then (br $l0 (block $l1 (result i32) (br $l1 (i32.const 1))))) + (else (block (drop (block $l1 (result i32) (br $l1 (i32.const 1)))))) ) (i32.const 1) ) ) (func (export "shadowing") (result i32) - (block $l1 i32 (i32.xor (br $l1 (i32.const 1)) (i32.const 2))) + (block $l1 (result i32) (i32.xor (br $l1 (i32.const 1)) (i32.const 2))) ) (func (export "redefinition") (result i32) - (block $l1 i32 + (block $l1 (result i32) (i32.add - (block $l1 i32 (i32.const 2)) - (block $l1 i32 (br $l1 (i32.const 3))) + (block $l1 (result i32) (i32.const 2)) + (block $l1 (result i32) (br $l1 (i32.const 3))) ) ) ) @@ -275,6 +294,7 @@ (assert_return (invoke "loop3") (i32.const 1)) (assert_return (invoke "loop4" (i32.const 8)) (i32.const 16)) (assert_return (invoke "loop5") (i32.const 2)) +(assert_return (invoke "loop6") (i32.const 3)) (assert_return (invoke "if") (i32.const 5)) (assert_return (invoke "if2") (i32.const 5)) (assert_return (invoke "switch" (i32.const 0)) (i32.const 50)) diff --git a/test/spec/left-to-right.wast b/test/spec/left-to-right.wast index 69e39abb3..634aa9c86 100644 --- a/test/spec/left-to-right.wast +++ b/test/spec/left-to-right.wast @@ -159,17 +159,17 @@ (func (export "f64_select") (result i32) (call $reset) (drop (select (call $f64_left) (call $f64_right) (call $f64_bool))) (call $get)) (func (export "br_if") (result i32) - (block i32 + (block (result i32) (call $reset) (drop (br_if 0 (call $i32_left) (i32.and (call $i32_right) (i32.const 0)))) (call $get) ) ) (func (export "br_table") (result i32) - (block $a i32 + (block $a (result i32) (call $reset) (drop - (block $b i32 + (block $b (result i32) (br_table $a $b (call $i32_left) (call $i32_right)) ) ) diff --git a/test/spec/linking.wast b/test/spec/linking.wast index 653433ac6..6868e8b70 100644 --- a/test/spec/linking.wast +++ b/test/spec/linking.wast @@ -19,22 +19,49 @@ (assert_return (invoke $Nf "call") (i32.const 3)) (assert_return (invoke $Nf "call Mf.call") (i32.const 2)) +(module + (import "spectest" "print_i32" (func $f (param i32))) + (export "print" (func $f)) +) +(register "reexport_f") +(assert_unlinkable + (module (import "reexport_f" "print" (func (param i64)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "reexport_f" "print" (func (param i32) (result i32)))) + "incompatible import type" +) + ;; Globals (module $Mg (global $glob (export "glob") i32 (i32.const 42)) (func (export "get") (result i32) (global.get $glob)) + + ;; export mutable globals + (global $mut_glob (export "mut_glob") (mut i32) (i32.const 142)) + (func (export "get_mut") (result i32) (global.get $mut_glob)) + (func (export "set_mut") (param i32) (global.set $mut_glob (local.get 0))) ) (register "Mg" $Mg) (module $Ng (global $x (import "Mg" "glob") i32) + (global $mut_glob (import "Mg" "mut_glob") (mut i32)) (func $f (import "Mg" "get") (result i32)) + (func $get_mut (import "Mg" "get_mut") (result i32)) + (func $set_mut (import "Mg" "set_mut") (param i32)) + (export "Mg.glob" (global $x)) (export "Mg.get" (func $f)) (global $glob (export "glob") i32 (i32.const 43)) (func (export "get") (result i32) (global.get $glob)) + + (export "Mg.mut_glob" (global $mut_glob)) + (export "Mg.get_mut" (func $get_mut)) + (export "Mg.set_mut" (func $set_mut)) ) (assert_return (get $Mg "glob") (i32.const 42)) @@ -44,6 +71,26 @@ (assert_return (invoke $Ng "Mg.get") (i32.const 42)) (assert_return (invoke $Ng "get") (i32.const 43)) +(assert_return (get $Mg "mut_glob") (i32.const 142)) +(assert_return (get $Ng "Mg.mut_glob") (i32.const 142)) +(assert_return (invoke $Mg "get_mut") (i32.const 142)) +(assert_return (invoke $Ng "Mg.get_mut") (i32.const 142)) + +(assert_return (invoke $Mg "set_mut" (i32.const 241))) +(assert_return (get $Mg "mut_glob") (i32.const 241)) +(assert_return (get $Ng "Mg.mut_glob") (i32.const 241)) +(assert_return (invoke $Mg "get_mut") (i32.const 241)) +(assert_return (invoke $Ng "Mg.get_mut") (i32.const 241)) + + +(assert_unlinkable + (module (import "Mg" "mut_glob" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "Mg" "glob" (global (mut i32)))) + "incompatible import type" +) ;; Tables @@ -142,15 +189,61 @@ (assert_trap (invoke $Ot "call" (i32.const 20)) "undefined") +(module + (table (import "Mt" "tab") 0 funcref) + (elem (i32.const 9) $f) + (func $f) +) + +(module $G1 (global (export "g") i32 (i32.const 5))) +(register "G1" $G1) +(module $G2 + (global (import "G1" "g") i32) + (global (export "g") i32 (global.get 0)) +) +(assert_return (get $G2 "g") (i32.const 5)) + (assert_unlinkable - (module $Qt - (func $host (import "spectest" "print")) + (module + (table (import "Mt" "tab") 0 funcref) + (elem (i32.const 10) $f) + (func $f) + ) + "elements segment does not fit" +) + +(assert_unlinkable + (module + (table (import "Mt" "tab") 10 funcref) + (memory (import "Mt" "mem") 1) ;; does not exist + (func $f (result i32) (i32.const 0)) + (elem (i32.const 7) $f) + (elem (i32.const 9) $f) + ) + "unknown import" +) +(assert_trap (invoke $Mt "call" (i32.const 7)) "uninitialized") + +(assert_unlinkable + (module + (table (import "Mt" "tab") 10 funcref) + (func $f (result i32) (i32.const 0)) + (elem (i32.const 7) $f) + (elem (i32.const 12) $f) ;; out of bounds + ) + "elements segment does not fit" +) +(assert_trap (invoke $Mt "call" (i32.const 7)) "uninitialized") + +(assert_unlinkable + (module (table (import "Mt" "tab") 10 funcref) - (elem (i32.const 7) $own) - (elem (i32.const 9) $host) - (func $own (result i32) (i32.const 666)) + (func $f (result i32) (i32.const 0)) + (elem (i32.const 7) $f) + (memory 1) + (data (i32.const 0x10000) "d") ;; out of bounds ) - "invalid use of host function" + "data segment does not fit" ) (assert_trap (invoke $Mt "call" (i32.const 7)) "uninitialized") @@ -197,6 +290,19 @@ (assert_return (invoke $Nm "load" (i32.const 12)) (i32.const 0xf2)) (assert_return (invoke $Om "load" (i32.const 12)) (i32.const 0xa7)) +(module + (memory (import "Mm" "mem") 0) + (data (i32.const 0xffff) "a") +) + +(assert_unlinkable + (module + (memory (import "Mm" "mem") 0) + (data (i32.const 0x10000) "a") + ) + "data segment does not fit" +) + (module $Pm (memory (import "Mm" "mem") 1 8) @@ -215,14 +321,68 @@ (assert_return (invoke $Pm "grow" (i32.const 0)) (i32.const 5)) (assert_unlinkable - (module $Qm + (module (func $host (import "spectest" "print")) (memory (import "Mm" "mem") 1) - (table 10 funcref) + (table (import "Mm" "tab") 0 funcref) ;; does not exist + (data (i32.const 0) "abc") + ) + "unknown import" +) +(assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 0)) + +(assert_unlinkable + (module + (memory (import "Mm" "mem") 1) + (data (i32.const 0) "abc") + (data (i32.const 0x50000) "d") ;; out of bounds + ) + "data segment does not fit" +) +(assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 0)) + +(assert_unlinkable + (module + (memory (import "Mm" "mem") 1) (data (i32.const 0) "abc") - (elem (i32.const 9) $host) - (func $own (result i32) (i32.const 666)) + (table 0 funcref) + (func) + (elem (i32.const 0) 0) ;; out of bounds ) - "invalid use of host function" + "elements segment does not fit" ) (assert_return (invoke $Mm "load" (i32.const 0)) (i32.const 0)) + +;; Store is modified if the start function traps. +(module $Ms + (type $t (func (result i32))) + (memory (export "memory") 1) + (table (export "table") 1 funcref) + (func (export "get memory[0]") (type $t) + (i32.load8_u (i32.const 0)) + ) + (func (export "get table[0]") (type $t) + (call_indirect (type $t) (i32.const 0)) + ) +) +(register "Ms" $Ms) + +(assert_trap + (module + (import "Ms" "memory" (memory 1)) + (import "Ms" "table" (table 1 funcref)) + (data (i32.const 0) "hello") + (elem (i32.const 0) $f) + (func $f (result i32) + (i32.const 0xdead) + ) + (func $main + (unreachable) + ) + (start $main) + ) + "unreachable" +) + +(assert_return (invoke $Ms "get memory[0]") (i32.const 104)) ;; 'h' +(assert_return (invoke $Ms "get table[0]") (i32.const 0xdead)) diff --git a/test/spec/load.wast b/test/spec/load.wast new file mode 100644 index 000000000..ef5ec7c42 --- /dev/null +++ b/test/spec/load.wast @@ -0,0 +1,567 @@ +;; Load operator as the argument of control constructs and instructions + +(module + (memory 1) + + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (i32.load (i32.const 0)))) + ) + + (func (export "as-br_if-cond") + (block (br_if 0 (i32.load (i32.const 0)))) + ) + (func (export "as-br_if-value") (result i32) + (block (result i32) + (drop (br_if 0 (i32.load (i32.const 0)) (i32.const 1))) (i32.const 7) + ) + ) + (func (export "as-br_if-value-cond") (result i32) + (block (result i32) + (drop (br_if 0 (i32.const 6) (i32.load (i32.const 0)))) (i32.const 7) + ) + ) + + (func (export "as-br_table-index") + (block (br_table 0 0 0 (i32.load (i32.const 0)))) + ) + (func (export "as-br_table-value") (result i32) + (block (result i32) + (br_table 0 0 0 (i32.load (i32.const 0)) (i32.const 1)) (i32.const 7) + ) + ) + (func (export "as-br_table-value-index") (result i32) + (block (result i32) + (br_table 0 0 (i32.const 6) (i32.load (i32.const 0))) (i32.const 7) + ) + ) + + (func (export "as-return-value") (result i32) + (return (i32.load (i32.const 0))) + ) + + (func (export "as-if-cond") (result i32) + (if (result i32) (i32.load (i32.const 0)) + (then (i32.const 0)) (else (i32.const 1)) + ) + ) + (func (export "as-if-then") (result i32) + (if (result i32) (i32.const 1) + (then (i32.load (i32.const 0))) (else (i32.const 0)) + ) + ) + (func (export "as-if-else") (result i32) + (if (result i32) (i32.const 0) + (then (i32.const 0)) (else (i32.load (i32.const 0))) + ) + ) + + (func (export "as-select-first") (param i32 i32) (result i32) + (select (i32.load (i32.const 0)) (local.get 0) (local.get 1)) + ) + (func (export "as-select-second") (param i32 i32) (result i32) + (select (local.get 0) (i32.load (i32.const 0)) (local.get 1)) + ) + (func (export "as-select-cond") (result i32) + (select (i32.const 0) (i32.const 1) (i32.load (i32.const 0))) + ) + + (func $f (param i32 i32 i32) (result i32) (i32.const -1)) + (func (export "as-call-first") (result i32) + (call $f (i32.load (i32.const 0)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-call-mid") (result i32) + (call $f (i32.const 1) (i32.load (i32.const 0)) (i32.const 3)) + ) + (func (export "as-call-last") (result i32) + (call $f (i32.const 1) (i32.const 2) (i32.load (i32.const 0))) + ) + + (type $sig (func (param i32 i32 i32) (result i32))) + (table funcref (elem $f)) + (func (export "as-call_indirect-first") (result i32) + (call_indirect (type $sig) + (i32.load (i32.const 0)) (i32.const 2) (i32.const 3) (i32.const 0) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.load (i32.const 0)) (i32.const 3) (i32.const 0) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.const 2) (i32.load (i32.const 0)) (i32.const 0) + ) + ) + (func (export "as-call_indirect-index") (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.const 2) (i32.const 3) (i32.load (i32.const 0)) + ) + ) + + (func (export "as-local.set-value") (local i32) + (local.set 0 (i32.load (i32.const 0))) + ) + (func (export "as-local.tee-value") (result i32) (local i32) + (local.tee 0 (i32.load (i32.const 0))) + ) + (global $g (mut i32) (i32.const 0)) + (func (export "as-global.set-value") (local i32) + (global.set $g (i32.load (i32.const 0))) + ) + + (func (export "as-load-address") (result i32) + (i32.load (i32.load (i32.const 0))) + ) + (func (export "as-loadN-address") (result i32) + (i32.load8_s (i32.load (i32.const 0))) + ) + + (func (export "as-store-address") + (i32.store (i32.load (i32.const 0)) (i32.const 7)) + ) + (func (export "as-store-value") + (i32.store (i32.const 2) (i32.load (i32.const 0))) + ) + + (func (export "as-storeN-address") + (i32.store8 (i32.load8_s (i32.const 0)) (i32.const 7)) + ) + (func (export "as-storeN-value") + (i32.store16 (i32.const 2) (i32.load (i32.const 0))) + ) + + (func (export "as-unary-operand") (result i32) + (i32.clz (i32.load (i32.const 100))) + ) + + (func (export "as-binary-left") (result i32) + (i32.add (i32.load (i32.const 100)) (i32.const 10)) + ) + (func (export "as-binary-right") (result i32) + (i32.sub (i32.const 10) (i32.load (i32.const 100))) + ) + + (func (export "as-test-operand") (result i32) + (i32.eqz (i32.load (i32.const 100))) + ) + + (func (export "as-compare-left") (result i32) + (i32.le_s (i32.load (i32.const 100)) (i32.const 10)) + ) + (func (export "as-compare-right") (result i32) + (i32.ne (i32.const 10) (i32.load (i32.const 100))) + ) + + (func (export "as-memory.grow-size") (result i32) + (memory.grow (i32.load (i32.const 100))) + ) +) + +(assert_return (invoke "as-br-value") (i32.const 0)) + +(assert_return (invoke "as-br_if-cond")) +(assert_return (invoke "as-br_if-value") (i32.const 0)) +(assert_return (invoke "as-br_if-value-cond") (i32.const 7)) + +(assert_return (invoke "as-br_table-index")) +(assert_return (invoke "as-br_table-value") (i32.const 0)) +(assert_return (invoke "as-br_table-value-index") (i32.const 6)) + +(assert_return (invoke "as-return-value") (i32.const 0)) + +(assert_return (invoke "as-if-cond") (i32.const 1)) +(assert_return (invoke "as-if-then") (i32.const 0)) +(assert_return (invoke "as-if-else") (i32.const 0)) + +(assert_return (invoke "as-select-first" (i32.const 0) (i32.const 1)) (i32.const 0)) +(assert_return (invoke "as-select-second" (i32.const 0) (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-select-cond") (i32.const 1)) + +(assert_return (invoke "as-call-first") (i32.const -1)) +(assert_return (invoke "as-call-mid") (i32.const -1)) +(assert_return (invoke "as-call-last") (i32.const -1)) + +(assert_return (invoke "as-call_indirect-first") (i32.const -1)) +(assert_return (invoke "as-call_indirect-mid") (i32.const -1)) +(assert_return (invoke "as-call_indirect-last") (i32.const -1)) +(assert_return (invoke "as-call_indirect-index") (i32.const -1)) + +(assert_return (invoke "as-local.set-value")) +(assert_return (invoke "as-local.tee-value") (i32.const 0)) +(assert_return (invoke "as-global.set-value")) + +(assert_return (invoke "as-load-address") (i32.const 0)) +(assert_return (invoke "as-loadN-address") (i32.const 0)) +(assert_return (invoke "as-store-address")) +(assert_return (invoke "as-store-value")) +(assert_return (invoke "as-storeN-address")) +(assert_return (invoke "as-storeN-value")) + +(assert_return (invoke "as-unary-operand") (i32.const 32)) + +(assert_return (invoke "as-binary-left") (i32.const 10)) +(assert_return (invoke "as-binary-right") (i32.const 10)) + +(assert_return (invoke "as-test-operand") (i32.const 1)) + +(assert_return (invoke "as-compare-left") (i32.const 1)) +(assert_return (invoke "as-compare-right") (i32.const 1)) + +(assert_return (invoke "as-memory.grow-size") (i32.const 1)) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i32) (i32.load32 (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i32) (i32.load32_u (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i32) (i32.load32_s (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i32) (i32.load64 (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i32) (i32.load64_u (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i32) (i32.load64_s (local.get 0)))" + ) + "unknown operator" +) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i64) (i64.load64 (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i64) (i64.load64_u (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result i64) (i64.load64_s (local.get 0)))" + ) + "unknown operator" +) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result f32) (f32.load32 (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result f32) (f32.load64 (local.get 0)))" + ) + "unknown operator" +) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result f64) (f64.load32 (local.get 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (result f64) (f64.load64 (local.get 0)))" + ) + "unknown operator" +) + + +;; load should have retval + +(assert_invalid + (module (memory 1) (func $load_i32 (i32.load (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load8_s_i32 (i32.load8_s (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load8_u_i32 (i32.load8_u (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load16_s_i32 (i32.load16_s (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load16_u_i32 (i32.load16_u (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load_i64 (i64.load (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load8_s_i64 (i64.load8_s (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load8_u_i64 (i64.load8_u (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load16_s_i64 (i64.load16_s (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load16_u_i64 (i64.load16_u (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load32_s_i64 (i64.load32_s (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load32_u_i64 (i64.load32_u (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load_f32 (f32.load (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func $load_f64 (f64.load (i32.const 0)))) + "type mismatch" +) + + +;; Type check + +(assert_invalid (module (memory 1) (func (result i32) (i32.load (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i32) (i32.load8_s (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i32) (i32.load8_u (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i32) (i32.load16_s (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i32) (i32.load16_u (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load8_s (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load8_u (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load16_s (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load16_u (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load32_s (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result i64) (i64.load32_u (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result f32) (f32.load (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (result f64) (f64.load (f32.const 0)))) "type mismatch") + + +(assert_invalid + (module + (memory 0) + (func $type-address-empty + (i32.load) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-block + (i32.const 0) + (block (i32.load) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-loop + (i32.const 0) + (loop (i32.load) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (i32.load) (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-else + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (i32.load))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-br + (i32.const 0) + (block (br 0 (i32.load)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-br_if + (i32.const 0) + (block (br_if 0 (i32.load) (i32.const 1)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-br_table + (i32.const 0) + (block (br_table 0 (i32.load)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-return + (return (i32.load)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-select + (select (i32.load) (i32.const 1) (i32.const 2)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-call + (call 1 (i32.load)) (drop) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-address-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (i32.load) (i32.const 0) + ) + (drop) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-local.set + (local i32) + (local.set 0 (i32.load)) (local.get 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-local.tee + (local i32) + (local.tee 0 (i32.load)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (global $x (mut i32) (i32.const 0)) + (func $type-address-empty-in-global.set + (global.set $x (i32.load)) (global.get $x) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-memory.grow + (memory.grow (i32.load)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-address-empty-in-load + (i32.load (i32.load)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-store + (i32.store (i32.load) (i32.const 1)) + ) + ) + "type mismatch" +) diff --git a/test/spec/local_get.wast b/test/spec/local_get.wast new file mode 100644 index 000000000..ab564cbed --- /dev/null +++ b/test/spec/local_get.wast @@ -0,0 +1,226 @@ +;; Test `local.get` operator + +(module + ;; Typing + + (func (export "type-local-i32") (result i32) (local i32) (local.get 0)) + (func (export "type-local-i64") (result i64) (local i64) (local.get 0)) + (func (export "type-local-f32") (result f32) (local f32) (local.get 0)) + (func (export "type-local-f64") (result f64) (local f64) (local.get 0)) + + (func (export "type-param-i32") (param i32) (result i32) (local.get 0)) + (func (export "type-param-i64") (param i64) (result i64) (local.get 0)) + (func (export "type-param-f32") (param f32) (result f32) (local.get 0)) + (func (export "type-param-f64") (param f64) (result f64) (local.get 0)) + + (func (export "type-mixed") (param i64 f32 f64 i32 i32) + (local f32 i64 i64 f64) + (drop (i64.eqz (local.get 0))) + (drop (f32.neg (local.get 1))) + (drop (f64.neg (local.get 2))) + (drop (i32.eqz (local.get 3))) + (drop (i32.eqz (local.get 4))) + (drop (f32.neg (local.get 5))) + (drop (i64.eqz (local.get 6))) + (drop (i64.eqz (local.get 7))) + (drop (f64.neg (local.get 8))) + ) + + ;; Reading + + (func (export "read") (param i64 f32 f64 i32 i32) (result f64) + (local f32 i64 i64 f64) + (local.set 5 (f32.const 5.5)) + (local.set 6 (i64.const 6)) + (local.set 8 (f64.const 8)) + (f64.add + (f64.convert_i64_u (local.get 0)) + (f64.add + (f64.promote_f32 (local.get 1)) + (f64.add + (local.get 2) + (f64.add + (f64.convert_i32_u (local.get 3)) + (f64.add + (f64.convert_i32_s (local.get 4)) + (f64.add + (f64.promote_f32 (local.get 5)) + (f64.add + (f64.convert_i64_u (local.get 6)) + (f64.add + (f64.convert_i64_u (local.get 7)) + (local.get 8) + ) + ) + ) + ) + ) + ) + ) + ) + ) + + ;; As parameter of control constructs and instructions + + (func (export "as-block-value") (param i32) (result i32) + (block (result i32) (local.get 0)) + ) + (func (export "as-loop-value") (param i32) (result i32) + (loop (result i32) (local.get 0)) + ) + (func (export "as-br-value") (param i32) (result i32) + (block (result i32) (br 0 (local.get 0))) + ) + (func (export "as-br_if-value") (param i32) (result i32) + (block $l0 (result i32) (br_if $l0 (local.get 0) (i32.const 1))) + ) + + (func (export "as-br_if-value-cond") (param i32) (result i32) + (block (result i32) + (br_if 0 (local.get 0) (local.get 0)) + ) + ) + (func (export "as-br_table-value") (param i32) (result i32) + (block + (block + (block + (br_table 0 1 2 (local.get 0)) + (return (i32.const 0)) + ) + (return (i32.const 1)) + ) + (return (i32.const 2)) + ) + (i32.const 3) + ) + + (func (export "as-return-value") (param i32) (result i32) + (return (local.get 0)) + ) + + (func (export "as-if-then") (param i32) (result i32) + (if (result i32) (local.get 0) (then (local.get 0)) (else (i32.const 0))) + ) + (func (export "as-if-else") (param i32) (result i32) + (if (result i32) (local.get 0) (then (i32.const 1)) (else (local.get 0))) + ) +) + +(assert_return (invoke "type-local-i32") (i32.const 0)) +(assert_return (invoke "type-local-i64") (i64.const 0)) +(assert_return (invoke "type-local-f32") (f32.const 0)) +(assert_return (invoke "type-local-f64") (f64.const 0)) + +(assert_return (invoke "type-param-i32" (i32.const 2)) (i32.const 2)) +(assert_return (invoke "type-param-i64" (i64.const 3)) (i64.const 3)) +(assert_return (invoke "type-param-f32" (f32.const 4.4)) (f32.const 4.4)) +(assert_return (invoke "type-param-f64" (f64.const 5.5)) (f64.const 5.5)) + +(assert_return (invoke "as-block-value" (i32.const 6)) (i32.const 6)) +(assert_return (invoke "as-loop-value" (i32.const 7)) (i32.const 7)) + +(assert_return (invoke "as-br-value" (i32.const 8)) (i32.const 8)) +(assert_return (invoke "as-br_if-value" (i32.const 9)) (i32.const 9)) +(assert_return (invoke "as-br_if-value-cond" (i32.const 10)) (i32.const 10)) +(assert_return (invoke "as-br_table-value" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-return-value" (i32.const 0)) (i32.const 0)) + +(assert_return (invoke "as-if-then" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-if-else" (i32.const 0)) (i32.const 0)) + +(assert_return + (invoke "type-mixed" + (i64.const 1) (f32.const 2.2) (f64.const 3.3) (i32.const 4) (i32.const 5) + ) +) + +(assert_return + (invoke "read" + (i64.const 1) (f32.const 2) (f64.const 3.3) (i32.const 4) (i32.const 5) + ) + (f64.const 34.8) +) + + +;; Invalid typing of access to locals + +(assert_invalid + (module (func $type-local-num-vs-num (result i64) (local i32) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-num-vs-num (result i32) (local f32) (i32.eqz (local.get 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-num-vs-num (result f64) (local f64 i64) (f64.neg (local.get 1)))) + "type mismatch" +) + + +;; Invalid typing of access to parameters + +(assert_invalid + (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-num-vs-num (param f32) (result i32) (i32.eqz (local.get 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-num-vs-num (param f64 i64) (result f64) (f64.neg (local.get 1)))) + "type mismatch" +) + + +;; local.set should have retval + +(assert_invalid + (module (func $type-empty-vs-i32 (local i32) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-vs-i64 (local i64) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-vs-f32 (local f32) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-vs-f64 (local f64) (local.get 0))) + "type mismatch" +) + + +;; Invalid local index + +(assert_invalid + (module (func $unbound-local (local i32 i64) (local.get 3))) + "unknown local" +) +(assert_invalid + (module (func $large-local (local i32 i64) (local.get 14324343))) + "unknown local" +) + +(assert_invalid + (module (func $unbound-param (param i32 i64) (local.get 2))) + "unknown local" +) +(assert_invalid + (module (func $large-param (param i32 i64) (local.get 714324343))) + "unknown local" +) + +(assert_invalid + (module (func $unbound-mixed (param i32) (local i32 i64) (local.get 3))) + "unknown local" +) +(assert_invalid + (module (func $large-mixed (param i64) (local i32 i64) (local.get 214324343))) + "unknown local" +) + diff --git a/test/spec/local_set.wast b/test/spec/local_set.wast new file mode 100644 index 000000000..ce9cf77f4 --- /dev/null +++ b/test/spec/local_set.wast @@ -0,0 +1,362 @@ +;; Test `local.set` operator + +(module + ;; Typing + + (func (export "type-local-i32") (local i32) (local.set 0 (i32.const 0))) + (func (export "type-local-i64") (local i64) (local.set 0 (i64.const 0))) + (func (export "type-local-f32") (local f32) (local.set 0 (f32.const 0))) + (func (export "type-local-f64") (local f64) (local.set 0 (f64.const 0))) + + (func (export "type-param-i32") (param i32) (local.set 0 (i32.const 10))) + (func (export "type-param-i64") (param i64) (local.set 0 (i64.const 11))) + (func (export "type-param-f32") (param f32) (local.set 0 (f32.const 11.1))) + (func (export "type-param-f64") (param f64) (local.set 0 (f64.const 12.2))) + + (func (export "type-mixed") (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64) + (local.set 0 (i64.const 0)) + (local.set 1 (f32.const 0)) + (local.set 2 (f64.const 0)) + (local.set 3 (i32.const 0)) + (local.set 4 (i32.const 0)) + (local.set 5 (f32.const 0)) + (local.set 6 (i64.const 0)) + (local.set 7 (i64.const 0)) + (local.set 8 (f64.const 0)) + ) + + ;; Writing + + (func (export "write") (param i64 f32 f64 i32 i32) (result i64) + (local f32 i64 i64 f64) + (local.set 1 (f32.const -0.3)) + (local.set 3 (i32.const 40)) + (local.set 4 (i32.const -7)) + (local.set 5 (f32.const 5.5)) + (local.set 6 (i64.const 6)) + (local.set 8 (f64.const 8)) + (i64.trunc_f64_s + (f64.add + (f64.convert_i64_u (local.get 0)) + (f64.add + (f64.promote_f32 (local.get 1)) + (f64.add + (local.get 2) + (f64.add + (f64.convert_i32_u (local.get 3)) + (f64.add + (f64.convert_i32_s (local.get 4)) + (f64.add + (f64.promote_f32 (local.get 5)) + (f64.add + (f64.convert_i64_u (local.get 6)) + (f64.add + (f64.convert_i64_u (local.get 7)) + (local.get 8) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + + ;; As parameter of control constructs and instructions + + (func (export "as-block-value") (param i32) + (block (local.set 0 (i32.const 1))) + ) + (func (export "as-loop-value") (param i32) + (loop (local.set 0 (i32.const 3))) + ) + + (func (export "as-br-value") (param i32) + (block (br 0 (local.set 0 (i32.const 9)))) + ) + (func (export "as-br_if-value") (param i32) + (block + (br_if 0 (local.set 0 (i32.const 8)) (i32.const 1)) + ) + ) + (func (export "as-br_if-value-cond") (param i32) + (block + (br_if 0 (i32.const 6) (local.set 0 (i32.const 9))) + ) + ) + (func (export "as-br_table-value") (param i32) + (block + (br_table 0 (local.set 0 (i32.const 10)) (i32.const 1)) + ) + ) + + (func (export "as-return-value") (param i32) + (return (local.set 0 (i32.const 7))) + ) + + (func (export "as-if-then") (param i32) + (if (local.get 0) (then (local.set 0 (i32.const 3)))) + ) + (func (export "as-if-else") (param i32) + (if (local.get 0) (then) (else (local.set 0 (i32.const 1)))) + ) +) + +(assert_return (invoke "type-local-i32")) +(assert_return (invoke "type-local-i64")) +(assert_return (invoke "type-local-f32")) +(assert_return (invoke "type-local-f64")) + +(assert_return (invoke "type-param-i32" (i32.const 2))) +(assert_return (invoke "type-param-i64" (i64.const 3))) +(assert_return (invoke "type-param-f32" (f32.const 4.4))) +(assert_return (invoke "type-param-f64" (f64.const 5.5))) + +(assert_return (invoke "as-block-value" (i32.const 0))) +(assert_return (invoke "as-loop-value" (i32.const 0))) + +(assert_return (invoke "as-br-value" (i32.const 0))) +(assert_return (invoke "as-br_if-value" (i32.const 0))) +(assert_return (invoke "as-br_if-value-cond" (i32.const 0))) +(assert_return (invoke "as-br_table-value" (i32.const 0))) + +(assert_return (invoke "as-return-value" (i32.const 0))) + +(assert_return (invoke "as-if-then" (i32.const 1))) +(assert_return (invoke "as-if-else" (i32.const 0))) + +(assert_return + (invoke "type-mixed" + (i64.const 1) (f32.const 2.2) (f64.const 3.3) (i32.const 4) (i32.const 5) + ) +) + +(assert_return + (invoke "write" + (i64.const 1) (f32.const 2) (f64.const 3.3) (i32.const 4) (i32.const 5) + ) + (i64.const 56) +) + + +;; Invalid typing of access to locals + + +(assert_invalid + (module (func $type-local-arg-void-vs-num (local i32) (local.set 0 (nop)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-arg-num-vs-num (local i32) (local.set 0 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-arg-num-vs-num (local f32) (local.set 0 (f64.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-arg-num-vs-num (local f64 i64) (local.set 1 (f64.const 0)))) + "type mismatch" +) + + +;; Invalid typing of access to parameters + + +(assert_invalid + (module (func $type-param-arg-void-vs-num (param i32) (local.set 0 (nop)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-arg-num-vs-num (param i32) (local.set 0 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-arg-num-vs-num (param f32) (local.set 0 (f64.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-arg-num-vs-num (param f64 i64) (local.set 1 (f64.const 0)))) + "type mismatch" +) + +(assert_invalid + (module + (func $type-param-arg-empty-vs-num (param i32) + (local.set 0) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-block (param i32) + (i32.const 0) + (block (local.set 0)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-loop (param i32) + (i32.const 0) + (loop (local.set 0)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-then (param i32) + (i32.const 0) + (if (i32.const 1) (then (local.set 0))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-else (param i32) + (i32.const 0) + (if (result i32) (i32.const 0) (then (i32.const 0)) (else (local.set 0))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-br (param i32) + (i32.const 0) + (block (br 0 (local.set 0))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-br_if (param i32) + (i32.const 0) + (block (br_if 0 (local.set 0))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-br_table (param i32) + (i32.const 0) + (block (br_table 0 (local.set 0))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-return (param i32) + (return (local.set 0)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-select (param i32) + (select (local.set 0) (i32.const 1) (i32.const 2)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-call (param i32) + (call 1 (local.set 0)) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-param-arg-empty-vs-num-in-call_indirect (param i32) + (block (result i32) + (call_indirect (type $sig) + (local.set 0) (i32.const 0) + ) + ) + ) + ) + "type mismatch" +) + + +;; Invalid typing of access to mixed args + +(assert_invalid + (module (func $type-mixed-arg-num-vs-num (param f32) (local i32) (local.set 1 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-mixed-arg-num-vs-num (param i64 i32) (local f32) (local.set 1 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-mixed-arg-num-vs-num (param i64) (local f64 i64) (local.set 1 (i64.const 0)))) + "type mismatch" +) + + +;; local.set should have no retval + +(assert_invalid + (module (func $type-empty-vs-i32 (param i32) (result i32) (local.set 0 (i32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-vs-i64 (param i64) (result i64) (local.set 0 (i64.const 1)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-vs-f32 (param f32) (result f32) (local.set 0 (f32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-vs-f64 (param f64) (result f64) (local.set 0 (f64.const 1)))) + "type mismatch" +) + + +;; Invalid local index + +(assert_invalid + (module (func $unbound-local (local i32 i64) (local.set 3 (i32.const 0)))) + "unknown local" +) +(assert_invalid + (module (func $large-local (local i32 i64) (local.set 14324343 (i32.const 0)))) + "unknown local" +) + +(assert_invalid + (module (func $unbound-param (param i32 i64) (local.set 2 (i32.const 0)))) + "unknown local" +) +(assert_invalid + (module (func $large-param (param i32 i64) (local.set 714324343 (i32.const 0)))) + "unknown local" +) + +(assert_invalid + (module (func $unbound-mixed (param i32) (local i32 i64) (local.set 3 (i32.const 0)))) + "unknown local" +) +(assert_invalid + (module (func $large-mixed (param i64) (local i32 i64) (local.set 214324343 (i32.const 0)))) + "unknown local" +) + diff --git a/test/spec/local_tee.wast b/test/spec/local_tee.wast new file mode 100644 index 000000000..dde7321ec --- /dev/null +++ b/test/spec/local_tee.wast @@ -0,0 +1,639 @@ +;; Test `local.tee` operator + +(module + ;; Typing + + (func (export "type-local-i32") (result i32) (local i32) (local.tee 0 (i32.const 0))) + (func (export "type-local-i64") (result i64) (local i64) (local.tee 0 (i64.const 0))) + (func (export "type-local-f32") (result f32) (local f32) (local.tee 0 (f32.const 0))) + (func (export "type-local-f64") (result f64) (local f64) (local.tee 0 (f64.const 0))) + + (func (export "type-param-i32") (param i32) (result i32) (local.tee 0 (i32.const 10))) + (func (export "type-param-i64") (param i64) (result i64) (local.tee 0 (i64.const 11))) + (func (export "type-param-f32") (param f32) (result f32) (local.tee 0 (f32.const 11.1))) + (func (export "type-param-f64") (param f64) (result f64) (local.tee 0 (f64.const 12.2))) + + (func (export "type-mixed") (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64) + (drop (i64.eqz (local.tee 0 (i64.const 0)))) + (drop (f32.neg (local.tee 1 (f32.const 0)))) + (drop (f64.neg (local.tee 2 (f64.const 0)))) + (drop (i32.eqz (local.tee 3 (i32.const 0)))) + (drop (i32.eqz (local.tee 4 (i32.const 0)))) + (drop (f32.neg (local.tee 5 (f32.const 0)))) + (drop (i64.eqz (local.tee 6 (i64.const 0)))) + (drop (i64.eqz (local.tee 7 (i64.const 0)))) + (drop (f64.neg (local.tee 8 (f64.const 0)))) + ) + + ;; Writing + + (func (export "write") (param i64 f32 f64 i32 i32) (result i64) (local f32 i64 i64 f64) + (drop (local.tee 1 (f32.const -0.3))) + (drop (local.tee 3 (i32.const 40))) + (drop (local.tee 4 (i32.const -7))) + (drop (local.tee 5 (f32.const 5.5))) + (drop (local.tee 6 (i64.const 6))) + (drop (local.tee 8 (f64.const 8))) + (i64.trunc_f64_s + (f64.add + (f64.convert_i64_u (local.get 0)) + (f64.add + (f64.promote_f32 (local.get 1)) + (f64.add + (local.get 2) + (f64.add + (f64.convert_i32_u (local.get 3)) + (f64.add + (f64.convert_i32_s (local.get 4)) + (f64.add + (f64.promote_f32 (local.get 5)) + (f64.add + (f64.convert_i64_u (local.get 6)) + (f64.add + (f64.convert_i64_u (local.get 7)) + (local.get 8) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + + ;; Result + + (func (export "result") (param i64 f32 f64 i32 i32) (result f64) + (local f32 i64 i64 f64) + (f64.add + (f64.convert_i64_u (local.tee 0 (i64.const 1))) + (f64.add + (f64.promote_f32 (local.tee 1 (f32.const 2))) + (f64.add + (local.tee 2 (f64.const 3.3)) + (f64.add + (f64.convert_i32_u (local.tee 3 (i32.const 4))) + (f64.add + (f64.convert_i32_s (local.tee 4 (i32.const 5))) + (f64.add + (f64.promote_f32 (local.tee 5 (f32.const 5.5))) + (f64.add + (f64.convert_i64_u (local.tee 6 (i64.const 6))) + (f64.add + (f64.convert_i64_u (local.tee 7 (i64.const 0))) + (local.tee 8 (f64.const 8)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + + (func $dummy) + + (func (export "as-block-first") (param i32) (result i32) + (block (result i32) (local.tee 0 (i32.const 1)) (call $dummy)) + ) + (func (export "as-block-mid") (param i32) (result i32) + (block (result i32) (call $dummy) (local.tee 0 (i32.const 1)) (call $dummy)) + ) + (func (export "as-block-last") (param i32) (result i32) + (block (result i32) (call $dummy) (call $dummy) (local.tee 0 (i32.const 1))) + ) + + (func (export "as-loop-first") (param i32) (result i32) + (loop (result i32) (local.tee 0 (i32.const 3)) (call $dummy)) + ) + (func (export "as-loop-mid") (param i32) (result i32) + (loop (result i32) (call $dummy) (local.tee 0 (i32.const 4)) (call $dummy)) + ) + (func (export "as-loop-last") (param i32) (result i32) + (loop (result i32) (call $dummy) (call $dummy) (local.tee 0 (i32.const 5))) + ) + + (func (export "as-br-value") (param i32) (result i32) + (block (result i32) (br 0 (local.tee 0 (i32.const 9)))) + ) + + (func (export "as-br_if-cond") (param i32) + (block (br_if 0 (local.tee 0 (i32.const 1)))) + ) + (func (export "as-br_if-value") (param i32) (result i32) + (block (result i32) + (drop (br_if 0 (local.tee 0 (i32.const 8)) (i32.const 1))) (i32.const 7) + ) + ) + (func (export "as-br_if-value-cond") (param i32) (result i32) + (block (result i32) + (drop (br_if 0 (i32.const 6) (local.tee 0 (i32.const 9)))) (i32.const 7) + ) + ) + + (func (export "as-br_table-index") (param i32) + (block (br_table 0 0 0 (local.tee 0 (i32.const 0)))) + ) + (func (export "as-br_table-value") (param i32) (result i32) + (block (result i32) + (br_table 0 0 0 (local.tee 0 (i32.const 10)) (i32.const 1)) (i32.const 7) + ) + ) + (func (export "as-br_table-value-index") (param i32) (result i32) + (block (result i32) + (br_table 0 0 (i32.const 6) (local.tee 0 (i32.const 11))) (i32.const 7) + ) + ) + + (func (export "as-return-value") (param i32) (result i32) + (return (local.tee 0 (i32.const 7))) + ) + + (func (export "as-if-cond") (param i32) (result i32) + (if (result i32) (local.tee 0 (i32.const 2)) + (then (i32.const 0)) (else (i32.const 1)) + ) + ) + (func (export "as-if-then") (param i32) (result i32) + (if (result i32) (local.get 0) + (then (local.tee 0 (i32.const 3))) (else (local.get 0)) + ) + ) + (func (export "as-if-else") (param i32) (result i32) + (if (result i32) (local.get 0) + (then (local.get 0)) (else (local.tee 0 (i32.const 4))) + ) + ) + + (func (export "as-select-first") (param i32 i32) (result i32) + (select (local.tee 0 (i32.const 5)) (local.get 0) (local.get 1)) + ) + (func (export "as-select-second") (param i32 i32) (result i32) + (select (local.get 0) (local.tee 0 (i32.const 6)) (local.get 1)) + ) + (func (export "as-select-cond") (param i32) (result i32) + (select (i32.const 0) (i32.const 1) (local.tee 0 (i32.const 7))) + ) + + (func $f (param i32 i32 i32) (result i32) (i32.const -1)) + (func (export "as-call-first") (param i32) (result i32) + (call $f (local.tee 0 (i32.const 12)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-call-mid") (param i32) (result i32) + (call $f (i32.const 1) (local.tee 0 (i32.const 13)) (i32.const 3)) + ) + (func (export "as-call-last") (param i32) (result i32) + (call $f (i32.const 1) (i32.const 2) (local.tee 0 (i32.const 14))) + ) + + (type $sig (func (param i32 i32 i32) (result i32))) + (table funcref (elem $f)) + (func (export "as-call_indirect-first") (param i32) (result i32) + (call_indirect (type $sig) + (local.tee 0 (i32.const 1)) (i32.const 2) (i32.const 3) (i32.const 0) + ) + ) + (func (export "as-call_indirect-mid") (param i32) (result i32) + (call_indirect (type $sig) + (i32.const 1) (local.tee 0 (i32.const 2)) (i32.const 3) (i32.const 0) + ) + ) + (func (export "as-call_indirect-last") (param i32) (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.const 2) (local.tee 0 (i32.const 3)) (i32.const 0) + ) + ) + (func (export "as-call_indirect-index") (param i32) (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.const 2) (i32.const 3) (local.tee 0 (i32.const 0)) + ) + ) + + (func (export "as-local.set-value") (local i32) + (local.set 0 (local.tee 0 (i32.const 1))) + ) + (func (export "as-local.tee-value") (param i32) (result i32) + (local.tee 0 (local.tee 0 (i32.const 1))) + ) + (global $g (mut i32) (i32.const 0)) + (func (export "as-global.set-value") (local i32) + (global.set $g (local.tee 0 (i32.const 1))) + ) + + (memory 1) + (func (export "as-load-address") (param i32) (result i32) + (i32.load (local.tee 0 (i32.const 1))) + ) + (func (export "as-loadN-address") (param i32) (result i32) + (i32.load8_s (local.tee 0 (i32.const 3))) + ) + + (func (export "as-store-address") (param i32) + (i32.store (local.tee 0 (i32.const 30)) (i32.const 7)) + ) + (func (export "as-store-value") (param i32) + (i32.store (i32.const 2) (local.tee 0 (i32.const 1))) + ) + + (func (export "as-storeN-address") (param i32) + (i32.store8 (local.tee 0 (i32.const 1)) (i32.const 7)) + ) + (func (export "as-storeN-value") (param i32) + (i32.store16 (i32.const 2) (local.tee 0 (i32.const 1))) + ) + + (func (export "as-unary-operand") (param f32) (result f32) + (f32.neg (local.tee 0 (f32.const nan:0x0f1e2))) + ) + + (func (export "as-binary-left") (param i32) (result i32) + (i32.add (local.tee 0 (i32.const 3)) (i32.const 10)) + ) + (func (export "as-binary-right") (param i32) (result i32) + (i32.sub (i32.const 10) (local.tee 0 (i32.const 4))) + ) + + (func (export "as-test-operand") (param i32) (result i32) + (i32.eqz (local.tee 0 (i32.const 0))) + ) + + (func (export "as-compare-left") (param i32) (result i32) + (i32.le_s (local.tee 0 (i32.const 43)) (i32.const 10)) + ) + (func (export "as-compare-right") (param i32) (result i32) + (i32.ne (i32.const 10) (local.tee 0 (i32.const 42))) + ) + + (func (export "as-convert-operand") (param i64) (result i32) + (i32.wrap_i64 (local.tee 0 (i64.const 41))) + ) + + (func (export "as-memory.grow-size") (param i32) (result i32) + (memory.grow (local.tee 0 (i32.const 40))) + ) + +) + +(assert_return (invoke "type-local-i32") (i32.const 0)) +(assert_return (invoke "type-local-i64") (i64.const 0)) +(assert_return (invoke "type-local-f32") (f32.const 0)) +(assert_return (invoke "type-local-f64") (f64.const 0)) + +(assert_return (invoke "type-param-i32" (i32.const 2)) (i32.const 10)) +(assert_return (invoke "type-param-i64" (i64.const 3)) (i64.const 11)) +(assert_return (invoke "type-param-f32" (f32.const 4.4)) (f32.const 11.1)) +(assert_return (invoke "type-param-f64" (f64.const 5.5)) (f64.const 12.2)) + +(assert_return (invoke "as-block-first" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-block-mid" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-block-last" (i32.const 0)) (i32.const 1)) + +(assert_return (invoke "as-loop-first" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-loop-mid" (i32.const 0)) (i32.const 4)) +(assert_return (invoke "as-loop-last" (i32.const 0)) (i32.const 5)) + +(assert_return (invoke "as-br-value" (i32.const 0)) (i32.const 9)) + +(assert_return (invoke "as-br_if-cond" (i32.const 0))) +(assert_return (invoke "as-br_if-value" (i32.const 0)) (i32.const 8)) +(assert_return (invoke "as-br_if-value-cond" (i32.const 0)) (i32.const 6)) + +(assert_return (invoke "as-br_table-index" (i32.const 0))) +(assert_return (invoke "as-br_table-value" (i32.const 0)) (i32.const 10)) +(assert_return (invoke "as-br_table-value-index" (i32.const 0)) (i32.const 6)) + +(assert_return (invoke "as-return-value" (i32.const 0)) (i32.const 7)) + +(assert_return (invoke "as-if-cond" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-if-then" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "as-if-else" (i32.const 0)) (i32.const 4)) + +(assert_return (invoke "as-select-first" (i32.const 0) (i32.const 1)) (i32.const 5)) +(assert_return (invoke "as-select-second" (i32.const 0) (i32.const 0)) (i32.const 6)) +(assert_return (invoke "as-select-cond" (i32.const 0)) (i32.const 0)) + +(assert_return (invoke "as-call-first" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-call-mid" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-call-last" (i32.const 0)) (i32.const -1)) + +(assert_return (invoke "as-call_indirect-first" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-call_indirect-mid" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-call_indirect-last" (i32.const 0)) (i32.const -1)) +(assert_return (invoke "as-call_indirect-index" (i32.const 0)) (i32.const -1)) + +(assert_return (invoke "as-local.set-value")) +(assert_return (invoke "as-local.tee-value" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-global.set-value")) + +(assert_return (invoke "as-load-address" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-loadN-address" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-store-address" (i32.const 0))) +(assert_return (invoke "as-store-value" (i32.const 0))) +(assert_return (invoke "as-storeN-address" (i32.const 0))) +(assert_return (invoke "as-storeN-value" (i32.const 0))) + +(assert_return (invoke "as-unary-operand" (f32.const 0)) (f32.const -nan:0x0f1e2)) +(assert_return (invoke "as-binary-left" (i32.const 0)) (i32.const 13)) +(assert_return (invoke "as-binary-right" (i32.const 0)) (i32.const 6)) +(assert_return (invoke "as-test-operand" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-compare-left" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-compare-right" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-convert-operand" (i64.const 0)) (i32.const 41)) +(assert_return (invoke "as-memory.grow-size" (i32.const 0)) (i32.const 1)) + +(assert_return + (invoke "type-mixed" + (i64.const 1) (f32.const 2.2) (f64.const 3.3) (i32.const 4) (i32.const 5) + ) +) + +(assert_return + (invoke "write" + (i64.const 1) (f32.const 2) (f64.const 3.3) (i32.const 4) (i32.const 5) + ) + (i64.const 56) +) + +(assert_return + (invoke "result" + (i64.const -1) (f32.const -2) (f64.const -3.3) (i32.const -4) (i32.const -5) + ) + (f64.const 34.8) +) + + +;; Invalid typing of access to locals + +(assert_invalid + (module (func $type-local-num-vs-num (result i64) (local i32) (local.tee 0 (i32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-num-vs-num (local f32) (i32.eqz (local.tee 0 (f32.const 0))))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (local.tee 1 (i64.const 0))))) + "type mismatch" +) + +(assert_invalid + (module (func $type-local-arg-void-vs-num (local i32) (local.tee 0 (nop)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-arg-num-vs-num (local i32) (local.tee 0 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-arg-num-vs-num (local f32) (local.tee 0 (f64.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-arg-num-vs-num (local f64 i64) (local.tee 1 (f64.const 0)))) + "type mismatch" +) + + +;; Invalid typing of access to parameters + +(assert_invalid + (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-num-vs-num (param f32) (i32.eqz (local.get 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1)))) + "type mismatch" +) + +(assert_invalid + (module (func $type-param-arg-void-vs-num (param i32) (local.tee 0 (nop)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-arg-num-vs-num (param i32) (local.tee 0 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-arg-num-vs-num (param f32) (local.tee 0 (f64.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-arg-num-vs-num (param f64 i64) (local.tee 1 (f64.const 0)))) + "type mismatch" +) + +(assert_invalid + (module + (func $type-param-arg-empty-vs-num (param i32) + (local.tee 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-block (param i32) + (i32.const 0) + (block (local.tee 0) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-loop (param i32) + (i32.const 0) + (loop (local.tee 0) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-then (param i32) + (i32.const 0) (i32.const 0) + (if (then (local.tee 0) (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-else (param i32) + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (local.tee 0))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-br (param i32) + (i32.const 0) + (block (br 0 (local.tee 0)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-br_if (param i32) + (i32.const 0) + (block (br_if 0 (local.tee 0) (i32.const 1)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-br_table (param i32) + (i32.const 0) + (block (br_table 0 (local.tee 0)) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-return (param i32) + (return (local.tee 0)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-select (param i32) + (select (local.tee 0) (i32.const 1) (i32.const 2)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-call (param i32) + (call 1 (local.tee 0)) (drop) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-param-arg-empty-vs-num-in-call_indirect (param i32) + (block (result i32) + (call_indirect (type $sig) + (local.tee 0) (i32.const 0) + ) + (drop) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-local.set (param i32) + (local.set 0 (local.tee 0)) (local.get 0) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-param-arg-empty-vs-num-in-local.tee (param i32) + (local.tee 0 (local.tee 0)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-param-arg-empty-vs-num-in-global.set (param i32) + (global.set $x (local.tee 0)) (global.get $x) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-param-arg-empty-vs-num-in-memory.grow (param i32) + (memory.grow (local.tee 0)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-param-arg-empty-vs-num-in-load (param i32) + (i32.load (local.tee 0)) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-param-arg-empty-vs-num-in-store (param i32) + (i32.store (local.tee 0) (i32.const 1)) + ) + ) + "type mismatch" +) + + +;; Invalid local index + +(assert_invalid + (module (func $unbound-local (local i32 i64) (local.get 3))) + "unknown local" +) +(assert_invalid + (module (func $large-local (local i32 i64) (local.get 14324343))) + "unknown local" +) + +(assert_invalid + (module (func $unbound-param (param i32 i64) (local.get 2))) + "unknown local" +) +(assert_invalid + (module (func $large-param (local i32 i64) (local.get 714324343))) + "unknown local" +) + +(assert_invalid + (module (func $unbound-mixed (param i32) (local i32 i64) (local.get 3))) + "unknown local" +) +(assert_invalid + (module (func $large-mixed (param i64) (local i32 i64) (local.get 214324343))) + "unknown local" +) + +(assert_invalid + (module (func $type-mixed-arg-num-vs-num (param f32) (local i32) (local.tee 1 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-mixed-arg-num-vs-num (param i64 i32) (local f32) (local.tee 1 (f32.const 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-mixed-arg-num-vs-num (param i64) (local f64 i64) (local.tee 1 (i64.const 0)))) + "type mismatch" +) diff --git a/test/spec/loop.wast b/test/spec/loop.wast index 9e51f618c..9141d00ed 100644 --- a/test/spec/loop.wast +++ b/test/spec/loop.wast @@ -1,6 +1,8 @@ ;; Test `loop` opcode (module + (memory 1) + (func $dummy) (func (export "empty") @@ -10,55 +12,180 @@ (func (export "singular") (result i32) (loop (nop)) - (loop i32 (i32.const 7)) + (loop (result i32) (i32.const 7)) ) (func (export "multi") (result i32) (loop (call $dummy) (call $dummy) (call $dummy) (call $dummy)) - (loop i32 (call $dummy) (call $dummy) (call $dummy) (i32.const 8)) + (loop (result i32) (call $dummy) (call $dummy) (call $dummy) (i32.const 8)) ) (func (export "nested") (result i32) - (loop i32 + (loop (result i32) (loop (call $dummy) (block) (nop)) - (loop i32 (call $dummy) (i32.const 9)) + (loop (result i32) (call $dummy) (i32.const 9)) ) ) (func (export "deep") (result i32) - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 - (loop i32 (block i32 (call $dummy) (i32.const 150))) - )))))) - )))))) - )))))) - )))))) - )))))) - )))))) - )))))) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (loop (result i32) (block (result i32) + (call $dummy) (i32.const 150) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + )) + ) + + (func (export "as-select-first") (result i32) + (select (loop (result i32) (i32.const 1)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-select-mid") (result i32) + (select (i32.const 2) (loop (result i32) (i32.const 1)) (i32.const 3)) + ) + (func (export "as-select-last") (result i32) + (select (i32.const 2) (i32.const 3) (loop (result i32) (i32.const 1))) + ) + + (func (export "as-if-condition") + (loop (result i32) (i32.const 1)) (if (then (call $dummy))) + ) + (func (export "as-if-then") (result i32) + (if (result i32) (i32.const 1) (then (loop (result i32) (i32.const 1))) (else (i32.const 2))) + ) + (func (export "as-if-else") (result i32) + (if (result i32) (i32.const 1) (then (i32.const 2)) (else (loop (result i32) (i32.const 1)))) + ) + + (func (export "as-br_if-first") (result i32) + (block (result i32) (br_if 0 (loop (result i32) (i32.const 1)) (i32.const 2))) + ) + (func (export "as-br_if-last") (result i32) + (block (result i32) (br_if 0 (i32.const 2) (loop (result i32) (i32.const 1)))) + ) + + (func (export "as-br_table-first") (result i32) + (block (result i32) (loop (result i32) (i32.const 1)) (i32.const 2) (br_table 0 0)) + ) + (func (export "as-br_table-last") (result i32) + (block (result i32) (i32.const 2) (loop (result i32) (i32.const 1)) (br_table 0 0)) + ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (result i32) + (block (result i32) + (call_indirect (type $check) + (loop (result i32) (i32.const 1)) (i32.const 2) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 2) (loop (result i32) (i32.const 1)) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (i32.const 2) (loop (result i32) (i32.const 0)) + ) + ) + ) + + (func (export "as-store-first") + (loop (result i32) (i32.const 1)) (i32.const 1) (i32.store) + ) + (func (export "as-store-last") + (i32.const 10) (loop (result i32) (i32.const 1)) (i32.store) + ) + + (func (export "as-memory.grow-value") (result i32) + (memory.grow (loop (result i32) (i32.const 1))) + ) + + (func $f (param i32) (result i32) (local.get 0)) + + (func (export "as-call-value") (result i32) + (call $f (loop (result i32) (i32.const 1))) + ) + (func (export "as-return-value") (result i32) + (loop (result i32) (i32.const 1)) (return) + ) + (func (export "as-drop-operand") + (drop (loop (result i32) (i32.const 1))) + ) + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (loop (result i32) (i32.const 1)))) + ) + (func (export "as-local.set-value") (result i32) + (local i32) (local.set 0 (loop (result i32) (i32.const 1))) (local.get 0) + ) + (func (export "as-local.tee-value") (result i32) + (local i32) (local.tee 0 (loop (result i32) (i32.const 1))) + ) + (global $a (mut i32) (i32.const 0)) + (func (export "as-global.set-value") (result i32) + (global.set $a (loop (result i32) (i32.const 1))) + (global.get $a) + ) + (func (export "as-load-operand") (result i32) + (i32.load (loop (result i32) (i32.const 1))) ) (func (export "as-unary-operand") (result i32) - (i32.ctz (loop i32 (call $dummy) (i32.const 13))) + (i32.ctz (loop (result i32) (call $dummy) (i32.const 13))) ) (func (export "as-binary-operand") (result i32) (i32.mul - (loop i32 (call $dummy) (i32.const 3)) - (loop i32 (call $dummy) (i32.const 4)) + (loop (result i32) (call $dummy) (i32.const 3)) + (loop (result i32) (call $dummy) (i32.const 4)) ) ) (func (export "as-test-operand") (result i32) - (i32.eqz (loop i32 (call $dummy) (i32.const 13))) + (i32.eqz (loop (result i32) (call $dummy) (i32.const 13))) ) (func (export "as-compare-operand") (result i32) (f32.gt - (loop f32 (call $dummy) (f32.const 3)) - (loop f32 (call $dummy) (f32.const 3)) + (loop (result f32) (call $dummy) (f32.const 3)) + (loop (result f32) (call $dummy) (f32.const 3)) ) ) @@ -70,11 +197,13 @@ (i32.const 19) ) (func (export "break-value") (result i32) - (block i32 (loop i32 (br 1 (i32.const 18)) (br 0) (i32.const 19))) + (block (result i32) + (loop (result i32) (br 1 (i32.const 18)) (br 0) (i32.const 19)) + ) ) (func (export "break-repeated") (result i32) - (block i32 - (loop i32 + (block (result i32) + (loop (result i32) (br 1 (i32.const 18)) (br 1 (i32.const 19)) (drop (br_if 1 (i32.const 20) (i32.const 0))) @@ -89,19 +218,19 @@ (func (export "break-inner") (result i32) (local i32) (local.set 0 (i32.const 0)) - (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (block i32 (br 2 (i32.const 0x1))))))) - (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (loop i32 (br 2 (i32.const 0x2))))))) - (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (block i32 (loop i32 (br 1 (i32.const 0x4)))))))) - (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (i32.ctz (br 1 (i32.const 0x8))))))) - (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (i32.ctz (loop i32 (br 2 (i32.const 0x10)))))))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (loop (result i32) (block (result i32) (br 2 (i32.const 0x1))))))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (loop (result i32) (loop (result i32) (br 2 (i32.const 0x2))))))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (loop (result i32) (block (result i32) (loop (result i32) (br 1 (i32.const 0x4)))))))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (loop (result i32) (i32.ctz (br 1 (i32.const 0x8))))))) + (local.set 0 (i32.add (local.get 0) (block (result i32) (loop (result i32) (i32.ctz (loop (result i32) (br 2 (i32.const 0x10)))))))) (local.get 0) ) (func (export "cont-inner") (result i32) (local i32) (local.set 0 (i32.const 0)) - (local.set 0 (i32.add (local.get 0) (loop i32 (loop i32 (br 1))))) - (local.set 0 (i32.add (local.get 0) (loop i32 (i32.ctz (br 0))))) - (local.set 0 (i32.add (local.get 0) (loop i32 (i32.ctz (loop i32 (br 1)))))) + (local.set 0 (i32.add (local.get 0) (loop (result i32) (loop (result i32) (br 1))))) + (local.set 0 (i32.add (local.get 0) (loop (result i32) (i32.ctz (br 0))))) + (local.set 0 (i32.add (local.get 0) (loop (result i32) (i32.ctz (loop (result i32) (br 1)))))) (local.get 0) ) @@ -179,6 +308,37 @@ (assert_return (invoke "nested") (i32.const 9)) (assert_return (invoke "deep") (i32.const 150)) +(assert_return (invoke "as-select-first") (i32.const 1)) +(assert_return (invoke "as-select-mid") (i32.const 2)) +(assert_return (invoke "as-select-last") (i32.const 2)) + +(assert_return (invoke "as-if-condition")) +(assert_return (invoke "as-if-then") (i32.const 1)) +(assert_return (invoke "as-if-else") (i32.const 2)) + +(assert_return (invoke "as-br_if-first") (i32.const 1)) +(assert_return (invoke "as-br_if-last") (i32.const 2)) + +(assert_return (invoke "as-br_table-first") (i32.const 1)) +(assert_return (invoke "as-br_table-last") (i32.const 2)) + +(assert_return (invoke "as-call_indirect-first") (i32.const 1)) +(assert_return (invoke "as-call_indirect-mid") (i32.const 2)) +(assert_return (invoke "as-call_indirect-last") (i32.const 1)) + +(assert_return (invoke "as-store-first")) +(assert_return (invoke "as-store-last")) + +(assert_return (invoke "as-memory.grow-value") (i32.const 1)) +(assert_return (invoke "as-call-value") (i32.const 1)) +(assert_return (invoke "as-return-value") (i32.const 1)) +(assert_return (invoke "as-drop-operand")) +(assert_return (invoke "as-br-value") (i32.const 1)) +(assert_return (invoke "as-local.set-value") (i32.const 1)) +(assert_return (invoke "as-local.tee-value") (i32.const 1)) +(assert_return (invoke "as-global.set-value") (i32.const 1)) +(assert_return (invoke "as-load-operand") (i32.const 1)) + (assert_return (invoke "as-unary-operand") (i32.const 0)) (assert_return (invoke "as-binary-operand") (i32.const 12)) (assert_return (invoke "as-test-operand") (i32.const 0)) @@ -240,43 +400,70 @@ ) (assert_invalid - (module (func $type-value-void-vs-num (result i32) - (loop (nop)) + (module (func $type-value-num-vs-void + (loop (i32.const 1)) )) "type mismatch" ) (assert_invalid - (module (func $type-value-num-vs-num (result i32) - (loop (f32.const 0)) + (module (func $type-value-empty-vs-num (result i32) + (loop (result i32)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-num (result i32) + (loop (result i32) (nop)) )) "type mismatch" ) - -(; TODO(stack): soft failure (assert_invalid - (module (func $type-value-void-vs-num-after-break (result i32) - (loop (br 1 (i32.const 1)) (nop)) + (module (func $type-value-num-vs-num (result i32) + (loop (result i32) (f32.const 0)) )) "type mismatch" ) (assert_invalid - (module (func $type-value-num-vs-num-after-break (result i32) - (loop (br 1 (i32.const 1)) (f32.const 0)) + (module (func $type-value-unreached-select (result i32) + (loop (result i64) (select (unreachable) (unreachable) (unreachable))) )) "type mismatch" ) -;) (assert_invalid - (module (func $type-cont-last-void-vs-empty (result i32) - (loop (br 0 (nop))) - )) + (module + (func $type-value-empty-in-block + (i32.const 0) + (block (loop (result i32)) (drop)) + ) + ) "type mismatch" ) (assert_invalid - (module (func $type-cont-last-num-vs-empty (result i32) - (loop (br 0 (i32.const 0))) - )) + (module + (func $type-value-empty-in-loop + (i32.const 0) + (loop (loop (result i32)) (drop)) + ) + ) "type mismatch" ) +(assert_invalid + (module + (func $type-value-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (loop (result i32)) (drop))) + ) + ) + "type mismatch" +) + +(assert_malformed + (module quote "(func loop end $l)") + "mismatching label" +) +(assert_malformed + (module quote "(func loop $a end $l)") + "mismatching label" +) diff --git a/test/spec/memory.wast b/test/spec/memory.wast index 5f926339b..3c426450a 100644 --- a/test/spec/memory.wast +++ b/test/spec/memory.wast @@ -5,6 +5,16 @@ (module (memory 1 256)) (module (memory 0 65536)) +(assert_invalid (module (memory 0) (memory 0)) "multiple memories") +(assert_invalid (module (memory (import "spectest" "memory") 0) (memory 0)) "multiple memories") + +(module (memory (data)) (func (export "memsize") (result i32) (memory.size))) +(assert_return (invoke "memsize") (i32.const 0)) +(module (memory (data "")) (func (export "memsize") (result i32) (memory.size))) +(assert_return (invoke "memsize") (i32.const 0)) +(module (memory (data "x")) (func (export "memsize") (result i32) (memory.size))) +(assert_return (invoke "memsize") (i32.const 1)) + (assert_invalid (module (data (i32.const 0))) "unknown memory") (assert_invalid (module (data (i32.const 0) "")) "unknown memory") (assert_invalid (module (data (i32.const 0) "x")) "unknown memory") @@ -14,7 +24,7 @@ "unknown memory" ) (assert_invalid - (module (func (f32.store (f32.const 0) (i32.const 0)))) + (module (func (f32.store (i32.const 0) (f32.const 0)))) "unknown memory" ) (assert_invalid @@ -26,6 +36,10 @@ "unknown memory" ) (assert_invalid + (module (func (drop (memory.size)))) + "unknown memory" +) +(assert_invalid (module (func (drop (memory.grow (i32.const 0))))) "unknown memory" ) diff --git a/test/spec/memory_grow.wast b/test/spec/memory_grow.wast new file mode 100644 index 000000000..8a87c77c6 --- /dev/null +++ b/test/spec/memory_grow.wast @@ -0,0 +1,355 @@ +(module + (memory 0) + + (func (export "load_at_zero") (result i32) (i32.load (i32.const 0))) + (func (export "store_at_zero") (i32.store (i32.const 0) (i32.const 2))) + + (func (export "load_at_page_size") (result i32) (i32.load (i32.const 0x10000))) + (func (export "store_at_page_size") (i32.store (i32.const 0x10000) (i32.const 3))) + + (func (export "grow") (param $sz i32) (result i32) (memory.grow (local.get $sz))) + (func (export "size") (result i32) (memory.size)) +) + +(assert_return (invoke "size") (i32.const 0)) +(assert_trap (invoke "store_at_zero") "out of bounds memory access") +(assert_trap (invoke "load_at_zero") "out of bounds memory access") +(assert_trap (invoke "store_at_page_size") "out of bounds memory access") +(assert_trap (invoke "load_at_page_size") "out of bounds memory access") +(assert_return (invoke "grow" (i32.const 1)) (i32.const 0)) +(assert_return (invoke "size") (i32.const 1)) +(assert_return (invoke "load_at_zero") (i32.const 0)) +(assert_return (invoke "store_at_zero")) +(assert_return (invoke "load_at_zero") (i32.const 2)) +(assert_trap (invoke "store_at_page_size") "out of bounds memory access") +(assert_trap (invoke "load_at_page_size") "out of bounds memory access") +(assert_return (invoke "grow" (i32.const 4)) (i32.const 1)) +(assert_return (invoke "size") (i32.const 5)) +(assert_return (invoke "load_at_zero") (i32.const 2)) +(assert_return (invoke "store_at_zero")) +(assert_return (invoke "load_at_zero") (i32.const 2)) +(assert_return (invoke "load_at_page_size") (i32.const 0)) +(assert_return (invoke "store_at_page_size")) +(assert_return (invoke "load_at_page_size") (i32.const 3)) + + +(module + (memory 0) + (func (export "grow") (param i32) (result i32) (memory.grow (local.get 0))) +) + +(assert_return (invoke "grow" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "grow" (i32.const 2)) (i32.const 1)) +(assert_return (invoke "grow" (i32.const 800)) (i32.const 3)) +(assert_return (invoke "grow" (i32.const 0x10000)) (i32.const -1)) +(assert_return (invoke "grow" (i32.const 64736)) (i32.const -1)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 803)) + +(module + (memory 0 10) + (func (export "grow") (param i32) (result i32) (memory.grow (local.get 0))) +) + +(assert_return (invoke "grow" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "grow" (i32.const 2)) (i32.const 2)) +(assert_return (invoke "grow" (i32.const 6)) (i32.const 4)) +(assert_return (invoke "grow" (i32.const 0)) (i32.const 10)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const -1)) +(assert_return (invoke "grow" (i32.const 0x10000)) (i32.const -1)) + +;; Test that newly allocated memory (program start and memory.grow) is zeroed + +(module + (memory 1) + (func (export "grow") (param i32) (result i32) + (memory.grow (local.get 0)) + ) + (func (export "check-memory-zero") (param i32 i32) (result i32) + (local i32) + (local.set 2 (i32.const 1)) + (block + (loop + (local.set 2 (i32.load8_u (local.get 0))) + (br_if 1 (i32.ne (local.get 2) (i32.const 0))) + (br_if 1 (i32.ge_u (local.get 0) (local.get 1))) + (local.set 0 (i32.add (local.get 0) (i32.const 1))) + (br_if 0 (i32.le_u (local.get 0) (local.get 1))) + ) + ) + (local.get 2) + ) +) + +(assert_return (invoke "check-memory-zero" (i32.const 0) (i32.const 0xffff)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "check-memory-zero" (i32.const 0x10000) (i32.const 0x1_ffff)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "check-memory-zero" (i32.const 0x20000) (i32.const 0x2_ffff)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "check-memory-zero" (i32.const 0x30000) (i32.const 0x3_ffff)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 4)) +(assert_return (invoke "check-memory-zero" (i32.const 0x40000) (i32.const 0x4_ffff)) (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 5)) +(assert_return (invoke "check-memory-zero" (i32.const 0x50000) (i32.const 0x5_ffff)) (i32.const 0)) + +;; As the argument of control constructs and instructions + +(module + (memory 1) + + (func (export "as-br-value") (result i32) + (block (result i32) (br 0 (memory.grow (i32.const 0)))) + ) + + (func (export "as-br_if-cond") + (block (br_if 0 (memory.grow (i32.const 0)))) + ) + (func (export "as-br_if-value") (result i32) + (block (result i32) + (drop (br_if 0 (memory.grow (i32.const 0)) (i32.const 1))) (i32.const 7) + ) + ) + (func (export "as-br_if-value-cond") (result i32) + (block (result i32) + (drop (br_if 0 (i32.const 6) (memory.grow (i32.const 0)))) (i32.const 7) + ) + ) + + (func (export "as-br_table-index") + (block (br_table 0 0 0 (memory.grow (i32.const 0)))) + ) + (func (export "as-br_table-value") (result i32) + (block (result i32) + (br_table 0 0 0 (memory.grow (i32.const 0)) (i32.const 1)) (i32.const 7) + ) + ) + (func (export "as-br_table-value-index") (result i32) + (block (result i32) + (br_table 0 0 (i32.const 6) (memory.grow (i32.const 0))) (i32.const 7) + ) + ) + + (func (export "as-return-value") (result i32) + (return (memory.grow (i32.const 0))) + ) + + (func (export "as-if-cond") (result i32) + (if (result i32) (memory.grow (i32.const 0)) + (then (i32.const 0)) (else (i32.const 1)) + ) + ) + (func (export "as-if-then") (result i32) + (if (result i32) (i32.const 1) + (then (memory.grow (i32.const 0))) (else (i32.const 0)) + ) + ) + (func (export "as-if-else") (result i32) + (if (result i32) (i32.const 0) + (then (i32.const 0)) (else (memory.grow (i32.const 0))) + ) + ) + + (func (export "as-select-first") (param i32 i32) (result i32) + (select (memory.grow (i32.const 0)) (local.get 0) (local.get 1)) + ) + (func (export "as-select-second") (param i32 i32) (result i32) + (select (local.get 0) (memory.grow (i32.const 0)) (local.get 1)) + ) + (func (export "as-select-cond") (result i32) + (select (i32.const 0) (i32.const 1) (memory.grow (i32.const 0))) + ) + + (func $f (param i32 i32 i32) (result i32) (i32.const -1)) + (func (export "as-call-first") (result i32) + (call $f (memory.grow (i32.const 0)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-call-mid") (result i32) + (call $f (i32.const 1) (memory.grow (i32.const 0)) (i32.const 3)) + ) + (func (export "as-call-last") (result i32) + (call $f (i32.const 1) (i32.const 2) (memory.grow (i32.const 0))) + ) + + (type $sig (func (param i32 i32 i32) (result i32))) + (table funcref (elem $f)) + (func (export "as-call_indirect-first") (result i32) + (call_indirect (type $sig) + (memory.grow (i32.const 0)) (i32.const 2) (i32.const 3) (i32.const 0) + ) + ) + (func (export "as-call_indirect-mid") (result i32) + (call_indirect (type $sig) + (i32.const 1) (memory.grow (i32.const 0)) (i32.const 3) (i32.const 0) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.const 2) (memory.grow (i32.const 0)) (i32.const 0) + ) + ) + (func (export "as-call_indirect-index") (result i32) + (call_indirect (type $sig) + (i32.const 1) (i32.const 2) (i32.const 3) (memory.grow (i32.const 0)) + ) + ) + + (func (export "as-local.set-value") (local i32) + (local.set 0 (memory.grow (i32.const 0))) + ) + (func (export "as-local.tee-value") (result i32) (local i32) + (local.tee 0 (memory.grow (i32.const 0))) + ) + (global $g (mut i32) (i32.const 0)) + (func (export "as-global.set-value") (local i32) + (global.set $g (memory.grow (i32.const 0))) + ) + + (func (export "as-load-address") (result i32) + (i32.load (memory.grow (i32.const 0))) + ) + (func (export "as-loadN-address") (result i32) + (i32.load8_s (memory.grow (i32.const 0))) + ) + + (func (export "as-store-address") + (i32.store (memory.grow (i32.const 0)) (i32.const 7)) + ) + (func (export "as-store-value") + (i32.store (i32.const 2) (memory.grow (i32.const 0))) + ) + + (func (export "as-storeN-address") + (i32.store8 (memory.grow (i32.const 0)) (i32.const 7)) + ) + (func (export "as-storeN-value") + (i32.store16 (i32.const 2) (memory.grow (i32.const 0))) + ) + + (func (export "as-unary-operand") (result i32) + (i32.clz (memory.grow (i32.const 0))) + ) + + (func (export "as-binary-left") (result i32) + (i32.add (memory.grow (i32.const 0)) (i32.const 10)) + ) + (func (export "as-binary-right") (result i32) + (i32.sub (i32.const 10) (memory.grow (i32.const 0))) + ) + + (func (export "as-test-operand") (result i32) + (i32.eqz (memory.grow (i32.const 0))) + ) + + (func (export "as-compare-left") (result i32) + (i32.le_s (memory.grow (i32.const 0)) (i32.const 10)) + ) + (func (export "as-compare-right") (result i32) + (i32.ne (i32.const 10) (memory.grow (i32.const 0))) + ) + + (func (export "as-memory.grow-size") (result i32) + (memory.grow (memory.grow (i32.const 0))) + ) +) + +(assert_return (invoke "as-br-value") (i32.const 1)) + +(assert_return (invoke "as-br_if-cond")) +(assert_return (invoke "as-br_if-value") (i32.const 1)) +(assert_return (invoke "as-br_if-value-cond") (i32.const 6)) + +(assert_return (invoke "as-br_table-index")) +(assert_return (invoke "as-br_table-value") (i32.const 1)) +(assert_return (invoke "as-br_table-value-index") (i32.const 6)) + +(assert_return (invoke "as-return-value") (i32.const 1)) + +(assert_return (invoke "as-if-cond") (i32.const 0)) +(assert_return (invoke "as-if-then") (i32.const 1)) +(assert_return (invoke "as-if-else") (i32.const 1)) + +(assert_return (invoke "as-select-first" (i32.const 0) (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-select-second" (i32.const 0) (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-select-cond") (i32.const 0)) + +(assert_return (invoke "as-call-first") (i32.const -1)) +(assert_return (invoke "as-call-mid") (i32.const -1)) +(assert_return (invoke "as-call-last") (i32.const -1)) + +(assert_return (invoke "as-call_indirect-first") (i32.const -1)) +(assert_return (invoke "as-call_indirect-mid") (i32.const -1)) +(assert_return (invoke "as-call_indirect-last") (i32.const -1)) +(assert_trap (invoke "as-call_indirect-index") "undefined element") + +(assert_return (invoke "as-local.set-value")) +(assert_return (invoke "as-local.tee-value") (i32.const 1)) +(assert_return (invoke "as-global.set-value")) + +(assert_return (invoke "as-load-address") (i32.const 0)) +(assert_return (invoke "as-loadN-address") (i32.const 0)) +(assert_return (invoke "as-store-address")) +(assert_return (invoke "as-store-value")) +(assert_return (invoke "as-storeN-address")) +(assert_return (invoke "as-storeN-value")) + +(assert_return (invoke "as-unary-operand") (i32.const 31)) + +(assert_return (invoke "as-binary-left") (i32.const 11)) +(assert_return (invoke "as-binary-right") (i32.const 9)) + +(assert_return (invoke "as-test-operand") (i32.const 0)) + +(assert_return (invoke "as-compare-left") (i32.const 1)) +(assert_return (invoke "as-compare-right") (i32.const 1)) + +(assert_return (invoke "as-memory.grow-size") (i32.const 1)) + + +(assert_invalid + (module + (memory 0) + (func $type-size-empty + (memory.grow) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-size-empty-in-block + (i32.const 0) + (block (memory.grow) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-size-empty-in-loop + (i32.const 0) + (loop (memory.grow) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-size-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (memory.grow) (drop))) + ) + ) + "type mismatch" +) + + +;; Type check + +(assert_invalid (module (memory 1) (func (result i32) (memory.grow (f32.const 0)))) "type mismatch") diff --git a/test/spec/memory_redundancy.wast b/test/spec/memory_redundancy.wast index 58a31caba..dd317311b 100644 --- a/test/spec/memory_redundancy.wast +++ b/test/spec/memory_redundancy.wast @@ -34,6 +34,26 @@ (i32.store (i32.const 8) (i32.const 0)) (local.get $t) ) + + ;; A function named "malloc" which implementations nonetheless shouldn't + ;; assume behaves like C malloc. + (func $malloc (export "malloc") + (param $size i32) + (result i32) + (i32.const 16) + ) + + ;; Call malloc twice, but unlike C malloc, we don't get non-aliasing pointers. + (func (export "malloc_aliasing") + (result i32) + (local $x i32) + (local $y i32) + (local.set $x (call $malloc (i32.const 4))) + (local.set $y (call $malloc (i32.const 4))) + (i32.store (local.get $x) (i32.const 42)) + (i32.store (local.get $y) (i32.const 43)) + (i32.load (local.get $x)) + ) ) (assert_return (invoke "test_store_to_load") (i32.const 0x00000080)) @@ -41,3 +61,5 @@ (assert_return (invoke "test_redundant_load") (i32.const 0x00000080)) (invoke "zero_everything") (assert_return (invoke "test_dead_store") (f32.const 0x1.18p-144)) +(invoke "zero_everything") +(assert_return (invoke "malloc_aliasing") (i32.const 43)) diff --git a/test/spec/memory_size.wast b/test/spec/memory_size.wast new file mode 100644 index 000000000..239e66d8f --- /dev/null +++ b/test/spec/memory_size.wast @@ -0,0 +1,85 @@ +(module + (memory 0) + (func (export "size") (result i32) (memory.size)) + (func (export "grow") (param $sz i32) (drop (memory.grow (local.get $sz)))) +) + +(assert_return (invoke "size") (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1))) +(assert_return (invoke "size") (i32.const 1)) +(assert_return (invoke "grow" (i32.const 4))) +(assert_return (invoke "size") (i32.const 5)) +(assert_return (invoke "grow" (i32.const 0))) +(assert_return (invoke "size") (i32.const 5)) + +(module + (memory 1) + (func (export "size") (result i32) (memory.size)) + (func (export "grow") (param $sz i32) (drop (memory.grow (local.get $sz)))) +) + +(assert_return (invoke "size") (i32.const 1)) +(assert_return (invoke "grow" (i32.const 1))) +(assert_return (invoke "size") (i32.const 2)) +(assert_return (invoke "grow" (i32.const 4))) +(assert_return (invoke "size") (i32.const 6)) +(assert_return (invoke "grow" (i32.const 0))) +(assert_return (invoke "size") (i32.const 6)) + +(module + (memory 0 2) + (func (export "size") (result i32) (memory.size)) + (func (export "grow") (param $sz i32) (drop (memory.grow (local.get $sz)))) +) + +(assert_return (invoke "size") (i32.const 0)) +(assert_return (invoke "grow" (i32.const 3))) +(assert_return (invoke "size") (i32.const 0)) +(assert_return (invoke "grow" (i32.const 1))) +(assert_return (invoke "size") (i32.const 1)) +(assert_return (invoke "grow" (i32.const 0))) +(assert_return (invoke "size") (i32.const 1)) +(assert_return (invoke "grow" (i32.const 4))) +(assert_return (invoke "size") (i32.const 1)) +(assert_return (invoke "grow" (i32.const 1))) +(assert_return (invoke "size") (i32.const 2)) + +(module + (memory 3 8) + (func (export "size") (result i32) (memory.size)) + (func (export "grow") (param $sz i32) (drop (memory.grow (local.get $sz)))) +) + +(assert_return (invoke "size") (i32.const 3)) +(assert_return (invoke "grow" (i32.const 1))) +(assert_return (invoke "size") (i32.const 4)) +(assert_return (invoke "grow" (i32.const 3))) +(assert_return (invoke "size") (i32.const 7)) +(assert_return (invoke "grow" (i32.const 0))) +(assert_return (invoke "size") (i32.const 7)) +(assert_return (invoke "grow" (i32.const 2))) +(assert_return (invoke "size") (i32.const 7)) +(assert_return (invoke "grow" (i32.const 1))) +(assert_return (invoke "size") (i32.const 8)) + + +;; Type errors + +(assert_invalid + (module + (memory 1) + (func $type-result-i32-vs-empty + (memory.size) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-result-i32-vs-f32 (result f32) + (memory.size) + ) + ) + "type mismatch" +) diff --git a/test/spec/memory_trap.wast b/test/spec/memory_trap.wast index fe2dee7fa..a4156fe2c 100644 --- a/test/spec/memory_trap.wast +++ b/test/spec/memory_trap.wast @@ -31,3 +31,240 @@ (assert_trap (invoke "store" (i32.const 0x80000000) (i32.const 13)) "out of bounds memory access") (assert_trap (invoke "load" (i32.const 0x80000000)) "out of bounds memory access") (assert_return (invoke "memory.grow" (i32.const 0x10001)) (i32.const -1)) + +(module + (memory 1) + (data (i32.const 0) "abcdefgh") + (data (i32.const 0xfff8) "abcdefgh") + + (func (export "i32.load") (param $a i32) (result i32) + (i32.load (local.get $a)) + ) + (func (export "i64.load") (param $a i32) (result i64) + (i64.load (local.get $a)) + ) + (func (export "f32.load") (param $a i32) (result f32) + (f32.load (local.get $a)) + ) + (func (export "f64.load") (param $a i32) (result f64) + (f64.load (local.get $a)) + ) + (func (export "i32.load8_s") (param $a i32) (result i32) + (i32.load8_s (local.get $a)) + ) + (func (export "i32.load8_u") (param $a i32) (result i32) + (i32.load8_u (local.get $a)) + ) + (func (export "i32.load16_s") (param $a i32) (result i32) + (i32.load16_s (local.get $a)) + ) + (func (export "i32.load16_u") (param $a i32) (result i32) + (i32.load16_u (local.get $a)) + ) + (func (export "i64.load8_s") (param $a i32) (result i64) + (i64.load8_s (local.get $a)) + ) + (func (export "i64.load8_u") (param $a i32) (result i64) + (i64.load8_u (local.get $a)) + ) + (func (export "i64.load16_s") (param $a i32) (result i64) + (i64.load16_s (local.get $a)) + ) + (func (export "i64.load16_u") (param $a i32) (result i64) + (i64.load16_u (local.get $a)) + ) + (func (export "i64.load32_s") (param $a i32) (result i64) + (i64.load32_s (local.get $a)) + ) + (func (export "i64.load32_u") (param $a i32) (result i64) + (i64.load32_u (local.get $a)) + ) + (func (export "i32.store") (param $a i32) (param $v i32) + (i32.store (local.get $a) (local.get $v)) + ) + (func (export "i64.store") (param $a i32) (param $v i64) + (i64.store (local.get $a) (local.get $v)) + ) + (func (export "f32.store") (param $a i32) (param $v f32) + (f32.store (local.get $a) (local.get $v)) + ) + (func (export "f64.store") (param $a i32) (param $v f64) + (f64.store (local.get $a) (local.get $v)) + ) + (func (export "i32.store8") (param $a i32) (param $v i32) + (i32.store8 (local.get $a) (local.get $v)) + ) + (func (export "i32.store16") (param $a i32) (param $v i32) + (i32.store16 (local.get $a) (local.get $v)) + ) + (func (export "i64.store8") (param $a i32) (param $v i64) + (i64.store8 (local.get $a) (local.get $v)) + ) + (func (export "i64.store16") (param $a i32) (param $v i64) + (i64.store16 (local.get $a) (local.get $v)) + ) + (func (export "i64.store32") (param $a i32) (param $v i64) + (i64.store32 (local.get $a) (local.get $v)) + ) +) + +(assert_trap (invoke "i32.store" (i32.const 0x10000) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const 0xffff) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const 0xfffe) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const 0xfffd) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const -1) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const -2) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const -3) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store" (i32.const -4) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0x10000) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xffff) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xfffe) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xfffd) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xfffc) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xfffb) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xfffa) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const 0xfff9) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -1) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -2) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -3) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -4) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -5) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -6) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -7) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store" (i32.const -8) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const 0x10000) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const 0xffff) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const 0xfffe) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const 0xfffd) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const -1) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const -2) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const -3) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f32.store" (i32.const -4) (f32.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0x10000) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xffff) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xfffe) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xfffd) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xfffc) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xfffb) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xfffa) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const 0xfff9) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -1) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -2) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -3) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -4) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -5) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -6) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -7) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "f64.store" (i32.const -8) (f64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store8" (i32.const 0x10000) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store8" (i32.const -1) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store16" (i32.const 0x10000) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store16" (i32.const 0xffff) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store16" (i32.const -1) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.store16" (i32.const -2) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store8" (i32.const 0x10000) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store8" (i32.const -1) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store16" (i32.const 0x10000) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store16" (i32.const 0xffff) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store16" (i32.const -1) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store16" (i32.const -2) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const 0x10000) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const 0xffff) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const 0xfffe) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const 0xfffd) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const -1) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const -2) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const -3) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i64.store32" (i32.const -4) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const 0xfffe)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const 0xfffd)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const -3)) "out of bounds memory access") +(assert_trap (invoke "i32.load" (i32.const -4)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xfffe)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xfffd)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xfffc)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xfffb)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xfffa)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const 0xfff9)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -3)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -4)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -5)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -6)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -7)) "out of bounds memory access") +(assert_trap (invoke "i64.load" (i32.const -8)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const 0xfffe)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const 0xfffd)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const -3)) "out of bounds memory access") +(assert_trap (invoke "f32.load" (i32.const -4)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xfffe)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xfffd)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xfffc)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xfffb)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xfffa)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const 0xfff9)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -3)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -4)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -5)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -6)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -7)) "out of bounds memory access") +(assert_trap (invoke "f64.load" (i32.const -8)) "out of bounds memory access") +(assert_trap (invoke "i32.load8_s" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i32.load8_s" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i32.load8_u" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i32.load8_u" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_s" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_s" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_s" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_s" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_u" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_u" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_u" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i32.load16_u" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i64.load8_s" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load8_s" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load8_u" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load8_u" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_s" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_s" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_s" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_s" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_u" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_u" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_u" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load16_u" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const 0xfffe)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const 0xfffd)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const -3)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_s" (i32.const -4)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const 0x10000)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const 0xffff)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const 0xfffe)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const 0xfffd)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const -1)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const -2)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const -3)) "out of bounds memory access") +(assert_trap (invoke "i64.load32_u" (i32.const -4)) "out of bounds memory access") + +;; No memory was changed +(assert_return (invoke "i64.load" (i32.const 0xfff8)) (i64.const 0x6867666564636261)) +(assert_return (invoke "i64.load" (i32.const 0)) (i64.const 0x6867666564636261)) diff --git a/test/spec/names.wast b/test/spec/names.wast index a586bc8e8..9c53234cf 100644 --- a/test/spec/names.wast +++ b/test/spec/names.wast @@ -18,54 +18,1085 @@ (module ;; Test that we can use the empty string as a symbol. - (func (export "") (result f32) (f32.const 0x1.91p+2)) + (func (export "") (result i32) (i32.const 0)) ;; Test that we can use names beginning with a digit. - (func (export "0") (result f32) (f32.const 0x1.97p+2)) + (func (export "0") (result i32) (i32.const 1)) + + ;; Test that we can use names beginning with a dash. + (func (export "-0") (result i32) (i32.const 2)) ;; Test that we can use names beginning with an underscore. - (func (export "_") (result f32) (f32.const 0x1.98p+2)) + (func (export "_") (result i32) (i32.const 3)) ;; Test that we can use names beginning with a dollar sign. - (func (export "$") (result f32) (f32.const 0x1.99p+2)) + (func (export "$") (result i32) (i32.const 4)) ;; Test that we can use names beginning with an at sign. - (func (export "@") (result f32) (f32.const 0x2.00p+2)) + (func (export "@") (result i32) (i32.const 5)) ;; Test that we can use non-alphanumeric names. - (func (export "~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./ ") (result f32) (f32.const 0x1.96p+2)) + (func (export "~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./ ") (result i32) (i32.const 6)) ;; Test that we can use names that have special meaning in JS. - (func (export "NaN") (result f32) (f32.const 0x2.01p+2)) - (func (export "Infinity") (result f32) (f32.const 0x2.02p+2)) - (func (export "if") (result f32) (f32.const 0x2.03p+2)) + (func (export "NaN") (result i32) (i32.const 7)) + (func (export "Infinity") (result i32) (i32.const 8)) + (func (export "if") (result i32) (i32.const 9)) ;; Test that we can use common libc names without conflict. - (func (export "malloc") (result f32) (f32.const 0x1.92p+2)) + (func (export "malloc") (result i32) (i32.const 10)) ;; Test that we can use some libc hidden names without conflict. - (func (export "_malloc") (result f32) (f32.const 0x1.93p+2)) - (func (export "__malloc") (result f32) (f32.const 0x1.94p+2)) + (func (export "_malloc") (result i32) (i32.const 11)) + (func (export "__malloc") (result i32) (i32.const 12)) + + ;; Test that names are case-sensitive. + (func (export "a") (result i32) (i32.const 13)) + (func (export "A") (result i32) (i32.const 14)) + + ;; Test that UTF-8 BOM code points can appear in identifiers. + (func (export "") (result i32) (i32.const 15)) + + ;; Test that Unicode normalization is not applied. These function names + ;; contain different codepoints which normalize to the same thing under + ;; NFC or NFD. + (func (export "Å") (result i32) (i32.const 16)) + (func (export "Å") (result i32) (i32.const 17)) + (func (export "Å") (result i32) (i32.const 18)) + + ;; Test that Unicode compatibility normalization is not applied. These + ;; function names contain different codepoints which normalize to the + ;; same thing under NFKC or NFKD. + (func (export "ffi") (result i32) (i32.const 19)) + (func (export "ffi") (result i32) (i32.const 20)) + (func (export "ffi") (result i32) (i32.const 21)) + + ;; Test the C0 control codes. + (func (export "\00\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f") (result i32) (i32.const 22)) + (func (export "\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f") (result i32) (i32.const 23)) + ;; Test miscellaneous control codes. + (func (export " \7f") (result i32) (i32.const 24)) + ;; Test the C1 control codes. + (func (export "\c2\80\c2\81\c2\82\c2\83\c2\84\c2\85\c2\86\c2\87\c2\88\c2\89\c2\8a\c2\8b\c2\8c\c2\8d\c2\8e\c2\8f") (result i32) (i32.const 25)) + (func (export "\c2\90\c2\91\c2\92\c2\93\c2\94\c2\95\c2\96\c2\97\c2\98\c2\99\c2\9a\c2\9b\c2\9c\c2\9d\c2\9e\c2\9f") (result i32) (i32.const 26)) + ;; Test the Unicode Specials. + (func (export "\ef\bf\b0\ef\bf\b1\ef\bf\b2\ef\bf\b3\ef\bf\b4\ef\bf\b5\ef\bf\b6\ef\bf\b7") (result i32) (i32.const 27)) + (func (export "\ef\bf\b8\ef\bf\b9\ef\bf\ba\ef\bf\bb\ef\bf\bc\ef\bf\bd\ef\bf\be\ef\bf\bf") (result i32) (i32.const 28)) + + ;; Test that the control pictures are distinct from the control codes they + ;; depict. These correspond to the C0 and miscellaneous control code tests + ;; above. + (func (export "␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏") (result i32) (i32.const 29)) + (func (export "␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟") (result i32) (i32.const 30)) + (func (export "␠␡") (result i32) (i32.const 31)) + + ;; Test the Unicode Specials in non-escaped form (excluding U+FFFE and + ;; U+FFFF, so that generic tools don't detect this file as non-UTF-8). + (func (export "�") (result i32) (i32.const 32)) + + ;; Test a bare ZWJ code point. + (func (export "") (result i32) (i32.const 33)) + ;; Test a bare ZWNJ code point. + (func (export "") (result i32) (i32.const 34)) + + ;; Test various bare joiner code points. + (func (export "͏") (result i32) (i32.const 35)) + (func (export "") (result i32) (i32.const 36)) + (func (export "⵿") (result i32) (i32.const 37)) + (func (export "𑁿") (result i32) (i32.const 38)) + (func (export "") (result i32) (i32.const 39)) + + ;; Test various interesting code points: reverse BOM, zero-width space, + ;; no-break space, soft hyphen, word joiner, ogham space mark, + ;; right-to-left override, left-to-right override. + (func (export " ") (result i32) (i32.const 40)) + + ;; Test more interesting code points: left-to-right mark, right-to-left mark, + ;; non-breaking hyphen, line separator, paragraph separator, + ;; left-to-right embedding, right-to-left embedding, + ;; pop directional formatting, narrow no-break space, left-to-right isolate, + ;; right-to-left isolate, first strong isolate, pop directional isolate. + (func (export "‑
") (result i32) (i32.const 41)) + + ;; Test some deprecated code points: inhibit symmetric swapping, + ;; activate symmetric swapping, inhibit arabic form shaping, + ;; activate arabic form shaping, national digit shapes, nominal digit shapes. + (func (export "") (result i32) (i32.const 42)) + + ;; Test "invisible" operator code points. + (func (export "") (result i32) (i32.const 43)) + + ;; Test that code points outside the BMP are supported. + (func (export "𐀀") (result i32) (i32.const 44)) + + ;; Test that WebAssembly implementations cope in the presence of Zalgo. + (func (export "Z̴͇̫̥̪͓͈͔͎̗̞̺̯̱̞̙̱̜̖̠̏͆̆͛͌͘͞ḁ̶̰̳̭͙̲̱̹̝͎̼͗ͨ̎̄̆͗̿̀́͟͡l̶̷͉̩̹̫̝͖̙̲̼͇͚͍̮͎̥̞̈́͊͗ͦ̈́ͫ̇́̚ͅͅg̶͕͔͚̩̓̐̅ͮ̔̐̎̂̏̾͊̍͋͊ͧ́̆ͦ͞o̡͋̔͐ͪͩ͏̢̧̫̙̤̮͖͙͓̺̜̩̼̘̠́") (result i32) (i32.const 45)) + + ;; Test Hangul filler code points. + (func (export "ᅟᅠㅤᅠ") (result i32) (i32.const 46)) + + ;; Test variation selectors (which are also ID_Continue code points). + (func (export "︀") (result i32) (i32.const 47)) + (func (export "︄") (result i32) (i32.const 48)) + (func (export "󠄀") (result i32) (i32.const 49)) + (func (export "󠇯") (result i32) (i32.const 50)) + + ;; Test an uncombined combining code point. + (func (export "̈") (result i32) (i32.const 51)) + + ;; Test that numerous different present and historical representations of the + ;; "newline" concept are distinct. Tests largely inspired by: + ;; https://en.wikipedia.org/wiki/Newline#Representations + ;; https://en.wikipedia.org/wiki/Newline#Unicode and + ;; https://en.wikipedia.org/wiki/Newline#Reverse_and_partial_line_feeds + (func (export "\0a") (result i32) (i32.const 52)) + (func (export "") (result i32) (i32.const 53)) + (func (export "
") (result i32) (i32.const 54)) + (func (export "\0d") (result i32) (i32.const 55)) + (func (export "\0d\0a") (result i32) (i32.const 56)) + (func (export "\0a\0d") (result i32) (i32.const 57)) + (func (export "\1e") (result i32) (i32.const 58)) + (func (export "\0b") (result i32) (i32.const 59)) + (func (export "\0c") (result i32) (i32.const 60)) + (func (export "\c2\85") (result i32) (i32.const 61)) + (func (export "
") (result i32) (i32.const 62)) + (func (export "…") (result i32) (i32.const 63)) + (func (export "⏎") (result i32) (i32.const 64)) + (func (export "\c2\8b") (result i32) (i32.const 65)) + (func (export "\c2\8c") (result i32) (i32.const 66)) + (func (export "\c2\8d") (result i32) (i32.const 67)) + (func (export "↵") (result i32) (i32.const 68)) + (func (export "↩") (result i32) (i32.const 69)) + (func (export "⌤") (result i32) (i32.const 70)) + (func (export "⤶") (result i32) (i32.const 71)) + (func (export "↲") (result i32) (i32.const 72)) + (func (export "⮨") (result i32) (i32.const 73)) + (func (export "⮰") (result i32) (i32.const 74)) + + ;; Test that non-characters are not replaced by the replacement character. + (func (export "�") (result i32) (i32.const 75)) + (func (export "\ef\b7\90") (result i32) (i32.const 76)) + (func (export "\ef\b7\91") (result i32) (i32.const 77)) + (func (export "\ef\b7\92") (result i32) (i32.const 78)) + (func (export "\ef\b7\93") (result i32) (i32.const 79)) + (func (export "\ef\b7\94") (result i32) (i32.const 80)) + (func (export "\ef\b7\95") (result i32) (i32.const 81)) + (func (export "\ef\b7\96") (result i32) (i32.const 82)) + (func (export "\ef\b7\97") (result i32) (i32.const 83)) + (func (export "\ef\b7\98") (result i32) (i32.const 84)) + (func (export "\ef\b7\99") (result i32) (i32.const 85)) + (func (export "\ef\b7\9a") (result i32) (i32.const 86)) + (func (export "\ef\b7\9b") (result i32) (i32.const 87)) + (func (export "\ef\b7\9c") (result i32) (i32.const 88)) + (func (export "\ef\b7\9d") (result i32) (i32.const 89)) + (func (export "\ef\b7\9e") (result i32) (i32.const 90)) + (func (export "\ef\b7\9f") (result i32) (i32.const 91)) + (func (export "\ef\b7\a0") (result i32) (i32.const 92)) + (func (export "\ef\b7\a1") (result i32) (i32.const 93)) + (func (export "\ef\b7\a2") (result i32) (i32.const 94)) + (func (export "\ef\b7\a3") (result i32) (i32.const 95)) + (func (export "\ef\b7\a4") (result i32) (i32.const 96)) + (func (export "\ef\b7\a5") (result i32) (i32.const 97)) + (func (export "\ef\b7\a6") (result i32) (i32.const 98)) + (func (export "\ef\b7\a7") (result i32) (i32.const 99)) + (func (export "\ef\b7\a8") (result i32) (i32.const 100)) + (func (export "\ef\b7\a9") (result i32) (i32.const 101)) + (func (export "\ef\b7\aa") (result i32) (i32.const 102)) + (func (export "\ef\b7\ab") (result i32) (i32.const 103)) + (func (export "\ef\b7\ac") (result i32) (i32.const 104)) + (func (export "\ef\b7\ad") (result i32) (i32.const 105)) + (func (export "\ef\b7\ae") (result i32) (i32.const 106)) + (func (export "\ef\b7\af") (result i32) (i32.const 107)) + (func (export "\ef\bf\be") (result i32) (i32.const 108)) + (func (export "\ef\bf\bf") (result i32) (i32.const 109)) + (func (export "\f0\9f\bf\be") (result i32) (i32.const 110)) + (func (export "\f0\9f\bf\bf") (result i32) (i32.const 111)) + (func (export "\f0\af\bf\be") (result i32) (i32.const 112)) + (func (export "\f0\af\bf\bf") (result i32) (i32.const 113)) + (func (export "\f0\bf\bf\be") (result i32) (i32.const 114)) + (func (export "\f0\bf\bf\bf") (result i32) (i32.const 115)) + (func (export "\f1\8f\bf\be") (result i32) (i32.const 116)) + (func (export "\f1\8f\bf\bf") (result i32) (i32.const 117)) + (func (export "\f1\9f\bf\be") (result i32) (i32.const 118)) + (func (export "\f1\9f\bf\bf") (result i32) (i32.const 119)) + (func (export "\f1\af\bf\be") (result i32) (i32.const 120)) + (func (export "\f1\af\bf\bf") (result i32) (i32.const 121)) + (func (export "\f1\bf\bf\be") (result i32) (i32.const 122)) + (func (export "\f1\bf\bf\bf") (result i32) (i32.const 123)) + (func (export "\f2\8f\bf\be") (result i32) (i32.const 124)) + (func (export "\f2\8f\bf\bf") (result i32) (i32.const 125)) + (func (export "\f2\9f\bf\be") (result i32) (i32.const 126)) + (func (export "\f2\9f\bf\bf") (result i32) (i32.const 127)) + (func (export "\f2\af\bf\be") (result i32) (i32.const 128)) + (func (export "\f2\af\bf\bf") (result i32) (i32.const 129)) + (func (export "\f2\bf\bf\be") (result i32) (i32.const 130)) + (func (export "\f2\bf\bf\bf") (result i32) (i32.const 131)) + (func (export "\f3\8f\bf\be") (result i32) (i32.const 132)) + (func (export "\f3\8f\bf\bf") (result i32) (i32.const 133)) + (func (export "\f3\9f\bf\be") (result i32) (i32.const 134)) + (func (export "\f3\9f\bf\bf") (result i32) (i32.const 135)) + (func (export "\f3\af\bf\be") (result i32) (i32.const 136)) + (func (export "\f3\af\bf\bf") (result i32) (i32.const 137)) + (func (export "\f3\bf\bf\be") (result i32) (i32.const 138)) + (func (export "\f3\bf\bf\bf") (result i32) (i32.const 139)) + (func (export "\f4\8f\bf\be") (result i32) (i32.const 140)) + (func (export "\f4\8f\bf\bf") (result i32) (i32.const 141)) + + ;; Test an interrobang with combining diacritical marks above. + ;; https://xkcd.com/1209/ + (func (export "̈‽̈̉") (result i32) (i32.const 142)) + + ;; Test that RLM/LRM don't change the logical byte order. + (func (export "abc") (result i32) (i32.const 143)) + (func (export "abc") (result i32) (i32.const 144)) + (func (export "cba") (result i32) (i32.const 145)) + (func (export "abc") (result i32) (i32.const 146)) + (func (export "cba") (result i32) (i32.const 147)) + + ;; Test that Unicode font variations are preserved. + (func (export "𝑨") (result i32) (i32.const 148)) + (func (export "𝐴") (result i32) (i32.const 149)) + (func (export "𝘈") (result i32) (i32.const 150)) + (func (export "𝘼") (result i32) (i32.const 151)) + (func (export "𝐀") (result i32) (i32.const 152)) + (func (export "𝓐") (result i32) (i32.const 153)) + (func (export "𝕬") (result i32) (i32.const 154)) + (func (export "𝗔") (result i32) (i32.const 155)) + (func (export "𝒜") (result i32) (i32.const 156)) + (func (export "𝔄") (result i32) (i32.const 157)) + (func (export "𝔸") (result i32) (i32.const 158)) + (func (export "𝖠") (result i32) (i32.const 159)) + (func (export "𝙰") (result i32) (i32.const 160)) + (func (export "ᴀ") (result i32) (i32.const 161)) + + ;; Test that various additional letter variations are preserved. + ;; (U+0040, U+0061, U+0041, U+00C5, U+0041 U+030A, U+212B, and the font + ;; variations are covered above.) + (func (export "ᴬ") (result i32) (i32.const 162)) + (func (export "Ⓐ") (result i32) (i32.const 163)) + (func (export "A") (result i32) (i32.const 164)) + (func (export "🄐") (result i32) (i32.const 165)) + (func (export "🄰") (result i32) (i32.const 166)) + (func (export "") (result i32) (i32.const 167)) + (func (export "U+0041") (result i32) (i32.const 168)) + (func (export "A") (result i32) (i32.const 169)) + (func (export "А") (result i32) (i32.const 170)) + (func (export "Ꙗ") (result i32) (i32.const 171)) + (func (export "ⷼ") (result i32) (i32.const 172)) + (func (export "ⷶ") (result i32) (i32.const 173)) + (func (export "Ɐ") (result i32) (i32.const 174)) + (func (export "🅐") (result i32) (i32.const 175)) + (func (export "🅰") (result i32) (i32.const 176)) + (func (export "Ⱝ") (result i32) (i32.const 177)) + (func (export "𐐂") (result i32) (i32.const 178)) + (func (export "𐐈") (result i32) (i32.const 179)) + (func (export "𐒰") (result i32) (i32.const 180)) + (func (export "À") (result i32) (i32.const 181)) + (func (export "Á") (result i32) (i32.const 182)) + (func (export "Â") (result i32) (i32.const 183)) + (func (export "Ã") (result i32) (i32.const 184)) + (func (export "Ä") (result i32) (i32.const 185)) + (func (export "Ā") (result i32) (i32.const 186)) + (func (export "Ă") (result i32) (i32.const 187)) + (func (export "Ą") (result i32) (i32.const 188)) + (func (export "Ǎ") (result i32) (i32.const 189)) + (func (export "Ǟ") (result i32) (i32.const 190)) + (func (export "Ǡ") (result i32) (i32.const 191)) + (func (export "Ǻ") (result i32) (i32.const 192)) + (func (export "Ȁ") (result i32) (i32.const 193)) + (func (export "Ȃ") (result i32) (i32.const 194)) + (func (export "Ȧ") (result i32) (i32.const 195)) + (func (export "Ⱥ") (result i32) (i32.const 196)) + (func (export "Ӑ") (result i32) (i32.const 197)) + (func (export "Ӓ") (result i32) (i32.const 198)) + (func (export "ߊ") (result i32) (i32.const 199)) + (func (export "ࠡ") (result i32) (i32.const 200)) + (func (export "ࠢ") (result i32) (i32.const 201)) + (func (export "ࠣ") (result i32) (i32.const 202)) + (func (export "ࠤ") (result i32) (i32.const 203)) + (func (export "ࠥ") (result i32) (i32.const 204)) + (func (export "ऄ") (result i32) (i32.const 205)) + (func (export "अ") (result i32) (i32.const 206)) + (func (export "ॲ") (result i32) (i32.const 207)) + (func (export "অ") (result i32) (i32.const 208)) + (func (export "ਅ") (result i32) (i32.const 209)) + (func (export "અ") (result i32) (i32.const 210)) + (func (export "ଅ") (result i32) (i32.const 211)) + (func (export "அ") (result i32) (i32.const 212)) + (func (export "అ") (result i32) (i32.const 213)) + (func (export "ಅ") (result i32) (i32.const 214)) + (func (export "അ") (result i32) (i32.const 215)) + (func (export "ะ") (result i32) (i32.const 216)) + (func (export "ະ") (result i32) (i32.const 217)) + (func (export "༁") (result i32) (i32.const 218)) + (func (export "ཨ") (result i32) (i32.const 219)) + (func (export "ྸ") (result i32) (i32.const 220)) + (func (export "အ") (result i32) (i32.const 221)) + (func (export "ဢ") (result i32) (i32.const 222)) + (func (export "ႜ") (result i32) (i32.const 223)) + (func (export "ᅡ") (result i32) (i32.const 224)) + (func (export "አ") (result i32) (i32.const 225)) + (func (export "ዐ") (result i32) (i32.const 226)) + (func (export "Ꭰ") (result i32) (i32.const 227)) + (func (export "ᐊ") (result i32) (i32.const 228)) + (func (export "ᖳ") (result i32) (i32.const 229)) + (func (export "ᚨ") (result i32) (i32.const 230)) + (func (export "ᚪ") (result i32) (i32.const 231)) + (func (export "ᛆ") (result i32) (i32.const 232)) + (func (export "ᜀ") (result i32) (i32.const 233)) + (func (export "ᜠ") (result i32) (i32.const 234)) + (func (export "ᝀ") (result i32) (i32.const 235)) + (func (export "ᝠ") (result i32) (i32.const 236)) + (func (export "ᠠ") (result i32) (i32.const 237)) + (func (export "ᢇ") (result i32) (i32.const 238)) + (func (export "ᤠ") (result i32) (i32.const 239)) + (func (export "ᥣ") (result i32) (i32.const 240)) + (func (export "ᨕ") (result i32) (i32.const 241)) + (func (export "ᩋ") (result i32) (i32.const 242)) + (func (export "ᩡ") (result i32) (i32.const 243)) + (func (export "ᮃ") (result i32) (i32.const 244)) + (func (export "ᯀ") (result i32) (i32.const 245)) + (func (export "ᯁ") (result i32) (i32.const 246)) + (func (export "ᰣ") (result i32) (i32.const 247)) + (func (export "Ḁ") (result i32) (i32.const 248)) + (func (export "Ạ") (result i32) (i32.const 249)) + (func (export "Ả") (result i32) (i32.const 250)) + (func (export "Ấ") (result i32) (i32.const 251)) + (func (export "Ầ") (result i32) (i32.const 252)) + (func (export "Ẩ") (result i32) (i32.const 253)) + (func (export "Ẫ") (result i32) (i32.const 254)) + (func (export "Ậ") (result i32) (i32.const 255)) + (func (export "Ắ") (result i32) (i32.const 256)) + (func (export "Ằ") (result i32) (i32.const 257)) + (func (export "Ẳ") (result i32) (i32.const 258)) + (func (export "Ẵ") (result i32) (i32.const 259)) + (func (export "Ặ") (result i32) (i32.const 260)) + (func (export "あ") (result i32) (i32.const 261)) + (func (export "ア") (result i32) (i32.const 262)) + (func (export "ㄚ") (result i32) (i32.const 263)) + (func (export "ㅏ") (result i32) (i32.const 264)) + (func (export "㈎") (result i32) (i32.const 265)) + (func (export "㈏") (result i32) (i32.const 266)) + (func (export "㈐") (result i32) (i32.const 267)) + (func (export "㈑") (result i32) (i32.const 268)) + (func (export "㈒") (result i32) (i32.const 269)) + (func (export "㈓") (result i32) (i32.const 270)) + (func (export "㈔") (result i32) (i32.const 271)) + (func (export "㈕") (result i32) (i32.const 272)) + (func (export "㈖") (result i32) (i32.const 273)) + (func (export "㈗") (result i32) (i32.const 274)) + (func (export "㈘") (result i32) (i32.const 275)) + (func (export "㈙") (result i32) (i32.const 276)) + (func (export "㈚") (result i32) (i32.const 277)) + (func (export "㈛") (result i32) (i32.const 278)) + (func (export "㉮") (result i32) (i32.const 279)) + (func (export "㉯") (result i32) (i32.const 280)) + (func (export "㉰") (result i32) (i32.const 281)) + (func (export "㉱") (result i32) (i32.const 282)) + (func (export "㉲") (result i32) (i32.const 283)) + (func (export "㉳") (result i32) (i32.const 284)) + (func (export "㉴") (result i32) (i32.const 285)) + (func (export "㉵") (result i32) (i32.const 286)) + (func (export "㉶") (result i32) (i32.const 287)) + (func (export "㉷") (result i32) (i32.const 288)) + (func (export "㉸") (result i32) (i32.const 289)) + (func (export "㉹") (result i32) (i32.const 290)) + (func (export "㉺") (result i32) (i32.const 291)) + (func (export "㉻") (result i32) (i32.const 292)) + (func (export "㋐") (result i32) (i32.const 293)) + (func (export "ꀊ") (result i32) (i32.const 294)) + (func (export "ꓮ") (result i32) (i32.const 295)) + (func (export "ꕉ") (result i32) (i32.const 296)) + (func (export "ꚠ") (result i32) (i32.const 297)) + (func (export "ꠀ") (result i32) (i32.const 298)) + (func (export "ꠣ") (result i32) (i32.const 299)) + (func (export "ꡝ") (result i32) (i32.const 300)) + (func (export "ꢂ") (result i32) (i32.const 301)) + (func (export "꣪") (result i32) (i32.const 302)) + (func (export "ꤢ") (result i32) (i32.const 303)) + (func (export "ꥆ") (result i32) (i32.const 304)) + (func (export "ꦄ") (result i32) (i32.const 305)) + (func (export "ꨀ") (result i32) (i32.const 306)) + (func (export "ア") (result i32) (i32.const 307)) + (func (export "ᅡ") (result i32) (i32.const 308)) + (func (export "𐀀") (result i32) (i32.const 309)) + (func (export "𐊀") (result i32) (i32.const 310)) + (func (export "𐊠") (result i32) (i32.const 311)) + (func (export "𐌀") (result i32) (i32.const 312)) + (func (export "𐎠") (result i32) (i32.const 313)) + (func (export "𐒖") (result i32) (i32.const 314)) + (func (export "𐔀") (result i32) (i32.const 315)) + (func (export "𐝀") (result i32) (i32.const 316)) + (func (export "𐠀") (result i32) (i32.const 317)) + (func (export "𐤠") (result i32) (i32.const 318)) + (func (export "𐦀") (result i32) (i32.const 319)) + (func (export "𐦠") (result i32) (i32.const 320)) + (func (export "𐨀") (result i32) (i32.const 321)) + (func (export "𐬀") (result i32) (i32.const 322)) + (func (export "𐰀") (result i32) (i32.const 323)) + (func (export "𐰁") (result i32) (i32.const 324)) + (func (export "𐲀") (result i32) (i32.const 325)) + (func (export "𑀅") (result i32) (i32.const 326)) + (func (export "𑂃") (result i32) (i32.const 327)) + (func (export "𑄧") (result i32) (i32.const 328)) + (func (export "𑅐") (result i32) (i32.const 329)) + (func (export "𑆃") (result i32) (i32.const 330)) + (func (export "𑈀") (result i32) (i32.const 331)) + (func (export "𑊀") (result i32) (i32.const 332)) + (func (export "𑊰") (result i32) (i32.const 333)) + (func (export "𑌅") (result i32) (i32.const 334)) + (func (export "𑍰") (result i32) (i32.const 335)) + (func (export "𑐀") (result i32) (i32.const 336)) + (func (export "𑒁") (result i32) (i32.const 337)) + (func (export "𑖀") (result i32) (i32.const 338)) + (func (export "𑘀") (result i32) (i32.const 339)) + (func (export "𑚀") (result i32) (i32.const 340)) + (func (export "𑜒") (result i32) (i32.const 341)) + (func (export "𑜠") (result i32) (i32.const 342)) + (func (export "𑢡") (result i32) (i32.const 343)) + (func (export "𑫕") (result i32) (i32.const 344)) + (func (export "𑰀") (result i32) (i32.const 345)) + (func (export "𑲏") (result i32) (i32.const 346)) + (func (export "𑲯") (result i32) (i32.const 347)) + (func (export "𒀀") (result i32) (i32.const 348)) + (func (export "𖧕") (result i32) (i32.const 349)) + (func (export "𖩆") (result i32) (i32.const 350)) + (func (export "𖫧") (result i32) (i32.const 351)) + (func (export "𖽔") (result i32) (i32.const 352)) + (func (export "𛱁") (result i32) (i32.const 353)) + (func (export "𛱤") (result i32) (i32.const 354)) + (func (export "𞠣") (result i32) (i32.const 355)) + (func (export "🇦") (result i32) (i32.const 356)) + (func (export "Ɑ") (result i32) (i32.const 357)) + (func (export "Λ") (result i32) (i32.const 358)) + (func (export "Ɒ") (result i32) (i32.const 359)) + (func (export "ª") (result i32) (i32.const 360)) + (func (export "∀") (result i32) (i32.const 361)) + (func (export "₳") (result i32) (i32.const 362)) + (func (export "𐤀") (result i32) (i32.const 363)) + (func (export "Ⲁ") (result i32) (i32.const 364)) + (func (export "𐌰") (result i32) (i32.const 365)) + (func (export "Ά") (result i32) (i32.const 366)) + (func (export "Α") (result i32) (i32.const 367)) + (func (export "Ἀ") (result i32) (i32.const 368)) + (func (export "Ἁ") (result i32) (i32.const 369)) + (func (export "Ἂ") (result i32) (i32.const 370)) + (func (export "Ἃ") (result i32) (i32.const 371)) + (func (export "Ἄ") (result i32) (i32.const 372)) + (func (export "Ἅ") (result i32) (i32.const 373)) + (func (export "Ἆ") (result i32) (i32.const 374)) + (func (export "Ἇ") (result i32) (i32.const 375)) + (func (export "ᾈ") (result i32) (i32.const 376)) + (func (export "ᾉ") (result i32) (i32.const 377)) + (func (export "ᾊ") (result i32) (i32.const 378)) + (func (export "ᾋ") (result i32) (i32.const 379)) + (func (export "ᾌ") (result i32) (i32.const 380)) + (func (export "ᾍ") (result i32) (i32.const 381)) + (func (export "ᾎ") (result i32) (i32.const 382)) + (func (export "ᾏ") (result i32) (i32.const 383)) + (func (export "Ᾰ") (result i32) (i32.const 384)) + (func (export "Ᾱ") (result i32) (i32.const 385)) + (func (export "Ὰ") (result i32) (i32.const 386)) + (func (export "Ά") (result i32) (i32.const 387)) + (func (export "ᾼ") (result i32) (i32.const 388)) + (func (export "𝚨") (result i32) (i32.const 389)) + (func (export "𝛢") (result i32) (i32.const 390)) + (func (export "𝜜") (result i32) (i32.const 391)) + (func (export "𝝖") (result i32) (i32.const 392)) + (func (export "𝞐") (result i32) (i32.const 393)) + (func (export "⍶") (result i32) (i32.const 394)) + (func (export "⍺") (result i32) (i32.const 395)) + (func (export "⩜") (result i32) (i32.const 396)) + (func (export "ᗅ") (result i32) (i32.const 397)) + (func (export "Ꭺ") (result i32) (i32.const 398)) + + ;; Test unmatched "closing" and "opening" code points. + (func (export ")˺˼𔗏⁾₎❩❫⟯﴿︶﹚)⦆❳❵⟧⟩⟫⟭⦈⦊⦖⸣⸥︘︸︺︼︾﹀﹂﹄﹈﹜﹞]}」»’”›❯") (result i32) (i32.const 399)) + (func (export "(˹˻𔗎⁽₍❨❪⟮﴾︵﹙(⦅❲❴⟦⟨⟪⟬⦇⦉⦕⸢⸤︗︷︹︻︽︿﹁﹃﹇﹛﹝[{「«‘“‹❮") (result i32) (i32.const 400)) + (func (export "𝪋𝪤") (result i32) (i32.const 401)) + (func (export "𝪋") (result i32) (i32.const 402)) + + ;; Test that Unicode fraction normalization is not applied. + (func (export "½") (result i32) (i32.const 403)) + (func (export "1⁄2") (result i32) (i32.const 404)) + (func (export "1/2") (result i32) (i32.const 405)) + (func (export "୳") (result i32) (i32.const 406)) + (func (export "൴") (result i32) (i32.const 407)) + (func (export "⳽") (result i32) (i32.const 408)) + (func (export "꠱") (result i32) (i32.const 409)) + (func (export "𐅁") (result i32) (i32.const 410)) + (func (export "𐅵") (result i32) (i32.const 411)) + (func (export "𐅶") (result i32) (i32.const 412)) + (func (export "𐦽") (result i32) (i32.const 413)) + (func (export "𐹻") (result i32) (i32.const 414)) + + ;; Test a full-width quote. + (func (export """) (result i32) (i32.const 415)) + + ;; Test that different present and historical representations of the "delete" + ;; concept are distinct. + (func (export "\7f") (result i32) (i32.const 416)) + (func (export "\08") (result i32) (i32.const 417)) + (func (export "⌫") (result i32) (i32.const 418)) + (func (export "⌦") (result i32) (i32.const 419)) + (func (export "␈") (result i32) (i32.const 420)) + (func (export "␡") (result i32) (i32.const 421)) + (func (export "᷻") (result i32) (i32.const 422)) + (func (export "\0f") (result i32) (i32.const 423)) + (func (export "←") (result i32) (i32.const 424)) + (func (export "⌧") (result i32) (i32.const 425)) + (func (export "⍒") (result i32) (i32.const 426)) + (func (export "⍔") (result i32) (i32.const 427)) + (func (export "⍢") (result i32) (i32.const 428)) + (func (export "⍫") (result i32) (i32.const 429)) + + ;; Test that different representations of the "substitute" concept are + ;; distinct. (U+FFFD is covered above.) + (func (export "\1a") (result i32) (i32.const 430)) + (func (export "␦") (result i32) (i32.const 431)) + (func (export "␚") (result i32) (i32.const 432)) + (func (export "") (result i32) (i32.const 433)) + (func (export "?") (result i32) (i32.const 434)) + (func (export "¿") (result i32) (i32.const 435)) + (func (export "᥅") (result i32) (i32.const 436)) + (func (export ";") (result i32) (i32.const 437)) + (func (export "՞") (result i32) (i32.const 438)) + (func (export "؟") (result i32) (i32.const 439)) + (func (export "፧") (result i32) (i32.const 440)) + (func (export "⁇") (result i32) (i32.const 441)) + (func (export "⍰") (result i32) (i32.const 442)) + (func (export "❓") (result i32) (i32.const 443)) + (func (export "❔") (result i32) (i32.const 444)) + (func (export "⳺") (result i32) (i32.const 445)) + (func (export "⳻") (result i32) (i32.const 446)) + (func (export "⸮") (result i32) (i32.const 447)) + (func (export "㉄") (result i32) (i32.const 448)) + (func (export "꘏") (result i32) (i32.const 449)) + (func (export "꛷") (result i32) (i32.const 450)) + (func (export "︖") (result i32) (i32.const 451)) + (func (export "﹖") (result i32) (i32.const 452)) + (func (export "?") (result i32) (i32.const 453)) + (func (export "𑅃") (result i32) (i32.const 454)) + (func (export "𞥟") (result i32) (i32.const 455)) + (func (export "") (result i32) (i32.const 456)) + (func (export "𖡄") (result i32) (i32.const 457)) + (func (export "⯑") (result i32) (i32.const 458)) + + ;; Test that different present and historical representations of the + ;; "paragraph" concept are distinct. (U+2029 is covered above). + (func (export "¶") (result i32) (i32.const 459)) + (func (export "⁋") (result i32) (i32.const 460)) + (func (export "܀") (result i32) (i32.const 461)) + (func (export "჻") (result i32) (i32.const 462)) + (func (export "፨") (result i32) (i32.const 463)) + (func (export "〷") (result i32) (i32.const 464)) + (func (export "❡") (result i32) (i32.const 465)) + (func (export "⸏") (result i32) (i32.const 466)) + (func (export "⸐") (result i32) (i32.const 467)) + (func (export "⸑") (result i32) (i32.const 468)) + (func (export "⸎") (result i32) (i32.const 469)) + (func (export "\14") (result i32) (i32.const 470)) ;; ¶ in CP437 + (func (export "☙") (result i32) (i32.const 471)) + (func (export "⸿") (result i32) (i32.const 472)) + (func (export "〇") (result i32) (i32.const 473)) + (func (export "๛") (result i32) (i32.const 474)) + + ;; Test an unusual character. + (func (export "ꙮ") (result i32) (i32.const 475)) + + ;; Test the three characters whose normalization forms under NFC, NFD, NFKC, + ;; and NFKD are all different. + ;; http://unicode.org/faq/normalization.html#6 + (func (export "ϓ") (result i32) (i32.const 476)) + (func (export "ϔ") (result i32) (i32.const 477)) + (func (export "ẛ") (result i32) (i32.const 478)) ) -(assert_return (invoke "") (f32.const 0x1.91p+2)) -(assert_return (invoke "malloc") (f32.const 0x1.92p+2)) -(assert_return (invoke "_malloc") (f32.const 0x1.93p+2)) -(assert_return (invoke "__malloc") (f32.const 0x1.94p+2)) -(assert_return (invoke "~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./ ") (f32.const 0x1.96p+2)) -(assert_return (invoke "0") (f32.const 0x1.97p+2)) -(assert_return (invoke "_") (f32.const 0x1.98p+2)) -(assert_return (invoke "$") (f32.const 0x1.99p+2)) -(assert_return (invoke "@") (f32.const 0x2.00p+2)) -(assert_return (invoke "NaN") (f32.const 0x2.01p+2)) -(assert_return (invoke "Infinity") (f32.const 0x2.02p+2)) -(assert_return (invoke "if") (f32.const 0x2.03p+2)) +(assert_return (invoke "") (i32.const 0)) +(assert_return (invoke "0") (i32.const 1)) +(assert_return (invoke "-0") (i32.const 2)) +(assert_return (invoke "_") (i32.const 3)) +(assert_return (invoke "$") (i32.const 4)) +(assert_return (invoke "@") (i32.const 5)) +(assert_return (invoke "~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./ ") (i32.const 6)) +(assert_return (invoke "NaN") (i32.const 7)) +(assert_return (invoke "Infinity") (i32.const 8)) +(assert_return (invoke "if") (i32.const 9)) +(assert_return (invoke "malloc") (i32.const 10)) +(assert_return (invoke "_malloc") (i32.const 11)) +(assert_return (invoke "__malloc") (i32.const 12)) +(assert_return (invoke "a") (i32.const 13)) +(assert_return (invoke "A") (i32.const 14)) +(assert_return (invoke "") (i32.const 15)) +(assert_return (invoke "Å") (i32.const 16)) +(assert_return (invoke "Å") (i32.const 17)) +(assert_return (invoke "Å") (i32.const 18)) +(assert_return (invoke "ffi") (i32.const 19)) +(assert_return (invoke "ffi") (i32.const 20)) +(assert_return (invoke "ffi") (i32.const 21)) +(assert_return (invoke "\00\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f") (i32.const 22)) +(assert_return (invoke "\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f") (i32.const 23)) +(assert_return (invoke " \7f") (i32.const 24)) +(assert_return (invoke "\c2\80\c2\81\c2\82\c2\83\c2\84\c2\85\c2\86\c2\87\c2\88\c2\89\c2\8a\c2\8b\c2\8c\c2\8d\c2\8e\c2\8f") (i32.const 25)) +(assert_return (invoke "\c2\90\c2\91\c2\92\c2\93\c2\94\c2\95\c2\96\c2\97\c2\98\c2\99\c2\9a\c2\9b\c2\9c\c2\9d\c2\9e\c2\9f") (i32.const 26)) +(assert_return (invoke "\ef\bf\b0\ef\bf\b1\ef\bf\b2\ef\bf\b3\ef\bf\b4\ef\bf\b5\ef\bf\b6\ef\bf\b7") (i32.const 27)) +(assert_return (invoke "\ef\bf\b8\ef\bf\b9\ef\bf\ba\ef\bf\bb\ef\bf\bc\ef\bf\bd\ef\bf\be\ef\bf\bf") (i32.const 28)) +(assert_return (invoke "␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏") (i32.const 29)) +(assert_return (invoke "␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟") (i32.const 30)) +(assert_return (invoke "␠␡") (i32.const 31)) +(assert_return (invoke "�") (i32.const 32)) +(assert_return (invoke "") (i32.const 33)) +(assert_return (invoke "") (i32.const 34)) +(assert_return (invoke "͏") (i32.const 35)) +(assert_return (invoke "") (i32.const 36)) +(assert_return (invoke "⵿") (i32.const 37)) +(assert_return (invoke "𑁿") (i32.const 38)) +(assert_return (invoke "") (i32.const 39)) +(assert_return (invoke " ") (i32.const 40)) +(assert_return (invoke "‑
") (i32.const 41)) +(assert_return (invoke "") (i32.const 42)) +(assert_return (invoke "") (i32.const 43)) +(assert_return (invoke "𐀀") (i32.const 44)) +(assert_return (invoke "Z̴͇̫̥̪͓͈͔͎̗̞̺̯̱̞̙̱̜̖̠̏͆̆͛͌͘͞ḁ̶̰̳̭͙̲̱̹̝͎̼͗ͨ̎̄̆͗̿̀́͟͡l̶̷͉̩̹̫̝͖̙̲̼͇͚͍̮͎̥̞̈́͊͗ͦ̈́ͫ̇́̚ͅͅg̶͕͔͚̩̓̐̅ͮ̔̐̎̂̏̾͊̍͋͊ͧ́̆ͦ͞o̡͋̔͐ͪͩ͏̢̧̫̙̤̮͖͙͓̺̜̩̼̘̠́") (i32.const 45)) +(assert_return (invoke "ᅟᅠㅤᅠ") (i32.const 46)) +(assert_return (invoke "︀") (i32.const 47)) +(assert_return (invoke "︄") (i32.const 48)) +(assert_return (invoke "󠄀") (i32.const 49)) +(assert_return (invoke "󠇯") (i32.const 50)) +(assert_return (invoke "̈") (i32.const 51)) +(assert_return (invoke "\0a") (i32.const 52)) +(assert_return (invoke "") (i32.const 53)) +(assert_return (invoke "
") (i32.const 54)) +(assert_return (invoke "\0d") (i32.const 55)) +(assert_return (invoke "\0d\0a") (i32.const 56)) +(assert_return (invoke "\0a\0d") (i32.const 57)) +(assert_return (invoke "\1e") (i32.const 58)) +(assert_return (invoke "\0b") (i32.const 59)) +(assert_return (invoke "\0c") (i32.const 60)) +(assert_return (invoke "\c2\85") (i32.const 61)) +(assert_return (invoke "
") (i32.const 62)) +(assert_return (invoke "…") (i32.const 63)) +(assert_return (invoke "⏎") (i32.const 64)) +(assert_return (invoke "\c2\8b") (i32.const 65)) +(assert_return (invoke "\c2\8c") (i32.const 66)) +(assert_return (invoke "\c2\8d") (i32.const 67)) +(assert_return (invoke "↵") (i32.const 68)) +(assert_return (invoke "↩") (i32.const 69)) +(assert_return (invoke "⌤") (i32.const 70)) +(assert_return (invoke "⤶") (i32.const 71)) +(assert_return (invoke "↲") (i32.const 72)) +(assert_return (invoke "⮨") (i32.const 73)) +(assert_return (invoke "⮰") (i32.const 74)) +(assert_return (invoke "�") (i32.const 75)) +(assert_return (invoke "\ef\b7\90") (i32.const 76)) +(assert_return (invoke "\ef\b7\91") (i32.const 77)) +(assert_return (invoke "\ef\b7\92") (i32.const 78)) +(assert_return (invoke "\ef\b7\93") (i32.const 79)) +(assert_return (invoke "\ef\b7\94") (i32.const 80)) +(assert_return (invoke "\ef\b7\95") (i32.const 81)) +(assert_return (invoke "\ef\b7\96") (i32.const 82)) +(assert_return (invoke "\ef\b7\97") (i32.const 83)) +(assert_return (invoke "\ef\b7\98") (i32.const 84)) +(assert_return (invoke "\ef\b7\99") (i32.const 85)) +(assert_return (invoke "\ef\b7\9a") (i32.const 86)) +(assert_return (invoke "\ef\b7\9b") (i32.const 87)) +(assert_return (invoke "\ef\b7\9c") (i32.const 88)) +(assert_return (invoke "\ef\b7\9d") (i32.const 89)) +(assert_return (invoke "\ef\b7\9e") (i32.const 90)) +(assert_return (invoke "\ef\b7\9f") (i32.const 91)) +(assert_return (invoke "\ef\b7\a0") (i32.const 92)) +(assert_return (invoke "\ef\b7\a1") (i32.const 93)) +(assert_return (invoke "\ef\b7\a2") (i32.const 94)) +(assert_return (invoke "\ef\b7\a3") (i32.const 95)) +(assert_return (invoke "\ef\b7\a4") (i32.const 96)) +(assert_return (invoke "\ef\b7\a5") (i32.const 97)) +(assert_return (invoke "\ef\b7\a6") (i32.const 98)) +(assert_return (invoke "\ef\b7\a7") (i32.const 99)) +(assert_return (invoke "\ef\b7\a8") (i32.const 100)) +(assert_return (invoke "\ef\b7\a9") (i32.const 101)) +(assert_return (invoke "\ef\b7\aa") (i32.const 102)) +(assert_return (invoke "\ef\b7\ab") (i32.const 103)) +(assert_return (invoke "\ef\b7\ac") (i32.const 104)) +(assert_return (invoke "\ef\b7\ad") (i32.const 105)) +(assert_return (invoke "\ef\b7\ae") (i32.const 106)) +(assert_return (invoke "\ef\b7\af") (i32.const 107)) +(assert_return (invoke "\ef\bf\be") (i32.const 108)) +(assert_return (invoke "\ef\bf\bf") (i32.const 109)) +(assert_return (invoke "\f0\9f\bf\be") (i32.const 110)) +(assert_return (invoke "\f0\9f\bf\bf") (i32.const 111)) +(assert_return (invoke "\f0\af\bf\be") (i32.const 112)) +(assert_return (invoke "\f0\af\bf\bf") (i32.const 113)) +(assert_return (invoke "\f0\bf\bf\be") (i32.const 114)) +(assert_return (invoke "\f0\bf\bf\bf") (i32.const 115)) +(assert_return (invoke "\f1\8f\bf\be") (i32.const 116)) +(assert_return (invoke "\f1\8f\bf\bf") (i32.const 117)) +(assert_return (invoke "\f1\9f\bf\be") (i32.const 118)) +(assert_return (invoke "\f1\9f\bf\bf") (i32.const 119)) +(assert_return (invoke "\f1\af\bf\be") (i32.const 120)) +(assert_return (invoke "\f1\af\bf\bf") (i32.const 121)) +(assert_return (invoke "\f1\bf\bf\be") (i32.const 122)) +(assert_return (invoke "\f1\bf\bf\bf") (i32.const 123)) +(assert_return (invoke "\f2\8f\bf\be") (i32.const 124)) +(assert_return (invoke "\f2\8f\bf\bf") (i32.const 125)) +(assert_return (invoke "\f2\9f\bf\be") (i32.const 126)) +(assert_return (invoke "\f2\9f\bf\bf") (i32.const 127)) +(assert_return (invoke "\f2\af\bf\be") (i32.const 128)) +(assert_return (invoke "\f2\af\bf\bf") (i32.const 129)) +(assert_return (invoke "\f2\bf\bf\be") (i32.const 130)) +(assert_return (invoke "\f2\bf\bf\bf") (i32.const 131)) +(assert_return (invoke "\f3\8f\bf\be") (i32.const 132)) +(assert_return (invoke "\f3\8f\bf\bf") (i32.const 133)) +(assert_return (invoke "\f3\9f\bf\be") (i32.const 134)) +(assert_return (invoke "\f3\9f\bf\bf") (i32.const 135)) +(assert_return (invoke "\f3\af\bf\be") (i32.const 136)) +(assert_return (invoke "\f3\af\bf\bf") (i32.const 137)) +(assert_return (invoke "\f3\bf\bf\be") (i32.const 138)) +(assert_return (invoke "\f3\bf\bf\bf") (i32.const 139)) +(assert_return (invoke "\f4\8f\bf\be") (i32.const 140)) +(assert_return (invoke "\f4\8f\bf\bf") (i32.const 141)) +(assert_return (invoke "̈‽̈̉") (i32.const 142)) +(assert_return (invoke "abc") (i32.const 143)) +(assert_return (invoke "abc") (i32.const 144)) +(assert_return (invoke "cba") (i32.const 145)) +(assert_return (invoke "abc") (i32.const 146)) +(assert_return (invoke "cba") (i32.const 147)) +(assert_return (invoke "𝑨") (i32.const 148)) +(assert_return (invoke "𝐴") (i32.const 149)) +(assert_return (invoke "𝘈") (i32.const 150)) +(assert_return (invoke "𝘼") (i32.const 151)) +(assert_return (invoke "𝐀") (i32.const 152)) +(assert_return (invoke "𝓐") (i32.const 153)) +(assert_return (invoke "𝕬") (i32.const 154)) +(assert_return (invoke "𝗔") (i32.const 155)) +(assert_return (invoke "𝒜") (i32.const 156)) +(assert_return (invoke "𝔄") (i32.const 157)) +(assert_return (invoke "𝔸") (i32.const 158)) +(assert_return (invoke "𝖠") (i32.const 159)) +(assert_return (invoke "𝙰") (i32.const 160)) +(assert_return (invoke "ᴀ") (i32.const 161)) +(assert_return (invoke "ᴬ") (i32.const 162)) +(assert_return (invoke "Ⓐ") (i32.const 163)) +(assert_return (invoke "A") (i32.const 164)) +(assert_return (invoke "🄐") (i32.const 165)) +(assert_return (invoke "🄰") (i32.const 166)) +(assert_return (invoke "") (i32.const 167)) +(assert_return (invoke "U+0041") (i32.const 168)) +(assert_return (invoke "A") (i32.const 169)) +(assert_return (invoke "А") (i32.const 170)) +(assert_return (invoke "Ꙗ") (i32.const 171)) +(assert_return (invoke "ⷼ") (i32.const 172)) +(assert_return (invoke "ⷶ") (i32.const 173)) +(assert_return (invoke "Ɐ") (i32.const 174)) +(assert_return (invoke "🅐") (i32.const 175)) +(assert_return (invoke "🅰") (i32.const 176)) +(assert_return (invoke "Ⱝ") (i32.const 177)) +(assert_return (invoke "𐐂") (i32.const 178)) +(assert_return (invoke "𐐈") (i32.const 179)) +(assert_return (invoke "𐒰") (i32.const 180)) +(assert_return (invoke "À") (i32.const 181)) +(assert_return (invoke "Á") (i32.const 182)) +(assert_return (invoke "Â") (i32.const 183)) +(assert_return (invoke "Ã") (i32.const 184)) +(assert_return (invoke "Ä") (i32.const 185)) +(assert_return (invoke "Ā") (i32.const 186)) +(assert_return (invoke "Ă") (i32.const 187)) +(assert_return (invoke "Ą") (i32.const 188)) +(assert_return (invoke "Ǎ") (i32.const 189)) +(assert_return (invoke "Ǟ") (i32.const 190)) +(assert_return (invoke "Ǡ") (i32.const 191)) +(assert_return (invoke "Ǻ") (i32.const 192)) +(assert_return (invoke "Ȁ") (i32.const 193)) +(assert_return (invoke "Ȃ") (i32.const 194)) +(assert_return (invoke "Ȧ") (i32.const 195)) +(assert_return (invoke "Ⱥ") (i32.const 196)) +(assert_return (invoke "Ӑ") (i32.const 197)) +(assert_return (invoke "Ӓ") (i32.const 198)) +(assert_return (invoke "ߊ") (i32.const 199)) +(assert_return (invoke "ࠡ") (i32.const 200)) +(assert_return (invoke "ࠢ") (i32.const 201)) +(assert_return (invoke "ࠣ") (i32.const 202)) +(assert_return (invoke "ࠤ") (i32.const 203)) +(assert_return (invoke "ࠥ") (i32.const 204)) +(assert_return (invoke "ऄ") (i32.const 205)) +(assert_return (invoke "अ") (i32.const 206)) +(assert_return (invoke "ॲ") (i32.const 207)) +(assert_return (invoke "অ") (i32.const 208)) +(assert_return (invoke "ਅ") (i32.const 209)) +(assert_return (invoke "અ") (i32.const 210)) +(assert_return (invoke "ଅ") (i32.const 211)) +(assert_return (invoke "அ") (i32.const 212)) +(assert_return (invoke "అ") (i32.const 213)) +(assert_return (invoke "ಅ") (i32.const 214)) +(assert_return (invoke "അ") (i32.const 215)) +(assert_return (invoke "ะ") (i32.const 216)) +(assert_return (invoke "ະ") (i32.const 217)) +(assert_return (invoke "༁") (i32.const 218)) +(assert_return (invoke "ཨ") (i32.const 219)) +(assert_return (invoke "ྸ") (i32.const 220)) +(assert_return (invoke "အ") (i32.const 221)) +(assert_return (invoke "ဢ") (i32.const 222)) +(assert_return (invoke "ႜ") (i32.const 223)) +(assert_return (invoke "ᅡ") (i32.const 224)) +(assert_return (invoke "አ") (i32.const 225)) +(assert_return (invoke "ዐ") (i32.const 226)) +(assert_return (invoke "Ꭰ") (i32.const 227)) +(assert_return (invoke "ᐊ") (i32.const 228)) +(assert_return (invoke "ᖳ") (i32.const 229)) +(assert_return (invoke "ᚨ") (i32.const 230)) +(assert_return (invoke "ᚪ") (i32.const 231)) +(assert_return (invoke "ᛆ") (i32.const 232)) +(assert_return (invoke "ᜀ") (i32.const 233)) +(assert_return (invoke "ᜠ") (i32.const 234)) +(assert_return (invoke "ᝀ") (i32.const 235)) +(assert_return (invoke "ᝠ") (i32.const 236)) +(assert_return (invoke "ᠠ") (i32.const 237)) +(assert_return (invoke "ᢇ") (i32.const 238)) +(assert_return (invoke "ᤠ") (i32.const 239)) +(assert_return (invoke "ᥣ") (i32.const 240)) +(assert_return (invoke "ᨕ") (i32.const 241)) +(assert_return (invoke "ᩋ") (i32.const 242)) +(assert_return (invoke "ᩡ") (i32.const 243)) +(assert_return (invoke "ᮃ") (i32.const 244)) +(assert_return (invoke "ᯀ") (i32.const 245)) +(assert_return (invoke "ᯁ") (i32.const 246)) +(assert_return (invoke "ᰣ") (i32.const 247)) +(assert_return (invoke "Ḁ") (i32.const 248)) +(assert_return (invoke "Ạ") (i32.const 249)) +(assert_return (invoke "Ả") (i32.const 250)) +(assert_return (invoke "Ấ") (i32.const 251)) +(assert_return (invoke "Ầ") (i32.const 252)) +(assert_return (invoke "Ẩ") (i32.const 253)) +(assert_return (invoke "Ẫ") (i32.const 254)) +(assert_return (invoke "Ậ") (i32.const 255)) +(assert_return (invoke "Ắ") (i32.const 256)) +(assert_return (invoke "Ằ") (i32.const 257)) +(assert_return (invoke "Ẳ") (i32.const 258)) +(assert_return (invoke "Ẵ") (i32.const 259)) +(assert_return (invoke "Ặ") (i32.const 260)) +(assert_return (invoke "あ") (i32.const 261)) +(assert_return (invoke "ア") (i32.const 262)) +(assert_return (invoke "ㄚ") (i32.const 263)) +(assert_return (invoke "ㅏ") (i32.const 264)) +(assert_return (invoke "㈎") (i32.const 265)) +(assert_return (invoke "㈏") (i32.const 266)) +(assert_return (invoke "㈐") (i32.const 267)) +(assert_return (invoke "㈑") (i32.const 268)) +(assert_return (invoke "㈒") (i32.const 269)) +(assert_return (invoke "㈓") (i32.const 270)) +(assert_return (invoke "㈔") (i32.const 271)) +(assert_return (invoke "㈕") (i32.const 272)) +(assert_return (invoke "㈖") (i32.const 273)) +(assert_return (invoke "㈗") (i32.const 274)) +(assert_return (invoke "㈘") (i32.const 275)) +(assert_return (invoke "㈙") (i32.const 276)) +(assert_return (invoke "㈚") (i32.const 277)) +(assert_return (invoke "㈛") (i32.const 278)) +(assert_return (invoke "㉮") (i32.const 279)) +(assert_return (invoke "㉯") (i32.const 280)) +(assert_return (invoke "㉰") (i32.const 281)) +(assert_return (invoke "㉱") (i32.const 282)) +(assert_return (invoke "㉲") (i32.const 283)) +(assert_return (invoke "㉳") (i32.const 284)) +(assert_return (invoke "㉴") (i32.const 285)) +(assert_return (invoke "㉵") (i32.const 286)) +(assert_return (invoke "㉶") (i32.const 287)) +(assert_return (invoke "㉷") (i32.const 288)) +(assert_return (invoke "㉸") (i32.const 289)) +(assert_return (invoke "㉹") (i32.const 290)) +(assert_return (invoke "㉺") (i32.const 291)) +(assert_return (invoke "㉻") (i32.const 292)) +(assert_return (invoke "㋐") (i32.const 293)) +(assert_return (invoke "ꀊ") (i32.const 294)) +(assert_return (invoke "ꓮ") (i32.const 295)) +(assert_return (invoke "ꕉ") (i32.const 296)) +(assert_return (invoke "ꚠ") (i32.const 297)) +(assert_return (invoke "ꠀ") (i32.const 298)) +(assert_return (invoke "ꠣ") (i32.const 299)) +(assert_return (invoke "ꡝ") (i32.const 300)) +(assert_return (invoke "ꢂ") (i32.const 301)) +(assert_return (invoke "꣪") (i32.const 302)) +(assert_return (invoke "ꤢ") (i32.const 303)) +(assert_return (invoke "ꥆ") (i32.const 304)) +(assert_return (invoke "ꦄ") (i32.const 305)) +(assert_return (invoke "ꨀ") (i32.const 306)) +(assert_return (invoke "ア") (i32.const 307)) +(assert_return (invoke "ᅡ") (i32.const 308)) +(assert_return (invoke "𐀀") (i32.const 309)) +(assert_return (invoke "𐊀") (i32.const 310)) +(assert_return (invoke "𐊠") (i32.const 311)) +(assert_return (invoke "𐌀") (i32.const 312)) +(assert_return (invoke "𐎠") (i32.const 313)) +(assert_return (invoke "𐒖") (i32.const 314)) +(assert_return (invoke "𐔀") (i32.const 315)) +(assert_return (invoke "𐝀") (i32.const 316)) +(assert_return (invoke "𐠀") (i32.const 317)) +(assert_return (invoke "𐤠") (i32.const 318)) +(assert_return (invoke "𐦀") (i32.const 319)) +(assert_return (invoke "𐦠") (i32.const 320)) +(assert_return (invoke "𐨀") (i32.const 321)) +(assert_return (invoke "𐬀") (i32.const 322)) +(assert_return (invoke "𐰀") (i32.const 323)) +(assert_return (invoke "𐰁") (i32.const 324)) +(assert_return (invoke "𐲀") (i32.const 325)) +(assert_return (invoke "𑀅") (i32.const 326)) +(assert_return (invoke "𑂃") (i32.const 327)) +(assert_return (invoke "𑄧") (i32.const 328)) +(assert_return (invoke "𑅐") (i32.const 329)) +(assert_return (invoke "𑆃") (i32.const 330)) +(assert_return (invoke "𑈀") (i32.const 331)) +(assert_return (invoke "𑊀") (i32.const 332)) +(assert_return (invoke "𑊰") (i32.const 333)) +(assert_return (invoke "𑌅") (i32.const 334)) +(assert_return (invoke "𑍰") (i32.const 335)) +(assert_return (invoke "𑐀") (i32.const 336)) +(assert_return (invoke "𑒁") (i32.const 337)) +(assert_return (invoke "𑖀") (i32.const 338)) +(assert_return (invoke "𑘀") (i32.const 339)) +(assert_return (invoke "𑚀") (i32.const 340)) +(assert_return (invoke "𑜒") (i32.const 341)) +(assert_return (invoke "𑜠") (i32.const 342)) +(assert_return (invoke "𑢡") (i32.const 343)) +(assert_return (invoke "𑫕") (i32.const 344)) +(assert_return (invoke "𑰀") (i32.const 345)) +(assert_return (invoke "𑲏") (i32.const 346)) +(assert_return (invoke "𑲯") (i32.const 347)) +(assert_return (invoke "𒀀") (i32.const 348)) +(assert_return (invoke "𖧕") (i32.const 349)) +(assert_return (invoke "𖩆") (i32.const 350)) +(assert_return (invoke "𖫧") (i32.const 351)) +(assert_return (invoke "𖽔") (i32.const 352)) +(assert_return (invoke "𛱁") (i32.const 353)) +(assert_return (invoke "𛱤") (i32.const 354)) +(assert_return (invoke "𞠣") (i32.const 355)) +(assert_return (invoke "🇦") (i32.const 356)) +(assert_return (invoke "Ɑ") (i32.const 357)) +(assert_return (invoke "Λ") (i32.const 358)) +(assert_return (invoke "Ɒ") (i32.const 359)) +(assert_return (invoke "ª") (i32.const 360)) +(assert_return (invoke "∀") (i32.const 361)) +(assert_return (invoke "₳") (i32.const 362)) +(assert_return (invoke "𐤀") (i32.const 363)) +(assert_return (invoke "Ⲁ") (i32.const 364)) +(assert_return (invoke "𐌰") (i32.const 365)) +(assert_return (invoke "Ά") (i32.const 366)) +(assert_return (invoke "Α") (i32.const 367)) +(assert_return (invoke "Ἀ") (i32.const 368)) +(assert_return (invoke "Ἁ") (i32.const 369)) +(assert_return (invoke "Ἂ") (i32.const 370)) +(assert_return (invoke "Ἃ") (i32.const 371)) +(assert_return (invoke "Ἄ") (i32.const 372)) +(assert_return (invoke "Ἅ") (i32.const 373)) +(assert_return (invoke "Ἆ") (i32.const 374)) +(assert_return (invoke "Ἇ") (i32.const 375)) +(assert_return (invoke "ᾈ") (i32.const 376)) +(assert_return (invoke "ᾉ") (i32.const 377)) +(assert_return (invoke "ᾊ") (i32.const 378)) +(assert_return (invoke "ᾋ") (i32.const 379)) +(assert_return (invoke "ᾌ") (i32.const 380)) +(assert_return (invoke "ᾍ") (i32.const 381)) +(assert_return (invoke "ᾎ") (i32.const 382)) +(assert_return (invoke "ᾏ") (i32.const 383)) +(assert_return (invoke "Ᾰ") (i32.const 384)) +(assert_return (invoke "Ᾱ") (i32.const 385)) +(assert_return (invoke "Ὰ") (i32.const 386)) +(assert_return (invoke "Ά") (i32.const 387)) +(assert_return (invoke "ᾼ") (i32.const 388)) +(assert_return (invoke "𝚨") (i32.const 389)) +(assert_return (invoke "𝛢") (i32.const 390)) +(assert_return (invoke "𝜜") (i32.const 391)) +(assert_return (invoke "𝝖") (i32.const 392)) +(assert_return (invoke "𝞐") (i32.const 393)) +(assert_return (invoke "⍶") (i32.const 394)) +(assert_return (invoke "⍺") (i32.const 395)) +(assert_return (invoke "⩜") (i32.const 396)) +(assert_return (invoke "ᗅ") (i32.const 397)) +(assert_return (invoke "Ꭺ") (i32.const 398)) +(assert_return (invoke ")˺˼𔗏⁾₎❩❫⟯﴿︶﹚)⦆❳❵⟧⟩⟫⟭⦈⦊⦖⸣⸥︘︸︺︼︾﹀﹂﹄﹈﹜﹞]}」»’”›❯") (i32.const 399)) +(assert_return (invoke "(˹˻𔗎⁽₍❨❪⟮﴾︵﹙(⦅❲❴⟦⟨⟪⟬⦇⦉⦕⸢⸤︗︷︹︻︽︿﹁﹃﹇﹛﹝[{「«‘“‹❮") (i32.const 400)) +(assert_return (invoke "𝪋𝪤") (i32.const 401)) +(assert_return (invoke "𝪋") (i32.const 402)) +(assert_return (invoke "½") (i32.const 403)) +(assert_return (invoke "1⁄2") (i32.const 404)) +(assert_return (invoke "1/2") (i32.const 405)) +(assert_return (invoke "୳") (i32.const 406)) +(assert_return (invoke "൴") (i32.const 407)) +(assert_return (invoke "⳽") (i32.const 408)) +(assert_return (invoke "꠱") (i32.const 409)) +(assert_return (invoke "𐅁") (i32.const 410)) +(assert_return (invoke "𐅵") (i32.const 411)) +(assert_return (invoke "𐅶") (i32.const 412)) +(assert_return (invoke "𐦽") (i32.const 413)) +(assert_return (invoke "𐹻") (i32.const 414)) +(assert_return (invoke """) (i32.const 415)) +(assert_return (invoke "\7f") (i32.const 416)) +(assert_return (invoke "\08") (i32.const 417)) +(assert_return (invoke "⌫") (i32.const 418)) +(assert_return (invoke "⌦") (i32.const 419)) +(assert_return (invoke "␈") (i32.const 420)) +(assert_return (invoke "␡") (i32.const 421)) +(assert_return (invoke "᷻") (i32.const 422)) +(assert_return (invoke "\0f") (i32.const 423)) +(assert_return (invoke "←") (i32.const 424)) +(assert_return (invoke "⌧") (i32.const 425)) +(assert_return (invoke "⍒") (i32.const 426)) +(assert_return (invoke "⍔") (i32.const 427)) +(assert_return (invoke "⍢") (i32.const 428)) +(assert_return (invoke "⍫") (i32.const 429)) +(assert_return (invoke "\1a") (i32.const 430)) +(assert_return (invoke "␦") (i32.const 431)) +(assert_return (invoke "␚") (i32.const 432)) +(assert_return (invoke "") (i32.const 433)) +(assert_return (invoke "?") (i32.const 434)) +(assert_return (invoke "¿") (i32.const 435)) +(assert_return (invoke "᥅") (i32.const 436)) +(assert_return (invoke ";") (i32.const 437)) +(assert_return (invoke "՞") (i32.const 438)) +(assert_return (invoke "؟") (i32.const 439)) +(assert_return (invoke "፧") (i32.const 440)) +(assert_return (invoke "⁇") (i32.const 441)) +(assert_return (invoke "⍰") (i32.const 442)) +(assert_return (invoke "❓") (i32.const 443)) +(assert_return (invoke "❔") (i32.const 444)) +(assert_return (invoke "⳺") (i32.const 445)) +(assert_return (invoke "⳻") (i32.const 446)) +(assert_return (invoke "⸮") (i32.const 447)) +(assert_return (invoke "㉄") (i32.const 448)) +(assert_return (invoke "꘏") (i32.const 449)) +(assert_return (invoke "꛷") (i32.const 450)) +(assert_return (invoke "︖") (i32.const 451)) +(assert_return (invoke "﹖") (i32.const 452)) +(assert_return (invoke "?") (i32.const 453)) +(assert_return (invoke "𑅃") (i32.const 454)) +(assert_return (invoke "𞥟") (i32.const 455)) +(assert_return (invoke "") (i32.const 456)) +(assert_return (invoke "𖡄") (i32.const 457)) +(assert_return (invoke "⯑") (i32.const 458)) +(assert_return (invoke "¶") (i32.const 459)) +(assert_return (invoke "⁋") (i32.const 460)) +(assert_return (invoke "܀") (i32.const 461)) +(assert_return (invoke "჻") (i32.const 462)) +(assert_return (invoke "፨") (i32.const 463)) +(assert_return (invoke "〷") (i32.const 464)) +(assert_return (invoke "❡") (i32.const 465)) +(assert_return (invoke "⸏") (i32.const 466)) +(assert_return (invoke "⸐") (i32.const 467)) +(assert_return (invoke "⸑") (i32.const 468)) +(assert_return (invoke "⸎") (i32.const 469)) +(assert_return (invoke "\14") (i32.const 470)) +(assert_return (invoke "☙") (i32.const 471)) +(assert_return (invoke "⸿") (i32.const 472)) +(assert_return (invoke "〇") (i32.const 473)) +(assert_return (invoke "๛") (i32.const 474)) +(assert_return (invoke "ꙮ") (i32.const 475)) +(assert_return (invoke "ϓ") (i32.const 476)) +(assert_return (invoke "ϔ") (i32.const 477)) +(assert_return (invoke "ẛ") (i32.const 478)) (module ;; Test that we can use indices instead of names to reference imports, ;; exports, functions and parameters. - (import "spectest" "print" (func (param i32))) - (func (import "spectest" "print") (param i32)) + (import "spectest" "print_i32" (func (param i32))) + (func (import "spectest" "print_i32") (param i32)) (func (param i32) (param i32) (call 0 (local.get 0)) (call 1 (local.get 1)) @@ -73,4 +1104,4 @@ (export "print32" (func 2)) ) -(invoke "print32" (i32.const 42) (i32.const 123)) +(assert_return (invoke "print32" (i32.const 42) (i32.const 123))) diff --git a/test/spec/nop.wast b/test/spec/nop.wast index 2348fdc1e..e8fe2de4b 100644 --- a/test/spec/nop.wast +++ b/test/spec/nop.wast @@ -21,6 +21,9 @@ (nop) (nop) (call $dummy) (nop) (i32.const 4) (nop) (nop) ) + (func (export "as-drop-first") (param i32) + (nop) (local.get 0) (drop) + ) (func (export "as-drop-last") (param i32) (local.get 0) (nop) (drop) ) @@ -28,6 +31,9 @@ (nop) (nop) (local.get 0) (nop) (nop) (drop) ) + (func (export "as-select-first") (param i32) (result i32) + (nop) (local.get 0) (local.get 0) (local.get 0) (select) + ) (func (export "as-select-mid1") (param i32) (result i32) (local.get 0) (nop) (local.get 0) (local.get 0) (select) ) @@ -43,74 +49,90 @@ ) (func (export "as-block-first") (result i32) - (block i32 (nop) (i32.const 2)) + (block (result i32) (nop) (i32.const 2)) ) (func (export "as-block-mid") (result i32) - (block i32 (call $dummy) (nop) (i32.const 2)) + (block (result i32) (call $dummy) (nop) (i32.const 2)) ) (func (export "as-block-last") (result i32) - (block i32 (nop) (call $dummy) (i32.const 3) (nop)) + (block (result i32) (nop) (call $dummy) (i32.const 3) (nop)) ) (func (export "as-block-everywhere") (result i32) - (block i32 (nop) (nop) (call $dummy) (nop) (i32.const 4) (nop) (nop)) + (block (result i32) + (nop) (nop) (call $dummy) (nop) (i32.const 4) (nop) (nop) + ) ) (func (export "as-loop-first") (result i32) - (loop i32 (nop) (i32.const 2)) + (loop (result i32) (nop) (i32.const 2)) ) (func (export "as-loop-mid") (result i32) - (loop i32 (call $dummy) (nop) (i32.const 2)) + (loop (result i32) (call $dummy) (nop) (i32.const 2)) ) (func (export "as-loop-last") (result i32) - (loop i32 (call $dummy) (i32.const 3) (nop)) + (loop (result i32) (call $dummy) (i32.const 3) (nop)) ) (func (export "as-loop-everywhere") (result i32) - (loop i32 (nop) (nop) (call $dummy) (nop) (i32.const 4) (nop) (nop)) + (loop (result i32) + (nop) (nop) (call $dummy) (nop) (i32.const 4) (nop) (nop) + ) ) (func (export "as-if-condition") (param i32) (local.get 0) (nop) (if (then (call $dummy))) ) (func (export "as-if-then") (param i32) - (if (local.get 0) (nop) (call $dummy)) + (if (local.get 0) (then (nop)) (else (call $dummy))) ) (func (export "as-if-else") (param i32) - (if (local.get 0) (call $dummy) (nop)) + (if (local.get 0) (then (call $dummy)) (else (nop))) ) + (func (export "as-br-first") (param i32) (result i32) + (block (result i32) (nop) (local.get 0) (br 0)) + ) (func (export "as-br-last") (param i32) (result i32) - (block i32 (local.get 0) (nop) (br 0)) + (block (result i32) (local.get 0) (nop) (br 0)) ) (func (export "as-br-everywhere") (param i32) (result i32) - (block i32 (nop) (nop) (local.get 0) (nop) (nop) (br 0)) + (block (result i32) (nop) (nop) (local.get 0) (nop) (nop) (br 0)) ) + (func (export "as-br_if-first") (param i32) (result i32) + (block (result i32) (nop) (local.get 0) (local.get 0) (br_if 0)) + ) (func (export "as-br_if-mid") (param i32) (result i32) - (block i32 (local.get 0) (nop) (local.get 0) (br_if 0)) + (block (result i32) (local.get 0) (nop) (local.get 0) (br_if 0)) ) (func (export "as-br_if-last") (param i32) (result i32) - (block i32 (local.get 0) (local.get 0) (nop) (br_if 0)) + (block (result i32) (local.get 0) (local.get 0) (nop) (br_if 0)) ) (func (export "as-br_if-everywhere") (param i32) (result i32) - (block i32 + (block (result i32) (nop) (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop) (br_if 0) ) ) + (func (export "as-br_table-first") (param i32) (result i32) + (block (result i32) (nop) (local.get 0) (local.get 0) (br_table 0 0)) + ) (func (export "as-br_table-mid") (param i32) (result i32) - (block i32 (local.get 0) (nop) (local.get 0) (br_table 0 0)) + (block (result i32) (local.get 0) (nop) (local.get 0) (br_table 0 0)) ) (func (export "as-br_table-last") (param i32) (result i32) - (block i32 (local.get 0) (local.get 0) (nop) (br_table 0 0)) + (block (result i32) (local.get 0) (local.get 0) (nop) (br_table 0 0)) ) (func (export "as-br_table-everywhere") (param i32) (result i32) - (block i32 + (block (result i32) (nop) (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop) (br_table 0 0) ) ) + (func (export "as-return-first") (param i32) (result i32) + (nop) (local.get 0) (return) + ) (func (export "as-return-last") (param i32) (result i32) (local.get 0) (nop) (return) ) @@ -118,6 +140,9 @@ (nop) (nop) (local.get 0) (nop) (nop) (return) ) + (func (export "as-call-first") (param i32 i32 i32) (result i32) + (nop) (local.get 0) (local.get 1) (local.get 2) (call $3-ary) + ) (func (export "as-call-mid1") (param i32 i32 i32) (result i32) (local.get 0) (nop) (local.get 1) (local.get 2) (call $3-ary) ) @@ -132,8 +157,9 @@ (nop) (nop) (local.get 2) (nop) (nop) (call $3-ary) ) - ;; TODO(stack): call_indirect, *_local, load*, store* - + (func (export "as-unary-first") (param i32) (result i32) + (nop) (local.get 0) (i32.ctz) + ) (func (export "as-unary-last") (param i32) (result i32) (local.get 0) (nop) (i32.ctz) ) @@ -141,6 +167,9 @@ (nop) (nop) (local.get 0) (nop) (nop) (i32.ctz) ) + (func (export "as-binary-first") (param i32) (result i32) + (nop) (local.get 0) (local.get 0) (i32.add) + ) (func (export "as-binary-mid") (param i32) (result i32) (local.get 0) (nop) (local.get 0) (i32.add) ) @@ -151,6 +180,9 @@ (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop) (i32.add) ) + (func (export "as-test-first") (param i32) (result i32) + (nop) (local.get 0) (i32.eqz) + ) (func (export "as-test-last") (param i32) (result i32) (local.get 0) (nop) (i32.eqz) ) @@ -158,6 +190,9 @@ (nop) (nop) (local.get 0) (nop) (nop) i32.eqz ) + (func (export "as-compare-first") (param i32) (result i32) + (nop) (local.get 0) (local.get 0) (i32.ne) + ) (func (export "as-compare-mid") (param i32) (result i32) (local.get 0) (nop) (local.get 0) (i32.ne) ) @@ -168,12 +203,104 @@ (nop) (local.get 0) (nop) (nop) (local.get 0) (nop) (nop) (i32.le_s) ) + (func (export "as-memory.grow-first") (param i32) (result i32) + (nop) (local.get 0) (memory.grow) + ) (func (export "as-memory.grow-last") (param i32) (result i32) (local.get 0) (nop) (memory.grow) ) (func (export "as-memory.grow-everywhere") (param i32) (result i32) (nop) (nop) (local.get 0) (nop) (nop) (memory.grow) ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (result i32) + (block (result i32) + (nop) (i32.const 1) (i32.const 2) (i32.const 0) + (call_indirect (type $check)) + ) + ) + (func (export "as-call_indirect-mid1") (result i32) + (block (result i32) + (i32.const 1) (nop) (i32.const 2) (i32.const 0) + (call_indirect (type $check)) + ) + ) + (func (export "as-call_indirect-mid2") (result i32) + (block (result i32) + (i32.const 1) (i32.const 2) (nop) (i32.const 0) + (call_indirect (type $check)) + ) + ) + (func (export "as-call_indirect-last") (result i32) + (block (result i32) + (i32.const 1) (i32.const 2) (i32.const 0) (nop) + (call_indirect (type $check)) + ) + ) + (func (export "as-call_indirect-everywhere") (result i32) + (block (result i32) + (nop) (nop) (i32.const 1) (nop) (nop) (i32.const 2) (nop) (nop) (i32.const 0) (nop) (nop) + (call_indirect (type $check)) + ) + ) + + (func (export "as-local.set-first") (param i32) (result i32) + (nop) (i32.const 2) (local.set 0) (local.get 0) + ) + (func (export "as-local.set-last") (param i32) (result i32) + (i32.const 2) (nop) (local.set 0) (local.get 0) + ) + (func (export "as-local.set-everywhere") (param i32) (result i32) + (nop) (nop) (i32.const 2) (nop) (nop) (local.set 0) (local.get 0) + ) + + (func (export "as-local.tee-first") (param i32) (result i32) + (nop) (i32.const 2) (local.tee 0) + ) + (func (export "as-local.tee-last") (param i32) (result i32) + (i32.const 2) (nop) (local.tee 0) + ) + (func (export "as-local.tee-everywhere") (param i32) (result i32) + (nop) (nop) (i32.const 2) (nop) (nop) (local.tee 0) + ) + + (global $a (mut i32) (i32.const 0)) + (func (export "as-global.set-first") (result i32) + (nop) (i32.const 2) (global.set $a) (global.get $a) + ) + (func (export "as-global.set-last") (result i32) + (i32.const 2) (nop) (global.set $a) (global.get $a) + ) + (func (export "as-global.set-everywhere") (result i32) + (nop) (nop) (i32.const 2) (nop) (nop) (global.set 0) + (global.get $a) + ) + + (func (export "as-load-first") (param i32) (result i32) + (nop) (local.get 0) (i32.load) + ) + (func (export "as-load-last") (param i32) (result i32) + (local.get 0) (nop) (i32.load) + ) + (func (export "as-load-everywhere") (param i32) (result i32) + (nop) (nop) (local.get 0) (nop) (nop) (i32.load) + ) + + (func (export "as-store-first") (param i32 i32) + (nop) (local.get 0) (local.get 1) (i32.store) + ) + (func (export "as-store-mid") (param i32 i32) + (local.get 0) (nop) (local.get 1) (i32.store) + ) + (func (export "as-store-last") (param i32 i32) + (local.get 0) (local.get 1) (nop) (i32.store) + ) + (func (export "as-store-everywhere") (param i32 i32) + (nop) (nop) (local.get 0) (nop) (nop) (local.get 1) (nop) (nop) (i32.store) + ) ) (assert_return (invoke "as-func-first") (i32.const 1)) @@ -181,9 +308,11 @@ (assert_return (invoke "as-func-last") (i32.const 3)) (assert_return (invoke "as-func-everywhere") (i32.const 4)) +(assert_return (invoke "as-drop-first" (i32.const 0))) (assert_return (invoke "as-drop-last" (i32.const 0))) (assert_return (invoke "as-drop-everywhere" (i32.const 0))) +(assert_return (invoke "as-select-first" (i32.const 3)) (i32.const 3)) (assert_return (invoke "as-select-mid1" (i32.const 3)) (i32.const 3)) (assert_return (invoke "as-select-mid2" (i32.const 3)) (i32.const 3)) (assert_return (invoke "as-select-last" (i32.const 3)) (i32.const 3)) @@ -206,42 +335,79 @@ (assert_return (invoke "as-if-else" (i32.const 0))) (assert_return (invoke "as-if-else" (i32.const 3))) +(assert_return (invoke "as-br-first" (i32.const 5)) (i32.const 5)) (assert_return (invoke "as-br-last" (i32.const 6)) (i32.const 6)) (assert_return (invoke "as-br-everywhere" (i32.const 7)) (i32.const 7)) +(assert_return (invoke "as-br_if-first" (i32.const 4)) (i32.const 4)) (assert_return (invoke "as-br_if-mid" (i32.const 5)) (i32.const 5)) (assert_return (invoke "as-br_if-last" (i32.const 6)) (i32.const 6)) (assert_return (invoke "as-br_if-everywhere" (i32.const 7)) (i32.const 7)) +(assert_return (invoke "as-br_table-first" (i32.const 4)) (i32.const 4)) (assert_return (invoke "as-br_table-mid" (i32.const 5)) (i32.const 5)) (assert_return (invoke "as-br_table-last" (i32.const 6)) (i32.const 6)) (assert_return (invoke "as-br_table-everywhere" (i32.const 7)) (i32.const 7)) +(assert_return (invoke "as-return-first" (i32.const 5)) (i32.const 5)) (assert_return (invoke "as-return-last" (i32.const 6)) (i32.const 6)) (assert_return (invoke "as-return-everywhere" (i32.const 7)) (i32.const 7)) +(assert_return (invoke "as-call-first" (i32.const 3) (i32.const 1) (i32.const 2)) (i32.const 2)) (assert_return (invoke "as-call-mid1" (i32.const 3) (i32.const 1) (i32.const 2)) (i32.const 2)) (assert_return (invoke "as-call-mid2" (i32.const 0) (i32.const 3) (i32.const 1)) (i32.const 2)) (assert_return (invoke "as-call-last" (i32.const 10) (i32.const 9) (i32.const -1)) (i32.const 20)) (assert_return (invoke "as-call-everywhere" (i32.const 2) (i32.const 1) (i32.const 5)) (i32.const -2)) +(assert_return (invoke "as-unary-first" (i32.const 30)) (i32.const 1)) (assert_return (invoke "as-unary-last" (i32.const 30)) (i32.const 1)) (assert_return (invoke "as-unary-everywhere" (i32.const 12)) (i32.const 2)) +(assert_return (invoke "as-binary-first" (i32.const 3)) (i32.const 6)) (assert_return (invoke "as-binary-mid" (i32.const 3)) (i32.const 6)) (assert_return (invoke "as-binary-last" (i32.const 3)) (i32.const 6)) (assert_return (invoke "as-binary-everywhere" (i32.const 3)) (i32.const 6)) +(assert_return (invoke "as-test-first" (i32.const 0)) (i32.const 1)) (assert_return (invoke "as-test-last" (i32.const 0)) (i32.const 1)) (assert_return (invoke "as-test-everywhere" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-compare-first" (i32.const 3)) (i32.const 0)) (assert_return (invoke "as-compare-mid" (i32.const 3)) (i32.const 0)) (assert_return (invoke "as-compare-last" (i32.const 3)) (i32.const 0)) (assert_return (invoke "as-compare-everywhere" (i32.const 3)) (i32.const 1)) +(assert_return (invoke "as-memory.grow-first" (i32.const 0)) (i32.const 1)) (assert_return (invoke "as-memory.grow-last" (i32.const 2)) (i32.const 1)) (assert_return (invoke "as-memory.grow-everywhere" (i32.const 12)) (i32.const 3)) +(assert_return (invoke "as-call_indirect-first") (i32.const 1)) +(assert_return (invoke "as-call_indirect-mid1") (i32.const 1)) +(assert_return (invoke "as-call_indirect-mid2") (i32.const 1)) +(assert_return (invoke "as-call_indirect-last") (i32.const 1)) +(assert_return (invoke "as-call_indirect-everywhere") (i32.const 1)) + +(assert_return (invoke "as-local.set-first" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-local.set-last" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-local.set-everywhere" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-local.tee-first" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-local.tee-last" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-local.tee-everywhere" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-global.set-first") (i32.const 2)) +(assert_return (invoke "as-global.set-last") (i32.const 2)) +(assert_return (invoke "as-global.set-everywhere") (i32.const 2)) + +(assert_return (invoke "as-load-first" (i32.const 100)) (i32.const 0)) +(assert_return (invoke "as-load-last" (i32.const 100)) (i32.const 0)) +(assert_return (invoke "as-load-everywhere" (i32.const 100)) (i32.const 0)) + +(assert_return (invoke "as-store-first" (i32.const 0) (i32.const 1))) +(assert_return (invoke "as-store-mid" (i32.const 0) (i32.const 2))) +(assert_return (invoke "as-store-last" (i32.const 0) (i32.const 3))) +(assert_return (invoke "as-store-everywhere" (i32.const 0) (i32.const 4))) + (assert_invalid (module (func $type-i32 (result i32) (nop))) "type mismatch" diff --git a/test/spec/old_address.wast b/test/spec/old_address.wast new file mode 100644 index 000000000..a3fb19b83 --- /dev/null +++ b/test/spec/old_address.wast @@ -0,0 +1,34 @@ +(module + (import "spectest" "print" (func $print (param i32))) + + (memory 1) + (data (i32.const 0) "abcdefghijklmnopqrstuvwxyz") + + (func (export "good") (param $i i32) + (call $print (i32.load8_u offset=0 (local.get $i))) ;; 97 'a' + (call $print (i32.load8_u offset=1 (local.get $i))) ;; 98 'b' + (call $print (i32.load8_u offset=2 (local.get $i))) ;; 99 'c' + (call $print (i32.load8_u offset=25 (local.get $i))) ;; 122 'z' + + (call $print (i32.load16_u offset=0 (local.get $i))) ;; 25185 'ab' + (call $print (i32.load16_u align=1 (local.get $i))) ;; 25185 'ab' + (call $print (i32.load16_u offset=1 align=1 (local.get $i))) ;; 25442 'bc' + (call $print (i32.load16_u offset=2 (local.get $i))) ;; 25699 'cd' + (call $print (i32.load16_u offset=25 align=1 (local.get $i))) ;; 122 'z\0' + + (call $print (i32.load offset=0 (local.get $i))) ;; 1684234849 'abcd' + (call $print (i32.load offset=1 align=1 (local.get $i))) ;; 1701077858 'bcde' + (call $print (i32.load offset=2 align=2 (local.get $i))) ;; 1717920867 'cdef' + (call $print (i32.load offset=25 align=1 (local.get $i))) ;; 122 'z\0\0\0' + ) + + (func (export "bad") (param $i i32) + (drop (i32.load offset=4294967295 (local.get $i))) + ) +) + +(invoke "good" (i32.const 0)) +(invoke "good" (i32.const 65507)) +(assert_trap (invoke "good" (i32.const 65508)) "out of bounds memory access") +(assert_trap (invoke "bad" (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "bad" (i32.const 1)) "out of bounds memory access") diff --git a/test/spec/old_block.wast b/test/spec/old_block.wast new file mode 100644 index 000000000..505560885 --- /dev/null +++ b/test/spec/old_block.wast @@ -0,0 +1,284 @@ +;; Test `block` operator + +(module + ;; Auxiliary definition + (func $dummy) + + (func (export "empty") + (block) + (block $l) + ) + + (func (export "singular") (result i32) + (block (nop)) + (block i32 (i32.const 7)) + ) + + (func (export "multi") (result i32) + (block (call $dummy) (call $dummy) (call $dummy) (call $dummy)) + (block i32 (call $dummy) (call $dummy) (call $dummy) (i32.const 8)) + ) + + (func (export "nested") (result i32) + (block i32 + (block (call $dummy) (block) (nop)) + (block i32 (call $dummy) (i32.const 9)) + ) + ) + + (func (export "deep") (result i32) + (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 + (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 + (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 + (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 + (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 + (block i32 (block i32 (block i32 (block i32 (block i32 (block i32 + (block i32 (block i32 (call $dummy) (i32.const 150))) + )))))) + )))))) + )))))) + )))))) + )))))) + )))))) + ) + + (func (export "as-unary-operand") (result i32) + (i32.ctz (block i32 (call $dummy) (i32.const 13))) + ) + (func (export "as-binary-operand") (result i32) + (i32.mul + (block i32 (call $dummy) (i32.const 3)) + (block i32 (call $dummy) (i32.const 4)) + ) + ) + (func (export "as-test-operand") (result i32) + (i32.eqz (block i32 (call $dummy) (i32.const 13))) + ) + (func (export "as-compare-operand") (result i32) + (f32.gt + (block f32 (call $dummy) (f32.const 3)) + (block f32 (call $dummy) (f32.const 3)) + ) + ) + + (func (export "break-bare") (result i32) + (block (br 0) (unreachable)) + (block (br_if 0 (i32.const 1)) (unreachable)) + (block (br_table 0 (i32.const 0)) (unreachable)) + (block (br_table 0 0 0 (i32.const 1)) (unreachable)) + (i32.const 19) + ) + (func (export "break-value") (result i32) + (block i32 (br 0 (i32.const 18)) (i32.const 19)) + ) + (func (export "break-repeated") (result i32) + (block i32 + (br 0 (i32.const 18)) + (br 0 (i32.const 19)) + (drop (br_if 0 (i32.const 20) (i32.const 0))) + (drop (br_if 0 (i32.const 20) (i32.const 1))) + (br 0 (i32.const 21)) + (br_table 0 (i32.const 22) (i32.const 4)) + (br_table 0 0 0 (i32.const 23) (i32.const 1)) + (i32.const 21) + ) + ) + (func (export "break-inner") (result i32) + (local i32) + (local.set 0 (i32.const 0)) + (local.set 0 (i32.add (local.get 0) (block i32 (block i32 (br 1 (i32.const 0x1)))))) + (local.set 0 (i32.add (local.get 0) (block i32 (block (br 0)) (i32.const 0x2)))) + (local.set 0 + (i32.add (local.get 0) (block i32 (i32.ctz (br 0 (i32.const 0x4))))) + ) + (local.set 0 + (i32.add (local.get 0) (block i32 (i32.ctz (block i32 (br 1 (i32.const 0x8)))))) + ) + (local.get 0) + ) + + (func (export "effects") (result i32) + (local i32) + (block + (local.set 0 (i32.const 1)) + (local.set 0 (i32.mul (local.get 0) (i32.const 3))) + (local.set 0 (i32.sub (local.get 0) (i32.const 5))) + (local.set 0 (i32.mul (local.get 0) (i32.const 7))) + (br 0) + (local.set 0 (i32.mul (local.get 0) (i32.const 100))) + ) + (i32.eq (local.get 0) (i32.const -14)) + ) +) + +(assert_return (invoke "empty")) +(assert_return (invoke "singular") (i32.const 7)) +(assert_return (invoke "multi") (i32.const 8)) +(assert_return (invoke "nested") (i32.const 9)) +(assert_return (invoke "deep") (i32.const 150)) + +(assert_return (invoke "as-unary-operand") (i32.const 0)) +(assert_return (invoke "as-binary-operand") (i32.const 12)) +(assert_return (invoke "as-test-operand") (i32.const 0)) +(assert_return (invoke "as-compare-operand") (i32.const 0)) + +(assert_return (invoke "break-bare") (i32.const 19)) +(assert_return (invoke "break-value") (i32.const 18)) +(assert_return (invoke "break-repeated") (i32.const 18)) +(assert_return (invoke "break-inner") (i32.const 0xf)) + +(assert_return (invoke "effects") (i32.const 1)) + +(assert_invalid + (module (func $type-empty-i32 (result i32) (block))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-i64 (result i64) (block))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f32 (result f32) (block))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f64 (result f64) (block))) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-num-vs-void + (block (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-num (result i32) + (block (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num (result i32) + (block (f32.const 0)) + )) + "type mismatch" +) + +(; TODO(stack): soft failure +(assert_invalid + (module (func $type-value-num-vs-void-after-break + (block (br 0) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-num-after-break (result i32) + (block (i32.const 1) (br 0) (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num-after-break (result i32) + (block (i32.const 1) (br 0) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-second-void-vs-num (result i32) + (block i32 (br 0 (i32.const 1)) (br 0 (nop))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-second-num-vs-num (result i32) + (block i32 (br 0 (i32.const 1)) (br 0 (f64.const 1))) + )) + "type mismatch" +) +;) + +(assert_invalid + (module (func $type-break-last-void-vs-num (result i32) + (block i32 (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-void-vs-num (result i32) + (block i32 (br 0) (i32.const 1)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-void-vs-num (result i32) + (block (br 0 (nop)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-num-vs-num (result i32) + (block (br 0 (i64.const 1)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-void-vs-num (result i32) + (block (br 0 (nop)) (br 0 (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-num-vs-num (result i32) + (block (br 0 (i64.const 1)) (br 0 (i32.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-nested-num-vs-void + (block i32 (block i32 (br 1 (i32.const 1))) (br 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-empty-vs-num (result i32) + (block (block (br 1)) (br 0 (i32.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-nested-void-vs-num (result i32) + (block (block (br 1 (nop))) (br 0 (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-num-vs-num (result i32) + (block (block (br 1 (i64.const 1))) (br 0 (i32.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-operand-empty-vs-num (result i32) + (i32.ctz (block (br 0))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-break-operand-void-vs-num (result i32) + (i64.ctz (block (br 0 (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-operand-num-vs-num (result i32) + (i64.ctz (block (br 0 (i64.const 9)))) + )) + "type mismatch" +) + diff --git a/test/spec/old_br_if.wast b/test/spec/old_br_if.wast new file mode 100644 index 000000000..44aeffbe7 --- /dev/null +++ b/test/spec/old_br_if.wast @@ -0,0 +1,306 @@ +;; Test `br_if` operator + +(module + (func $dummy) + + (func (export "as-block-first") (param i32) (result i32) + (block (br_if 0 (local.get 0)) (return (i32.const 2))) (i32.const 3) + ) + (func (export "as-block-mid") (param i32) (result i32) + (block (call $dummy) (br_if 0 (local.get 0)) (return (i32.const 2))) + (i32.const 3) + ) + (func (export "as-block-last") (param i32) + (block (call $dummy) (call $dummy) (br_if 0 (local.get 0))) + ) + (func (export "as-block-first-value") (param i32) (result i32) + (block i32 (drop (br_if 0 (i32.const 10) (local.get 0))) (return (i32.const 11))) + ) + (func (export "as-block-mid-value") (param i32) (result i32) + (block i32 (call $dummy) (drop (br_if 0 (i32.const 20) (local.get 0))) (return (i32.const 21))) + ) + (func (export "as-block-last-value") (param i32) (result i32) + (block i32 + (call $dummy) (call $dummy) (br_if 0 (i32.const 11) (local.get 0)) + ) + ) + + (func (export "as-loop-first") (param i32) (result i32) + (block (loop (br_if 1 (local.get 0)) (return (i32.const 2)))) (i32.const 3) + ) + (func (export "as-loop-mid") (param i32) (result i32) + (block (loop (call $dummy) (br_if 1 (local.get 0)) (return (i32.const 2)))) + (i32.const 4) + ) + (func (export "as-loop-last") (param i32) + (loop (call $dummy) (br_if 1 (local.get 0))) + ) + + (func (export "as-if-then") (param i32 i32) + (block (if (local.get 0) (br_if 1 (local.get 1)) (call $dummy))) + ) + (func (export "as-if-else") (param i32 i32) + (block (if (local.get 0) (call $dummy) (br_if 1 (local.get 1)))) + ) + + (func (export "nested-block-value") (param i32) (result i32) + (i32.add + (i32.const 1) + (block i32 + (drop (i32.const 2)) + (i32.add + (i32.const 4) + (block i32 + (drop (br_if 1 (i32.const 8) (local.get 0))) + (i32.const 16) + ) + ) + ) + ) + ) + + (func (export "nested-br-value") (param i32) (result i32) + (i32.add + (i32.const 1) + (block i32 + (drop (i32.const 2)) + (br 0 + (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4)) + ) + (i32.const 16) + ) + ) + ) + + (func (export "nested-br_if-value") (param i32) (result i32) + (i32.add + (i32.const 1) + (block i32 + (drop (i32.const 2)) + (drop (br_if 0 + (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4)) + (i32.const 1) + )) + (i32.const 16) + ) + ) + ) + + (func (export "nested-br_if-value-cond") (param i32) (result i32) + (i32.add + (i32.const 1) + (block i32 + (drop (i32.const 2)) + (drop (br_if 0 + (i32.const 4) + (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1)) + )) + (i32.const 16) + ) + ) + ) + + (func (export "nested-br_table-value") (param i32) (result i32) + (i32.add + (i32.const 1) + (block i32 + (drop (i32.const 2)) + (br_table 0 + (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 4)) + (i32.const 1) + ) + (i32.const 16) + ) + ) + ) + + (func (export "nested-br_table-value-index") (param i32) (result i32) + (i32.add + (i32.const 1) + (block i32 + (drop (i32.const 2)) + (br_table 0 + (i32.const 4) + (block i32 (drop (br_if 1 (i32.const 8) (local.get 0))) (i32.const 1)) + ) + (i32.const 16) + ) + ) + ) +) + +(assert_return (invoke "as-block-first" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-block-first" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "as-block-mid" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-block-mid" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "as-block-last" (i32.const 0))) +(assert_return (invoke "as-block-last" (i32.const 1))) +(assert_return (invoke "as-block-last-value" (i32.const 0)) (i32.const 11)) +(assert_return (invoke "as-block-last-value" (i32.const 1)) (i32.const 11)) + +(assert_return (invoke "as-loop-first" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-loop-first" (i32.const 1)) (i32.const 3)) +(assert_return (invoke "as-loop-mid" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-loop-mid" (i32.const 1)) (i32.const 4)) +(assert_return (invoke "as-loop-last" (i32.const 0))) +(assert_return (invoke "as-loop-last" (i32.const 1))) + +(assert_return (invoke "as-if-then" (i32.const 0) (i32.const 0))) +(assert_return (invoke "as-if-then" (i32.const 4) (i32.const 0))) +(assert_return (invoke "as-if-then" (i32.const 0) (i32.const 1))) +(assert_return (invoke "as-if-then" (i32.const 4) (i32.const 1))) +(assert_return (invoke "as-if-else" (i32.const 0) (i32.const 0))) +(assert_return (invoke "as-if-else" (i32.const 3) (i32.const 0))) +(assert_return (invoke "as-if-else" (i32.const 0) (i32.const 1))) +(assert_return (invoke "as-if-else" (i32.const 3) (i32.const 1))) + +(assert_return (invoke "nested-block-value" (i32.const 0)) (i32.const 21)) +(assert_return (invoke "nested-block-value" (i32.const 1)) (i32.const 9)) +(assert_return (invoke "nested-br-value" (i32.const 0)) (i32.const 5)) +(assert_return (invoke "nested-br-value" (i32.const 1)) (i32.const 9)) +(assert_return (invoke "nested-br_if-value" (i32.const 0)) (i32.const 5)) +(assert_return (invoke "nested-br_if-value" (i32.const 1)) (i32.const 9)) +(assert_return (invoke "nested-br_if-value-cond" (i32.const 0)) (i32.const 5)) +(assert_return (invoke "nested-br_if-value-cond" (i32.const 1)) (i32.const 9)) +(assert_return (invoke "nested-br_table-value" (i32.const 0)) (i32.const 5)) +(assert_return (invoke "nested-br_table-value" (i32.const 1)) (i32.const 9)) +(assert_return (invoke "nested-br_table-value-index" (i32.const 0)) (i32.const 5)) +(assert_return (invoke "nested-br_table-value-index" (i32.const 1)) (i32.const 9)) + +(assert_invalid + (module (func $type-false-i32 (block (i32.ctz (br_if 0 (i32.const 0)))))) + "type mismatch" +) +(assert_invalid + (module (func $type-false-i64 (block (i64.ctz (br_if 0 (i32.const 0)))))) + "type mismatch" +) +(assert_invalid + (module (func $type-false-f32 (block (f32.neg (br_if 0 (i32.const 0)))))) + "type mismatch" +) +(assert_invalid + (module (func $type-false-f64 (block (f64.neg (br_if 0 (i32.const 0)))))) + "type mismatch" +) + +(assert_invalid + (module (func $type-true-i32 (block (i32.ctz (br_if 0 (i32.const 1)))))) + "type mismatch" +) +(assert_invalid + (module (func $type-true-i64 (block (i64.ctz (br_if 0 (i64.const 1)))))) + "type mismatch" +) +(assert_invalid + (module (func $type-true-f32 (block (f32.neg (br_if 0 (f32.const 1)))))) + "type mismatch" +) +(assert_invalid + (module (func $type-true-f64 (block (f64.neg (br_if 0 (i64.const 1)))))) + "type mismatch" +) + +(assert_invalid + (module (func $type-false-arg-void-vs-num (result i32) + (block i32 (br_if 0 (i32.const 0)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-true-arg-void-vs-num (result i32) + (block i32 (br_if 0 (i32.const 1)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-false-arg-num-vs-void + (block (br_if 0 (i32.const 0) (i32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-true-arg-num-vs-void + (block (br_if 0 (i32.const 0) (i32.const 1))) + )) + "type mismatch" +) + +(; TODO(stack): soft failure +(assert_invalid + (module (func $type-false-arg-poly-vs-empty + (block (br_if 0 (unreachable) (i32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-true-arg-poly-vs-empty + (block (br_if 0 (unreachable) (i32.const 1))) + )) + "type mismatch" +) +;) + +(assert_invalid + (module (func $type-false-arg-void-vs-num (result i32) + (block i32 (br_if 0 (nop) (i32.const 0)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-true-arg-void-vs-num (result i32) + (block i32 (br_if 0 (nop) (i32.const 1)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-false-arg-num-vs-num (result i32) + (block i32 (drop (br_if 0 (i64.const 1) (i32.const 0))) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-true-arg-num-vs-num (result i32) + (block i32 (drop (br_if 0 (i64.const 1) (i32.const 0))) (i32.const 1)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-cond-void-vs-i32 + (block (br_if 0 (nop))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-cond-num-vs-i32 + (block (br_if 0 (i64.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-arg-cond-void-vs-i32 (result i32) + (block i32 (br_if 0 (i32.const 0) (nop)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-arg-cond-num-vs-i32 (result i32) + (block i32 (br_if 0 (i32.const 0) (i64.const 0)) (i32.const 1)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $unbound-label (br_if 1 (i32.const 1)))) + "unknown label" +) +(assert_invalid + (module (func $unbound-nested-label (block (block (br_if 5 (i32.const 1)))))) + "unknown label" +) +(assert_invalid + (module (func $large-label (br_if 0x10000001 (i32.const 1)))) + "unknown label" +) + diff --git a/test/spec/old_call.wast b/test/spec/old_call.wast new file mode 100644 index 000000000..00bd97397 --- /dev/null +++ b/test/spec/old_call.wast @@ -0,0 +1,233 @@ +;; Test `call` operator + +(module + ;; Auxiliary definitions + (func $const-i32 (result i32) (i32.const 0x132)) + (func $const-i64 (result i64) (i64.const 0x164)) + (func $const-f32 (result f32) (f32.const 0xf32)) + (func $const-f64 (result f64) (f64.const 0xf64)) + + (func $id-i32 (param i32) (result i32) (local.get 0)) + (func $id-i64 (param i64) (result i64) (local.get 0)) + (func $id-f32 (param f32) (result f32) (local.get 0)) + (func $id-f64 (param f64) (result f64) (local.get 0)) + + (func $f32-i32 (param f32 i32) (result i32) (local.get 1)) + (func $i32-i64 (param i32 i64) (result i64) (local.get 1)) + (func $f64-f32 (param f64 f32) (result f32) (local.get 1)) + (func $i64-f64 (param i64 f64) (result f64) (local.get 1)) + + ;; Typing + + (func (export "type-i32") (result i32) (call $const-i32)) + (func (export "type-i64") (result i64) (call $const-i64)) + (func (export "type-f32") (result f32) (call $const-f32)) + (func (export "type-f64") (result f64) (call $const-f64)) + + (func (export "type-first-i32") (result i32) (call $id-i32 (i32.const 32))) + (func (export "type-first-i64") (result i64) (call $id-i64 (i64.const 64))) + (func (export "type-first-f32") (result f32) (call $id-f32 (f32.const 1.32))) + (func (export "type-first-f64") (result f64) (call $id-f64 (f64.const 1.64))) + + (func (export "type-second-i32") (result i32) + (call $f32-i32 (f32.const 32.1) (i32.const 32)) + ) + (func (export "type-second-i64") (result i64) + (call $i32-i64 (i32.const 32) (i64.const 64)) + ) + (func (export "type-second-f32") (result f32) + (call $f64-f32 (f64.const 64) (f32.const 32)) + ) + (func (export "type-second-f64") (result f64) + (call $i64-f64 (i64.const 64) (f64.const 64.1)) + ) + + ;; Recursion + + (func $fac (export "fac") (param i64) (result i64) + (if i64 (i64.eqz (local.get 0)) + (i64.const 1) + (i64.mul (local.get 0) (call $fac (i64.sub (local.get 0) (i64.const 1)))) + ) + ) + + (func $fac-acc (export "fac-acc") (param i64 i64) (result i64) + (if i64 (i64.eqz (local.get 0)) + (local.get 1) + (call $fac-acc + (i64.sub (local.get 0) (i64.const 1)) + (i64.mul (local.get 0) (local.get 1)) + ) + ) + ) + + (func $fib (export "fib") (param i64) (result i64) + (if i64 (i64.le_u (local.get 0) (i64.const 1)) + (i64.const 1) + (i64.add + (call $fib (i64.sub (local.get 0) (i64.const 2))) + (call $fib (i64.sub (local.get 0) (i64.const 1))) + ) + ) + ) + + (func $even (export "even") (param i64) (result i32) + (if i32 (i64.eqz (local.get 0)) + (i32.const 44) + (call $odd (i64.sub (local.get 0) (i64.const 1))) + ) + ) + (func $odd (export "odd") (param i64) (result i32) + (if i32 (i64.eqz (local.get 0)) + (i32.const 99) + (call $even (i64.sub (local.get 0) (i64.const 1))) + ) + ) + + ;; Stack exhaustion + + ;; Implementations are required to have every call consume some abstract + ;; resource towards exhausting some abstract finite limit, such that + ;; infinitely recursive test cases reliably trap in finite time. This is + ;; because otherwise applications could come to depend on it on those + ;; implementations and be incompatible with implementations that don't do + ;; it (or don't do it under the same circumstances). + + (func $runaway (export "runaway") (call $runaway)) + + (func $mutual-runaway1 (export "mutual-runaway") (call $mutual-runaway2)) + (func $mutual-runaway2 (call $mutual-runaway1)) +) + +(assert_return (invoke "type-i32") (i32.const 0x132)) +(assert_return (invoke "type-i64") (i64.const 0x164)) +(assert_return (invoke "type-f32") (f32.const 0xf32)) +(assert_return (invoke "type-f64") (f64.const 0xf64)) + +(assert_return (invoke "type-first-i32") (i32.const 32)) +(assert_return (invoke "type-first-i64") (i64.const 64)) +(assert_return (invoke "type-first-f32") (f32.const 1.32)) +(assert_return (invoke "type-first-f64") (f64.const 1.64)) + +(assert_return (invoke "type-second-i32") (i32.const 32)) +(assert_return (invoke "type-second-i64") (i64.const 64)) +(assert_return (invoke "type-second-f32") (f32.const 32)) +(assert_return (invoke "type-second-f64") (f64.const 64.1)) + +(assert_return (invoke "fac" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "fac" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fac" (i64.const 5)) (i64.const 120)) +(assert_return (invoke "fac" (i64.const 25)) (i64.const 7034535277573963776)) +(assert_return (invoke "fac-acc" (i64.const 0) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fac-acc" (i64.const 1) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fac-acc" (i64.const 5) (i64.const 1)) (i64.const 120)) +(assert_return + (invoke "fac-acc" (i64.const 25) (i64.const 1)) + (i64.const 7034535277573963776) +) + +(assert_return (invoke "fib" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "fib" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fib" (i64.const 2)) (i64.const 2)) +(assert_return (invoke "fib" (i64.const 5)) (i64.const 8)) +(assert_return (invoke "fib" (i64.const 20)) (i64.const 10946)) + +(assert_return (invoke "even" (i64.const 0)) (i32.const 44)) +(assert_return (invoke "even" (i64.const 1)) (i32.const 99)) +(assert_return (invoke "even" (i64.const 10)) (i32.const 44)) +(assert_return (invoke "even" (i64.const 7)) (i32.const 99)) +(assert_return (invoke "odd" (i64.const 0)) (i32.const 99)) +(assert_return (invoke "odd" (i64.const 1)) (i32.const 44)) +(assert_return (invoke "odd" (i64.const 20)) (i32.const 99)) +(assert_return (invoke "odd" (i64.const 7)) (i32.const 44)) + +(assert_trap (invoke "runaway") "call stack exhausted") +(assert_trap (invoke "mutual-runaway") "call stack exhausted") + + +;; Invalid typing + +(assert_invalid + (module + (func $type-void-vs-num (i32.eqz (call 1))) + (func) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-num-vs-num (i32.eqz (call 1))) + (func (result i64) (i64.const 1)) + ) + "type mismatch" +) + +(assert_invalid + (module + (func $arity-0-vs-1 (call 1)) + (func (param i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $arity-0-vs-2 (call 1)) + (func (param f64 i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $arity-1-vs-0 (call 1 (i32.const 1))) + (func) + ) + "type mismatch" +) +(assert_invalid + (module + (func $arity-2-vs-0 (call 1 (f64.const 2) (i32.const 1))) + (func) + ) + "type mismatch" +) + +(assert_invalid + (module + (func $type-first-void-vs-num (call 1 (nop) (i32.const 1))) + (func (param i32 i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-second-void-vs-num (call 1 (i32.const 1) (nop))) + (func (param i32 i32)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-first-num-vs-num (call 1 (f64.const 1) (i32.const 1))) + (func (param i32 f64)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-second-num-vs-num (call 1 (i32.const 1) (f64.const 1))) + (func (param f64 i32)) + ) + "type mismatch" +) + + +;; Unbound function + +(assert_invalid + (module (func $unbound-func (call 1))) + "unknown function" +) +(assert_invalid + (module (func $large-func (call 1012321300))) + "unknown function" +) diff --git a/test/spec/old_call_indirect.wast b/test/spec/old_call_indirect.wast new file mode 100644 index 000000000..41f4316f6 --- /dev/null +++ b/test/spec/old_call_indirect.wast @@ -0,0 +1,362 @@ +;; Test `call_indirect` operator + +(module + ;; Auxiliary definitions + (type $proc (func)) + (type $out-i32 (func (result i32))) + (type $out-i64 (func (result i64))) + (type $out-f32 (func (result f32))) + (type $out-f64 (func (result f64))) + (type $over-i32 (func (param i32) (result i32))) + (type $over-i64 (func (param i64) (result i64))) + (type $over-f32 (func (param f32) (result f32))) + (type $over-f64 (func (param f64) (result f64))) + (type $f32-i32 (func (param f32 i32) (result i32))) + (type $i32-i64 (func (param i32 i64) (result i64))) + (type $f64-f32 (func (param f64 f32) (result f32))) + (type $i64-f64 (func (param i64 f64) (result f64))) + (type $over-i32-duplicate (func (param i32) (result i32))) + (type $over-i64-duplicate (func (param i64) (result i64))) + (type $over-f32-duplicate (func (param f32) (result f32))) + (type $over-f64-duplicate (func (param f64) (result f64))) + + (func $const-i32 (type $out-i32) (i32.const 0x132)) + (func $const-i64 (type $out-i64) (i64.const 0x164)) + (func $const-f32 (type $out-f32) (f32.const 0xf32)) + (func $const-f64 (type $out-f64) (f64.const 0xf64)) + + (func $id-i32 (type $over-i32) (local.get 0)) + (func $id-i64 (type $over-i64) (local.get 0)) + (func $id-f32 (type $over-f32) (local.get 0)) + (func $id-f64 (type $over-f64) (local.get 0)) + + (func $i32-i64 (type $i32-i64) (local.get 1)) + (func $i64-f64 (type $i64-f64) (local.get 1)) + (func $f32-i32 (type $f32-i32) (local.get 1)) + (func $f64-f32 (type $f64-f32) (local.get 1)) + + (func $over-i32-duplicate (type $over-i32-duplicate) (local.get 0)) + (func $over-i64-duplicate (type $over-i64-duplicate) (local.get 0)) + (func $over-f32-duplicate (type $over-f32-duplicate) (local.get 0)) + (func $over-f64-duplicate (type $over-f64-duplicate) (local.get 0)) + + (table funcref + (elem + $const-i32 $const-i64 $const-f32 $const-f64 + $id-i32 $id-i64 $id-f32 $id-f64 + $f32-i32 $i32-i64 $f64-f32 $i64-f64 + $fac $fib $even $odd + $runaway $mutual-runaway1 $mutual-runaway2 + $over-i32-duplicate $over-i64-duplicate + $over-f32-duplicate $over-f64-duplicate + ) + ) + + ;; Typing + + (func (export "type-i32") (result i32) (call_indirect (type $out-i32) (i32.const 0))) + (func (export "type-i64") (result i64) (call_indirect (type $out-i64) (i32.const 1))) + (func (export "type-f32") (result f32) (call_indirect (type $out-f32) (i32.const 2))) + (func (export "type-f64") (result f64) (call_indirect (type $out-f64) (i32.const 3))) + + (func (export "type-index") (result i64) + (call_indirect (type $over-i64) (i64.const 100) (i32.const 5)) + ) + + (func (export "type-first-i32") (result i32) + (call_indirect (type $over-i32) (i32.const 32) (i32.const 4)) + ) + (func (export "type-first-i64") (result i64) + (call_indirect (type $over-i64) (i64.const 64) (i32.const 5)) + ) + (func (export "type-first-f32") (result f32) + (call_indirect (type $over-f32) (f32.const 1.32) (i32.const 6)) + ) + (func (export "type-first-f64") (result f64) + (call_indirect (type $over-f64) (f64.const 1.64) (i32.const 7)) + ) + + (func (export "type-second-i32") (result i32) + (call_indirect (type $f32-i32) (f32.const 32.1) (i32.const 32) (i32.const 8)) + ) + (func (export "type-second-i64") (result i64) + (call_indirect (type $i32-i64) (i32.const 32) (i64.const 64) (i32.const 9)) + ) + (func (export "type-second-f32") (result f32) + (call_indirect (type $f64-f32) (f64.const 64) (f32.const 32) (i32.const 10)) + ) + (func (export "type-second-f64") (result f64) + (call_indirect (type $i64-f64) (i64.const 64) (f64.const 64.1) (i32.const 11)) + ) + + ;; Dispatch + + (func (export "dispatch") (param i32 i64) (result i64) + (call_indirect (type $over-i64) (local.get 1) (local.get 0)) + ) + + (func (export "dispatch-structural") (param i32) (result i64) + (call_indirect (type $over-i64-duplicate) (i64.const 9) (local.get 0)) + ) + + ;; Recursion + + (func $fac (export "fac") (type $over-i64) + (if i64 (i64.eqz (local.get 0)) + (i64.const 1) + (i64.mul + (local.get 0) + (call_indirect (type $over-i64) + (i64.sub (local.get 0) (i64.const 1)) + (i32.const 12) + ) + ) + ) + ) + + (func $fib (export "fib") (type $over-i64) + (if i64 (i64.le_u (local.get 0) (i64.const 1)) + (i64.const 1) + (i64.add + (call_indirect (type $over-i64) + (i64.sub (local.get 0) (i64.const 2)) + (i32.const 13) + ) + (call_indirect (type $over-i64) + (i64.sub (local.get 0) (i64.const 1)) + (i32.const 13) + ) + ) + ) + ) + + (func $even (export "even") (param i32) (result i32) + (if i32 (i32.eqz (local.get 0)) + (i32.const 44) + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 1)) + (i32.const 15) + ) + ) + ) + (func $odd (export "odd") (param i32) (result i32) + (if i32 (i32.eqz (local.get 0)) + (i32.const 99) + (call_indirect (type $over-i32) + (i32.sub (local.get 0) (i32.const 1)) + (i32.const 14) + ) + ) + ) + + ;; Stack exhaustion + + ;; Implementations are required to have every call consume some abstract + ;; resource towards exhausting some abstract finite limit, such that + ;; infinitely recursive test cases reliably trap in finite time. This is + ;; because otherwise applications could come to depend on it on those + ;; implementations and be incompatible with implementations that don't do + ;; it (or don't do it under the same circumstances). + + (func $runaway (export "runaway") (call_indirect (type $proc) (i32.const 16))) + + (func $mutual-runaway1 (export "mutual-runaway") (call_indirect (type $proc) (i32.const 18))) + (func $mutual-runaway2 (call_indirect (type $proc) (i32.const 17))) +) + +(assert_return (invoke "type-i32") (i32.const 0x132)) +(assert_return (invoke "type-i64") (i64.const 0x164)) +(assert_return (invoke "type-f32") (f32.const 0xf32)) +(assert_return (invoke "type-f64") (f64.const 0xf64)) + +(assert_return (invoke "type-index") (i64.const 100)) + +(assert_return (invoke "type-first-i32") (i32.const 32)) +(assert_return (invoke "type-first-i64") (i64.const 64)) +(assert_return (invoke "type-first-f32") (f32.const 1.32)) +(assert_return (invoke "type-first-f64") (f64.const 1.64)) + +(assert_return (invoke "type-second-i32") (i32.const 32)) +(assert_return (invoke "type-second-i64") (i64.const 64)) +(assert_return (invoke "type-second-f32") (f32.const 32)) +(assert_return (invoke "type-second-f64") (f64.const 64.1)) + +(assert_return (invoke "dispatch" (i32.const 5) (i64.const 2)) (i64.const 2)) +(assert_return (invoke "dispatch" (i32.const 5) (i64.const 5)) (i64.const 5)) +(assert_return (invoke "dispatch" (i32.const 12) (i64.const 5)) (i64.const 120)) +(assert_return (invoke "dispatch" (i32.const 13) (i64.const 5)) (i64.const 8)) +(assert_return (invoke "dispatch" (i32.const 20) (i64.const 2)) (i64.const 2)) +(assert_trap (invoke "dispatch" (i32.const 0) (i64.const 2)) "indirect call signature mismatch") +(assert_trap (invoke "dispatch" (i32.const 15) (i64.const 2)) "indirect call signature mismatch") +(assert_trap (invoke "dispatch" (i32.const 23) (i64.const 2)) "undefined element") +(assert_trap (invoke "dispatch" (i32.const -1) (i64.const 2)) "undefined element") +(assert_trap (invoke "dispatch" (i32.const 1213432423) (i64.const 2)) "undefined element") + +(assert_return (invoke "dispatch-structural" (i32.const 5)) (i64.const 9)) +(assert_return (invoke "dispatch-structural" (i32.const 5)) (i64.const 9)) +(assert_return (invoke "dispatch-structural" (i32.const 12)) (i64.const 362880)) +(assert_return (invoke "dispatch-structural" (i32.const 20)) (i64.const 9)) +(assert_trap (invoke "dispatch-structural" (i32.const 11)) "indirect call signature mismatch") +(assert_trap (invoke "dispatch-structural" (i32.const 22)) "indirect call signature mismatch") + +(assert_return (invoke "fac" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "fac" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fac" (i64.const 5)) (i64.const 120)) +(assert_return (invoke "fac" (i64.const 25)) (i64.const 7034535277573963776)) + +(assert_return (invoke "fib" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "fib" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "fib" (i64.const 2)) (i64.const 2)) +(assert_return (invoke "fib" (i64.const 5)) (i64.const 8)) +(assert_return (invoke "fib" (i64.const 20)) (i64.const 10946)) + +(assert_return (invoke "even" (i32.const 0)) (i32.const 44)) +(assert_return (invoke "even" (i32.const 1)) (i32.const 99)) +(assert_return (invoke "even" (i32.const 10)) (i32.const 44)) +(assert_return (invoke "even" (i32.const 7)) (i32.const 99)) +(assert_return (invoke "odd" (i32.const 0)) (i32.const 99)) +(assert_return (invoke "odd" (i32.const 1)) (i32.const 44)) +(assert_return (invoke "odd" (i32.const 20)) (i32.const 99)) +(assert_return (invoke "odd" (i32.const 7)) (i32.const 44)) + +(assert_trap (invoke "runaway") "call stack exhausted") +(assert_trap (invoke "mutual-runaway") "call stack exhausted") + + +;; Invalid typing + +(assert_invalid + (module + (type (func)) + (func $no-table (call_indirect (type 0) (i32.const 0))) + ) + "unknown table" +) + +(assert_invalid + (module + (type (func)) + (table 0 funcref) + (func $type-void-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0)))) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func (result i64))) + (table 0 funcref) + (func $type-num-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0)))) + ) + "type mismatch" +) + +(assert_invalid + (module + (type (func (param i32))) + (table 0 funcref) + (func $arity-0-vs-1 (call_indirect (type 0) (i32.const 0))) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func (param f64 i32))) + (table 0 funcref) + (func $arity-0-vs-2 (call_indirect (type 0) (i32.const 0))) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func)) + (table 0 funcref) + (func $arity-1-vs-0 (call_indirect (type 0) (i32.const 1) (i32.const 0))) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func)) + (table 0 funcref) + (func $arity-2-vs-0 + (call_indirect (type 0) (f64.const 2) (i32.const 1) (i32.const 0)) + ) + ) + "type mismatch" +) + +(assert_invalid + (module + (type (func (param i32))) + (table 0 funcref) + (func $type-func-void-vs-i32 (call_indirect (type 0) (i32.const 1) (nop))) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func (param i32))) + (table 0 funcref) + (func $type-func-num-vs-i32 (call_indirect (type 0) (i32.const 0) (i64.const 1))) + ) + "type mismatch" +) + +(assert_invalid + (module + (type (func (param i32 i32))) + (table 0 funcref) + (func $type-first-void-vs-num + (call_indirect (type 0) (nop) (i32.const 1) (i32.const 0)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func (param i32 i32))) + (table 0 funcref) + (func $type-second-void-vs-num + (call_indirect (type 0) (i32.const 1) (nop) (i32.const 0)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func (param i32 f64))) + (table 0 funcref) + (func $type-first-num-vs-num + (call_indirect (type 0) (f64.const 1) (i32.const 1) (i32.const 0)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (type (func (param f64 i32))) + (table 0 funcref) + (func $type-second-num-vs-num + (call_indirect (type 0) (i32.const 1) (f64.const 1) (i32.const 0)) + ) + ) + "type mismatch" +) + + +;; Unbound type + +(assert_invalid + (module + (table 0 funcref) + (func $unbound-type (call_indirect (type 1) (i32.const 0))) + ) + "unknown type" +) +(assert_invalid + (module + (table 0 funcref) + (func $large-type (call_indirect (type 1012321300) (i32.const 0))) + ) + "unknown type" +) diff --git a/test/spec/old_exports.wast b/test/spec/old_exports.wast new file mode 100644 index 000000000..487103b89 --- /dev/null +++ b/test/spec/old_exports.wast @@ -0,0 +1,172 @@ +;; Functions + +(module (func) (export "a" (func 0))) +(module (func) (export "a" (func 0)) (export "b" (func 0))) +(module (func) (func) (export "a" (func 0)) (export "b" (func 1))) + +(module (func (export "a"))) +(module (func $a (export "a"))) + +(module $Func + (export "e" (func $f)) + (func $f (param $n i32) (result i32) + (return (i32.add (local.get $n) (i32.const 1))) + ) +) +(assert_return (invoke "e" (i32.const 42)) (i32.const 43)) +(assert_return (invoke $Func "e" (i32.const 42)) (i32.const 43)) +(module) +(module $Other1) +(assert_return (invoke $Func "e" (i32.const 42)) (i32.const 43)) + +(assert_invalid + (module (func) (export "a" (func 1))) + "unknown function" +) +(assert_invalid + (module (func) (export "a" (func 0)) (export "a" (func 0))) + "duplicate export name" +) +(assert_invalid + (module (func) (func) (export "a" (func 0)) (export "a" (func 1))) + "duplicate export name" +) +(assert_invalid + (module (func) (global i32 (i32.const 0)) (export "a" (func 0)) (export "a" (global 0))) + "duplicate export name" +) +(assert_invalid + (module (func) (table 0 funcref) (export "a" (func 0)) (export "a" (table 0))) + "duplicate export name" +) +(assert_invalid + (module (func) (memory 0) (export "a" (func 0)) (export "a" (memory 0))) + "duplicate export name" +) + + +;; Globals + +(module (global i32 (i32.const 0)) (export "a" (global 0))) +(module (global i32 (i32.const 0)) (export "a" (global 0)) (export "b" (global 0))) +(module (global i32 (i32.const 0)) (global i32 (i32.const 0)) (export "a" (global 0)) (export "b" (global 1))) + +(module (global (export "a") i32 (i32.const 0))) +(module (global $a (export "a") i32 (i32.const 0))) + +(module $Global + (export "e" (global $g)) + (global $g i32 (i32.const 42)) +) +(assert_return (get "e") (i32.const 42)) +(assert_return (get $Global "e") (i32.const 42)) +(module) +(module $Other2) +(assert_return (get $Global "e") (i32.const 42)) + +(assert_invalid + (module (global i32 (i32.const 0)) (export "a" (global 1))) + "unknown global" +) +(assert_invalid + (module (global i32 (i32.const 0)) (export "a" (global 0)) (export "a" (global 0))) + "duplicate export name" +) +(assert_invalid + (module (global i32 (i32.const 0)) (global i32 (i32.const 0)) (export "a" (global 0)) (export "a" (global 1))) + "duplicate export name" +) +(assert_invalid + (module (global i32 (i32.const 0)) (func) (export "a" (global 0)) (export "a" (func 0))) + "duplicate export name" +) +(assert_invalid + (module (global i32 (i32.const 0)) (table 0 funcref) (export "a" (global 0)) (export "a" (table 0))) + "duplicate export name" +) +(assert_invalid + (module (global i32 (i32.const 0)) (memory 0) (export "a" (global 0)) (export "a" (memory 0))) + "duplicate export name" +) + + +;; Tables + +(module (table 0 funcref) (export "a" (table 0))) +(module (table 0 funcref) (export "a" (table 0)) (export "b" (table 0))) +;; No multiple tables yet. +;; (module (table 0 funcref) (table 0 funcref) (export "a" (table 0)) (export "b" (table 1))) + +(module (table (export "a") 0 funcref)) +(module (table (export "a") 0 1 funcref)) +(module (table $a (export "a") 0 funcref)) +(module (table $a (export "a") 0 1 funcref)) + +(; TODO: access table ;) + +(assert_invalid + (module (table 0 funcref) (export "a" (table 1))) + "unknown table" +) +(assert_invalid + (module (table 0 funcref) (export "a" (table 0)) (export "a" (table 0))) + "duplicate export name" +) +;; No multiple tables yet. +;; (assert_invalid +;; (module (table 0 funcref) (table 0 funcref) (export "a" (table 0)) (export "a" (table 1))) +;; "duplicate export name" +;; ) +(assert_invalid + (module (table 0 funcref) (func) (export "a" (table 0)) (export "a" (func 0))) + "duplicate export name" +) +(assert_invalid + (module (table 0 funcref) (global i32 (i32.const 0)) (export "a" (table 0)) (export "a" (global 0))) + "duplicate export name" +) +(assert_invalid + (module (table 0 funcref) (memory 0) (export "a" (table 0)) (export "a" (memory 0))) + "duplicate export name" +) + + +;; Memories + +(module (memory 0) (export "a" (memory 0))) +(module (memory 0) (export "a" (memory 0)) (export "b" (memory 0))) +;; No multiple memories yet. +;; (module (memory 0) (memory 0) (export "a" (memory 0)) (export "b" (memory 1))) + +(module (memory (export "a") 0)) +(module (memory (export "a") 0 1)) +(module (memory $a (export "a") 0)) +(module (memory $a (export "a") 0 1)) + +(; TODO: access memory ;) + +(assert_invalid + (module (memory 0) (export "a" (memory 1))) + "unknown memory" +) +(assert_invalid + (module (memory 0) (export "a" (memory 0)) (export "a" (memory 0))) + "duplicate export name" +) +;; No multiple memories yet. +;; (assert_invalid +;; (module (memory 0) (memory 0) (export "a" (memory 0)) (export "a" (memory 1))) +;; "duplicate export name" +;; ) +(assert_invalid + (module (memory 0) (func) (export "a" (memory 0)) (export "a" (func 0))) + "duplicate export name" +) +(assert_invalid + (module (memory 0) (global i32 (i32.const 0)) (export "a" (memory 0)) (export "a" (global 0))) + "duplicate export name" +) +(assert_invalid + (module (memory 0) (table 0 funcref) (export "a" (memory 0)) (export "a" (table 0))) + "duplicate export name" +) diff --git a/test/spec/old_float_exprs.wast b/test/spec/old_float_exprs.wast new file mode 100644 index 000000000..7900832b0 --- /dev/null +++ b/test/spec/old_float_exprs.wast @@ -0,0 +1,1979 @@ +;; Test interesting floating-point "expressions". These tests contain code +;; patterns which tempt common value-changing optimizations. + +;; Test that x*y+z is not done with x87-style intermediate precision. + +(module + (func (export "f64.no_contraction") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.add (f64.mul (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f64.no_contraction" (f64.const -0x1.9e87ce14273afp-103) (f64.const 0x1.2515ad31db63ep+664) (f64.const 0x1.868c6685e6185p+533)) (f64.const -0x1.da94885b11493p+561)) +(assert_return (invoke "f64.no_contraction" (f64.const 0x1.da21c460a6f44p+52) (f64.const 0x1.60859d2e7714ap-321) (f64.const 0x1.e63f1b7b660e1p-302)) (f64.const 0x1.4672f256d1794p-268)) +(assert_return (invoke "f64.no_contraction" (f64.const -0x1.f3eaf43f327cp-594) (f64.const 0x1.dfcc009906b57p+533) (f64.const 0x1.5984e03c520a1p-104)) (f64.const -0x1.d4797fb3db166p-60)) +(assert_return (invoke "f64.no_contraction" (f64.const 0x1.dab6c772cb2e2p-69) (f64.const -0x1.d761663679a84p-101) (f64.const 0x1.f22f92c843226p-218)) (f64.const -0x1.b50d72dfcef68p-169)) +(assert_return (invoke "f64.no_contraction" (f64.const -0x1.87c5def1e4d3dp-950) (f64.const -0x1.50cd5dab2207fp+935) (f64.const 0x1.e629bd0da8c5dp-54)) (f64.const 0x1.01b6feb4e78a7p-14)) + +;; Test that x*y+z is not folded to fma. + +(module + (func (export "f32.no_fma") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.add (f32.mul (local.get $x) (local.get $y)) (local.get $z))) + (func (export "f64.no_fma") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.add (f64.mul (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f32.no_fma" (f32.const 0x1.a78402p+124) (f32.const 0x1.cf8548p-23) (f32.const 0x1.992adap+107)) (f32.const 0x1.a5262cp+107)) +(assert_return (invoke "f32.no_fma" (f32.const 0x1.ed15a4p-28) (f32.const -0x1.613c72p-50) (f32.const 0x1.4757bp-88)) (f32.const -0x1.5406b8p-77)) +(assert_return (invoke "f32.no_fma" (f32.const 0x1.ae63a2p+37) (f32.const 0x1.b3a59ap-13) (f32.const 0x1.c16918p+10)) (f32.const 0x1.6e385cp+25)) +(assert_return (invoke "f32.no_fma" (f32.const 0x1.2a77fap-8) (f32.const -0x1.bb7356p+22) (f32.const -0x1.32be2ap+1)) (f32.const -0x1.0286d4p+15)) +(assert_return (invoke "f32.no_fma" (f32.const 0x1.298fb6p+126) (f32.const -0x1.03080cp-70) (f32.const -0x1.418de6p+34)) (f32.const -0x1.2d15c6p+56)) +(assert_return (invoke "f64.no_fma" (f64.const 0x1.ac357ff46eed4p+557) (f64.const 0x1.852c01a5e7297p+430) (f64.const -0x1.05995704eda8ap+987)) (f64.const 0x1.855d905d338ep+987)) +(assert_return (invoke "f64.no_fma" (f64.const 0x1.e2fd6bf32010cp+749) (f64.const 0x1.01c2238d405e4p-130) (f64.const 0x1.2ecc0db4b9f94p+573)) (f64.const 0x1.e64eb07e063bcp+619)) +(assert_return (invoke "f64.no_fma" (f64.const 0x1.92b7c7439ede3p-721) (f64.const -0x1.6aa97586d3de6p+1011) (f64.const 0x1.8de4823f6358ap+237)) (f64.const -0x1.1d4139fd20ecdp+291)) +(assert_return (invoke "f64.no_fma" (f64.const -0x1.466d30bddb453p-386) (f64.const -0x1.185a4d739c7aap+443) (f64.const 0x1.5f9c436fbfc7bp+55)) (f64.const 0x1.bd61a350fcc1ap+57)) +(assert_return (invoke "f64.no_fma" (f64.const 0x1.7e2c44058a799p+52) (f64.const 0x1.c73b71765b8b2p+685) (f64.const -0x1.16c641df0b108p+690)) (f64.const 0x1.53ccb53de0bd1p+738)) + +;; Test that x+0.0 is not folded to x. +;; See IEEE 754-2008 10.4 "Literal meaning and value-changing optimizations". + +(module + (func (export "f32.no_fold_add_zero") (param $x f32) (result f32) + (f32.add (local.get $x) (f32.const 0.0))) + (func (export "f64.no_fold_add_zero") (param $x f64) (result f64) + (f64.add (local.get $x) (f64.const 0.0))) +) + +(assert_return (invoke "f32.no_fold_add_zero" (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f64.no_fold_add_zero" (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f32.no_fold_add_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_add_zero" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that 0.0 - x is not folded to -x. + +(module + (func (export "f32.no_fold_zero_sub") (param $x f32) (result f32) + (f32.sub (f32.const 0.0) (local.get $x))) + (func (export "f64.no_fold_zero_sub") (param $x f64) (result f64) + (f64.sub (f64.const 0.0) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_zero_sub" (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f64.no_fold_zero_sub" (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f32.no_fold_zero_sub" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_zero_sub" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x - 0.0 is not folded to x. + +(module + (func (export "f32.no_fold_sub_zero") (param $x f32) (result f32) + (f32.sub (local.get $x) (f32.const 0.0))) + (func (export "f64.no_fold_sub_zero") (param $x f64) (result f64) + (f64.sub (local.get $x) (f64.const 0.0))) +) + +(assert_return (invoke "f32.no_fold_sub_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_sub_zero" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x*0.0 is not folded to 0.0. + +(module + (func (export "f32.no_fold_mul_zero") (param $x f32) (result f32) + (f32.mul (local.get $x) (f32.const 0.0))) + (func (export "f64.no_fold_mul_zero") (param $x f64) (result f64) + (f64.mul (local.get $x) (f64.const 0.0))) +) + +(assert_return (invoke "f32.no_fold_mul_zero" (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_mul_zero" (f32.const -1.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_mul_zero" (f32.const -2.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_mul_zero" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_mul_zero" (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_mul_zero" (f64.const -1.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_mul_zero" (f64.const -2.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_mul_zero" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x*1.0 is not folded to x. +;; See IEEE 754-2008 10.4 "Literal meaning and value-changing optimizations". + +(module + (func (export "f32.no_fold_mul_one") (param $x f32) (result f32) + (f32.mul (local.get $x) (f32.const 1.0))) + (func (export "f64.no_fold_mul_one") (param $x f64) (result f64) + (f64.mul (local.get $x) (f64.const 1.0))) +) + +(assert_return (invoke "f32.no_fold_mul_one" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_mul_one" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that 0.0/x is not folded to 0.0. + +(module + (func (export "f32.no_fold_zero_div") (param $x f32) (result f32) + (f32.div (f32.const 0.0) (local.get $x))) + (func (export "f64.no_fold_zero_div") (param $x f64) (result f64) + (f64.div (f64.const 0.0) (local.get $x))) +) + +(assert_return_nan (invoke "f32.no_fold_zero_div" (f32.const 0.0))) +(assert_return_nan (invoke "f32.no_fold_zero_div" (f32.const -0.0))) +(assert_return (invoke "f32.no_fold_zero_div" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_zero_div" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return_nan (invoke "f64.no_fold_zero_div" (f64.const 0.0))) +(assert_return_nan (invoke "f64.no_fold_zero_div" (f64.const -0.0))) +(assert_return (invoke "f64.no_fold_zero_div" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_zero_div" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x/1.0 is not folded to x. + +(module + (func (export "f32.no_fold_div_one") (param $x f32) (result f32) + (f32.div (local.get $x) (f32.const 1.0))) + (func (export "f64.no_fold_div_one") (param $x f64) (result f64) + (f64.div (local.get $x) (f64.const 1.0))) +) + +(assert_return (invoke "f32.no_fold_div_one" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_div_one" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x/-1.0 is not folded to -x. + +(module + (func (export "f32.no_fold_div_neg1") (param $x f32) (result f32) + (f32.div (local.get $x) (f32.const -1.0))) + (func (export "f64.no_fold_div_neg1") (param $x f64) (result f64) + (f64.div (local.get $x) (f64.const -1.0))) +) + +(assert_return (invoke "f32.no_fold_div_neg1" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_div_neg1" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that -0.0 - x is not folded to -x. + +(module + (func (export "f32.no_fold_neg0_sub") (param $x f32) (result f32) + (f32.sub (f32.const -0.0) (local.get $x))) + (func (export "f64.no_fold_neg0_sub") (param $x f64) (result f64) + (f64.sub (f64.const -0.0) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_neg0_sub" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_neg0_sub" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that -1.0 * x is not folded to -x. + +(module + (func (export "f32.no_fold_neg1_mul") (param $x f32) (result f32) + (f32.mul (f32.const -1.0) (local.get $x))) + (func (export "f64.no_fold_neg1_mul") (param $x f64) (result f64) + (f64.mul (f64.const -1.0) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_neg1_mul" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f64.no_fold_neg1_mul" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x == x is not folded to true. + +(module + (func (export "f32.no_fold_eq_self") (param $x f32) (result i32) + (f32.eq (local.get $x) (local.get $x))) + (func (export "f64.no_fold_eq_self") (param $x f64) (result i32) + (f64.eq (local.get $x) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_eq_self" (f32.const nan)) (i32.const 0)) +(assert_return (invoke "f64.no_fold_eq_self" (f64.const nan)) (i32.const 0)) + +;; Test that x != x is not folded to false. + +(module + (func (export "f32.no_fold_ne_self") (param $x f32) (result i32) + (f32.ne (local.get $x) (local.get $x))) + (func (export "f64.no_fold_ne_self") (param $x f64) (result i32) + (f64.ne (local.get $x) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_ne_self" (f32.const nan)) (i32.const 1)) +(assert_return (invoke "f64.no_fold_ne_self" (f64.const nan)) (i32.const 1)) + +;; Test that x - x is not folded to 0.0. + +(module + (func (export "f32.no_fold_sub_self") (param $x f32) (result f32) + (f32.sub (local.get $x) (local.get $x))) + (func (export "f64.no_fold_sub_self") (param $x f64) (result f64) + (f64.sub (local.get $x) (local.get $x))) +) + +(assert_return_nan (invoke "f32.no_fold_sub_self" (f32.const infinity))) +(assert_return (invoke "f32.no_fold_sub_self" (f32.const nan)) (f32.const nan)) +(assert_return_nan (invoke "f64.no_fold_sub_self" (f64.const infinity))) +(assert_return (invoke "f64.no_fold_sub_self" (f64.const nan)) (f64.const nan)) + +;; Test that x/3 is not folded to x*(1/3). + +(module + (func (export "f32.no_fold_div_3") (param $x f32) (result f32) + (f32.div (local.get $x) (f32.const 3.0))) + (func (export "f64.no_fold_div_3") (param $x f64) (result f64) + (f64.div (local.get $x) (f64.const 3.0))) +) + +(assert_return (invoke "f32.no_fold_div_3" (f32.const -0x1.359c26p+50)) (f32.const -0x1.9cd032p+48)) +(assert_return (invoke "f32.no_fold_div_3" (f32.const -0x1.e45646p+93)) (f32.const -0x1.42e42ep+92)) +(assert_return (invoke "f32.no_fold_div_3" (f32.const -0x1.2a3916p-83)) (f32.const -0x1.8da172p-85)) +(assert_return (invoke "f32.no_fold_div_3" (f32.const -0x1.1f8b38p-124)) (f32.const -0x1.7f644ap-126)) +(assert_return (invoke "f32.no_fold_div_3" (f32.const -0x1.d64f64p-56)) (f32.const -0x1.398a42p-57)) +(assert_return (invoke "f64.no_fold_div_3" (f64.const -0x1.a8a88d29e2cc3p+632)) (f64.const -0x1.1b1b08c69732dp+631)) +(assert_return (invoke "f64.no_fold_div_3" (f64.const -0x1.bcf52dc950972p-167)) (f64.const -0x1.28a373db8b0f7p-168)) +(assert_return (invoke "f64.no_fold_div_3" (f64.const 0x1.bd3c0d989f7a4p-874)) (f64.const 0x1.28d2b3bb14fc3p-875)) +(assert_return (invoke "f64.no_fold_div_3" (f64.const -0x1.0138bf530a53cp+1007)) (f64.const -0x1.56f6546eb86fbp+1005)) +(assert_return (invoke "f64.no_fold_div_3" (f64.const 0x1.052b87f9d794dp+415)) (f64.const 0x1.5c3a0aa274c67p+413)) + +;; Test that (x*z)+(y*z) is not folded to (x+y)*z + +(module + (func (export "f32.no_factor") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.add (f32.mul (local.get $x) (local.get $z)) (f32.mul (local.get $y) (local.get $z)))) + (func (export "f64.no_factor") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.add (f64.mul (local.get $x) (local.get $z)) (f64.mul (local.get $y) (local.get $z)))) +) + +(assert_return (invoke "f32.no_factor" (f32.const -0x1.4e2352p+40) (f32.const -0x1.842e2cp+49) (f32.const 0x1.eea602p+59)) (f32.const -0x1.77a7dp+109)) +(assert_return (invoke "f32.no_factor" (f32.const -0x1.b4e7f6p-6) (f32.const 0x1.8c990cp-5) (f32.const -0x1.70cc02p-9)) (f32.const -0x1.00a342p-14)) +(assert_return (invoke "f32.no_factor" (f32.const -0x1.06722ep-41) (f32.const 0x1.eed3cep-64) (f32.const 0x1.5c5558p+123)) (f32.const -0x1.651aaep+82)) +(assert_return (invoke "f32.no_factor" (f32.const -0x1.f8c6a4p-64) (f32.const 0x1.08c806p-83) (f32.const 0x1.b5ceccp+118)) (f32.const -0x1.afa15p+55)) +(assert_return (invoke "f32.no_factor" (f32.const -0x1.3aaa1ep-84) (f32.const 0x1.c6d5eep-71) (f32.const 0x1.8d2924p+20)) (f32.const 0x1.60c9cep-50)) +(assert_return (invoke "f64.no_factor" (f64.const 0x1.3adeda9144977p-424) (f64.const 0x1.c15af887049e1p-462) (f64.const -0x1.905179c4c4778p-225)) (f64.const -0x1.ec606bcb87b1ap-649)) +(assert_return (invoke "f64.no_factor" (f64.const 0x1.3c84821c1d348p-662) (f64.const -0x1.4ffd4c77ad037p-1009) (f64.const -0x1.dd275335c6f4p-957)) (f64.const 0x0p+0)) +(assert_return (invoke "f64.no_factor" (f64.const -0x1.074f372347051p-334) (f64.const -0x1.aaeef661f4c96p-282) (f64.const -0x1.9bd34abe8696dp+479)) (f64.const 0x1.5767029593e2p+198)) +(assert_return (invoke "f64.no_factor" (f64.const -0x1.c4ded58a6f389p-289) (f64.const 0x1.ba6fdef5d59c9p-260) (f64.const -0x1.c1201c0470205p-253)) (f64.const -0x1.841ada2e0f184p-512)) +(assert_return (invoke "f64.no_factor" (f64.const 0x1.9d3688f8e375ap-608) (f64.const 0x1.bf91311588256p-579) (f64.const -0x1.1605a6b5d5ff8p+489)) (f64.const -0x1.e6118ca76af53p-90)) + +;; Test that (x+y)*z is not folded to (x*z)+(y*z) + +(module + (func (export "f32.no_distribute") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.mul (f32.add (local.get $x) (local.get $y)) (local.get $z))) + (func (export "f64.no_distribute") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.mul (f64.add (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f32.no_distribute" (f32.const -0x1.4e2352p+40) (f32.const -0x1.842e2cp+49) (f32.const 0x1.eea602p+59)) (f32.const -0x1.77a7d2p+109)) +(assert_return (invoke "f32.no_distribute" (f32.const -0x1.b4e7f6p-6) (f32.const 0x1.8c990cp-5) (f32.const -0x1.70cc02p-9)) (f32.const -0x1.00a34p-14)) +(assert_return (invoke "f32.no_distribute" (f32.const -0x1.06722ep-41) (f32.const 0x1.eed3cep-64) (f32.const 0x1.5c5558p+123)) (f32.const -0x1.651abp+82)) +(assert_return (invoke "f32.no_distribute" (f32.const -0x1.f8c6a4p-64) (f32.const 0x1.08c806p-83) (f32.const 0x1.b5ceccp+118)) (f32.const -0x1.afa14ep+55)) +(assert_return (invoke "f32.no_distribute" (f32.const -0x1.3aaa1ep-84) (f32.const 0x1.c6d5eep-71) (f32.const 0x1.8d2924p+20)) (f32.const 0x1.60c9ccp-50)) +(assert_return (invoke "f64.no_distribute" (f64.const 0x1.3adeda9144977p-424) (f64.const 0x1.c15af887049e1p-462) (f64.const -0x1.905179c4c4778p-225)) (f64.const -0x1.ec606bcb87b1bp-649)) +(assert_return (invoke "f64.no_distribute" (f64.const 0x1.3c84821c1d348p-662) (f64.const -0x1.4ffd4c77ad037p-1009) (f64.const -0x1.dd275335c6f4p-957)) (f64.const -0x0p+0)) +(assert_return (invoke "f64.no_distribute" (f64.const -0x1.074f372347051p-334) (f64.const -0x1.aaeef661f4c96p-282) (f64.const -0x1.9bd34abe8696dp+479)) (f64.const 0x1.5767029593e1fp+198)) +(assert_return (invoke "f64.no_distribute" (f64.const -0x1.c4ded58a6f389p-289) (f64.const 0x1.ba6fdef5d59c9p-260) (f64.const -0x1.c1201c0470205p-253)) (f64.const -0x1.841ada2e0f183p-512)) +(assert_return (invoke "f64.no_distribute" (f64.const 0x1.9d3688f8e375ap-608) (f64.const 0x1.bf91311588256p-579) (f64.const -0x1.1605a6b5d5ff8p+489)) (f64.const -0x1.e6118ca76af52p-90)) + +;; Test that x*(y/z) is not folded to (x*y)/z + +(module + (func (export "f32.no_regroup_div_mul") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.mul (local.get $x) (f32.div (local.get $y) (local.get $z)))) + (func (export "f64.no_regroup_div_mul") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.mul (local.get $x) (f64.div (local.get $y) (local.get $z)))) +) + +(assert_return (invoke "f32.no_regroup_div_mul" (f32.const -0x1.2d14a6p-115) (f32.const -0x1.575a6cp-64) (f32.const 0x1.5cee0ep-116)) (f32.const 0x1.2844cap-63)) +(assert_return (invoke "f32.no_regroup_div_mul" (f32.const -0x1.454738p+91) (f32.const -0x1.b28a66p-115) (f32.const -0x1.f53908p+72)) (f32.const -0x0p+0)) +(assert_return (invoke "f32.no_regroup_div_mul" (f32.const -0x1.6be56ep+16) (f32.const -0x1.b46fc6p-21) (f32.const -0x1.a51df6p-123)) (f32.const -0x1.792258p+118)) +(assert_return (invoke "f32.no_regroup_div_mul" (f32.const -0x1.c343f8p-94) (f32.const 0x1.e4d906p+73) (f32.const 0x1.be69f8p+68)) (f32.const -0x1.ea1df2p-89)) +(assert_return (invoke "f32.no_regroup_div_mul" (f32.const 0x1.c6ae76p+112) (f32.const 0x1.fc953cp+24) (f32.const -0x1.60b3e8p+71)) (f32.const -0x1.47d0eap+66)) +(assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.3c04b815e30bp-423) (f64.const -0x1.379646fd98127p-119) (f64.const 0x1.bddb158506031p-642)) (f64.const -0x1.b9b3301f2dd2dp+99)) +(assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.46b3a402f86d5p+337) (f64.const 0x1.6fbf1b9e1798dp-447) (f64.const -0x1.bd9704a5a6a06p+797)) (f64.const -0x0p+0)) +(assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.6c9765bb4347fp-479) (f64.const 0x1.a4af42e34a141p+902) (f64.const 0x1.d2dde70eb68f9p-448)) (f64.const infinity)) +(assert_return (invoke "f64.no_regroup_div_mul" (f64.const -0x1.706023645be72p+480) (f64.const -0x1.6c229f7d9101dp+611) (f64.const -0x1.4d50fa68d3d9ep+836)) (f64.const -0x1.926fa3cacc651p+255)) +(assert_return (invoke "f64.no_regroup_div_mul" (f64.const 0x1.8cc63d8caf4c7p-599) (f64.const 0x1.8671ac4c35753p-878) (f64.const -0x1.ef35b1695e659p-838)) (f64.const -0x1.38d55f56406dp-639)) + +;; Test that (x*y)/z is not folded to x*(y/z) + +(module + (func (export "f32.no_regroup_mul_div") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.div (f32.mul (local.get $x) (local.get $y)) (local.get $z))) + (func (export "f64.no_regroup_mul_div") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.div (f64.mul (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.2d14a6p-115) (f32.const -0x1.575a6cp-64) (f32.const 0x1.5cee0ep-116)) (f32.const 0x0p+0)) +(assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.454738p+91) (f32.const -0x1.b28a66p-115) (f32.const -0x1.f53908p+72)) (f32.const -0x1.1a00e8p-96)) +(assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.6be56ep+16) (f32.const -0x1.b46fc6p-21) (f32.const -0x1.a51df6p-123)) (f32.const -0x1.79225ap+118)) +(assert_return (invoke "f32.no_regroup_mul_div" (f32.const -0x1.c343f8p-94) (f32.const 0x1.e4d906p+73) (f32.const 0x1.be69f8p+68)) (f32.const -0x1.ea1df4p-89)) +(assert_return (invoke "f32.no_regroup_mul_div" (f32.const 0x1.c6ae76p+112) (f32.const 0x1.fc953cp+24) (f32.const -0x1.60b3e8p+71)) (f32.const -infinity)) +(assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.3c04b815e30bp-423) (f64.const -0x1.379646fd98127p-119) (f64.const 0x1.bddb158506031p-642)) (f64.const -0x1.b9b3301f2dd2ep+99)) +(assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.46b3a402f86d5p+337) (f64.const 0x1.6fbf1b9e1798dp-447) (f64.const -0x1.bd9704a5a6a06p+797)) (f64.const -0x1.0da0b6328e09p-907)) +(assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.6c9765bb4347fp-479) (f64.const 0x1.a4af42e34a141p+902) (f64.const 0x1.d2dde70eb68f9p-448)) (f64.const 0x1.4886b6d9a9a79p+871)) +(assert_return (invoke "f64.no_regroup_mul_div" (f64.const -0x1.706023645be72p+480) (f64.const -0x1.6c229f7d9101dp+611) (f64.const -0x1.4d50fa68d3d9ep+836)) (f64.const -infinity)) +(assert_return (invoke "f64.no_regroup_mul_div" (f64.const 0x1.8cc63d8caf4c7p-599) (f64.const 0x1.8671ac4c35753p-878) (f64.const -0x1.ef35b1695e659p-838)) (f64.const -0x0p+0)) + +;; Test that x+y+z+w is not reassociated. + +(module + (func (export "f32.no_reassociate_add") (param $x f32) (param $y f32) (param $z f32) (param $w f32) (result f32) + (f32.add (f32.add (f32.add (local.get $x) (local.get $y)) (local.get $z)) (local.get $w))) + (func (export "f64.no_reassociate_add") (param $x f64) (param $y f64) (param $z f64) (param $w f64) (result f64) + (f64.add (f64.add (f64.add (local.get $x) (local.get $y)) (local.get $z)) (local.get $w))) +) + +(assert_return (invoke "f32.no_reassociate_add" (f32.const -0x1.5f7ddcp+44) (f32.const 0x1.854e1p+34) (f32.const -0x1.b2068cp+47) (f32.const -0x1.209692p+41)) (f32.const -0x1.e26c76p+47)) +(assert_return (invoke "f32.no_reassociate_add" (f32.const 0x1.da3b78p-9) (f32.const -0x1.4312fap-7) (f32.const 0x1.0395e6p-4) (f32.const -0x1.6d5ea6p-7)) (f32.const 0x1.78b31ap-5)) +(assert_return (invoke "f32.no_reassociate_add" (f32.const -0x1.fdb93ap+34) (f32.const -0x1.b6fce6p+41) (f32.const 0x1.c131d8p+44) (f32.const 0x1.8835b6p+38)) (f32.const 0x1.8ff3a2p+44)) +(assert_return (invoke "f32.no_reassociate_add" (f32.const 0x1.1739fcp+47) (f32.const 0x1.a4b186p+49) (f32.const -0x1.0c623cp+35) (f32.const 0x1.16a102p+51)) (f32.const 0x1.913ff6p+51)) +(assert_return (invoke "f32.no_reassociate_add" (f32.const 0x1.733cfap+108) (f32.const -0x1.38d30cp+108) (f32.const 0x1.2f5854p+105) (f32.const -0x1.ccb058p+94)) (f32.const 0x1.813716p+106)) +(assert_return (invoke "f64.no_reassociate_add" (f64.const -0x1.697a4d9ff19a6p+841) (f64.const 0x1.b305466238397p+847) (f64.const 0x1.e0b2d9bfb4e72p+855) (f64.const -0x1.6e1f3ae2b06bbp+857)) (f64.const -0x1.eb0e5936f087ap+856)) +(assert_return (invoke "f64.no_reassociate_add" (f64.const 0x1.00ef6746b30e1p-543) (f64.const 0x1.cc1cfafdf3fe1p-544) (f64.const -0x1.f7726df3ecba6p-543) (f64.const -0x1.b26695f99d307p-594)) (f64.const -0x1.074892e3fad76p-547)) +(assert_return (invoke "f64.no_reassociate_add" (f64.const -0x1.e807b3bd6d854p+440) (f64.const 0x1.cedae26c2c5fp+407) (f64.const -0x1.00ab6e1442541p+437) (f64.const 0x1.28538a55997bdp+397)) (f64.const -0x1.040e90bf871ebp+441)) +(assert_return (invoke "f64.no_reassociate_add" (f64.const -0x1.ba2b6f35a2402p-317) (f64.const 0x1.ad1c3fea7cd9ep-307) (f64.const -0x1.93aace2bf1261p-262) (f64.const 0x1.9fddbe472847ep-260)) (f64.const 0x1.3af30abc2c01bp-260)) +(assert_return (invoke "f64.no_reassociate_add" (f64.const -0x1.ccb9c6092fb1dp+641) (f64.const -0x1.4b7c28c108244p+614) (f64.const 0x1.8a7cefef4bde1p+646) (f64.const -0x1.901b28b08b482p+644)) (f64.const 0x1.1810579194126p+646)) + +;; Test that x*y*z*w is not reassociated. + +(module + (func (export "f32.no_reassociate_mul") (param $x f32) (param $y f32) (param $z f32) (param $w f32) (result f32) + (f32.mul (f32.mul (f32.mul (local.get $x) (local.get $y)) (local.get $z)) (local.get $w))) + (func (export "f64.no_reassociate_mul") (param $x f64) (param $y f64) (param $z f64) (param $w f64) (result f64) + (f64.mul (f64.mul (f64.mul (local.get $x) (local.get $y)) (local.get $z)) (local.get $w))) +) + +(assert_return (invoke "f32.no_reassociate_mul" (f32.const 0x1.950ba8p-116) (f32.const 0x1.efdacep-33) (f32.const -0x1.5f9bcp+102) (f32.const 0x1.f04508p-56)) (f32.const -0x1.ff356ep-101)) +(assert_return (invoke "f32.no_reassociate_mul" (f32.const 0x1.5990aep-56) (f32.const -0x1.7dfb04p+102) (f32.const -0x1.4f774ap-125) (f32.const -0x1.595fe6p+70)) (f32.const -0x1.c7c8fcp-8)) +(assert_return (invoke "f32.no_reassociate_mul" (f32.const 0x1.6ad9a4p-48) (f32.const -0x1.9138aap+55) (f32.const -0x1.4a774ep-40) (f32.const 0x1.1ff08p+76)) (f32.const 0x1.9cd8ecp+44)) +(assert_return (invoke "f32.no_reassociate_mul" (f32.const 0x1.e1caecp-105) (f32.const 0x1.af0dd2p+77) (f32.const -0x1.016eep+56) (f32.const -0x1.ab70d6p+59)) (f32.const 0x1.54870ep+89)) +(assert_return (invoke "f32.no_reassociate_mul" (f32.const -0x1.3b1dcp-99) (f32.const 0x1.4e5a34p-49) (f32.const -0x1.38ba5ap+3) (f32.const 0x1.7fb8eep+59)) (f32.const 0x1.5bbf98p-85)) +(assert_return (invoke "f64.no_reassociate_mul" (f64.const -0x1.e7842ab7181p-667) (f64.const -0x1.fabf40ceeceafp+990) (f64.const -0x1.1a38a825ab01ap-376) (f64.const -0x1.27e8ea469b14fp+664)) (f64.const 0x1.336eb428af4f3p+613)) +(assert_return (invoke "f64.no_reassociate_mul" (f64.const 0x1.4ca2292a6acbcp+454) (f64.const 0x1.6ffbab850089ap-516) (f64.const -0x1.547c32e1f5b93p-899) (f64.const -0x1.c7571d9388375p+540)) (f64.const 0x1.1ac796954fc1p-419)) +(assert_return (invoke "f64.no_reassociate_mul" (f64.const 0x1.73881a52e0401p-501) (f64.const -0x1.1b68dd9efb1a7p+788) (f64.const 0x1.d1c5e6a3eb27cp-762) (f64.const -0x1.56cb2fcc7546fp+88)) (f64.const 0x1.f508db92c34efp-386)) +(assert_return (invoke "f64.no_reassociate_mul" (f64.const 0x1.2efa87859987cp+692) (f64.const 0x1.68e4373e241p-423) (f64.const 0x1.4e2d0fb383a57p+223) (f64.const -0x1.301d3265c737bp-23)) (f64.const -0x1.4b2b6c393f30cp+470)) +(assert_return (invoke "f64.no_reassociate_mul" (f64.const 0x1.1013f7498b95fp-234) (f64.const 0x1.d2d1c36fff138p-792) (f64.const -0x1.cbf1824ea7bfdp+728) (f64.const -0x1.440da9c8b836dp-599)) (f64.const 0x1.1a16512881c91p-895)) + +;; Test that x/0 is not folded away. + +(module + (func (export "f32.no_fold_div_0") (param $x f32) (result f32) + (f32.div (local.get $x) (f32.const 0.0))) + (func (export "f64.no_fold_div_0") (param $x f64) (result f64) + (f64.div (local.get $x) (f64.const 0.0))) +) + +(assert_return (invoke "f32.no_fold_div_0" (f32.const 1.0)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const -1.0)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const infinity)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const -infinity)) (f32.const -infinity)) +(assert_return_nan (invoke "f32.no_fold_div_0" (f32.const 0))) +(assert_return_nan (invoke "f32.no_fold_div_0" (f32.const -0))) +(assert_return (invoke "f32.no_fold_div_0" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f32.no_fold_div_0" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const 1.0)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const -1.0)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const infinity)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const -infinity)) (f64.const -infinity)) +(assert_return_nan (invoke "f64.no_fold_div_0" (f64.const 0))) +(assert_return_nan (invoke "f64.no_fold_div_0" (f64.const -0))) +(assert_return (invoke "f64.no_fold_div_0" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_div_0" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that x/-0 is not folded away. + +(module + (func (export "f32.no_fold_div_neg0") (param $x f32) (result f32) + (f32.div (local.get $x) (f32.const -0.0))) + (func (export "f64.no_fold_div_neg0") (param $x f64) (result f64) + (f64.div (local.get $x) (f64.const -0.0))) +) + +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const 1.0)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const -1.0)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const infinity)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const -infinity)) (f32.const infinity)) +(assert_return_nan (invoke "f32.no_fold_div_neg0" (f32.const 0))) +(assert_return_nan (invoke "f32.no_fold_div_neg0" (f32.const -0))) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "f32.no_fold_div_neg0" (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const 1.0)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const -1.0)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const infinity)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const -infinity)) (f64.const infinity)) +(assert_return_nan (invoke "f64.no_fold_div_neg0" (f64.const 0))) +(assert_return_nan (invoke "f64.no_fold_div_neg0" (f64.const -0))) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_div_neg0" (f64.const nan:0x4000000000000)) (f64.const nan:0xc000000000000)) + +;; Test that sqrt(x*x+y*y) is not folded to hypot. + +(module + (func (export "f32.no_fold_to_hypot") (param $x f32) (param $y f32) (result f32) + (f32.sqrt (f32.add (f32.mul (local.get $x) (local.get $x)) + (f32.mul (local.get $y) (local.get $y))))) + (func (export "f64.no_fold_to_hypot") (param $x f64) (param $y f64) (result f64) + (f64.sqrt (f64.add (f64.mul (local.get $x) (local.get $x)) + (f64.mul (local.get $y) (local.get $y))))) +) + +(assert_return (invoke "f32.no_fold_to_hypot" (f32.const 0x1.c2f338p-81) (f32.const 0x1.401b5ep-68)) (f32.const 0x1.401cccp-68)) +(assert_return (invoke "f32.no_fold_to_hypot" (f32.const -0x1.c38d1p-71) (f32.const -0x1.359ddp-107)) (f32.const 0x1.c36a62p-71)) +(assert_return (invoke "f32.no_fold_to_hypot" (f32.const -0x1.99e0cap-114) (f32.const -0x1.ed0c6cp-69)) (f32.const 0x1.ed0e48p-69)) +(assert_return (invoke "f32.no_fold_to_hypot" (f32.const -0x1.1b6ceap+5) (f32.const 0x1.5440bep+17)) (f32.const 0x1.5440cp+17)) +(assert_return (invoke "f32.no_fold_to_hypot" (f32.const 0x1.8f019ep-76) (f32.const -0x1.182308p-71)) (f32.const 0x1.17e2bcp-71)) +(assert_return (invoke "f64.no_fold_to_hypot" (f64.const 0x1.1a0ac4f7c8711p-636) (f64.const 0x1.1372ebafff551p-534)) (f64.const 0x1.13463fa37014ep-534)) +(assert_return (invoke "f64.no_fold_to_hypot" (f64.const 0x1.b793512167499p+395) (f64.const -0x1.11cbc52af4c36p+410)) (f64.const 0x1.11cbc530783a2p+410)) +(assert_return (invoke "f64.no_fold_to_hypot" (f64.const 0x1.76777f44ff40bp-536) (f64.const -0x1.c3896e4dc1fbp-766)) (f64.const 0x1.8p-536)) +(assert_return (invoke "f64.no_fold_to_hypot" (f64.const -0x1.889ac72cc6b5dp-521) (f64.const 0x1.8d7084e659f3bp-733)) (f64.const 0x1.889ac72ca843ap-521)) +(assert_return (invoke "f64.no_fold_to_hypot" (f64.const 0x1.5ee588c02cb08p-670) (f64.const -0x1.05ce25788d9ecp-514)) (f64.const 0x1.05ce25788d9dfp-514)) + +;; Test that 1.0/x isn't approximated. + +(module + (func (export "f32.no_approximate_reciprocal") (param $x f32) (result f32) + (f32.div (f32.const 1.0) (local.get $x))) +) + +(assert_return (invoke "f32.no_approximate_reciprocal" (f32.const -0x1.2900b6p-10)) (f32.const -0x1.b950d4p+9)) +(assert_return (invoke "f32.no_approximate_reciprocal" (f32.const 0x1.e7212p+127)) (f32.const 0x1.0d11f8p-128)) +(assert_return (invoke "f32.no_approximate_reciprocal" (f32.const -0x1.42a466p-93)) (f32.const -0x1.963ee6p+92)) +(assert_return (invoke "f32.no_approximate_reciprocal" (f32.const 0x1.5d0c32p+76)) (f32.const 0x1.778362p-77)) +(assert_return (invoke "f32.no_approximate_reciprocal" (f32.const -0x1.601de2p-82)) (f32.const -0x1.743d7ep+81)) + +;; Test that 1.0/sqrt(x) isn't approximated or fused. + +(module + (func (export "f32.no_approximate_reciprocal_sqrt") (param $x f32) (result f32) + (f32.div (f32.const 1.0) (f32.sqrt (local.get $x)))) + (func (export "f64.no_fuse_reciprocal_sqrt") (param $x f64) (result f64) + (f64.div (f64.const 1.0) (f64.sqrt (local.get $x)))) +) + +(assert_return (invoke "f32.no_approximate_reciprocal_sqrt" (f32.const 0x1.6af12ap-43)) (f32.const 0x1.300ed4p+21)) +(assert_return (invoke "f32.no_approximate_reciprocal_sqrt" (f32.const 0x1.e82fc6p-8)) (f32.const 0x1.72c376p+3)) +(assert_return (invoke "f32.no_approximate_reciprocal_sqrt" (f32.const 0x1.b9fa9cp-66)) (f32.const 0x1.85a9bap+32)) +(assert_return (invoke "f32.no_approximate_reciprocal_sqrt" (f32.const 0x1.f4f546p-44)) (f32.const 0x1.6e01c2p+21)) +(assert_return (invoke "f32.no_approximate_reciprocal_sqrt" (f32.const 0x1.5da7aap-86)) (f32.const 0x1.b618cap+42)) + +(assert_return (invoke "f64.no_fuse_reciprocal_sqrt" (f64.const 0x1.1568a63b55fa3p+889)) (f64.const 0x1.5bc9c74c9952p-445)) +(assert_return (invoke "f64.no_fuse_reciprocal_sqrt" (f64.const 0x1.239fcd0939cafp+311)) (f64.const 0x1.5334a922b4818p-156)) +(assert_return (invoke "f64.no_fuse_reciprocal_sqrt" (f64.const 0x1.6e36a24e11054p+104)) (f64.const 0x1.ac13f20977f29p-53)) +(assert_return (invoke "f64.no_fuse_reciprocal_sqrt" (f64.const 0x1.23ee173219f83p+668)) (f64.const 0x1.df753e055862dp-335)) +(assert_return (invoke "f64.no_fuse_reciprocal_sqrt" (f64.const 0x1.b30f74caf9babp+146)) (f64.const 0x1.88bfc3d1764a9p-74)) + +;; Test that sqrt(1.0/x) isn't approximated. + +(module + (func (export "f32.no_approximate_sqrt_reciprocal") (param $x f32) (result f32) + (f32.sqrt (f32.div (f32.const 1.0) (local.get $x)))) +) + +(assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.a4c986p+60)) (f32.const 0x1.8f5ac6p-31)) +(assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.50511ep-9)) (f32.const 0x1.3bdd46p+4)) +(assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.125ec2p+69)) (f32.const 0x1.5db572p-35)) +(assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.ba4c5p+13)) (f32.const 0x1.136f16p-7)) +(assert_return (invoke "f32.no_approximate_sqrt_reciprocal" (f32.const 0x1.4a5be2p+104)) (f32.const 0x1.c2b5bp-53)) + +;; Test that converting i32/i64 to f32/f64 and back isn't folded away + +(module + (func (export "i32.no_fold_f32_s") (param i32) (result i32) + (i32.trunc_f32_s (f32.convert_i32_s (local.get 0)))) + (func (export "i32.no_fold_f32_u") (param i32) (result i32) + (i32.trunc_f32_u (f32.convert_i32_u (local.get 0)))) + (func (export "i64.no_fold_f64_s") (param i64) (result i64) + (i64.trunc_f64_s (f64.convert_i64_s (local.get 0)))) + (func (export "i64.no_fold_f64_u") (param i64) (result i64) + (i64.trunc_f64_u (f64.convert_i64_u (local.get 0)))) +) + +(assert_return (invoke "i32.no_fold_f32_s" (i32.const 0x1000000)) (i32.const 0x1000000)) +(assert_return (invoke "i32.no_fold_f32_s" (i32.const 0x1000001)) (i32.const 0x1000000)) +(assert_return (invoke "i32.no_fold_f32_s" (i32.const 0xf0000010)) (i32.const 0xf0000010)) + +(assert_return (invoke "i32.no_fold_f32_u" (i32.const 0x1000000)) (i32.const 0x1000000)) +(assert_return (invoke "i32.no_fold_f32_u" (i32.const 0x1000001)) (i32.const 0x1000000)) +(assert_return (invoke "i32.no_fold_f32_u" (i32.const 0xf0000010)) (i32.const 0xf0000000)) + +(assert_return (invoke "i64.no_fold_f64_s" (i64.const 0x20000000000000)) (i64.const 0x20000000000000)) +(assert_return (invoke "i64.no_fold_f64_s" (i64.const 0x20000000000001)) (i64.const 0x20000000000000)) +(assert_return (invoke "i64.no_fold_f64_s" (i64.const 0xf000000000000400)) (i64.const 0xf000000000000400)) + +(assert_return (invoke "i64.no_fold_f64_u" (i64.const 0x20000000000000)) (i64.const 0x20000000000000)) +(assert_return (invoke "i64.no_fold_f64_u" (i64.const 0x20000000000001)) (i64.const 0x20000000000000)) +(assert_return (invoke "i64.no_fold_f64_u" (i64.const 0xf000000000000400)) (i64.const 0xf000000000000000)) + +;; Test that x+y-y is not folded to x. + +(module + (func (export "f32.no_fold_add_sub") (param $x f32) (param $y f32) (result f32) + (f32.sub (f32.add (local.get $x) (local.get $y)) (local.get $y))) + (func (export "f64.no_fold_add_sub") (param $x f64) (param $y f64) (result f64) + (f64.sub (f64.add (local.get $x) (local.get $y)) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_add_sub" (f32.const 0x1.b553e4p-47) (f32.const -0x1.67db2cp-26)) (f32.const 0x1.cp-47)) +(assert_return (invoke "f32.no_fold_add_sub" (f32.const -0x1.a884dp-23) (f32.const 0x1.f2ae1ep-19)) (f32.const -0x1.a884ep-23)) +(assert_return (invoke "f32.no_fold_add_sub" (f32.const -0x1.fc04fp+82) (f32.const -0x1.65403ap+101)) (f32.const -0x1p+83)) +(assert_return (invoke "f32.no_fold_add_sub" (f32.const 0x1.870fa2p-78) (f32.const 0x1.c54916p-56)) (f32.const 0x1.8p-78)) +(assert_return (invoke "f32.no_fold_add_sub" (f32.const -0x1.17e966p-108) (f32.const -0x1.5fa61ap-84)) (f32.const -0x1p-107)) + +(assert_return (invoke "f64.no_fold_add_sub" (f64.const -0x1.1053ea172dba8p-874) (f64.const 0x1.113c413408ac8p-857)) (f64.const -0x1.1053ea172p-874)) +(assert_return (invoke "f64.no_fold_add_sub" (f64.const 0x1.e377d54807972p-546) (f64.const 0x1.040a0a4d1ff7p-526)) (f64.const 0x1.e377d548p-546)) +(assert_return (invoke "f64.no_fold_add_sub" (f64.const -0x1.75f53cd926b62p-30) (f64.const -0x1.66b176e602bb5p-3)) (f64.const -0x1.75f53dp-30)) +(assert_return (invoke "f64.no_fold_add_sub" (f64.const -0x1.c450ff28332ap-341) (f64.const 0x1.15a5855023baep-305)) (f64.const -0x1.c451p-341)) +(assert_return (invoke "f64.no_fold_add_sub" (f64.const -0x1.1ad4a596d3ea8p-619) (f64.const -0x1.17d81a41c0ea8p-588)) (f64.const -0x1.1ad4a8p-619)) + +;; Test that x-y+y is not folded to x. + +(module + (func (export "f32.no_fold_sub_add") (param $x f32) (param $y f32) (result f32) + (f32.add (f32.sub (local.get $x) (local.get $y)) (local.get $y))) + (func (export "f64.no_fold_sub_add") (param $x f64) (param $y f64) (result f64) + (f64.add (f64.sub (local.get $x) (local.get $y)) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_sub_add" (f32.const -0x1.523cb8p+9) (f32.const 0x1.93096cp+8)) (f32.const -0x1.523cbap+9)) +(assert_return (invoke "f32.no_fold_sub_add" (f32.const -0x1.a31a1p-111) (f32.const 0x1.745efp-95)) (f32.const -0x1.a4p-111)) +(assert_return (invoke "f32.no_fold_sub_add" (f32.const 0x1.3d5328p+26) (f32.const 0x1.58567p+35)) (f32.const 0x1.3d54p+26)) +(assert_return (invoke "f32.no_fold_sub_add" (f32.const 0x1.374e26p-39) (f32.const -0x1.66a5p-27)) (f32.const 0x1.374p-39)) +(assert_return (invoke "f32.no_fold_sub_add" (f32.const 0x1.320facp-3) (f32.const -0x1.ac069ap+14)) (f32.const 0x1.34p-3)) + +(assert_return (invoke "f64.no_fold_sub_add" (f64.const 0x1.8f92aad2c9b8dp+255) (f64.const -0x1.08cd4992266cbp+259)) (f64.const 0x1.8f92aad2c9b9p+255)) +(assert_return (invoke "f64.no_fold_sub_add" (f64.const 0x1.5aaff55742c8bp-666) (f64.const 0x1.8f5f47181f46dp-647)) (f64.const 0x1.5aaff5578p-666)) +(assert_return (invoke "f64.no_fold_sub_add" (f64.const 0x1.21bc52967a98dp+251) (f64.const -0x1.fcffaa32d0884p+300)) (f64.const 0x1.2p+251)) +(assert_return (invoke "f64.no_fold_sub_add" (f64.const 0x1.9c78361f47374p-26) (f64.const -0x1.69d69f4edc61cp-13)) (f64.const 0x1.9c78361f48p-26)) +(assert_return (invoke "f64.no_fold_sub_add" (f64.const 0x1.4dbe68e4afab2p-367) (f64.const -0x1.dc24e5b39cd02p-361)) (f64.const 0x1.4dbe68e4afacp-367)) + +;; Test that x*y/y is not folded to x. + +(module + (func (export "f32.no_fold_mul_div") (param $x f32) (param $y f32) (result f32) + (f32.div (f32.mul (local.get $x) (local.get $y)) (local.get $y))) + (func (export "f64.no_fold_mul_div") (param $x f64) (param $y f64) (result f64) + (f64.div (f64.mul (local.get $x) (local.get $y)) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_mul_div" (f32.const -0x1.cd859ap+54) (f32.const 0x1.6ca936p-47)) (f32.const -0x1.cd8598p+54)) +(assert_return (invoke "f32.no_fold_mul_div" (f32.const -0x1.0b56b8p-26) (f32.const 0x1.48264cp-106)) (f32.const -0x1.0b56a4p-26)) +(assert_return (invoke "f32.no_fold_mul_div" (f32.const -0x1.e7555cp-48) (f32.const -0x1.9161cp+48)) (f32.const -0x1.e7555ap-48)) +(assert_return (invoke "f32.no_fold_mul_div" (f32.const 0x1.aaa50ep+52) (f32.const -0x1.dfb39ep+60)) (f32.const 0x1.aaa50cp+52)) +(assert_return (invoke "f32.no_fold_mul_div" (f32.const -0x1.2b7dfap-92) (f32.const -0x1.7c4ca6p-37)) (f32.const -0x1.2b7dfep-92)) + +(assert_return (invoke "f64.no_fold_mul_div" (f64.const -0x1.3d79ff4118a1ap-837) (f64.const -0x1.b8b5dda31808cp-205)) (f64.const -0x1.3d79ff412263ep-837)) +(assert_return (invoke "f64.no_fold_mul_div" (f64.const 0x1.f894d1ee6b3a4p+384) (f64.const 0x1.8c2606d03d58ap+585)) (f64.const 0x1.f894d1ee6b3a5p+384)) +(assert_return (invoke "f64.no_fold_mul_div" (f64.const -0x1.a022260acc993p+238) (f64.const -0x1.5fbc128fc8e3cp-552)) (f64.const -0x1.a022260acc992p+238)) +(assert_return (invoke "f64.no_fold_mul_div" (f64.const 0x1.9d4b8ed174f54p-166) (f64.const 0x1.ee3d467aeeac6p-906)) (f64.const 0x1.8dcc95a053b2bp-166)) +(assert_return (invoke "f64.no_fold_mul_div" (f64.const -0x1.e95ea897cdcd4p+660) (f64.const -0x1.854d5df085f2ep-327)) (f64.const -0x1.e95ea897cdcd5p+660)) + +;; Test that x/y*y is not folded to x. + +(module + (func (export "f32.no_fold_div_mul") (param $x f32) (param $y f32) (result f32) + (f32.mul (f32.div (local.get $x) (local.get $y)) (local.get $y))) + (func (export "f64.no_fold_div_mul") (param $x f64) (param $y f64) (result f64) + (f64.mul (f64.div (local.get $x) (local.get $y)) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_div_mul" (f32.const -0x1.dc6364p+38) (f32.const 0x1.d630ecp+29)) (f32.const -0x1.dc6362p+38)) +(assert_return (invoke "f32.no_fold_div_mul" (f32.const -0x1.1f9836p-52) (f32.const -0x1.16c4e4p-18)) (f32.const -0x1.1f9838p-52)) +(assert_return (invoke "f32.no_fold_div_mul" (f32.const 0x1.c5972cp-126) (f32.const -0x1.d6659ep+7)) (f32.const 0x1.c5980ep-126)) +(assert_return (invoke "f32.no_fold_div_mul" (f32.const -0x1.2e3a9ep-74) (f32.const -0x1.353994p+59)) (f32.const -0x1.2e3a4p-74)) +(assert_return (invoke "f32.no_fold_div_mul" (f32.const 0x1.d96b82p-98) (f32.const 0x1.95d908p+27)) (f32.const 0x1.d96b84p-98)) + +(assert_return (invoke "f64.no_fold_div_mul" (f64.const 0x1.d01f913a52481p-876) (f64.const -0x1.2cd0668b28344p+184)) (f64.const 0x1.d020daf71cdcp-876)) +(assert_return (invoke "f64.no_fold_div_mul" (f64.const -0x1.81cb7d400918dp-714) (f64.const 0x1.7caa643586d6ep-53)) (f64.const -0x1.81cb7d400918ep-714)) +(assert_return (invoke "f64.no_fold_div_mul" (f64.const -0x1.66904c97b5c8ep-145) (f64.const 0x1.5c3481592ad4cp+428)) (f64.const -0x1.66904c97b5c8dp-145)) +(assert_return (invoke "f64.no_fold_div_mul" (f64.const -0x1.e75859d2f0765p-278) (f64.const -0x1.5f19b6ab497f9p+283)) (f64.const -0x1.e75859d2f0764p-278)) +(assert_return (invoke "f64.no_fold_div_mul" (f64.const -0x1.515fe9c3b5f5p+620) (f64.const 0x1.36be869c99f7ap+989)) (f64.const -0x1.515fe9c3b5f4fp+620)) + +;; Test that promote(demote(x)) is not folded to x. + +(module + (func (export "no_fold_demote_promote") (param $x f64) (result f64) + (f64.promote_f32 (f32.demote_f64 (local.get $x)))) +) + +(assert_return (invoke "no_fold_demote_promote" (f64.const -0x1.dece272390f5dp-133)) (f64.const -0x1.decep-133)) +(assert_return (invoke "no_fold_demote_promote" (f64.const -0x1.19e6c79938a6fp-85)) (f64.const -0x1.19e6c8p-85)) +(assert_return (invoke "no_fold_demote_promote" (f64.const 0x1.49b297ec44dc1p+107)) (f64.const 0x1.49b298p+107)) +(assert_return (invoke "no_fold_demote_promote" (f64.const -0x1.74f5bd865163p-88)) (f64.const -0x1.74f5bep-88)) +(assert_return (invoke "no_fold_demote_promote" (f64.const 0x1.26d675662367ep+104)) (f64.const 0x1.26d676p+104)) + +;; Test that demote(promote(x)) is not folded to x, and aside from NaN is +;; bit-preserving. + +(module + (func (export "no_fold_promote_demote") (param $x f32) (result f32) + (f32.demote_f64 (f64.promote_f32 (local.get $x)))) +) + +(assert_return (invoke "no_fold_promote_demote" (f32.const nan:0x200000)) (f32.const nan:0x600000)) +(assert_return (invoke "no_fold_promote_demote" (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "no_fold_promote_demote" (f32.const 0x1p-149)) (f32.const 0x1p-149)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -0x1p-149)) (f32.const -0x1p-149)) +(assert_return (invoke "no_fold_promote_demote" (f32.const 0x1.fffffcp-127)) (f32.const 0x1.fffffcp-127)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -0x1.fffffcp-127)) (f32.const -0x1.fffffcp-127)) +(assert_return (invoke "no_fold_promote_demote" (f32.const 0x1p-126)) (f32.const 0x1p-126)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -0x1p-126)) (f32.const -0x1p-126)) +(assert_return (invoke "no_fold_promote_demote" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -0x1.fffffep+127)) (f32.const -0x1.fffffep+127)) +(assert_return (invoke "no_fold_promote_demote" (f32.const infinity)) (f32.const infinity)) +(assert_return (invoke "no_fold_promote_demote" (f32.const -infinity)) (f32.const -infinity)) + +;; Test that demote(x+promote(y)) is not folded to demote(x)+y. + +(module + (func (export "no_demote_mixed_add") (param $x f64) (param $y f32) (result f32) + (f32.demote_f64 (f64.add (local.get $x) (f64.promote_f32 (local.get $y))))) + (func (export "no_demote_mixed_add_commuted") (param $y f32) (param $x f64) (result f32) + (f32.demote_f64 (f64.add (f64.promote_f32 (local.get $y)) (local.get $x)))) +) + +(assert_return (invoke "no_demote_mixed_add" (f64.const 0x1.f51a9d04854f9p-95) (f32.const 0x1.3f4e9cp-119)) (f32.const 0x1.f51a9ep-95)) +(assert_return (invoke "no_demote_mixed_add" (f64.const 0x1.065b3d81ad8dp+37) (f32.const 0x1.758cd8p+38)) (f32.const 0x1.f8ba76p+38)) +(assert_return (invoke "no_demote_mixed_add" (f64.const 0x1.626c80963bd17p-119) (f32.const -0x1.9bbf86p-121)) (f32.const 0x1.f6f93ep-120)) +(assert_return (invoke "no_demote_mixed_add" (f64.const -0x1.0d5110e3385bbp-20) (f32.const 0x1.096f4ap-29)) (f32.const -0x1.0ccc5ap-20)) +(assert_return (invoke "no_demote_mixed_add" (f64.const -0x1.73852db4e5075p-20) (f32.const -0x1.24e474p-41)) (f32.const -0x1.738536p-20)) + +(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const 0x1.3f4e9cp-119) (f64.const 0x1.f51a9d04854f9p-95)) (f32.const 0x1.f51a9ep-95)) +(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const 0x1.758cd8p+38) (f64.const 0x1.065b3d81ad8dp+37)) (f32.const 0x1.f8ba76p+38)) +(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const -0x1.9bbf86p-121) (f64.const 0x1.626c80963bd17p-119)) (f32.const 0x1.f6f93ep-120)) +(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const 0x1.096f4ap-29) (f64.const -0x1.0d5110e3385bbp-20)) (f32.const -0x1.0ccc5ap-20)) +(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const -0x1.24e474p-41) (f64.const -0x1.73852db4e5075p-20)) (f32.const -0x1.738536p-20)) + +;; Test that demote(x-promote(y)) is not folded to demote(x)-y. + +(module + (func (export "no_demote_mixed_sub") (param $x f64) (param $y f32) (result f32) + (f32.demote_f64 (f64.sub (local.get $x) (f64.promote_f32 (local.get $y))))) +) + +(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.a0a183220e9b1p+82) (f32.const 0x1.c5acf8p+61)) (f32.const 0x1.a0a174p+82)) +(assert_return (invoke "no_demote_mixed_sub" (f64.const -0x1.6e2c5ac39f63ep+30) (f32.const 0x1.d48ca4p+17)) (f32.const -0x1.6e3bp+30)) +(assert_return (invoke "no_demote_mixed_sub" (f64.const -0x1.98c74350dde6ap+6) (f32.const 0x1.9d69bcp-12)) (f32.const -0x1.98c7aap+6)) +(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.0459f34091dbfp-54) (f32.const 0x1.61ad08p-71)) (f32.const 0x1.045942p-54)) +(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.a7498dca3fdb7p+14) (f32.const 0x1.ed21c8p+15)) (f32.const -0x1.197d02p+15)) + +;; Test that converting between integer and float and back isn't folded away. + +(module + (func (export "f32.i32.no_fold_trunc_s_convert_s") (param $x f32) (result f32) + (f32.convert_i32_s (i32.trunc_f32_s (local.get $x)))) + (func (export "f32.i32.no_fold_trunc_u_convert_s") (param $x f32) (result f32) + (f32.convert_i32_s (i32.trunc_f32_u (local.get $x)))) + (func (export "f32.i32.no_fold_trunc_s_convert_u") (param $x f32) (result f32) + (f32.convert_i32_u (i32.trunc_f32_s (local.get $x)))) + (func (export "f32.i32.no_fold_trunc_u_convert_u") (param $x f32) (result f32) + (f32.convert_i32_u (i32.trunc_f32_u (local.get $x)))) + (func (export "f64.i32.no_fold_trunc_s_convert_s") (param $x f64) (result f64) + (f64.convert_i32_s (i32.trunc_f64_s (local.get $x)))) + (func (export "f64.i32.no_fold_trunc_u_convert_s") (param $x f64) (result f64) + (f64.convert_i32_s (i32.trunc_f64_u (local.get $x)))) + (func (export "f64.i32.no_fold_trunc_s_convert_u") (param $x f64) (result f64) + (f64.convert_i32_u (i32.trunc_f64_s (local.get $x)))) + (func (export "f64.i32.no_fold_trunc_u_convert_u") (param $x f64) (result f64) + (f64.convert_i32_u (i32.trunc_f64_u (local.get $x)))) + (func (export "f32.i64.no_fold_trunc_s_convert_s") (param $x f32) (result f32) + (f32.convert_i64_s (i64.trunc_f32_s (local.get $x)))) + (func (export "f32.i64.no_fold_trunc_u_convert_s") (param $x f32) (result f32) + (f32.convert_i64_s (i64.trunc_f32_u (local.get $x)))) + (func (export "f32.i64.no_fold_trunc_s_convert_u") (param $x f32) (result f32) + (f32.convert_i64_u (i64.trunc_f32_s (local.get $x)))) + (func (export "f32.i64.no_fold_trunc_u_convert_u") (param $x f32) (result f32) + (f32.convert_i64_u (i64.trunc_f32_u (local.get $x)))) + (func (export "f64.i64.no_fold_trunc_s_convert_s") (param $x f64) (result f64) + (f64.convert_i64_s (i64.trunc_f64_s (local.get $x)))) + (func (export "f64.i64.no_fold_trunc_u_convert_s") (param $x f64) (result f64) + (f64.convert_i64_s (i64.trunc_f64_u (local.get $x)))) + (func (export "f64.i64.no_fold_trunc_s_convert_u") (param $x f64) (result f64) + (f64.convert_i64_u (i64.trunc_f64_s (local.get $x)))) + (func (export "f64.i64.no_fold_trunc_u_convert_u") (param $x f64) (result f64) + (f64.convert_i64_u (i64.trunc_f64_u (local.get $x)))) +) + +(assert_return (invoke "f32.i32.no_fold_trunc_s_convert_s" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i32.no_fold_trunc_s_convert_s" (f32.const -1.5)) (f32.const -1.0)) +(assert_return (invoke "f32.i32.no_fold_trunc_u_convert_s" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i32.no_fold_trunc_u_convert_s" (f32.const -0.5)) (f32.const 0.0)) +(assert_return (invoke "f32.i32.no_fold_trunc_s_convert_u" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i32.no_fold_trunc_s_convert_u" (f32.const -1.5)) (f32.const 0x1p+32)) +(assert_return (invoke "f32.i32.no_fold_trunc_u_convert_u" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i32.no_fold_trunc_u_convert_u" (f32.const -0.5)) (f32.const 0.0)) + +(assert_return (invoke "f64.i32.no_fold_trunc_s_convert_s" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i32.no_fold_trunc_s_convert_s" (f64.const -1.5)) (f64.const -1.0)) +(assert_return (invoke "f64.i32.no_fold_trunc_u_convert_s" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i32.no_fold_trunc_u_convert_s" (f64.const -0.5)) (f64.const 0.0)) +(assert_return (invoke "f64.i32.no_fold_trunc_s_convert_u" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i32.no_fold_trunc_s_convert_u" (f64.const -1.5)) (f64.const 0x1.fffffffep+31)) +(assert_return (invoke "f64.i32.no_fold_trunc_u_convert_u" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i32.no_fold_trunc_u_convert_u" (f64.const -0.5)) (f64.const 0.0)) + +(assert_return (invoke "f32.i64.no_fold_trunc_s_convert_s" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i64.no_fold_trunc_s_convert_s" (f32.const -1.5)) (f32.const -1.0)) +(assert_return (invoke "f32.i64.no_fold_trunc_u_convert_s" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i64.no_fold_trunc_u_convert_s" (f32.const -0.5)) (f32.const 0.0)) +(assert_return (invoke "f32.i64.no_fold_trunc_s_convert_u" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i64.no_fold_trunc_s_convert_u" (f32.const -1.5)) (f32.const 0x1p+64)) +(assert_return (invoke "f32.i64.no_fold_trunc_u_convert_u" (f32.const 1.5)) (f32.const 1.0)) +(assert_return (invoke "f32.i64.no_fold_trunc_u_convert_u" (f32.const -0.5)) (f32.const 0.0)) + +(assert_return (invoke "f64.i64.no_fold_trunc_s_convert_s" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i64.no_fold_trunc_s_convert_s" (f64.const -1.5)) (f64.const -1.0)) +(assert_return (invoke "f64.i64.no_fold_trunc_u_convert_s" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i64.no_fold_trunc_u_convert_s" (f64.const -0.5)) (f64.const 0.0)) +(assert_return (invoke "f64.i64.no_fold_trunc_s_convert_u" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i64.no_fold_trunc_s_convert_u" (f64.const -1.5)) (f64.const 0x1p+64)) +(assert_return (invoke "f64.i64.no_fold_trunc_u_convert_u" (f64.const 1.5)) (f64.const 1.0)) +(assert_return (invoke "f64.i64.no_fold_trunc_u_convert_u" (f64.const -0.5)) (f64.const 0.0)) + +;; Test that dividing by a loop-invariant constant isn't optimized to be a +;; multiplication by a reciprocal, which would be particularly tempting since +;; the reciprocal computation could be hoisted. + +(module + (memory 1 1) + (func (export "init") (param $i i32) (param $x f32) (f32.store (local.get $i) (local.get $x))) + + (func (export "run") (param $n i32) (param $z f32) + (local $i i32) + (block $exit + (loop $cont + (f32.store + (local.get $i) + (f32.div (f32.load (local.get $i)) (local.get $z)) + ) + (local.set $i (i32.add (local.get $i) (i32.const 4))) + (br_if $cont (i32.lt_u (local.get $i) (local.get $n))) + ) + ) + ) + + (func (export "check") (param $i i32) (result f32) (f32.load (local.get $i))) +) + +(invoke "init" (i32.const 0) (f32.const 15.1)) +(invoke "init" (i32.const 4) (f32.const 15.2)) +(invoke "init" (i32.const 8) (f32.const 15.3)) +(invoke "init" (i32.const 12) (f32.const 15.4)) +(assert_return (invoke "check" (i32.const 0)) (f32.const 15.1)) +(assert_return (invoke "check" (i32.const 4)) (f32.const 15.2)) +(assert_return (invoke "check" (i32.const 8)) (f32.const 15.3)) +(assert_return (invoke "check" (i32.const 12)) (f32.const 15.4)) +(invoke "run" (i32.const 16) (f32.const 3.0)) +(assert_return (invoke "check" (i32.const 0)) (f32.const 0x1.422222p+2)) +(assert_return (invoke "check" (i32.const 4)) (f32.const 0x1.444444p+2)) +(assert_return (invoke "check" (i32.const 8)) (f32.const 0x1.466666p+2)) +(assert_return (invoke "check" (i32.const 12)) (f32.const 0x1.488888p+2)) + +(module + (memory 1 1) + (func (export "init") (param $i i32) (param $x f64) (f64.store (local.get $i) (local.get $x))) + + (func (export "run") (param $n i32) (param $z f64) + (local $i i32) + (block $exit + (loop $cont + (f64.store + (local.get $i) + (f64.div (f64.load (local.get $i)) (local.get $z)) + ) + (local.set $i (i32.add (local.get $i) (i32.const 8))) + (br_if $cont (i32.lt_u (local.get $i) (local.get $n))) + ) + ) + ) + + (func (export "check") (param $i i32) (result f64) (f64.load (local.get $i))) +) + +(invoke "init" (i32.const 0) (f64.const 15.1)) +(invoke "init" (i32.const 8) (f64.const 15.2)) +(invoke "init" (i32.const 16) (f64.const 15.3)) +(invoke "init" (i32.const 24) (f64.const 15.4)) +(assert_return (invoke "check" (i32.const 0)) (f64.const 15.1)) +(assert_return (invoke "check" (i32.const 8)) (f64.const 15.2)) +(assert_return (invoke "check" (i32.const 16)) (f64.const 15.3)) +(assert_return (invoke "check" (i32.const 24)) (f64.const 15.4)) +(invoke "run" (i32.const 32) (f64.const 3.0)) +(assert_return (invoke "check" (i32.const 0)) (f64.const 0x1.4222222222222p+2)) +(assert_return (invoke "check" (i32.const 8)) (f64.const 0x1.4444444444444p+2)) +(assert_return (invoke "check" (i32.const 16)) (f64.const 0x1.4666666666667p+2)) +(assert_return (invoke "check" (i32.const 24)) (f64.const 0x1.4888888888889p+2)) + +;; Test that ult/ugt/etc. aren't folded to olt/ogt/etc. + +(module + (func (export "f32.ult") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.ge (local.get $x) (local.get $y)))) + (func (export "f32.ule") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.gt (local.get $x) (local.get $y)))) + (func (export "f32.ugt") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.le (local.get $x) (local.get $y)))) + (func (export "f32.uge") (param $x f32) (param $y f32) (result i32) (i32.eqz (f32.lt (local.get $x) (local.get $y)))) + + (func (export "f64.ult") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.ge (local.get $x) (local.get $y)))) + (func (export "f64.ule") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.gt (local.get $x) (local.get $y)))) + (func (export "f64.ugt") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.le (local.get $x) (local.get $y)))) + (func (export "f64.uge") (param $x f64) (param $y f64) (result i32) (i32.eqz (f64.lt (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.ult" (f32.const 3.0) (f32.const 2.0)) (i32.const 0)) +(assert_return (invoke "f32.ult" (f32.const 2.0) (f32.const 2.0)) (i32.const 0)) +(assert_return (invoke "f32.ult" (f32.const 2.0) (f32.const 3.0)) (i32.const 1)) +(assert_return (invoke "f32.ult" (f32.const 2.0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "f32.ule" (f32.const 3.0) (f32.const 2.0)) (i32.const 0)) +(assert_return (invoke "f32.ule" (f32.const 2.0) (f32.const 2.0)) (i32.const 1)) +(assert_return (invoke "f32.ule" (f32.const 2.0) (f32.const 3.0)) (i32.const 1)) +(assert_return (invoke "f32.ule" (f32.const 2.0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "f32.ugt" (f32.const 3.0) (f32.const 2.0)) (i32.const 1)) +(assert_return (invoke "f32.ugt" (f32.const 2.0) (f32.const 2.0)) (i32.const 0)) +(assert_return (invoke "f32.ugt" (f32.const 2.0) (f32.const 3.0)) (i32.const 0)) +(assert_return (invoke "f32.ugt" (f32.const 2.0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "f32.uge" (f32.const 3.0) (f32.const 2.0)) (i32.const 1)) +(assert_return (invoke "f32.uge" (f32.const 2.0) (f32.const 2.0)) (i32.const 1)) +(assert_return (invoke "f32.uge" (f32.const 2.0) (f32.const 3.0)) (i32.const 0)) +(assert_return (invoke "f32.uge" (f32.const 2.0) (f32.const nan)) (i32.const 1)) +(assert_return (invoke "f64.ult" (f64.const 3.0) (f64.const 2.0)) (i32.const 0)) +(assert_return (invoke "f64.ult" (f64.const 2.0) (f64.const 2.0)) (i32.const 0)) +(assert_return (invoke "f64.ult" (f64.const 2.0) (f64.const 3.0)) (i32.const 1)) +(assert_return (invoke "f64.ult" (f64.const 2.0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "f64.ule" (f64.const 3.0) (f64.const 2.0)) (i32.const 0)) +(assert_return (invoke "f64.ule" (f64.const 2.0) (f64.const 2.0)) (i32.const 1)) +(assert_return (invoke "f64.ule" (f64.const 2.0) (f64.const 3.0)) (i32.const 1)) +(assert_return (invoke "f64.ule" (f64.const 2.0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "f64.ugt" (f64.const 3.0) (f64.const 2.0)) (i32.const 1)) +(assert_return (invoke "f64.ugt" (f64.const 2.0) (f64.const 2.0)) (i32.const 0)) +(assert_return (invoke "f64.ugt" (f64.const 2.0) (f64.const 3.0)) (i32.const 0)) +(assert_return (invoke "f64.ugt" (f64.const 2.0) (f64.const nan)) (i32.const 1)) +(assert_return (invoke "f64.uge" (f64.const 3.0) (f64.const 2.0)) (i32.const 1)) +(assert_return (invoke "f64.uge" (f64.const 2.0) (f64.const 2.0)) (i32.const 1)) +(assert_return (invoke "f64.uge" (f64.const 2.0) (f64.const 3.0)) (i32.const 0)) +(assert_return (invoke "f64.uge" (f64.const 2.0) (f64.const nan)) (i32.const 1)) + +;; Test that x<y?x:y, etc. using select aren't folded to min, etc. + +(module + (func (export "f32.no_fold_lt_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.lt (local.get $x) (local.get $y)))) + (func (export "f32.no_fold_le_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.le (local.get $x) (local.get $y)))) + (func (export "f32.no_fold_gt_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.gt (local.get $x) (local.get $y)))) + (func (export "f32.no_fold_ge_select") (param $x f32) (param $y f32) (result f32) (select (local.get $x) (local.get $y) (f32.ge (local.get $x) (local.get $y)))) + + (func (export "f64.no_fold_lt_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.lt (local.get $x) (local.get $y)))) + (func (export "f64.no_fold_le_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.le (local.get $x) (local.get $y)))) + (func (export "f64.no_fold_gt_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.gt (local.get $x) (local.get $y)))) + (func (export "f64.no_fold_ge_select") (param $x f64) (param $y f64) (result f64) (select (local.get $x) (local.get $y) (f64.ge (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.no_fold_lt_select" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_lt_select" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_lt_select" (f32.const 0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_lt_select" (f32.const -0.0) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_le_select" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_le_select" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_le_select" (f32.const 0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_le_select" (f32.const -0.0) (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_gt_select" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_gt_select" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_gt_select" (f32.const 0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_gt_select" (f32.const -0.0) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_select" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_ge_select" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_select" (f32.const 0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_select" (f32.const -0.0) (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f64.no_fold_lt_select" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_lt_select" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_lt_select" (f64.const 0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_lt_select" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_le_select" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_le_select" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_le_select" (f64.const 0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_le_select" (f64.const -0.0) (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_gt_select" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_gt_select" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_gt_select" (f64.const 0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_gt_select" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_select" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_ge_select" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_select" (f64.const 0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_select" (f64.const -0.0) (f64.const 0.0)) (f64.const -0.0)) + +;; Test that x<y?x:y, etc. using if and else aren't folded to min, etc. + +(module + (func (export "f32.no_fold_lt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.lt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f32.no_fold_le_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.le (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f32.no_fold_gt_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.gt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f32.no_fold_ge_if") (param $x f32) (param $y f32) (result f32) (if f32 (f32.ge (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + + (func (export "f64.no_fold_lt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.lt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f64.no_fold_le_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.le (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f64.no_fold_gt_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.gt (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) + (func (export "f64.no_fold_ge_if") (param $x f64) (param $y f64) (result f64) (if f64 (f64.ge (local.get $x) (local.get $y)) (local.get $x) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_lt_if" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_lt_if" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_lt_if" (f32.const 0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_lt_if" (f32.const -0.0) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_le_if" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_le_if" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_le_if" (f32.const 0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_le_if" (f32.const -0.0) (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_gt_if" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_gt_if" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_gt_if" (f32.const 0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_gt_if" (f32.const -0.0) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_if" (f32.const 0.0) (f32.const nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_ge_if" (f32.const nan) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_if" (f32.const 0.0) (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_if" (f32.const -0.0) (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f64.no_fold_lt_if" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_lt_if" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_lt_if" (f64.const 0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_lt_if" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_le_if" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_le_if" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_le_if" (f64.const 0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_le_if" (f64.const -0.0) (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_gt_if" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_gt_if" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_gt_if" (f64.const 0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_gt_if" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_if" (f64.const 0.0) (f64.const nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_ge_if" (f64.const nan) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_if" (f64.const 0.0) (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_if" (f64.const -0.0) (f64.const 0.0)) (f64.const -0.0)) + +;; Test that x<0?-x:0, etc. using select aren't folded to abs + +(module + (func (export "f32.no_fold_lt_select_to_abs") (param $x f32) (result f32) (select (f32.neg (local.get $x)) (local.get $x) (f32.lt (local.get $x) (f32.const 0.0)))) + (func (export "f32.no_fold_le_select_to_abs") (param $x f32) (result f32) (select (f32.neg (local.get $x)) (local.get $x) (f32.le (local.get $x) (f32.const -0.0)))) + (func (export "f32.no_fold_gt_select_to_abs") (param $x f32) (result f32) (select (local.get $x) (f32.neg (local.get $x)) (f32.gt (local.get $x) (f32.const -0.0)))) + (func (export "f32.no_fold_ge_select_to_abs") (param $x f32) (result f32) (select (local.get $x) (f32.neg (local.get $x)) (f32.ge (local.get $x) (f32.const 0.0)))) + + (func (export "f64.no_fold_lt_select_to_abs") (param $x f64) (result f64) (select (f64.neg (local.get $x)) (local.get $x) (f64.lt (local.get $x) (f64.const 0.0)))) + (func (export "f64.no_fold_le_select_to_abs") (param $x f64) (result f64) (select (f64.neg (local.get $x)) (local.get $x) (f64.le (local.get $x) (f64.const -0.0)))) + (func (export "f64.no_fold_gt_select_to_abs") (param $x f64) (result f64) (select (local.get $x) (f64.neg (local.get $x)) (f64.gt (local.get $x) (f64.const -0.0)))) + (func (export "f64.no_fold_ge_select_to_abs") (param $x f64) (result f64) (select (local.get $x) (f64.neg (local.get $x)) (f64.ge (local.get $x) (f64.const 0.0)))) +) + +(assert_return (invoke "f32.no_fold_lt_select_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000)) +(assert_return (invoke "f32.no_fold_lt_select_to_abs" (f32.const -nan)) (f32.const -nan)) +(assert_return (invoke "f32.no_fold_lt_select_to_abs" (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_lt_select_to_abs" (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_le_select_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000)) +(assert_return (invoke "f32.no_fold_le_select_to_abs" (f32.const -nan)) (f32.const -nan)) +(assert_return (invoke "f32.no_fold_le_select_to_abs" (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_le_select_to_abs" (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_gt_select_to_abs" (f32.const nan:0x200000)) (f32.const -nan:0x200000)) +(assert_return (invoke "f32.no_fold_gt_select_to_abs" (f32.const -nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_gt_select_to_abs" (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_gt_select_to_abs" (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_select_to_abs" (f32.const nan:0x200000)) (f32.const -nan:0x200000)) +(assert_return (invoke "f32.no_fold_ge_select_to_abs" (f32.const -nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_ge_select_to_abs" (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_select_to_abs" (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f64.no_fold_lt_select_to_abs" (f64.const nan:0x4000000000000)) (f64.const nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_lt_select_to_abs" (f64.const -nan)) (f64.const -nan)) +(assert_return (invoke "f64.no_fold_lt_select_to_abs" (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_lt_select_to_abs" (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_le_select_to_abs" (f64.const nan:0x4000000000000)) (f64.const nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_le_select_to_abs" (f64.const -nan)) (f64.const -nan)) +(assert_return (invoke "f64.no_fold_le_select_to_abs" (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_le_select_to_abs" (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_gt_select_to_abs" (f64.const nan:0x4000000000000)) (f64.const -nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_gt_select_to_abs" (f64.const -nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_gt_select_to_abs" (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_gt_select_to_abs" (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_select_to_abs" (f64.const nan:0x4000000000000)) (f64.const -nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_ge_select_to_abs" (f64.const -nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_ge_select_to_abs" (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_select_to_abs" (f64.const -0.0)) (f64.const -0.0)) + +;; Test that x<0?-x:0, etc. using if aren't folded to abs + +(module + (func (export "f32.no_fold_lt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.lt (local.get $x) (f32.const 0.0)) (f32.neg (local.get $x)) (local.get $x))) + (func (export "f32.no_fold_le_if_to_abs") (param $x f32) (result f32) (if f32 (f32.le (local.get $x) (f32.const -0.0)) (f32.neg (local.get $x)) (local.get $x))) + (func (export "f32.no_fold_gt_if_to_abs") (param $x f32) (result f32) (if f32 (f32.gt (local.get $x) (f32.const -0.0)) (local.get $x) (f32.neg (local.get $x)))) + (func (export "f32.no_fold_ge_if_to_abs") (param $x f32) (result f32) (if f32 (f32.ge (local.get $x) (f32.const 0.0)) (local.get $x) (f32.neg (local.get $x)))) + + (func (export "f64.no_fold_lt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.lt (local.get $x) (f64.const 0.0)) (f64.neg (local.get $x)) (local.get $x))) + (func (export "f64.no_fold_le_if_to_abs") (param $x f64) (result f64) (if f64 (f64.le (local.get $x) (f64.const -0.0)) (f64.neg (local.get $x)) (local.get $x))) + (func (export "f64.no_fold_gt_if_to_abs") (param $x f64) (result f64) (if f64 (f64.gt (local.get $x) (f64.const -0.0)) (local.get $x) (f64.neg (local.get $x)))) + (func (export "f64.no_fold_ge_if_to_abs") (param $x f64) (result f64) (if f64 (f64.ge (local.get $x) (f64.const 0.0)) (local.get $x) (f64.neg (local.get $x)))) +) + +(assert_return (invoke "f32.no_fold_lt_if_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000)) +(assert_return (invoke "f32.no_fold_lt_if_to_abs" (f32.const -nan)) (f32.const -nan)) +(assert_return (invoke "f32.no_fold_lt_if_to_abs" (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_lt_if_to_abs" (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_le_if_to_abs" (f32.const nan:0x200000)) (f32.const nan:0x200000)) +(assert_return (invoke "f32.no_fold_le_if_to_abs" (f32.const -nan)) (f32.const -nan)) +(assert_return (invoke "f32.no_fold_le_if_to_abs" (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_le_if_to_abs" (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_gt_if_to_abs" (f32.const nan:0x200000)) (f32.const -nan:0x200000)) +(assert_return (invoke "f32.no_fold_gt_if_to_abs" (f32.const -nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_gt_if_to_abs" (f32.const 0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_gt_if_to_abs" (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_if_to_abs" (f32.const nan:0x200000)) (f32.const -nan:0x200000)) +(assert_return (invoke "f32.no_fold_ge_if_to_abs" (f32.const -nan)) (f32.const nan)) +(assert_return (invoke "f32.no_fold_ge_if_to_abs" (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_ge_if_to_abs" (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f64.no_fold_lt_if_to_abs" (f64.const nan:0x4000000000000)) (f64.const nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_lt_if_to_abs" (f64.const -nan)) (f64.const -nan)) +(assert_return (invoke "f64.no_fold_lt_if_to_abs" (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_lt_if_to_abs" (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_le_if_to_abs" (f64.const nan:0x4000000000000)) (f64.const nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_le_if_to_abs" (f64.const -nan)) (f64.const -nan)) +(assert_return (invoke "f64.no_fold_le_if_to_abs" (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_le_if_to_abs" (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_gt_if_to_abs" (f64.const nan:0x4000000000000)) (f64.const -nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_gt_if_to_abs" (f64.const -nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_gt_if_to_abs" (f64.const 0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_gt_if_to_abs" (f64.const -0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_if_to_abs" (f64.const nan:0x4000000000000)) (f64.const -nan:0x4000000000000)) +(assert_return (invoke "f64.no_fold_ge_if_to_abs" (f64.const -nan)) (f64.const nan)) +(assert_return (invoke "f64.no_fold_ge_if_to_abs" (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_ge_if_to_abs" (f64.const -0.0)) (f64.const -0.0)) + +;; Test for a historic spreadsheet bug. +;; https://support.microsoft.com/en-us/kb/78113 + +(module + (func (export "incorrect_correction") (result f32) + (f32.sub (f32.sub (f32.add (f32.const 1.333) (f32.const 1.225)) (f32.const 1.333)) (f32.const 1.225)) + ) +) + +(assert_return (invoke "incorrect_correction") (f32.const 0x1p-23)) + +(module + (func (export "incorrect_correction") (result f64) + (f64.sub (f64.sub (f64.add (f64.const 1.333) (f64.const 1.225)) (f64.const 1.333)) (f64.const 1.225)) + ) +) + +(assert_return (invoke "incorrect_correction") (f64.const -0x1p-52)) + +;; Test for a historical calculator bug. +;; http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=735 + +(module + (func (export "calculate") (result f32) + (local $x f32) + (local $r f32) + (local $q f32) + (local $z0 f32) + (local $z1 f32) + (local.set $x (f32.const 156.25)) + (local.set $r (f32.const 208.333333334)) + (local.set $q (f32.const 1.77951304201)) + (local.set $z0 (f32.div (f32.mul (f32.neg (local.get $r)) (local.get $x)) (f32.sub (f32.mul (local.get $x) (local.get $q)) (local.get $r)))) + (local.set $z1 (f32.div (f32.mul (f32.neg (local.get $r)) (local.get $x)) (f32.sub (f32.mul (local.get $x) (local.get $q)) (local.get $r)))) + (block (br_if 0 (f32.eq (local.get $z0) (local.get $z1))) (unreachable)) + (local.get $z1) + ) +) + +(assert_return (invoke "calculate") (f32.const -0x1.d2ed46p+8)) + +(module + (func (export "calculate") (result f64) + (local $x f64) + (local $r f64) + (local $q f64) + (local $z0 f64) + (local $z1 f64) + (local.set $x (f64.const 156.25)) + (local.set $r (f64.const 208.333333334)) + (local.set $q (f64.const 1.77951304201)) + (local.set $z0 (f64.div (f64.mul (f64.neg (local.get $r)) (local.get $x)) (f64.sub (f64.mul (local.get $x) (local.get $q)) (local.get $r)))) + (local.set $z1 (f64.div (f64.mul (f64.neg (local.get $r)) (local.get $x)) (f64.sub (f64.mul (local.get $x) (local.get $q)) (local.get $r)))) + (block (br_if 0 (f64.eq (local.get $z0) (local.get $z1))) (unreachable)) + (local.get $z1) + ) +) + +(assert_return (invoke "calculate") (f64.const -0x1.d2ed4d0218c93p+8)) + +;; Test that 0 - (-0 - x) is not optimized to x. +;; https://llvm.org/bugs/show_bug.cgi?id=26746 + +(module + (func (export "llvm_pr26746") (param $x f32) (result f32) + (f32.sub (f32.const 0.0) (f32.sub (f32.const -0.0) (local.get $x))) + ) +) + +(assert_return (invoke "llvm_pr26746" (f32.const -0.0)) (f32.const 0.0)) + +;; Test for improperly reassociating an addition and a conversion. +;; https://llvm.org/bugs/show_bug.cgi?id=27153 + +(module + (func (export "llvm_pr27153") (param $x i32) (result f32) + (f32.add (f32.convert_i32_s (i32.and (local.get $x) (i32.const 268435455))) (f32.const -8388608.0)) + ) +) + +(assert_return (invoke "llvm_pr27153" (i32.const 33554434)) (f32.const 25165824.000000)) + +;; Test that (float)x + (float)y is not optimized to (float)(x + y) when unsafe. +;; https://llvm.org/bugs/show_bug.cgi?id=27036 + +(module + (func (export "llvm_pr27036") (param $x i32) (param $y i32) (result f32) + (f32.add (f32.convert_i32_s (i32.or (local.get $x) (i32.const -25034805))) + (f32.convert_i32_s (i32.and (local.get $y) (i32.const 14942208)))) + ) +) + +(assert_return (invoke "llvm_pr27036" (i32.const -25034805) (i32.const 14942208)) (f32.const -0x1.340068p+23)) + +;; Test for bugs in old versions of historic IEEE 754 platforms as reported in: +;; +;; N. L. Schryer. 1981. A Test of a Computer's Floating-Point Arithmetic Unit. +;; Tech. Rep. Computer Science Technical Report 89, AT&T Bell Laboratories, Feb. +;; +;; specifically, the appendices describing IEEE systems with "The Past" sections +;; describing specific bugs. The 0 < 0 bug is omitted here due to being already +;; covered elsewhere. +(module + (func (export "thepast0") (param $a f64) (param $b f64) (param $c f64) (param $d f64) (result f64) + (f64.div (f64.mul (local.get $a) (local.get $b)) (f64.mul (local.get $c) (local.get $d))) + ) + + (func (export "thepast1") (param $a f64) (param $b f64) (param $c f64) (result f64) + (f64.sub (f64.mul (local.get $a) (local.get $b)) (local.get $c)) + ) + + (func (export "thepast2") (param $a f32) (param $b f32) (param $c f32) (result f32) + (f32.mul (f32.mul (local.get $a) (local.get $b)) (local.get $c)) + ) +) + +(assert_return (invoke "thepast0" (f64.const 0x1p-1021) (f64.const 0x1.fffffffffffffp-1) (f64.const 0x1p1) (f64.const 0x1p-1)) (f64.const 0x1.fffffffffffffp-1022)) +(assert_return (invoke "thepast1" (f64.const 0x1p-54) (f64.const 0x1.fffffffffffffp-1) (f64.const 0x1p-54)) (f64.const -0x1p-107)) +(assert_return (invoke "thepast2" (f32.const 0x1p-125) (f32.const 0x1p-1) (f32.const 0x1p0)) (f32.const 0x1p-126)) + +;; Test for floating point tolerances observed in some GPUs. +;; https://community.amd.com/thread/145582 + +(module + (func (export "inverse") (param $x f32) (result f32) + (f32.div (f32.const 1.0) (local.get $x)) + ) +) + +(assert_return (invoke "inverse" (f32.const 96.0)) (f32.const 0x1.555556p-7)) + +;; Test for incorrect rounding on sqrt(4.0). +;; http://www.askvg.com/microsoft-windows-calculator-bug/ + +(module + (func (export "f32_sqrt_minus_2") (param $x f32) (result f32) + (f32.sub (f32.sqrt (local.get $x)) (f32.const 2.0)) + ) + + (func (export "f64_sqrt_minus_2") (param $x f64) (result f64) + (f64.sub (f64.sqrt (local.get $x)) (f64.const 2.0)) + ) +) + +(assert_return (invoke "f32_sqrt_minus_2" (f32.const 4.0)) (f32.const 0.0)) +(assert_return (invoke "f64_sqrt_minus_2" (f64.const 4.0)) (f64.const 0.0)) + +;; Test that 1.0 / (1.0 / x) is not optimized to x. + +(module + (func (export "f32.no_fold_recip_recip") (param $x f32) (result f32) + (f32.div (f32.const 1.0) (f32.div (f32.const 1.0) (local.get $x)))) + + (func (export "f64.no_fold_recip_recip") (param $x f64) (result f64) + (f64.div (f64.const 1.0) (f64.div (f64.const 1.0) (local.get $x)))) +) + +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -0x1.e8bf18p+65)) (f32.const -0x1.e8bf16p+65)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const 0x1.e24248p-77)) (f32.const 0x1.e24246p-77)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const 0x1.caf0e8p-64)) (f32.const 0x1.caf0eap-64)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -0x1.e66982p+4)) (f32.const -0x1.e66984p+4)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const 0x1.f99916p+70)) (f32.const 0x1.f99914p+70)) + +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -0x0p+0)) (f32.const -0x0p+0)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const 0x0p+0)) (f32.const 0x0p+0)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const -infinity)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_recip_recip" (f32.const infinity)) (f32.const infinity)) + +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const -0x1.d81248dda63dp+148)) (f64.const -0x1.d81248dda63d1p+148)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const -0x1.f4750312039e3p+66)) (f64.const -0x1.f4750312039e2p+66)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const 0x1.fa50630eec7f6p+166)) (f64.const 0x1.fa50630eec7f5p+166)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const 0x1.db0598617ba92p-686)) (f64.const 0x1.db0598617ba91p-686)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const 0x1.85f1638a0c82bp+902)) (f64.const 0x1.85f1638a0c82ap+902)) + +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const -0x0p+0)) (f64.const -0x0p+0)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const 0x0p+0)) (f64.const 0x0p+0)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const -infinity)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_recip_recip" (f64.const infinity)) (f64.const infinity)) + +;; Test that (x+y) * (x-y) is not optimized to x*x - y*y. + +(module + (func (export "f32.no_algebraic_factoring") (param $x f32) (param $y f32) (result f32) + (f32.mul (f32.add (local.get $x) (local.get $y)) + (f32.sub (local.get $x) (local.get $y)))) + + (func (export "f64.no_algebraic_factoring") (param $x f64) (param $y f64) (result f64) + (f64.mul (f64.add (local.get $x) (local.get $y)) + (f64.sub (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const -0x1.ef678ep-55) (f32.const 0x1.c160b8p-54)) (f32.const -0x1.129402p-107)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const -0x1.2d76bcp+24) (f32.const 0x1.f4089cp+24)) (f32.const -0x1.36d89ap+49)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.7ca2b2p+45) (f32.const -0x1.08513cp+47)) (f32.const -0x1.db10dep+93)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.7d5e3p+17) (f32.const -0x1.c783b4p+7)) (f32.const 0x1.1c10a6p+35)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const -0x1.daf96p+7) (f32.const -0x1.dac6bp+19)) (f32.const -0x1.b8422ep+39)) + +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const 0x1.e17c0a02ac6b5p-476) (f64.const 0x1.e8f13f1fcdc14p-463)) (f64.const -0x1.d2ec518f62863p-925)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const 0x1.971b55a57e3a3p-377) (f64.const 0x1.edeb4233c1b27p-399)) (f64.const 0x1.43b3f69fb258bp-753)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.c3b9dc02472fap-378) (f64.const -0x1.74e9faebaff14p-369)) (f64.const -0x1.0f9c07e8caa25p-737)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.afaf4688ed019p+179) (f64.const 0x1.b07171cb49e94p+188)) (f64.const -0x1.6d3f2e2bebcf7p+377)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const 0x1.4377a98948f12p+114) (f64.const -0x1.500c05bd24c97p+90)) (f64.const 0x1.98b72dbf7bf72p+228)) + +;; Test that x*x - y*y is not optimized to (x+y) * (x-y). + +(module + (func (export "f32.no_algebraic_factoring") (param $x f32) (param $y f32) (result f32) + (f32.sub (f32.mul (local.get $x) (local.get $x)) + (f32.mul (local.get $y) (local.get $y)))) + + (func (export "f64.no_algebraic_factoring") (param $x f64) (param $y f64) (result f64) + (f64.sub (f64.mul (local.get $x) (local.get $x)) + (f64.mul (local.get $y) (local.get $y)))) +) + +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.8e2c14p-46) (f32.const 0x1.bad59ap-39)) (f32.const -0x1.7efe5p-77)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const -0x1.7ef192p+41) (f32.const -0x1.db184ap+33)) (f32.const 0x1.1e6932p+83)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.7eb458p-12) (f32.const -0x1.52c498p-13)) (f32.const 0x1.cc0bc6p-24)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.2675c6p-44) (f32.const -0x1.edd31ap-46)) (f32.const 0x1.17294cp-88)) +(assert_return (invoke "f32.no_algebraic_factoring" (f32.const 0x1.9a5f92p+51) (f32.const -0x1.2b0098p+52)) (f32.const -0x1.7189a6p+103)) + +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const 0x1.749a128f18f69p+356) (f64.const -0x1.0bc97ee1354e1p+337)) (f64.const 0x1.0f28115518d74p+713)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.2dab01b2215eap+309) (f64.const -0x1.e12b288bff2bdp+331)) (f64.const -0x1.c4319ad25d201p+663)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const 0x1.3ed898431e102p+42) (f64.const -0x1.c409183fa92e6p+39)) (f64.const 0x1.80a611103c71dp+84)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.be663e4c0e4b2p+182) (f64.const -0x1.da85703760d25p+166)) (f64.const 0x1.853434f1a2ffep+365)) +(assert_return (invoke "f64.no_algebraic_factoring" (f64.const -0x1.230e09952df1cp-236) (f64.const -0x1.fa2752adfadc9p-237)) (f64.const 0x1.42e43156bd1b8p-474)) + +;; Test that plain summation is not reassociated, and that Kahan summation +;; isn't optimized into plain summation. + +(module + (memory (data + "\c4\c5\57\24\a5\84\c8\0b\6d\b8\4b\2e\f2\76\17\1c\ca\4a\56\1e\1b\6e\71\22" + "\5d\17\1e\6e\bf\cd\14\5c\c7\21\55\51\39\9c\1f\b2\51\f0\a3\93\d7\c1\2c\ae" + "\7e\a8\28\3a\01\21\f4\0a\58\93\f8\42\77\9f\83\39\6a\5f\ba\f7\0a\d8\51\6a" + "\34\ca\ad\c6\34\0e\d8\26\dc\4c\33\1c\ed\29\90\a8\78\0f\d1\ce\76\31\23\83" + "\b8\35\e8\f2\44\b0\d3\a1\fc\bb\32\e1\b0\ba\69\44\09\d6\d9\7d\ff\2e\c0\5a" + "\36\14\33\14\3e\a9\fa\87\6d\8b\bc\ce\9d\a7\fd\c4\e9\85\3f\dd\d7\e1\18\a6" + "\50\26\72\6e\3f\73\0f\f8\12\93\23\34\61\76\12\48\c0\9b\05\93\eb\ac\86\de" + "\94\3e\55\e8\8c\e8\dd\e4\fc\95\47\be\56\03\21\20\4c\e6\bf\7b\f6\7f\d5\ba" + "\73\1c\c1\14\8f\c4\27\96\b3\bd\33\ff\78\41\5f\c0\5a\ce\f6\67\6e\73\9a\17" + "\66\70\03\f8\ce\27\a3\52\b2\9f\3b\bf\fb\ae\ed\d3\5a\f8\37\57\f0\f5\6e\ef" + "\b1\4d\70\3d\54\a7\01\9a\85\08\48\91\f5\9d\0c\60\87\5b\d9\54\1e\51\6d\88" + "\8e\08\8c\a5\71\3a\56\08\67\46\8f\8f\13\2a\2c\ec\2c\1f\b4\62\2b\6f\41\0a" + "\c4\65\42\a2\31\6b\2c\7d\3e\bb\75\ac\86\97\30\d9\48\cd\9a\1f\56\c4\c6\e4" + "\12\c0\9d\fb\ee\02\8c\ce\1c\f2\1e\a1\78\23\db\c4\1e\49\03\d3\71\cc\08\50" + "\c5\d8\5c\ed\d5\b5\65\ac\b5\c9\21\d2\c9\29\76\de\f0\30\1a\5b\3c\f2\3b\db" + "\3a\39\82\3a\16\08\6f\a8\f1\be\69\69\99\71\a6\05\d3\14\93\2a\16\f2\2f\11" + "\c7\7e\20\bb\91\44\ee\f8\e4\01\53\c0\b9\7f\f0\bf\f0\03\9c\6d\b1\df\a2\44" + "\01\6d\6b\71\2b\5c\b3\21\19\46\5e\8f\db\91\d3\7c\78\6b\b7\12\00\8f\eb\bd" + "\8a\f5\d4\2e\c4\c1\1e\df\73\63\59\47\49\03\0a\b7\cf\24\cf\9c\0e\44\7a\9e" + "\14\fb\42\bf\9d\39\30\9e\a0\ab\2f\d1\ae\9e\6a\83\43\e3\55\7d\85\bf\63\8a" + "\f8\96\10\1f\fe\6d\e7\22\1b\e1\69\46\8a\44\c8\c8\f9\0c\2b\19\07\a5\02\3e" + "\f2\30\10\9a\85\8a\5f\ef\81\45\a0\77\b1\03\10\73\4b\ae\98\9d\47\bf\9a\2d" + "\3a\d5\0f\03\66\e3\3d\53\d9\40\ce\1f\6f\32\2f\21\2b\23\21\6c\62\d4\a7\3e" + "\a8\ce\28\31\2d\00\3d\67\5e\af\a0\cf\2e\d2\b9\6b\84\eb\69\08\3c\62\36\be" + "\12\fd\36\7f\88\3e\ad\bc\0b\c0\41\c4\50\b6\e3\50\31\e8\ce\e2\96\65\55\9c" + "\16\46\e6\b0\2d\3a\e8\81\05\b0\bf\34\f7\bc\10\1c\fb\cc\3c\f1\85\97\42\9f" + "\eb\14\8d\3c\bf\d7\17\88\49\9d\8b\2b\b2\3a\83\d1\4f\04\9e\a1\0f\ad\08\9d" + "\54\af\d1\82\c3\ec\32\2f\02\8f\05\21\2d\a2\b7\e4\f4\6f\2e\81\2b\0b\9c\fc" + "\cb\fe\74\02\f9\db\f4\f3\ea\00\a8\ec\d1\99\74\26\dd\d6\34\d5\25\b1\46\dd" + "\9c\aa\71\f5\60\b0\88\c8\e0\0b\59\5a\25\4f\29\66\f9\e3\2e\fe\e9\da\e5\18" + "\4f\27\62\f4\ce\a4\21\95\74\c7\57\64\27\9a\4c\fd\54\7d\61\ce\c3\ac\87\46" + "\9c\fa\ff\09\ca\79\97\67\24\74\ca\d4\21\83\26\25\19\12\37\64\19\e5\65\e0" + "\74\75\8e\dd\c8\ef\74\c7\d8\21\2b\79\04\51\46\65\60\03\5d\fa\d8\f4\65\a4" + "\9e\5d\23\da\d7\8a\92\80\a4\de\78\3c\f1\57\42\6d\cd\c9\2f\d5\a4\9e\ab\40" + "\f4\cb\1b\d7\a3\ca\fc\eb\a7\01\b2\9a\69\4e\46\9b\18\4e\dd\79\a7\aa\a6\52" + "\39\1e\ef\30\cc\9b\bd\5b\ee\4c\21\6d\30\00\72\b0\46\5f\08\cf\c5\b9\e0\3e" + "\c2\b3\0c\dc\8e\64\de\19\42\79\cf\43\ea\43\5d\8e\88\f7\ab\15\dc\3f\c8\67" + "\20\db\b8\64\b1\47\1f\de\f2\cb\3f\59\9f\d8\46\90\dc\ae\2f\22\f9\e2\31\89" + "\d9\9c\1c\4c\d3\a9\4a\57\84\9c\9f\ea\2c\3c\ae\3c\c3\1e\8b\e5\4e\17\01\25" + "\db\34\46\5f\15\ea\05\0c\7c\d9\45\8c\19\d0\73\8a\96\16\dd\44\f9\05\b7\5b" + "\71\b0\e6\21\36\5f\75\89\91\73\75\ab\7d\ae\d3\73\ec\37\c6\ea\55\75\ef\ea" + "\ab\8b\7b\11\dc\6d\1a\b2\6a\c4\25\cf\aa\e3\9f\49\49\89\cb\37\9b\0a\a7\01" + "\60\70\dc\b7\c8\83\e1\42\f5\be\ad\62\94\ad\8d\a1" + )) + + (func (export "f32.kahan_sum") (param $p i32) (param $n i32) (result f32) + (local $sum f32) + (local $c f32) + (local $t f32) + (block $exit + (loop $top + (local.set $t + (f32.sub + (f32.sub + (local.tee $sum + (f32.add + (local.get $c) + (local.tee $t + (f32.sub (f32.load (local.get $p)) (local.get $t)) + ) + ) + ) + (local.get $c) + ) + (local.get $t) + ) + ) + (local.set $p (i32.add (local.get $p) (i32.const 4))) + (local.set $c (local.get $sum)) + (br_if $top (local.tee $n (i32.add (local.get $n) (i32.const -1)))) + ) + ) + (local.get $sum) + ) + + (func (export "f32.plain_sum") (param $p i32) (param $n i32) (result f32) + (local $sum f32) + (block $exit + (loop $top + (local.set $sum (f32.add (local.get $sum) (f32.load (local.get $p)))) + (local.set $p (i32.add (local.get $p) (i32.const 4))) + (local.set $n (i32.add (local.get $n) (i32.const -1))) + (br_if $top (local.get $n)) + ) + ) + (local.get $sum) + ) +) + +(assert_return (invoke "f32.kahan_sum" (i32.const 0) (i32.const 256)) (f32.const -0x1.101a1ap+104)) +(assert_return (invoke "f32.plain_sum" (i32.const 0) (i32.const 256)) (f32.const -0x1.a0343ap+103)) + +(module + (memory (data "\13\05\84\42\5d\a2\2c\c6\43\db\55\a9\cd\da\55\e3\73\fc\58\d6\ba\d5\00\fd\83\35\42\88\8b\13\5d\38\4a\47\0d\72\73\a1\1a\ef\c4\45\17\57\d8\c9\46\e0\8d\6c\e1\37\70\c8\83\5b\55\5e\5a\2d\73\1e\56\c8\e1\6d\69\14\78\0a\8a\5a\64\3a\09\c7\a8\87\c5\f0\d3\5d\e6\03\fc\93\be\26\ca\d6\a9\91\60\bd\b0\ed\ae\f7\30\7e\92\3a\6f\a7\59\8e\aa\7d\bf\67\58\2a\54\f8\4e\fe\ed\35\58\a6\51\bf\42\e5\4b\66\27\24\6d\7f\42\2d\28\92\18\ec\08\ae\e7\55\da\b1\a6\65\a5\72\50\47\1b\b8\a9\54\d7\a6\06\5b\0f\42\58\83\8a\17\82\c6\10\43\a0\c0\2e\6d\bc\5a\85\53\72\7f\ad\44\bc\30\3c\55\b2\24\9a\74\3a\9e\e1\d8\0f\70\fc\a9\3a\cd\93\4b\ec\e3\7e\dd\5d\27\cd\f8\a0\9d\1c\11\c0\57\2e\fd\c8\13\32\cc\3a\1a\7d\a3\41\55\ed\c3\82\49\2a\04\1e\ef\73\b9\2e\2e\e3\5f\f4\df\e6\b2\33\0c\39\3f\6f\44\6a\03\c1\42\b9\fa\b1\c8\ed\a5\58\99\7f\ed\b4\72\9e\79\eb\fb\43\82\45\aa\bb\95\d2\ff\28\9e\f6\a1\ad\95\d6\55\95\0d\6f\60\11\c7\78\3e\49\f2\7e\48\f4\a2\71\d0\13\8e\b3\de\99\52\e3\45\74\ea\76\0e\1b\2a\c8\ee\14\01\c4\50\5b\36\3c\ef\ba\72\a2\a6\08\f8\7b\36\9d\f9\ef\0b\c7\56\2d\5c\f0\9d\5d\de\fc\b8\ad\0f\64\0e\97\15\32\26\c2\31\e6\05\1e\ef\cb\17\1b\6d\15\0b\74\5d\d3\2e\f8\6b\86\b4\ba\73\52\53\99\a9\76\20\45\c9\40\80\6b\14\ed\a1\fa\80\46\e6\26\d2\e6\98\c4\57\bf\c4\1c\a4\90\7a\36\94\14\ba\15\89\6e\e6\9c\37\8c\f4\de\12\22\5d\a1\79\50\67\0d\3d\7a\e9\d4\aa\2e\7f\2a\7a\30\3d\ea\5d\12\48\fe\e1\18\cd\a4\57\a2\87\3e\b6\9a\8b\db\da\9d\78\9c\cf\8d\b1\4f\90\b4\34\e0\9d\f6\ca\fe\4c\3b\78\6d\0a\5c\18\9f\61\b9\dd\b4\e0\0f\76\e0\1b\69\0d\5e\58\73\70\5e\0e\2d\a1\7d\ff\20\eb\91\34\92\ac\38\72\2a\1f\8e\71\2e\6a\f1\af\c7\27\70\d9\c4\57\f7\d2\3c\1d\b8\f0\f0\64\cf\dc\ae\be\a3\cc\3e\22\7d\4e\69\21\63\17\ed\03\02\54\9a\0f\50\4e\13\5a\35\a1\22\a4\df\86\c2\74\79\16\b8\69\69\a0\52\5d\11\64\bd\5b\93\fc\69\a0\f4\13\d0\81\51\dd\fa\0c\15\c3\7a\c9\62\7a\a9\1d\c9\e6\5a\b3\5b\97\02\3c\64\22\12\3c\22\90\64\2d\30\54\4c\b4\a1\22\09\57\22\5e\8e\38\2b\02\a8\ae\f6\be\0d\2b\f2\03\ad\fa\10\01\71\77\2a\30\02\95\f6\00\3e\d0\c4\8d\34\19\50\21\0a\bc\50\da\3c\30\d6\3a\31\94\8d\3a\fe\ef\14\57\9d\4b\93\00\96\24\0c\6f\fd\bc\23\76\02\6c\eb\52\72\80\11\7e\80\3a\13\12\38\1d\38\49\95\40\27\8a\44\7b\e8\dc\6d\8c\8c\8e\3c\b5\b3\18\0e\f6\08\1a\84\41\35\ff\8b\b8\93\40\ea\e1\51\1d\89\a5\8d\42\68\29\ea\2f\c1\7a\52\eb\90\5d\4d\d6\80\e3\d7\75\48\ce\ed\d3\01\1c\8d\5b\a5\94\0d\78\cf\f1\06\13\2f\98\02\a4\6d\2e\6c\f2\d5\74\29\89\4c\f9\03\f5\c7\18\ad\7a\f0\68\f8\5c\d6\59\87\6e\d6\3f\06\be\86\20\e3\41\91\22\f3\6e\8b\f0\68\1c\57\a7\fc\b0\7c\9e\99\0b\96\1a\89\5f\e6\0d\7c\08\51\a0\a2\67\9a\47\00\93\6b\f9\28\f0\68\db\62\f1\e0\65\2c\53\33\e0\a7\ca\11\42\30\f6\af\01\c1\65\3d\32\01\6f\ab\2e\be\d3\8b\be\14\c3\ff\ec\fb\f0\f9\c5\0c\05\6f\01\09\6b\e3\34\31\0c\1f\66\a6\42\bc\1a\87\49\16\16\8c\b0\90\0d\34\8c\0a\e1\09\5e\10\a4\6b\56\cc\f0\c9\bb\dc\b8\5c\ce\f6\cc\8d\75\7e\b3\07\88\04\2f\b4\5e\c9\e3\4a\23\73\19\62\6c\9a\03\76\44\86\9c\60\fc\db\72\8f\27\a0\dd\b3\c5\da\ff\f9\ec\6a\b1\7b\d3\cf\50\37\c9\7a\78\0c\e4\3a\b6\f5\e6\f4\98\6e\42\7d\35\73\8b\45\c0\56\97\cd\6d\ce\cf\ad\31\b3\c3\54\fa\ef\d5\c0\f4\6a\5f\54\e7\49\3e\33\0a\30\38\fd\d9\05\ff\a5\3f\57\46\14\b5\91\17\ca\6b\98\23\7a\65\b3\6c\02\b4\cc\79\5d\58\d8\b3\d5\94\ae\f4\6d\75\65\f7\92\bf\7e\47\4c\3c\ee\db\ac\f1\32\5d\fb\6f\41\1c\34\c8\83\4f\c2\58\01\be\05\3e\66\16\a6\04\6d\5d\4f\86\09\27\82\25\12\cd\3a\cd\ce\6b\bc\ca\ac\28\9b\ee\6a\25\86\9e\45\70\c6\d2\bd\3b\7d\42\e5\27\af\c7\1d\f4\81\c8\b3\76\8a\a8\36\a3\ae\2a\e6\18\e1\36\22\ad\f6\25\72\b0\39\8b\01\9a\22\7b\84\c3\2d\5f\72\a4\98\ac\15\70\e7\d4\18\e2\7d\d2\30\7c\33\08\cd\ca\c4\22\85\88\75\81\c6\4a\74\58\8d\e0\e8\ac\c5\ab\75\5a\f4\28\12\f0\18\45\52\f2\97\b2\93\41\6f\8d\7f\db\70\fb\a3\5d\1f\a7\8d\98\20\2b\22\9f\3a\01\b5\8b\1b\d2\cb\14\03\0e\14\14\d2\19\5a\1f\ce\5e\cd\81\79\15\01\ca\de\73\74\8c\56\20\9f\77\2d\25\16\f6\61\51\1d\a4\8e\9b\98\a5\c6\ec\a8\45\57\82\59\78\0d\90\b4\df\51\b0\c3\82\94\cc\b3\53\09\15\6d\96\6c\3a\40\47\b7\4a\7a\05\2f\a1\1e\8c\9d\a0\20\88\fb\52\b7\9f\f3\f3\bb\5f\e7\8a\61\a7\21\b1\ac\fa\09\aa\a4\6c\bc\24\80\ba\2a\e9\65\ff\70\ff\cc\fa\65\87\76\f3\c5\15\ce\cb\e8\42\31\00\0c\91\57\d9\e0\9d\35\54\24\ad\a4\d8\f9\08\67\63\c8\cf\81\dd\90\a2\d7\c4\07\4a\e6\10\6f\67\e7\27\d4\23\59\18\f2\a8\9d\5f\d8\94\30\aa\54\86\4f\87\9d\82\b5\26\ca\a6\96\bf\cf\55\f9\9d\37\01\19\48\43\c5\94\6c\f3\74\97\58\4c\3c\9d\08\e8\04\c2\58\30\76\e1\a0\f8\ea\e9\c5\ae\cf\78\9e\a9\0c\ac\b3\44\42\e0\bc\5d\1b\9c\49\58\4a\1c\19\49\c1\3a\ea\f5\eb\3b\81\a9\4b\70\0c\cc\9e\1a\d3\2f\b7\52\2f\20\3b\eb\64\51\1d\a0\2d\b2\3e\be\13\85\48\92\32\2e\db\5c\a1\e7\8c\45\91\35\01\0a\93\c2\eb\09\ce\f3\d2\22\24\d0\8c\cc\1d\9d\38\c8\4d\e3\82\cc\64\15\06\2d\e7\01\2f\ab\bb\b5\04\4c\92\1c\7a\d6\3f\e8\5f\31\15\0c\dc\e4\31\b4\c4\25\3e\2a\aa\00\9e\c8\e5\21\7a\7f\29\f1\c0\af\1d\5e\e8\63\39\ad\f8\7e\6c\c8\c5\7f\c2\a8\97\27\0a\d9\f4\21\6a\ea\03\09\fb\f7\96\3b\83\79\5f\7c\4b\30\9f\56\35\de\b4\73\d4\95\f0\14\c3\74\2f\0d\a3\1d\4e\8d\31\24\b3\1a\84\85\62\5a\7b\3c\14\39\17\e6\6d\eb\37\c2\00\58\5b\0b\e3\3c\8a\62\e1\f8\35\4b\56\e2\87\60\8b\be\a7\38\91\77\54\a9\5a\24\25\90\9f\a5\42\77\f3\5c\39\df\ff\74\07\76\a1\cd\1f\62\0b\81\81\68\af\05\c1\c0\7f\26\ee\c0\91\a3\6a\7d\29\61\45\27\e5\57\88\dc\0d\97\04\1a\33\a9\44\8a\da\02\10\45\3f\8e\55\a6\76\8c\4d\e3\f1\89\83\c8\d0\f8\9b\50\77\9f\47\df\4c\9c\66\0d\aa\18\b8\5f\4f\c4\01\ce\dc\84\ac\46\9e\69\e1\76\45\6b\61\89\e4\5d\94\bb\11\83\9f\78\d8\0a\d2\f5\7e\5d\43\ea\bc\10\f1\3a\c9\e2\64\fb\53\65\d0\c7\b4\a7\fb\d4\05\53\25\d0\cd\29\88\00\56\25\24\7d\5d\b4\f3\41\9f\e9\b5\f7\ae\64\2c\e3\c9\6d\d5\84\3a\72\12\b8\7a\d9\1b\09\e8\38\da\26\4f\04\ce\03\71\6e\8a\44\7b\5c\81\59\9c\d2\e4\c3\ba\59\a6\e5\28\a7\8f\9a\e4\d5\4e\b9\ca\7f\cb\75\b8\2b\43\3e\b3\15\46\b1\a5\bc\9d\9e\38\15\f1\bd\1b\21\aa\f1\82\00\95\fc\a7\77\47\39\a7\33\43\92\d7\52\40\4b\06\81\8a\a0\bd\f1\6b\99\84\42\5b\e2\3b\c5\5e\12\5c\28\4d\b6\0e\4e\c8\5c\e8\01\8a\c5\e7\e4\9d\42\ee\5d\9c\c4\eb\eb\68\09\27\92\95\9a\11\54\73\c4\12\80\fb\7d\fe\c5\08\60\7f\36\41\e0\10\ba\d6\2b\6c\f1\b4\17\fe\26\34\e3\4b\f8\a8\e3\91\be\4f\2a\fc\da\81\b8\e7\fe\d5\26\50\47\f3\1a\65\32\81\e0\05\b8\4f\32\31\26\00\4a\53\97\c2\c3\0e\2e\a1\26\54\ab\05\8e\56\2f\7d\af\22\84\68\a5\8b\97\f6\a4\fd\a8\cc\75\41\96\86\fd\27\3d\29\86\8d\7f\4c\d4\8e\73\41\f4\1e\e2\dd\58\27\97\ce\9c\94\cf\7a\04\2f\dc\ed" + )) + + (func (export "f64.kahan_sum") (param $p i32) (param $n i32) (result f64) + (local $sum f64) + (local $c f64) + (local $t f64) + (block $exit + (loop $top + (local.set $t + (f64.sub + (f64.sub + (local.tee $sum + (f64.add + (local.get $c) + (local.tee $t + (f64.sub (f64.load (local.get $p)) (local.get $t)) + ) + ) + ) + (local.get $c) + ) + (local.get $t) + ) + ) + (local.set $p (i32.add (local.get $p) (i32.const 8))) + (local.set $c (local.get $sum)) + (br_if $top (local.tee $n (i32.add (local.get $n) (i32.const -1)))) + ) + ) + (local.get $sum) + ) + + (func (export "f64.plain_sum") (param $p i32) (param $n i32) (result f64) + (local $sum f64) + (block $exit + (loop $top + (local.set $sum (f64.add (local.get $sum) (f64.load (local.get $p)))) + (local.set $p (i32.add (local.get $p) (i32.const 8))) + (local.set $n (i32.add (local.get $n) (i32.const -1))) + (br_if $top (local.get $n)) + ) + ) + (local.get $sum) + ) +) + +(assert_return (invoke "f64.kahan_sum" (i32.const 0) (i32.const 256)) (f64.const 0x1.dd7cb2a5ffc88p+998)) +(assert_return (invoke "f64.plain_sum" (i32.const 0) (i32.const 256)) (f64.const 0x1.dd7cb2a63fc87p+998)) + +;; Test that -(x - y) is not folded to y - x. + +(module + (func (export "f32.no_fold_neg_sub") (param $x f32) (param $y f32) (result f32) + (f32.neg (f32.sub (local.get $x) (local.get $y)))) + + (func (export "f64.no_fold_neg_sub") (param $x f64) (param $y f64) (result f64) + (f64.neg (f64.sub (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.no_fold_neg_sub" (f32.const -0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_neg_sub" (f32.const 0.0) (f32.const -0.0)) (f32.const -0.0)) +(assert_return (invoke "f32.no_fold_neg_sub" (f32.const -0.0) (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_neg_sub" (f32.const 0.0) (f32.const 0.0)) (f32.const -0.0)) + +(assert_return (invoke "f64.no_fold_neg_sub" (f64.const -0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_neg_sub" (f64.const 0.0) (f64.const -0.0)) (f64.const -0.0)) +(assert_return (invoke "f64.no_fold_neg_sub" (f64.const -0.0) (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_neg_sub" (f64.const 0.0) (f64.const 0.0)) (f64.const -0.0)) + +;; Test that -x + x is not folded to 0.0. + +(module + (func (export "f32.no_fold_add_neg") (param $x f32) (result f32) + (f32.add (f32.neg (local.get $x)) (local.get $x))) + + (func (export "f64.no_fold_add_neg") (param $x f64) (result f64) + (f64.add (f64.neg (local.get $x)) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_add_neg" (f32.const 0.0)) (f32.const 0.0)) +(assert_return (invoke "f32.no_fold_add_neg" (f32.const -0.0)) (f32.const 0.0)) +(assert_return_nan (invoke "f32.no_fold_add_neg" (f32.const infinity))) +(assert_return_nan (invoke "f32.no_fold_add_neg" (f32.const -infinity))) + +(assert_return (invoke "f64.no_fold_add_neg" (f64.const 0.0)) (f64.const 0.0)) +(assert_return (invoke "f64.no_fold_add_neg" (f64.const -0.0)) (f64.const 0.0)) +(assert_return_nan (invoke "f64.no_fold_add_neg" (f64.const infinity))) +(assert_return_nan (invoke "f64.no_fold_add_neg" (f64.const -infinity))) + +;; Test that x+x+x+x+x+x is not folded to x * 6. + +(module + (func (export "f32.no_fold_6x_via_add") (param $x f32) (result f32) + (f32.add (f32.add (f32.add (f32.add (f32.add + (local.get $x) + (local.get $x)) (local.get $x)) (local.get $x)) + (local.get $x)) (local.get $x))) + + (func (export "f64.no_fold_6x_via_add") (param $x f64) (result f64) + (f64.add (f64.add (f64.add (f64.add (f64.add + (local.get $x) + (local.get $x)) (local.get $x)) (local.get $x)) + (local.get $x)) (local.get $x))) +) + +(assert_return (invoke "f32.no_fold_6x_via_add" (f32.const -0x1.598a0cp+99)) (f32.const -0x1.03278ap+102)) +(assert_return (invoke "f32.no_fold_6x_via_add" (f32.const -0x1.d3e7acp-77)) (f32.const -0x1.5eedc2p-74)) +(assert_return (invoke "f32.no_fold_6x_via_add" (f32.const 0x1.00fa02p-77)) (f32.const 0x1.817702p-75)) +(assert_return (invoke "f32.no_fold_6x_via_add" (f32.const -0x1.51f434p-31)) (f32.const -0x1.faee4cp-29)) +(assert_return (invoke "f32.no_fold_6x_via_add" (f32.const -0x1.00328ap+80)) (f32.const -0x1.804bcep+82)) + +(assert_return (invoke "f64.no_fold_6x_via_add" (f64.const -0x1.310e15acaffe6p+68)) (f64.const -0x1.c995208307fdap+70)) +(assert_return (invoke "f64.no_fold_6x_via_add" (f64.const -0x1.aad62c78fa9b4p-535)) (f64.const -0x1.4020a15abbf46p-532)) +(assert_return (invoke "f64.no_fold_6x_via_add" (f64.const -0x1.f8fbfa94f6ab2p+271)) (f64.const -0x1.7abcfbefb9005p+274)) +(assert_return (invoke "f64.no_fold_6x_via_add" (f64.const 0x1.756ccc2830a8ep+751)) (f64.const 0x1.1811991e247ebp+754)) +(assert_return (invoke "f64.no_fold_6x_via_add" (f64.const -0x1.8fd1ab1d2402ap+234)) (f64.const -0x1.2bdd4055db01fp+237)) + +;; Test that (x/y)/z is not optimized to x/(y*z), +;; which is an "allowable alternative Form" in Fortran. + +(module + (func (export "f32.no_fold_div_div") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.div (f32.div (local.get $x) (local.get $y)) (local.get $z))) + + (func (export "f64.no_fold_div_div") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.div (f64.div (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f32.no_fold_div_div" (f32.const -0x1.f70228p+78) (f32.const -0x1.fbc612p-16) (f32.const -0x1.8c379p+10)) (f32.const -0x1.47b43cp+83)) +(assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.d29d2ep-70) (f32.const 0x1.f3a17ep+110) (f32.const -0x1.64d41p-112)) (f32.const -0x0p+0)) +(assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.867f98p+43) (f32.const 0x1.30acfcp-105) (f32.const 0x1.e210d8p+105)) (f32.const infinity)) +(assert_return (invoke "f32.no_fold_div_div" (f32.const -0x1.c4001ap-14) (f32.const -0x1.9beb6cp+124) (f32.const -0x1.74f34cp-43)) (f32.const -0x1.819874p-96)) +(assert_return (invoke "f32.no_fold_div_div" (f32.const 0x1.db0e6ep+46) (f32.const 0x1.55eea2p+56) (f32.const -0x1.f3134p+124)) (f32.const -0x1.6cep-135)) + +(assert_return (invoke "f64.no_fold_div_div" (f64.const 0x1.b4dc8ec3c7777p+337) (f64.const 0x1.9f95ac2d1863p+584) (f64.const -0x1.d4318abba341ep-782)) (f64.const -0x1.2649159d87e02p+534)) +(assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.ac53af5eb445fp+791) (f64.const 0x1.8549c0a4ceb13p-29) (f64.const 0x1.64e384003c801p+316)) (f64.const -0x1.9417cdccbae91p+503)) +(assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.d2685afb27327p+2) (f64.const -0x1.abb1eeed3dbebp+880) (f64.const 0x1.a543e2e6968a3p+170)) (f64.const 0x0.0000002a69a5fp-1022)) +(assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.47ddede78ad1cp+825) (f64.const 0x1.6d932d070a367p-821) (f64.const 0x1.79cf18cc64fp+961)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_div_div" (f64.const -0x1.f73d4979a9379p-888) (f64.const 0x1.4d83b53e97788p-596) (f64.const -0x1.f8f86c9603b5bp-139)) (f64.const 0x1.87a7bd89c586cp-154)) + +;; Test that (x/y)*(z/w) is not optimized to (x*z)/(y*w), example from +;; http://perso.ens-lyon.fr/jean-michel.muller/Handbook.html +;; section 7.4.1: FORTRAN Floating Point in a Nutshell: Philosophy + +(module + (func (export "f32.no_fold_mul_divs") (param $x f32) (param $y f32) (param $z f32) (param $w f32) (result f32) + (f32.mul (f32.div (local.get $x) (local.get $y)) (f32.div (local.get $z) (local.get $w)))) + + (func (export "f64.no_fold_mul_divs") (param $x f64) (param $y f64) (param $z f64) (param $w f64) (result f64) + (f64.mul (f64.div (local.get $x) (local.get $y)) (f64.div (local.get $z) (local.get $w)))) +) + +(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.c483bep-109) (f32.const 0x1.ee1c3cp-92) (f32.const 0x1.800756p-88) (f32.const -0x1.95b972p+4)) (f32.const 0x1.bbd30cp-110)) +(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.0f4262p+102) (f32.const 0x1.248498p+25) (f32.const 0x1.f66a7cp-17) (f32.const 0x1.897fc8p-3)) (f32.const -0x1.2f1aa4p+63)) +(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.df5f22p+33) (f32.const -0x1.fcee3ep+39) (f32.const -0x1.9ea914p+29) (f32.const -0x1.2c4d3p+10)) (f32.const 0x1.4cf51cp+13)) +(assert_return (invoke "f32.no_fold_mul_divs" (f32.const -0x1.f568bcp+109) (f32.const 0x1.d9963p-34) (f32.const 0x1.37a87ap-16) (f32.const 0x1.a1524ap+78)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_mul_divs" (f32.const 0x1.3dd592p-53) (f32.const -0x1.332c22p-64) (f32.const 0x1.b01064p-91) (f32.const 0x1.92bb3ap-36)) (f32.const -0x1.1c2dbp-44)) + +(assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.363d6764f7b12p-819) (f64.const -0x1.ed5471f660b5fp-464) (f64.const -0x1.671b0a7f3a42p+547) (f64.const 0x1.0633be34ba1f2p+186)) (f64.const -0x1.b8fa2b76baeebp+5)) +(assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.37880182e0fa8p+115) (f64.const 0x1.f842631576147p-920) (f64.const -0x1.999372231d156p+362) (f64.const -0x1.d5db481ab9554p+467)) (f64.const -infinity)) +(assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.9a747c8d4b541p+308) (f64.const -0x1.99092ad6bbdc8p+192) (f64.const -0x1.cb23755c20101p-140) (f64.const -0x1.de8716f6b0b6ap+732)) (f64.const 0x1.ecf584c8466a5p-757)) +(assert_return (invoke "f64.no_fold_mul_divs" (f64.const -0x1.c424b2ece903dp+129) (f64.const -0x1.568ce281db37fp-347) (f64.const 0x1.53900b99fd3dp-957) (f64.const 0x1.5c33952254dadp+223)) (f64.const 0x0p+0)) +(assert_return (invoke "f64.no_fold_mul_divs" (f64.const 0x1.a8ec2cecb32a9p-18) (f64.const 0x1.58acab0051851p-277) (f64.const 0x1.35e87c9077f7fp-620) (f64.const -0x1.925ee37ffb386p+352)) (f64.const -0x1.e6286970b31bfp-714)) + +;; Test that (x/z)+(y/z) is not optimized to (x+y)/z. + +(module + (func (export "f32.no_fold_add_divs") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.add (f32.div (local.get $x) (local.get $z)) (f32.div (local.get $y) (local.get $z)))) + + (func (export "f64.no_fold_add_divs") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.add (f64.div (local.get $x) (local.get $z)) (f64.div (local.get $y) (local.get $z)))) +) + +(assert_return (invoke "f32.no_fold_add_divs" (f32.const 0x1.795e7p+8) (f32.const -0x1.48a5eep-5) (f32.const -0x1.9a244cp+126)) (f32.const -0x1.d709b6p-119)) +(assert_return (invoke "f32.no_fold_add_divs" (f32.const -0x1.ae89e8p-63) (f32.const -0x1.e9903ep-49) (f32.const -0x1.370a8cp+47)) (f32.const 0x1.92f3f6p-96)) +(assert_return (invoke "f32.no_fold_add_divs" (f32.const -0x1.626408p-46) (f32.const 0x1.2ee5b2p-64) (f32.const -0x1.ecefaap+48)) (f32.const 0x1.701864p-95)) +(assert_return (invoke "f32.no_fold_add_divs" (f32.const -0x1.061d3p-101) (f32.const 0x1.383492p-98) (f32.const -0x1.1d92d2p+88)) (f32.const 0x0p+0)) +(assert_return (invoke "f32.no_fold_add_divs" (f32.const 0x1.1ea39ep-10) (f32.const 0x1.a7fffep-3) (f32.const 0x1.6fc574p-123)) (f32.const 0x1.28b2dep+120)) + +(assert_return (invoke "f64.no_fold_add_divs" (f64.const -0x1.c5fcc3273b136p+430) (f64.const 0x1.892a09eed8f6fp+434) (f64.const 0x1.8258b71e64397p+911)) (f64.const 0x1.e36eb9706ad82p-478)) +(assert_return (invoke "f64.no_fold_add_divs" (f64.const -0x1.2215d4061b5b3p+53) (f64.const 0x1.fb6184d97f27cp+5) (f64.const -0x1.f3bb59dacc0ebp-957)) (f64.const 0x1.2934eb0118be3p+1009)) +(assert_return (invoke "f64.no_fold_add_divs" (f64.const -0x1.e7a4533741d8ep-967) (f64.const 0x1.a519bb7feb802p-976) (f64.const 0x1.1f8a43454e51ap+504)) (f64.const 0x0p+0)) +(assert_return (invoke "f64.no_fold_add_divs" (f64.const 0x1.991c6cf93e2b4p+313) (f64.const -0x1.f2f7432698d11p+329) (f64.const 0x1.0d8c1b2453617p-126)) (f64.const -0x1.d9e1d84ddd1d4p+455)) +(assert_return (invoke "f64.no_fold_add_divs" (f64.const -0x1.d436849dc1271p-728) (f64.const 0x1.19d1c1450e52dp-755) (f64.const 0x1.fa1be69ea06fep-70)) (f64.const -0x1.d9a9b1c2f5623p-659)) + +;; Test that sqrt(x*x) is not optimized to abs(x). + +(module + (func (export "f32.no_fold_sqrt_square") (param $x f32) (result f32) + (f32.sqrt (f32.mul (local.get $x) (local.get $x)))) + + (func (export "f64.no_fold_sqrt_square") (param $x f64) (result f64) + (f64.sqrt (f64.mul (local.get $x) (local.get $x)))) +) + +(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const -0x1.5cb316p-66)) (f32.const 0x1.5cb322p-66)) +(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const -0x1.b0f9e4p-73)) (f32.const 0x1.b211b2p-73)) +(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const -0x1.de417cp-71)) (f32.const 0x1.de65b8p-71)) +(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const 0x1.64c872p-86)) (f32.const 0x0p+0)) +(assert_return (invoke "f32.no_fold_sqrt_square" (f32.const 0x1.e199e4p+108)) (f32.const infinity)) + +(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const 0x1.1759d657203fdp-529)) (f64.const 0x1.1759dd57545f3p-529)) +(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const -0x1.4c68de1c78d83p-514)) (f64.const 0x1.4c68de1c78d81p-514)) +(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const -0x1.214736edb6e1ep-521)) (f64.const 0x1.214736ed9cf8dp-521)) +(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const -0x1.0864b9f68457p-616)) (f64.const 0x0p+0)) +(assert_return (invoke "f64.no_fold_sqrt_square" (f64.const 0x1.b2a9855995abap+856)) (f64.const infinity)) + +;; Test that sqrt(x)*sqrt(y) is not optimized to sqrt(x*y). + +(module + (func (export "f32.no_fold_mul_sqrts") (param $x f32) (param $y f32) (result f32) + (f32.mul (f32.sqrt (local.get $x)) (f32.sqrt (local.get $y)))) + + (func (export "f64.no_fold_mul_sqrts") (param $x f64) (param $y f64) (result f64) + (f64.mul (f64.sqrt (local.get $x)) (f64.sqrt (local.get $y)))) +) + +(assert_return_nan (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.dddda8p-125) (f32.const -0x1.25d22ap-83))) +(assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.418d14p-92) (f32.const 0x1.c6535cp-32)) (f32.const 0x1.7e373ap-62)) +(assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.4de7ep-88) (f32.const 0x1.84ff18p+6)) (f32.const 0x1.686668p-41)) +(assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.78091ep+101) (f32.const 0x1.81feb8p-9)) (f32.const 0x1.7cfb98p+46)) +(assert_return (invoke "f32.no_fold_mul_sqrts" (f32.const 0x1.583ap-56) (f32.const 0x1.14ba2ap-9)) (f32.const 0x1.b47a8ep-33)) + +(assert_return_nan (invoke "f64.no_fold_mul_sqrts" (f64.const -0x1.d1144cc28cdbep-635) (f64.const -0x1.bf9bc373d3b6ap-8))) +(assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.5a7eb976bebc9p-643) (f64.const 0x1.f30cb8865a4cap-404)) (f64.const 0x1.260a1032d6e76p-523)) +(assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.711a0c1707935p-89) (f64.const 0x1.6fb5de51a20d3p-913)) (f64.const 0x1.7067ca28e31ecp-501)) +(assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.fb0bbea33b076p-363) (f64.const 0x1.d963b34894158p-573)) (f64.const 0x1.e9edc1fa624afp-468)) +(assert_return (invoke "f64.no_fold_mul_sqrts" (f64.const 0x1.8676eab7a4d0dp+24) (f64.const 0x1.75a58231ba7a5p+513)) (f64.const 0x1.0e16aebe203b3p+269)) + +;; Test that sqrt(x)/sqrt(y) is not optimized to sqrt(x/y). + +(module + (func (export "f32.no_fold_div_sqrts") (param $x f32) (param $y f32) (result f32) + (f32.div (f32.sqrt (local.get $x)) (f32.sqrt (local.get $y)))) + + (func (export "f64.no_fold_div_sqrts") (param $x f64) (param $y f64) (result f64) + (f64.div (f64.sqrt (local.get $x)) (f64.sqrt (local.get $y)))) +) + +(assert_return_nan (invoke "f32.no_fold_div_sqrts" (f32.const -0x1.bea9bap+25) (f32.const -0x1.db776ep-58))) +(assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.b983b6p+32) (f32.const 0x1.901f1ep+27)) (f32.const 0x1.7c4df6p+2)) +(assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.d45e72p-120) (f32.const 0x1.ab49ccp+15)) (f32.const 0x1.7b0b04p-68)) +(assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.b2e444p+59) (f32.const 0x1.5b8b16p-30)) (f32.const 0x1.94fca8p+44)) +(assert_return (invoke "f32.no_fold_div_sqrts" (f32.const 0x1.835aa6p-112) (f32.const 0x1.d17128p-103)) (f32.const 0x1.4a468p-5)) + +(assert_return_nan (invoke "f64.no_fold_div_sqrts" (f64.const -0x1.509fc16411167p-711) (f64.const -0x1.9c4255f5d6517p-187))) +(assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.b6897bddac76p-587) (f64.const 0x1.104578b4c91f3p+541)) (f64.const 0x1.44e4f21f26cc9p-564)) +(assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.ac83451b08989p+523) (f64.const 0x1.8da575c6d12b8p-109)) (f64.const 0x1.09c003991ce17p+316)) +(assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.bab7836456417p-810) (f64.const 0x1.1ff60d03ba607p+291)) (f64.const 0x1.c0e6c833bf657p-551)) +(assert_return (invoke "f64.no_fold_div_sqrts" (f64.const 0x1.a957816ad9515p-789) (f64.const 0x1.8c18a3a222ab1p+945)) (f64.const 0x1.0948539781e92p-867)) + +;; Test that (x*sqrt(y))/y is not optimized to x/sqrt(y). + +(module + (func (export "f32.no_fold_mul_sqrt_div") (param $x f32) (param $y f32) (result f32) + (f32.div (f32.mul (local.get $x) (f32.sqrt (local.get $y))) (local.get $y))) + + (func (export "f64.no_fold_mul_sqrt_div") (param $x f64) (param $y f64) (result f64) + (f64.div (f64.mul (local.get $x) (f64.sqrt (local.get $y))) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.f4a7cap+81) (f32.const 0x1.c09adep+92)) (f32.const -infinity)) +(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.90bf1cp-120) (f32.const 0x1.8dbe88p-97)) (f32.const -0x0p+0)) +(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const 0x1.8570e8p+29) (f32.const 0x1.217d3p-128)) (f32.const 0x1.6e391ap+93)) +(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.5b4652p+43) (f32.const 0x1.a9d71cp+112)) (f32.const -0x1.0d423ap-13)) +(assert_return (invoke "f32.no_fold_mul_sqrt_div" (f32.const -0x1.910604p+8) (f32.const 0x1.0ca912p+7)) (f32.const -0x1.14cdecp+5)) + +(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const 0x1.1dcdeb857305fp+698) (f64.const 0x1.a066171c40eb9p+758)) (f64.const infinity)) +(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const -0x1.8b4f1c218e2abp-827) (f64.const 0x1.5e1ee65953b0bp-669)) (f64.const -0x0p+0)) +(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const 0x1.74ee531ddba38p-425) (f64.const 0x1.f370f758857f3p+560)) (f64.const 0x1.0aff34269583ep-705)) +(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const -0x1.27f216b0da6c5p+352) (f64.const 0x1.8e0b4e0b9fd7ep-483)) (f64.const -0x1.4fa558aad514ep+593)) +(assert_return (invoke "f64.no_fold_mul_sqrt_div" (f64.const 0x1.4c6955df9912bp+104) (f64.const 0x1.0cca42c9d371ep+842)) (f64.const 0x1.4468072f54294p-317)) + +;; Test that subnormals are not flushed even in an intermediate value in an +;; expression with a normal result. + +(module + (func (export "f32.no_flush_intermediate_subnormal") (param $x f32) (param $y f32) (param $z f32) (result f32) + (f32.mul (f32.mul (local.get $x) (local.get $y)) (local.get $z))) + + (func (export "f64.no_flush_intermediate_subnormal") (param $x f64) (param $y f64) (param $z f64) (result f64) + (f64.mul (f64.mul (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f32.no_flush_intermediate_subnormal" (f32.const 0x1p-126) (f32.const 0x1p-23) (f32.const 0x1p23)) (f32.const 0x1p-126)) +(assert_return (invoke "f64.no_flush_intermediate_subnormal" (f64.const 0x1p-1022) (f64.const 0x1p-52) (f64.const 0x1p52)) (f64.const 0x1p-1022)) + +;; Test corner cases of John Hauser's microarchitectural recoding scheme. +;; https://github.com/riscv/riscv-tests/blob/695b86a6fcbe06ffbed8891af7e6fe7bf2062543/isa/rv64uf/recoding.S + +(module + (func (export "f32.recoding_eq") (param $x f32) (param $y f32) (result i32) + (f32.eq (f32.mul (local.get $x) (local.get $y)) (local.get $x))) + + (func (export "f32.recoding_le") (param $x f32) (param $y f32) (result i32) + (f32.le (f32.mul (local.get $x) (local.get $y)) (local.get $x))) + + (func (export "f32.recoding_lt") (param $x f32) (param $y f32) (result i32) + (f32.lt (f32.mul (local.get $x) (local.get $y)) (local.get $x))) + + (func (export "f64.recoding_eq") (param $x f64) (param $y f64) (result i32) + (f64.eq (f64.mul (local.get $x) (local.get $y)) (local.get $x))) + + (func (export "f64.recoding_le") (param $x f64) (param $y f64) (result i32) + (f64.le (f64.mul (local.get $x) (local.get $y)) (local.get $x))) + + (func (export "f64.recoding_lt") (param $x f64) (param $y f64) (result i32) + (f64.lt (f64.mul (local.get $x) (local.get $y)) (local.get $x))) + + (func (export "recoding_demote") (param $x f64) (param $y f32) (result f32) + (f32.mul (f32.demote_f64 (local.get $x)) (local.get $y))) +) + +(assert_return (invoke "f32.recoding_eq" (f32.const -infinity) (f32.const 3.0)) (i32.const 1)) +(assert_return (invoke "f32.recoding_le" (f32.const -infinity) (f32.const 3.0)) (i32.const 1)) +(assert_return (invoke "f32.recoding_lt" (f32.const -infinity) (f32.const 3.0)) (i32.const 0)) + +(assert_return (invoke "f32.recoding_eq" (f32.const 0x0p+0) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "f32.recoding_le" (f32.const 0x0p+0) (f32.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "f32.recoding_lt" (f32.const 0x0p+0) (f32.const 0x1p+0)) (i32.const 0)) + +(assert_return (invoke "f64.recoding_eq" (f64.const -infinity) (f64.const 3.0)) (i32.const 1)) +(assert_return (invoke "f64.recoding_le" (f64.const -infinity) (f64.const 3.0)) (i32.const 1)) +(assert_return (invoke "f64.recoding_lt" (f64.const -infinity) (f64.const 3.0)) (i32.const 0)) + +(assert_return (invoke "f64.recoding_eq" (f64.const 0x0p+0) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "f64.recoding_le" (f64.const 0x0p+0) (f64.const 0x1p+0)) (i32.const 1)) +(assert_return (invoke "f64.recoding_lt" (f64.const 0x0p+0) (f64.const 0x1p+0)) (i32.const 0)) + +(assert_return (invoke "recoding_demote" (f64.const 0x1.4c8f8p-132) (f32.const 1221)) (f32.const 0x1.8c8a1cp-122)) + +;; Test that division is not done as on an extended-base system. +;; http://www.ucbtest.org/goldberg/addendum.html + +(module + (func (export "f32.no_extended_precision_div") (param $x f32) (param $y f32) (param $z f32) (result i32) + (f32.eq (f32.div (local.get $x) (local.get $y)) (local.get $z))) + + (func (export "f64.no_extended_precision_div") (param $x f64) (param $y f64) (param $z f64) (result i32) + (f64.eq (f64.div (local.get $x) (local.get $y)) (local.get $z))) +) + +(assert_return (invoke "f32.no_extended_precision_div" (f32.const 3.0) (f32.const 7.0) (f32.const 0x1.b6db6ep-2)) (i32.const 1)) +(assert_return (invoke "f64.no_extended_precision_div" (f64.const 3.0) (f64.const 7.0) (f64.const 0x1.b6db6db6db6dbp-2)) (i32.const 1)) + +;; a*x + b*x == (a+b)*x for all x only if the operations a*x, b*x, and (a+b) +;; are all exact operations, which is true only if a and b are exact powers of +;; 2. Even then, if a==-b and x==-0, then a*x+b*x==0.0, (a+b)*x==-0.0. +;; https://dlang.org/d-floating-point.html + +(module + (func (export "f32.no_distribute_exact") (param $x f32) (result f32) + (f32.add (f32.mul (f32.const -8.0) (local.get $x)) (f32.mul (f32.const 8.0) (local.get $x)))) + + (func (export "f64.no_distribute_exact") (param $x f64) (result f64) + (f64.add (f64.mul (f64.const -8.0) (local.get $x)) (f64.mul (f64.const 8.0) (local.get $x)))) +) + +(assert_return (invoke "f32.no_distribute_exact" (f32.const -0.0)) (f32.const 0.0)) +(assert_return (invoke "f64.no_distribute_exact" (f64.const -0.0)) (f64.const 0.0)) + +;; Test that various approximations of sqrt(2), sqrt(3), and sqrt(5) compute the +;; expected approximation. +;; https://xkcd.com/1047/ +(module + (func (export "f32.sqrt") (param f32) (result f32) + (f32.sqrt (local.get 0))) + + (func (export "f32.xkcd_sqrt_2") (param f32) (param f32) (param f32) (param f32) (result f32) + (f32.add (f32.div (local.get 0) (local.get 1)) (f32.div (local.get 2) (f32.sub (local.get 3) (local.get 2))))) + + (func (export "f32.xkcd_sqrt_3") (param f32) (param f32) (param f32) (result f32) + (f32.div (f32.mul (local.get 0) (local.get 1)) (local.get 2))) + + (func (export "f32.xkcd_sqrt_5") (param f32) (param f32) (param f32) (result f32) + (f32.add (f32.div (local.get 0) (local.get 1)) (f32.div (local.get 2) (local.get 0)))) + + (func (export "f32.xkcd_better_sqrt_5") (param f32) (param f32) (param f32) (param f32) (result f32) + (f32.div (f32.add (local.get 0) (f32.mul (local.get 1) (local.get 2))) (f32.sub (local.get 3) (f32.mul (local.get 1) (local.get 2))))) + + (func (export "f64.sqrt") (param f64) (result f64) + (f64.sqrt (local.get 0))) + + (func (export "f64.xkcd_sqrt_2") (param f64) (param f64) (param f64) (param f64) (result f64) + (f64.add (f64.div (local.get 0) (local.get 1)) (f64.div (local.get 2) (f64.sub (local.get 3) (local.get 2))))) + + (func (export "f64.xkcd_sqrt_3") (param f64) (param f64) (param f64) (result f64) + (f64.div (f64.mul (local.get 0) (local.get 1)) (local.get 2))) + + (func (export "f64.xkcd_sqrt_5") (param f64) (param f64) (param f64) (result f64) + (f64.add (f64.div (local.get 0) (local.get 1)) (f64.div (local.get 2) (local.get 0)))) + + (func (export "f64.xkcd_better_sqrt_5") (param f64) (param f64) (param f64) (param f64) (result f64) + (f64.div (f64.add (local.get 0) (f64.mul (local.get 1) (local.get 2))) (f64.sub (local.get 3) (f64.mul (local.get 1) (local.get 2))))) +) + +(assert_return (invoke "f32.sqrt" (f32.const 2.0)) (f32.const 0x1.6a09e6p+0)) +(assert_return (invoke "f32.xkcd_sqrt_2" (f32.const 3.0) (f32.const 5.0) (f32.const 0x1.921fb6p+1) (f32.const 7.0)) (f32.const 0x1.6a0a54p+0)) +(assert_return (invoke "f32.sqrt" (f32.const 3.0)) (f32.const 0x1.bb67aep+0)) +(assert_return (invoke "f32.xkcd_sqrt_3" (f32.const 2.0) (f32.const 0x1.5bf0a8p+1) (f32.const 0x1.921fb6p+1)) (f32.const 0x1.bb02d4p+0)) +(assert_return (invoke "f32.sqrt" (f32.const 5.0)) (f32.const 0x1.1e377ap+1)) +(assert_return (invoke "f32.xkcd_sqrt_5" (f32.const 2.0) (f32.const 0x1.5bf0a8p+1) (f32.const 3.0)) (f32.const 0x1.1e2d58p+1)) +(assert_return (invoke "f32.xkcd_better_sqrt_5" (f32.const 13.0) (f32.const 4.0) (f32.const 0x1.921fb6p+1) (f32.const 24.0)) (f32.const 0x1.1e377ap+1)) + +(assert_return (invoke "f64.sqrt" (f64.const 2.0)) (f64.const 0x1.6a09e667f3bcdp+0)) +(assert_return (invoke "f64.xkcd_sqrt_2" (f64.const 3.0) (f64.const 5.0) (f64.const 0x1.921fb54442d18p+1) (f64.const 7.0)) (f64.const 0x1.6a0a5362b055fp+0)) +(assert_return (invoke "f64.sqrt" (f64.const 3.0)) (f64.const 0x1.bb67ae8584caap+0)) +(assert_return (invoke "f64.xkcd_sqrt_3" (f64.const 2.0) (f64.const 0x1.5bf0a8b145769p+1) (f64.const 0x1.921fb54442d18p+1)) (f64.const 0x1.bb02d4eca8f95p+0)) +(assert_return (invoke "f64.sqrt" (f64.const 5.0)) (f64.const 0x1.1e3779b97f4a8p+1)) +(assert_return (invoke "f64.xkcd_sqrt_5" (f64.const 2.0) (f64.const 0x1.5bf0a8b145769p+1) (f64.const 3.0)) (f64.const 0x1.1e2d58d8b3bcep+1)) +(assert_return (invoke "f64.xkcd_better_sqrt_5" (f64.const 13.0) (f64.const 4.0) (f64.const 0x1.921fb54442d18p+1) (f64.const 24.0)) (f64.const 0x1.1e3778509a5a3p+1)) + +;; Compute the floating-point radix. +;; M. A. Malcom. Algorithms to reveal properties of floating-point arithmetic. +;; Communications of the ACM, 15(11):949-951, November 1972. +(module + (func (export "f32.compute_radix") (param $0 f32) (param $1 f32) (result f32) + (loop $label$0 + (br_if $label$0 + (f32.eq + (f32.add + (f32.sub + (f32.add + (local.tee $0 (f32.add (local.get $0) (local.get $0))) + (f32.const 1) + ) + (local.get $0) + ) + (f32.const -1) + ) + (f32.const 0) + ) + ) + ) + (loop $label$2 + (br_if $label$2 + (f32.ne + (f32.sub + (f32.sub + (f32.add + (local.get $0) + (local.tee $1 (f32.add (local.get $1) (f32.const 1))) + ) + (local.get $0) + ) + (local.get $1) + ) + (f32.const 0) + ) + ) + ) + (local.get $1) + ) + + (func (export "f64.compute_radix") (param $0 f64) (param $1 f64) (result f64) + (loop $label$0 + (br_if $label$0 + (f64.eq + (f64.add + (f64.sub + (f64.add + (local.tee $0 (f64.add (local.get $0) (local.get $0))) + (f64.const 1) + ) + (local.get $0) + ) + (f64.const -1) + ) + (f64.const 0) + ) + ) + ) + (loop $label$2 + (br_if $label$2 + (f64.ne + (f64.sub + (f64.sub + (f64.add + (local.get $0) + (local.tee $1 (f64.add (local.get $1) (f64.const 1))) + ) + (local.get $0) + ) + (local.get $1) + ) + (f64.const 0) + ) + ) + ) + (local.get $1) + ) +) + +(assert_return (invoke "f32.compute_radix" (f32.const 1.0) (f32.const 1.0)) (f32.const 2.0)) +(assert_return (invoke "f64.compute_radix" (f64.const 1.0) (f64.const 1.0)) (f64.const 2.0)) + +;; Test that (x - 1) * y + y is not optimized to x * y. +;; http://blog.frama-c.com/index.php?post/2013/05/14/Contrarianism + +(module + (func (export "f32.no_fold_sub1_mul_add") (param $x f32) (param $y f32) (result f32) + (f32.add (f32.mul (f32.sub (local.get $x) (f32.const 1.0)) (local.get $y)) (local.get $y))) + + (func (export "f64.no_fold_sub1_mul_add") (param $x f64) (param $y f64) (result f64) + (f64.add (f64.mul (f64.sub (local.get $x) (f64.const 1.0)) (local.get $y)) (local.get $y))) +) + +(assert_return (invoke "f32.no_fold_sub1_mul_add" (f32.const 0x1p-32) (f32.const 1.0)) (f32.const 0x0p+0)) +(assert_return (invoke "f64.no_fold_sub1_mul_add" (f64.const 0x1p-64) (f64.const 1.0)) (f64.const 0x0p+0)) + +;; Test that x+z >= y+z is not optimized to x >= y (monotonicity). +;; http://cs.nyu.edu/courses/spring13/CSCI-UA.0201-003/lecture6.pdf + +(module + (func (export "f32.no_fold_add_le_monotonicity") (param $x f32) (param $y f32) (param $z f32) (result i32) + (f32.le (f32.add (local.get $x) (local.get $z)) (f32.add (local.get $y) (local.get $z)))) + + (func (export "f32.no_fold_add_ge_monotonicity") (param $x f32) (param $y f32) (param $z f32) (result i32) + (f32.ge (f32.add (local.get $x) (local.get $z)) (f32.add (local.get $y) (local.get $z)))) + + (func (export "f64.no_fold_add_le_monotonicity") (param $x f64) (param $y f64) (param $z f64) (result i32) + (f64.le (f64.add (local.get $x) (local.get $z)) (f64.add (local.get $y) (local.get $z)))) + + (func (export "f64.no_fold_add_ge_monotonicity") (param $x f64) (param $y f64) (param $z f64) (result i32) + (f64.ge (f64.add (local.get $x) (local.get $z)) (f64.add (local.get $y) (local.get $z)))) +) + +(assert_return (invoke "f32.no_fold_add_le_monotonicity" (f32.const 0.0) (f32.const 0.0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "f32.no_fold_add_le_monotonicity" (f32.const infinity) (f32.const -infinity) (f32.const infinity)) (i32.const 0)) +(assert_return (invoke "f64.no_fold_add_le_monotonicity" (f64.const 0.0) (f64.const 0.0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "f64.no_fold_add_le_monotonicity" (f64.const infinity) (f64.const -infinity) (f64.const infinity)) (i32.const 0)) + +;; Test that !(x < y) and friends are not optimized to x >= y and friends. + +(module + (func (export "f32.not_lt") (param $x f32) (param $y f32) (result i32) + (i32.eqz (f32.lt (local.get $x) (local.get $y)))) + + (func (export "f32.not_le") (param $x f32) (param $y f32) (result i32) + (i32.eqz (f32.le (local.get $x) (local.get $y)))) + + (func (export "f32.not_gt") (param $x f32) (param $y f32) (result i32) + (i32.eqz (f32.gt (local.get $x) (local.get $y)))) + + (func (export "f32.not_ge") (param $x f32) (param $y f32) (result i32) + (i32.eqz (f32.ge (local.get $x) (local.get $y)))) + + (func (export "f64.not_lt") (param $x f64) (param $y f64) (result i32) + (i32.eqz (f64.lt (local.get $x) (local.get $y)))) + + (func (export "f64.not_le") (param $x f64) (param $y f64) (result i32) + (i32.eqz (f64.le (local.get $x) (local.get $y)))) + + (func (export "f64.not_gt") (param $x f64) (param $y f64) (result i32) + (i32.eqz (f64.gt (local.get $x) (local.get $y)))) + + (func (export "f64.not_ge") (param $x f64) (param $y f64) (result i32) + (i32.eqz (f64.ge (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.not_lt" (f32.const nan) (f32.const 0.0)) (i32.const 1)) +(assert_return (invoke "f32.not_le" (f32.const nan) (f32.const 0.0)) (i32.const 1)) +(assert_return (invoke "f32.not_gt" (f32.const nan) (f32.const 0.0)) (i32.const 1)) +(assert_return (invoke "f32.not_ge" (f32.const nan) (f32.const 0.0)) (i32.const 1)) +(assert_return (invoke "f64.not_lt" (f64.const nan) (f64.const 0.0)) (i32.const 1)) +(assert_return (invoke "f64.not_le" (f64.const nan) (f64.const 0.0)) (i32.const 1)) +(assert_return (invoke "f64.not_gt" (f64.const nan) (f64.const 0.0)) (i32.const 1)) +(assert_return (invoke "f64.not_ge" (f64.const nan) (f64.const 0.0)) (i32.const 1)) + +;; Test that a method for approximating a "machine epsilon" produces the expected +;; approximation. +;; http://blogs.mathworks.com/cleve/2014/07/07/floating-point-numbers/#24cb4f4d-b8a9-4c19-b22b-9d2a9f7f3812 + +(module + (func (export "f32.epsilon") (result f32) + (f32.sub (f32.const 1.0) (f32.mul (f32.const 3.0) (f32.sub (f32.div (f32.const 4.0) (f32.const 3.0)) (f32.const 1.0))))) + + (func (export "f64.epsilon") (result f64) + (f64.sub (f64.const 1.0) (f64.mul (f64.const 3.0) (f64.sub (f64.div (f64.const 4.0) (f64.const 3.0)) (f64.const 1.0))))) +) + +(assert_return (invoke "f32.epsilon") (f32.const -0x1p-23)) +(assert_return (invoke "f64.epsilon") (f64.const 0x1p-52)) + +;; Test that floating-point numbers are not optimized as if they form a +;; trichotomy. + +(module + (func (export "f32.no_trichotomy_lt") (param $x f32) (param $y f32) (result i32) + (i32.or (f32.lt (local.get $x) (local.get $y)) (f32.ge (local.get $x) (local.get $y)))) + (func (export "f32.no_trichotomy_le") (param $x f32) (param $y f32) (result i32) + (i32.or (f32.le (local.get $x) (local.get $y)) (f32.gt (local.get $x) (local.get $y)))) + (func (export "f32.no_trichotomy_gt") (param $x f32) (param $y f32) (result i32) + (i32.or (f32.gt (local.get $x) (local.get $y)) (f32.le (local.get $x) (local.get $y)))) + (func (export "f32.no_trichotomy_ge") (param $x f32) (param $y f32) (result i32) + (i32.or (f32.ge (local.get $x) (local.get $y)) (f32.lt (local.get $x) (local.get $y)))) + + (func (export "f64.no_trichotomy_lt") (param $x f64) (param $y f64) (result i32) + (i32.or (f64.lt (local.get $x) (local.get $y)) (f64.ge (local.get $x) (local.get $y)))) + (func (export "f64.no_trichotomy_le") (param $x f64) (param $y f64) (result i32) + (i32.or (f64.le (local.get $x) (local.get $y)) (f64.gt (local.get $x) (local.get $y)))) + (func (export "f64.no_trichotomy_gt") (param $x f64) (param $y f64) (result i32) + (i32.or (f64.gt (local.get $x) (local.get $y)) (f64.le (local.get $x) (local.get $y)))) + (func (export "f64.no_trichotomy_ge") (param $x f64) (param $y f64) (result i32) + (i32.or (f64.ge (local.get $x) (local.get $y)) (f64.lt (local.get $x) (local.get $y)))) +) + +(assert_return (invoke "f32.no_trichotomy_lt" (f32.const 0.0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "f32.no_trichotomy_le" (f32.const 0.0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "f32.no_trichotomy_gt" (f32.const 0.0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "f32.no_trichotomy_ge" (f32.const 0.0) (f32.const nan)) (i32.const 0)) +(assert_return (invoke "f64.no_trichotomy_lt" (f64.const 0.0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "f64.no_trichotomy_le" (f64.const 0.0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "f64.no_trichotomy_gt" (f64.const 0.0) (f64.const nan)) (i32.const 0)) +(assert_return (invoke "f64.no_trichotomy_ge" (f64.const 0.0) (f64.const nan)) (i32.const 0)) diff --git a/test/spec/old_float_literals.wast b/test/spec/old_float_literals.wast new file mode 100644 index 000000000..6f890affd --- /dev/null +++ b/test/spec/old_float_literals.wast @@ -0,0 +1,137 @@ +;; Test floating-point literal parsing. + +(module + ;; f32 special values + (func (export "f32.nan") (result i32) (i32.reinterpret_f32 (f32.const nan))) + (func (export "f32.positive_nan") (result i32) (i32.reinterpret_f32 (f32.const +nan))) + (func (export "f32.negative_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan))) + (func (export "f32.plain_nan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x400000))) + (func (export "f32.informally_known_as_plain_snan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x200000))) + (func (export "f32.all_ones_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan:0x7fffff))) + (func (export "f32.misc_nan") (result i32) (i32.reinterpret_f32 (f32.const nan:0x012345))) + (func (export "f32.misc_positive_nan") (result i32) (i32.reinterpret_f32 (f32.const +nan:0x304050))) + (func (export "f32.misc_negative_nan") (result i32) (i32.reinterpret_f32 (f32.const -nan:0x2abcde))) + (func (export "f32.infinity") (result i32) (i32.reinterpret_f32 (f32.const infinity))) + (func (export "f32.positive_infinity") (result i32) (i32.reinterpret_f32 (f32.const +infinity))) + (func (export "f32.negative_infinity") (result i32) (i32.reinterpret_f32 (f32.const -infinity))) + + ;; f32 numbers + (func (export "f32.zero") (result i32) (i32.reinterpret_f32 (f32.const 0x0.0p0))) + (func (export "f32.positive_zero") (result i32) (i32.reinterpret_f32 (f32.const +0x0.0p0))) + (func (export "f32.negative_zero") (result i32) (i32.reinterpret_f32 (f32.const -0x0.0p0))) + (func (export "f32.misc") (result i32) (i32.reinterpret_f32 (f32.const 0x1.921fb6p+2))) + (func (export "f32.min_positive") (result i32) (i32.reinterpret_f32 (f32.const 0x1p-149))) + (func (export "f32.min_normal") (result i32) (i32.reinterpret_f32 (f32.const 0x1p-126))) + (func (export "f32.max_finite") (result i32) (i32.reinterpret_f32 (f32.const 0x1.fffffep+127))) + (func (export "f32.max_subnormal") (result i32) (i32.reinterpret_f32 (f32.const 0x1.fffffcp-127))) + (func (export "f32.trailing_dot") (result i32) (i32.reinterpret_f32 (f32.const 0x1.p10))) + + ;; f32 in decimal format + (func (export "f32_dec.zero") (result i32) (i32.reinterpret_f32 (f32.const 0.0e0))) + (func (export "f32_dec.positive_zero") (result i32) (i32.reinterpret_f32 (f32.const +0.0e0))) + (func (export "f32_dec.negative_zero") (result i32) (i32.reinterpret_f32 (f32.const -0.0e0))) + (func (export "f32_dec.misc") (result i32) (i32.reinterpret_f32 (f32.const 6.28318548202514648))) + (func (export "f32_dec.min_positive") (result i32) (i32.reinterpret_f32 (f32.const 1.4013e-45))) + (func (export "f32_dec.min_normal") (result i32) (i32.reinterpret_f32 (f32.const 1.1754944e-38))) + (func (export "f32_dec.max_subnormal") (result i32) (i32.reinterpret_f32 (f32.const 1.1754942e-38))) + (func (export "f32_dec.max_finite") (result i32) (i32.reinterpret_f32 (f32.const 3.4028234e+38))) + (func (export "f32_dec.trailing_dot") (result i32) (i32.reinterpret_f32 (f32.const 1.e10))) + + ;; f64 special values + (func (export "f64.nan") (result i64) (i64.reinterpret_f64 (f64.const nan))) + (func (export "f64.positive_nan") (result i64) (i64.reinterpret_f64 (f64.const +nan))) + (func (export "f64.negative_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan))) + (func (export "f64.plain_nan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x8000000000000))) + (func (export "f64.informally_known_as_plain_snan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x4000000000000))) + (func (export "f64.all_ones_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan:0xfffffffffffff))) + (func (export "f64.misc_nan") (result i64) (i64.reinterpret_f64 (f64.const nan:0x0123456789abc))) + (func (export "f64.misc_positive_nan") (result i64) (i64.reinterpret_f64 (f64.const +nan:0x3040506070809))) + (func (export "f64.misc_negative_nan") (result i64) (i64.reinterpret_f64 (f64.const -nan:0x2abcdef012345))) + (func (export "f64.infinity") (result i64) (i64.reinterpret_f64 (f64.const infinity))) + (func (export "f64.positive_infinity") (result i64) (i64.reinterpret_f64 (f64.const +infinity))) + (func (export "f64.negative_infinity") (result i64) (i64.reinterpret_f64 (f64.const -infinity))) + + ;; f64 numbers + (func (export "f64.zero") (result i64) (i64.reinterpret_f64 (f64.const 0x0.0p0))) + (func (export "f64.positive_zero") (result i64) (i64.reinterpret_f64 (f64.const +0x0.0p0))) + (func (export "f64.negative_zero") (result i64) (i64.reinterpret_f64 (f64.const -0x0.0p0))) + (func (export "f64.misc") (result i64) (i64.reinterpret_f64 (f64.const 0x1.921fb54442d18p+2))) + (func (export "f64.min_positive") (result i64) (i64.reinterpret_f64 (f64.const 0x0.0000000000001p-1022))) + (func (export "f64.min_normal") (result i64) (i64.reinterpret_f64 (f64.const 0x1p-1022))) + (func (export "f64.max_subnormal") (result i64) (i64.reinterpret_f64 (f64.const 0x0.fffffffffffffp-1022))) + (func (export "f64.max_finite") (result i64) (i64.reinterpret_f64 (f64.const 0x1.fffffffffffffp+1023))) + (func (export "f64.trailing_dot") (result i64) (i64.reinterpret_f64 (f64.const 0x1.p100))) + + ;; f64 numbers in decimal format + (func (export "f64_dec.zero") (result i64) (i64.reinterpret_f64 (f64.const 0.0e0))) + (func (export "f64_dec.positive_zero") (result i64) (i64.reinterpret_f64 (f64.const +0.0e0))) + (func (export "f64_dec.negative_zero") (result i64) (i64.reinterpret_f64 (f64.const -0.0e0))) + (func (export "f64_dec.misc") (result i64) (i64.reinterpret_f64 (f64.const 6.28318530717958623))) + (func (export "f64_dec.min_positive") (result i64) (i64.reinterpret_f64 (f64.const 4.94066e-324))) + (func (export "f64_dec.min_normal") (result i64) (i64.reinterpret_f64 (f64.const 2.2250738585072012e-308))) + (func (export "f64_dec.max_subnormal") (result i64) (i64.reinterpret_f64 (f64.const 2.2250738585072011e-308))) + (func (export "f64_dec.max_finite") (result i64) (i64.reinterpret_f64 (f64.const 1.7976931348623157e+308))) + (func (export "f64_dec.trailing_dot") (result i64) (i64.reinterpret_f64 (f64.const 1.e100))) +) + +(assert_return (invoke "f32.nan") (i32.const 0x7fc00000)) +(assert_return (invoke "f32.positive_nan") (i32.const 0x7fc00000)) +(assert_return (invoke "f32.negative_nan") (i32.const 0xffc00000)) +(assert_return (invoke "f32.plain_nan") (i32.const 0x7fc00000)) +(assert_return (invoke "f32.informally_known_as_plain_snan") (i32.const 0x7fa00000)) +(assert_return (invoke "f32.all_ones_nan") (i32.const 0xffffffff)) +(assert_return (invoke "f32.misc_nan") (i32.const 0x7f812345)) +(assert_return (invoke "f32.misc_positive_nan") (i32.const 0x7fb04050)) +(assert_return (invoke "f32.misc_negative_nan") (i32.const 0xffaabcde)) +(assert_return (invoke "f32.infinity") (i32.const 0x7f800000)) +(assert_return (invoke "f32.positive_infinity") (i32.const 0x7f800000)) +(assert_return (invoke "f32.negative_infinity") (i32.const 0xff800000)) +(assert_return (invoke "f32.zero") (i32.const 0)) +(assert_return (invoke "f32.positive_zero") (i32.const 0)) +(assert_return (invoke "f32.negative_zero") (i32.const 0x80000000)) +(assert_return (invoke "f32.misc") (i32.const 0x40c90fdb)) +(assert_return (invoke "f32.min_positive") (i32.const 1)) +(assert_return (invoke "f32.min_normal") (i32.const 0x800000)) +(assert_return (invoke "f32.max_subnormal") (i32.const 0x7fffff)) +(assert_return (invoke "f32.max_finite") (i32.const 0x7f7fffff)) +(assert_return (invoke "f32.trailing_dot") (i32.const 0x44800000)) +(assert_return (invoke "f32_dec.zero") (i32.const 0)) +(assert_return (invoke "f32_dec.positive_zero") (i32.const 0)) +(assert_return (invoke "f32_dec.negative_zero") (i32.const 0x80000000)) +(assert_return (invoke "f32_dec.misc") (i32.const 0x40c90fdb)) +(assert_return (invoke "f32_dec.min_positive") (i32.const 1)) +(assert_return (invoke "f32_dec.min_normal") (i32.const 0x800000)) +(assert_return (invoke "f32_dec.max_subnormal") (i32.const 0x7fffff)) +(assert_return (invoke "f32_dec.max_finite") (i32.const 0x7f7fffff)) +(assert_return (invoke "f32_dec.trailing_dot") (i32.const 0x501502f9)) + +(assert_return (invoke "f64.nan") (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.positive_nan") (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.negative_nan") (i64.const 0xfff8000000000000)) +(assert_return (invoke "f64.plain_nan") (i64.const 0x7ff8000000000000)) +(assert_return (invoke "f64.informally_known_as_plain_snan") (i64.const 0x7ff4000000000000)) +(assert_return (invoke "f64.all_ones_nan") (i64.const 0xffffffffffffffff)) +(assert_return (invoke "f64.misc_nan") (i64.const 0x7ff0123456789abc)) +(assert_return (invoke "f64.misc_positive_nan") (i64.const 0x7ff3040506070809)) +(assert_return (invoke "f64.misc_negative_nan") (i64.const 0xfff2abcdef012345)) +(assert_return (invoke "f64.infinity") (i64.const 0x7ff0000000000000)) +(assert_return (invoke "f64.positive_infinity") (i64.const 0x7ff0000000000000)) +(assert_return (invoke "f64.negative_infinity") (i64.const 0xfff0000000000000)) +(assert_return (invoke "f64.zero") (i64.const 0)) +(assert_return (invoke "f64.positive_zero") (i64.const 0)) +(assert_return (invoke "f64.negative_zero") (i64.const 0x8000000000000000)) +(assert_return (invoke "f64.misc") (i64.const 0x401921fb54442d18)) +(assert_return (invoke "f64.min_positive") (i64.const 1)) +(assert_return (invoke "f64.min_normal") (i64.const 0x10000000000000)) +(assert_return (invoke "f64.max_subnormal") (i64.const 0xfffffffffffff)) +(assert_return (invoke "f64.max_finite") (i64.const 0x7fefffffffffffff)) +(assert_return (invoke "f64.trailing_dot") (i64.const 0x4630000000000000)) +(assert_return (invoke "f64_dec.zero") (i64.const 0)) +(assert_return (invoke "f64_dec.positive_zero") (i64.const 0)) +(assert_return (invoke "f64_dec.negative_zero") (i64.const 0x8000000000000000)) +(assert_return (invoke "f64_dec.misc") (i64.const 0x401921fb54442d18)) +(assert_return (invoke "f64_dec.min_positive") (i64.const 1)) +(assert_return (invoke "f64_dec.min_normal") (i64.const 0x10000000000000)) +(assert_return (invoke "f64_dec.max_subnormal") (i64.const 0xfffffffffffff)) +(assert_return (invoke "f64_dec.max_finite") (i64.const 0x7fefffffffffffff)) +(assert_return (invoke "f64_dec.trailing_dot") (i64.const 0x54b249ad2594c37d)) diff --git a/test/spec/old_func.wast b/test/spec/old_func.wast new file mode 100644 index 000000000..83fb1aff3 --- /dev/null +++ b/test/spec/old_func.wast @@ -0,0 +1,532 @@ +;; Test `func` declarations, i.e. functions + +(module + ;; Auxiliary definition + (type $sig (func)) + (func $dummy) + + ;; Syntax + + (func) + (func (export "f")) + (func $f) + (func $h (export "g")) + + (func (local)) + (func (local) (local)) + (func (local i32)) + (func (local $x i32)) + (func (local i32 f64 i64)) + (func (local i32) (local f64)) + (func (local i32 f32) (local $x i64) (local) (local i32 f64)) + + (func (param)) + (func (param) (param)) + (func (param i32)) + (func (param $x i32)) + (func (param i32 f64 i64)) + (func (param i32) (param f64)) + (func (param i32 f32) (param $x i64) (param) (param i32 f64)) + + (func (result i32) (unreachable)) + + (func (type $sig)) + + (func $complex + (param i32 f32) (param $x i64) (param) (param i32) + (result i32) + (local f32) (local $y i32) (local i64 i32) (local) (local f64 i32) + (unreachable) (unreachable) + ) + (func $complex-sig + (type $sig) + (local f32) (local $y i32) (local i64 i32) (local) (local f64 i32) + (unreachable) (unreachable) + ) + + + ;; Typing of locals + + (func (export "local-first-i32") (result i32) (local i32 i32) (local.get 0)) + (func (export "local-first-i64") (result i64) (local i64 i64) (local.get 0)) + (func (export "local-first-f32") (result f32) (local f32 f32) (local.get 0)) + (func (export "local-first-f64") (result f64) (local f64 f64) (local.get 0)) + (func (export "local-second-i32") (result i32) (local i32 i32) (local.get 1)) + (func (export "local-second-i64") (result i64) (local i64 i64) (local.get 1)) + (func (export "local-second-f32") (result f32) (local f32 f32) (local.get 1)) + (func (export "local-second-f64") (result f64) (local f64 f64) (local.get 1)) + (func (export "local-mixed") (result f64) + (local f32) (local $x i32) (local i64 i32) (local) (local f64 i32) + (drop (f32.neg (local.get 0))) + (drop (i32.eqz (local.get 1))) + (drop (i64.eqz (local.get 2))) + (drop (i32.eqz (local.get 3))) + (drop (f64.neg (local.get 4))) + (drop (i32.eqz (local.get 5))) + (local.get 4) + ) + + ;; Typing of parameters + + (func (export "param-first-i32") (param i32 i32) (result i32) (local.get 0)) + (func (export "param-first-i64") (param i64 i64) (result i64) (local.get 0)) + (func (export "param-first-f32") (param f32 f32) (result f32) (local.get 0)) + (func (export "param-first-f64") (param f64 f64) (result f64) (local.get 0)) + (func (export "param-second-i32") (param i32 i32) (result i32) (local.get 1)) + (func (export "param-second-i64") (param i64 i64) (result i64) (local.get 1)) + (func (export "param-second-f32") (param f32 f32) (result f32) (local.get 1)) + (func (export "param-second-f64") (param f64 f64) (result f64) (local.get 1)) + (func (export "param-mixed") (param f32 i32) (param) (param $x i64) (param i32 f64 i32) + (result f64) + (drop (f32.neg (local.get 0))) + (drop (i32.eqz (local.get 1))) + (drop (i64.eqz (local.get 2))) + (drop (i32.eqz (local.get 3))) + (drop (f64.neg (local.get 4))) + (drop (i32.eqz (local.get 5))) + (local.get 4) + ) + + ;; Typing of result + + (func (export "empty")) + (func (export "value-void") (call $dummy)) + (func (export "value-i32") (result i32) (i32.const 77)) + (func (export "value-i64") (result i64) (i64.const 7777)) + (func (export "value-f32") (result f32) (f32.const 77.7)) + (func (export "value-f64") (result f64) (f64.const 77.77)) + (func (export "value-block-void") (block (call $dummy) (call $dummy))) + (func (export "value-block-i32") (result i32) + (block i32 (call $dummy) (i32.const 77)) + ) + + (func (export "return-empty") (return)) + (func (export "return-i32") (result i32) (return (i32.const 78))) + (func (export "return-i64") (result i64) (return (i64.const 7878))) + (func (export "return-f32") (result f32) (return (f32.const 78.7))) + (func (export "return-f64") (result f64) (return (f64.const 78.78))) + (func (export "return-block-i32") (result i32) + (return (block i32 (call $dummy) (i32.const 77))) + ) + + (func (export "break-empty") (br 0)) + (func (export "break-i32") (result i32) (br 0 (i32.const 79))) + (func (export "break-i64") (result i64) (br 0 (i64.const 7979))) + (func (export "break-f32") (result f32) (br 0 (f32.const 79.9))) + (func (export "break-f64") (result f64) (br 0 (f64.const 79.79))) + (func (export "break-block-i32") (result i32) + (br 0 (block i32 (call $dummy) (i32.const 77))) + ) + + (func (export "break-br_if-empty") (param i32) + (br_if 0 (local.get 0)) + ) + (func (export "break-br_if-num") (param i32) (result i32) + (drop (br_if 0 (i32.const 50) (local.get 0))) (i32.const 51) + ) + + (func (export "break-br_table-empty") (param i32) + (br_table 0 0 0 (local.get 0)) + ) + (func (export "break-br_table-num") (param i32) (result i32) + (br_table 0 0 (i32.const 50) (local.get 0)) (i32.const 51) + ) + (func (export "break-br_table-nested-empty") (param i32) + (block (br_table 0 1 0 (local.get 0))) + ) + (func (export "break-br_table-nested-num") (param i32) (result i32) + (i32.add + (block i32 (br_table 0 1 0 (i32.const 50) (local.get 0)) (i32.const 51)) + (i32.const 2) + ) + ) + + ;; Default initialization of locals + + (func (export "init-local-i32") (result i32) (local i32) (local.get 0)) + (func (export "init-local-i64") (result i64) (local i64) (local.get 0)) + (func (export "init-local-f32") (result f32) (local f32) (local.get 0)) + (func (export "init-local-f64") (result f64) (local f64) (local.get 0)) + + + ;; Desugaring of implicit type signature + (func $empty-sig-1) ;; should be assigned type $sig + (func $complex-sig-1 (param f64 i64 f64 i64 f64 i64 f32 i32)) + (func $empty-sig-2) ;; should be assigned type $sig + (func $complex-sig-2 (param f64 i64 f64 i64 f64 i64 f32 i32)) + (func $complex-sig-3 (param f64 i64 f64 i64 f64 i64 f32 i32)) + + (type $empty-sig-duplicate (func)) + (type $complex-sig-duplicate (func (param f64 i64 f64 i64 f64 i64 f32 i32))) + (table funcref + (elem + $complex-sig-3 $empty-sig-2 $complex-sig-1 $complex-sig-3 $empty-sig-1 + ) + ) + + (func (export "signature-explicit-reused") + (call_indirect (type $sig) (i32.const 1)) + (call_indirect (type $sig) (i32.const 4)) + ) + + (func (export "signature-implicit-reused") + ;; The implicit index 16 in this test depends on the function and + ;; type definitions, and may need adapting if they change. + (call_indirect (type 16) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 0) + ) + (call_indirect (type 16) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 2) + ) + (call_indirect (type 16) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 3) + ) + ) + + (func (export "signature-explicit-duplicate") + (call_indirect (type $empty-sig-duplicate) (i32.const 1)) + ) + + (func (export "signature-implicit-duplicate") + (call_indirect (type $complex-sig-duplicate) + (f64.const 0) (i64.const 0) (f64.const 0) (i64.const 0) + (f64.const 0) (i64.const 0) (f32.const 0) (i32.const 0) + (i32.const 0) + ) + ) +) + +(assert_return (invoke "local-first-i32") (i32.const 0)) +(assert_return (invoke "local-first-i64") (i64.const 0)) +(assert_return (invoke "local-first-f32") (f32.const 0)) +(assert_return (invoke "local-first-f64") (f64.const 0)) +(assert_return (invoke "local-second-i32") (i32.const 0)) +(assert_return (invoke "local-second-i64") (i64.const 0)) +(assert_return (invoke "local-second-f32") (f32.const 0)) +(assert_return (invoke "local-second-f64") (f64.const 0)) +(assert_return (invoke "local-mixed") (f64.const 0)) + +(assert_return + (invoke "param-first-i32" (i32.const 2) (i32.const 3)) (i32.const 2) +) +(assert_return + (invoke "param-first-i64" (i64.const 2) (i64.const 3)) (i64.const 2) +) +(assert_return + (invoke "param-first-f32" (f32.const 2) (f32.const 3)) (f32.const 2) +) +(assert_return + (invoke "param-first-f64" (f64.const 2) (f64.const 3)) (f64.const 2) +) +(assert_return + (invoke "param-second-i32" (i32.const 2) (i32.const 3)) (i32.const 3) +) +(assert_return + (invoke "param-second-i64" (i64.const 2) (i64.const 3)) (i64.const 3) +) +(assert_return + (invoke "param-second-f32" (f32.const 2) (f32.const 3)) (f32.const 3) +) +(assert_return + (invoke "param-second-f64" (f64.const 2) (f64.const 3)) (f64.const 3) +) + +(assert_return + (invoke "param-mixed" + (f32.const 1) (i32.const 2) (i64.const 3) + (i32.const 4) (f64.const 5.5) (i32.const 6) + ) + (f64.const 5.5) +) + +(assert_return (invoke "empty")) +(assert_return (invoke "value-void")) +(assert_return (invoke "value-i32") (i32.const 77)) +(assert_return (invoke "value-i64") (i64.const 7777)) +(assert_return (invoke "value-f32") (f32.const 77.7)) +(assert_return (invoke "value-f64") (f64.const 77.77)) +(assert_return (invoke "value-block-void")) +(assert_return (invoke "value-block-i32") (i32.const 77)) + +(assert_return (invoke "return-empty")) +(assert_return (invoke "return-i32") (i32.const 78)) +(assert_return (invoke "return-i64") (i64.const 7878)) +(assert_return (invoke "return-f32") (f32.const 78.7)) +(assert_return (invoke "return-f64") (f64.const 78.78)) +(assert_return (invoke "return-block-i32") (i32.const 77)) + +(assert_return (invoke "break-empty")) +(assert_return (invoke "break-i32") (i32.const 79)) +(assert_return (invoke "break-i64") (i64.const 7979)) +(assert_return (invoke "break-f32") (f32.const 79.9)) +(assert_return (invoke "break-f64") (f64.const 79.79)) +(assert_return (invoke "break-block-i32") (i32.const 77)) + +(assert_return (invoke "break-br_if-empty" (i32.const 0))) +(assert_return (invoke "break-br_if-empty" (i32.const 2))) +(assert_return (invoke "break-br_if-num" (i32.const 0)) (i32.const 51)) +(assert_return (invoke "break-br_if-num" (i32.const 1)) (i32.const 50)) + +(assert_return (invoke "break-br_table-empty" (i32.const 0))) +(assert_return (invoke "break-br_table-empty" (i32.const 1))) +(assert_return (invoke "break-br_table-empty" (i32.const 5))) +(assert_return (invoke "break-br_table-empty" (i32.const -1))) +(assert_return (invoke "break-br_table-num" (i32.const 0)) (i32.const 50)) +(assert_return (invoke "break-br_table-num" (i32.const 1)) (i32.const 50)) +(assert_return (invoke "break-br_table-num" (i32.const 10)) (i32.const 50)) +(assert_return (invoke "break-br_table-num" (i32.const -100)) (i32.const 50)) +(assert_return (invoke "break-br_table-nested-empty" (i32.const 0))) +(assert_return (invoke "break-br_table-nested-empty" (i32.const 1))) +(assert_return (invoke "break-br_table-nested-empty" (i32.const 3))) +(assert_return (invoke "break-br_table-nested-empty" (i32.const -2))) +(assert_return + (invoke "break-br_table-nested-num" (i32.const 0)) (i32.const 52) +) +(assert_return + (invoke "break-br_table-nested-num" (i32.const 1)) (i32.const 50) +) +(assert_return + (invoke "break-br_table-nested-num" (i32.const 2)) (i32.const 52) +) +(assert_return + (invoke "break-br_table-nested-num" (i32.const -3)) (i32.const 52) +) + +(assert_return (invoke "init-local-i32") (i32.const 0)) +(assert_return (invoke "init-local-i64") (i64.const 0)) +(assert_return (invoke "init-local-f32") (f32.const 0)) +(assert_return (invoke "init-local-f64") (f64.const 0)) + +(assert_return (invoke "signature-explicit-reused")) +(assert_return (invoke "signature-implicit-reused")) +(assert_return (invoke "signature-explicit-duplicate")) +(assert_return (invoke "signature-implicit-duplicate")) + + +;; Invalid typing of locals + +(assert_invalid + (module (func $type-local-num-vs-num (result i64) (local i32) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-num-vs-num (local f32) (i32.eqz (local.get 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-local-num-vs-num (local f64 i64) (f64.neg (local.get 1)))) + "type mismatch" +) + + +;; Invalid typing of parameters + +(assert_invalid + (module (func $type-param-num-vs-num (param i32) (result i64) (local.get 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-num-vs-num (param f32) (i32.eqz (local.get 0)))) + "type mismatch" +) +(assert_invalid + (module (func $type-param-num-vs-num (param f64 i64) (f64.neg (local.get 1)))) + "type mismatch" +) + + +;; Invalid typing of result + +(assert_invalid + (module (func $type-multiple-result (result i32 i32) (unreachable))) + "invalid result arity" +) +(assert_invalid + (module + (type (func (result i32 i32))) + (func $type-multiple-result (type 0) (unreachable)) + ) + "invalid result arity" +) + + +(assert_invalid + (module (func $type-empty-i32 (result i32))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-i64 (result i64))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f32 (result f32))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f64 (result f64))) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-void-vs-num (result i32) + (nop) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-void + (i32.const 0) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num (result i32) + (f32.const 0) + )) + "type mismatch" +) + +(; TODO(stack): Should these become legal? +(assert_invalid + (module (func $type-value-void-vs-num-after-return (result i32) + (return (i32.const 1)) (nop) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num-after-return (result i32) + (return (i32.const 1)) (f32.const 0) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-void-vs-num-after-break (result i32) + (br 0 (i32.const 1)) (nop) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num-after-break (result i32) + (br 0 (i32.const 1)) (f32.const 0) + )) + "arity mismatch" +) +;) + +(assert_invalid + (module (func $type-return-last-empty-vs-num (result i32) + (return) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-return-last-void-vs-num (result i32) + (return (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-return-last-num-vs-num (result i32) + (return (i64.const 0)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-return-empty-vs-num (result i32) + (return) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-return-void-vs-num (result i32) + (return (nop)) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-return-num-vs-num (result i32) + (return (i64.const 1)) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-return-first-num-vs-num (result i32) + (return (i64.const 1)) (return (i32.const 1)) + )) + "type mismatch" +) +(; TODO(stack): Should this become legal? +(assert_invalid + (module (func $type-return-second-num-vs-num (result i32) + (return (i32.const 1)) (return (f64.const 1)) + )) + "type mismatch" +) +;) + +(assert_invalid + (module (func $type-break-last-void-vs-num (result i32) + (br 0) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-last-num-vs-num (result i32) + (br 0 (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-void-vs-num (result i32) + (br 0) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-num-vs-num (result i32) + (br 0 (i64.const 1)) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-first-num-vs-num (result i32) + (br 0 (i64.const 1)) (br 0 (i32.const 1)) + )) + "type mismatch" +) + +(; TODO(stack): soft failure +(assert_invalid + (module (func $type-break-second-num-vs-num (result i32) + (br 0 (i32.const 1)) (br 0 (f64.const 1)) + )) + "type mismatch" +) +;) + +(assert_invalid + (module (func $type-break-nested-empty-vs-num (result i32) + (block (br 1)) (br 0 (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-void-vs-num (result i32) + (block (br 1 (nop))) (br 0 (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-break-nested-num-vs-num (result i32) + (block (br 1 (i64.const 1))) (br 0 (i32.const 1)) + )) + "type mismatch" +) + diff --git a/test/spec/old_globals.wast b/test/spec/old_globals.wast new file mode 100644 index 000000000..ca3100a64 --- /dev/null +++ b/test/spec/old_globals.wast @@ -0,0 +1,72 @@ +;; Test globals + +(module + (global $a i32 (i32.const -2)) + (global (;1;) f32 (f32.const -3)) + (global (;2;) f64 (f64.const -4)) + (global $b i64 (i64.const -5)) + + (global $x (mut i32) (i32.const -12)) + (global (;5;) (mut f32) (f32.const -13)) + (global (;6;) (mut f64) (f64.const -14)) + (global $y (mut i64) (i64.const -15)) + + (func (export "get-a") (result i32) (global.get $a)) + (func (export "get-b") (result i64) (global.get $b)) + (func (export "get-x") (result i32) (global.get $x)) + (func (export "get-y") (result i64) (global.get $y)) + (func (export "set-x") (param i32) (global.set $x (local.get 0))) + (func (export "set-y") (param i64) (global.set $y (local.get 0))) + + (func (export "get-1") (result f32) (global.get 1)) + (func (export "get-2") (result f64) (global.get 2)) + (func (export "get-5") (result f32) (global.get 5)) + (func (export "get-6") (result f64) (global.get 6)) + (func (export "set-5") (param f32) (global.set 5 (local.get 0))) + (func (export "set-6") (param f64) (global.set 6 (local.get 0))) +) + +(assert_return (invoke "get-a") (i32.const -2)) +(assert_return (invoke "get-b") (i64.const -5)) +(assert_return (invoke "get-x") (i32.const -12)) +(assert_return (invoke "get-y") (i64.const -15)) + +(assert_return (invoke "get-1") (f32.const -3)) +(assert_return (invoke "get-2") (f64.const -4)) +(assert_return (invoke "get-5") (f32.const -13)) +(assert_return (invoke "get-6") (f64.const -14)) + +(assert_return (invoke "set-x" (i32.const 6))) +(assert_return (invoke "set-y" (i64.const 7))) +(assert_return (invoke "set-5" (f32.const 8))) +(assert_return (invoke "set-6" (f64.const 9))) + +(assert_return (invoke "get-x") (i32.const 6)) +(assert_return (invoke "get-y") (i64.const 7)) +(assert_return (invoke "get-5") (f32.const 8)) +(assert_return (invoke "get-6") (f64.const 9)) + +(assert_invalid + (module (global f32 (f32.const 0)) (func (global.set 0 (i32.const 1)))) + "global is immutable" +) + +(assert_invalid + (module (global f32 (f32.neg (f32.const 0)))) + "constant expression required" +) + +(assert_invalid + (module (global f32 (local.get 0))) + "constant expression required" +) + +(assert_invalid + (module (global i32 (f32.const 0))) + "type mismatch" +) + +(assert_invalid + (module (global i32 (global.get 0))) + "unknown global" +) diff --git a/test/spec/old_import.wast b/test/spec/old_import.wast new file mode 100644 index 000000000..19ea25202 --- /dev/null +++ b/test/spec/old_import.wast @@ -0,0 +1,224 @@ +;; Functions + +(module + (import "spectest" "print" (func (param i32))) + (func (import "spectest" "print") (param i64)) + + (import "spectest" "print" (func $print_i32 (param i32))) + (import "spectest" "print" (func $print_i64 (param i64))) + (import "spectest" "print" (func $print_i32_f32 (param i32 f32))) + (import "spectest" "print" (func $print_i64_f64 (param i64 f64))) + + (func $print_i32-2 (import "spectest" "print") (param i32)) + (func $print_i64-2 (import "spectest" "print") (param i64)) + + (func (export "print32") (param $i i32) + (call 0 (local.get $i)) + (call $print_i32_f32 + (i32.add (local.get $i) (i32.const 1)) + (f32.const 42) + ) + (call $print_i32 (local.get $i)) + (call $print_i32-2 (local.get $i)) + ) + + (func (export "print64") (param $i i64) + (call 1 (local.get $i)) + (call $print_i64_f64 + (i64.add (local.get $i) (i64.const 1)) + (f64.const 53) + ) + (call $print_i64 (local.get $i)) + (call $print_i64-2 (local.get $i)) + ) +) + +(assert_return (invoke "print32" (i32.const 13))) +(assert_return (invoke "print64" (i64.const 24))) + +(assert_unlinkable + (module (import "spectest" "unknown" (func))) + "unknown import" +) +(assert_unlinkable + (module (import "spectest" "table" (func))) + "type mismatch" +) + +(assert_unlinkable + (module (import "spectest" "print" (func)) (table funcref (elem 0))) + "invalid use of host function" +) + + +;; Globals + +(module + (import "spectest" "global" (global i32)) + (global (import "spectest" "global") i32) + + (import "spectest" "global" (global $x i32)) + (global $y (import "spectest" "global") i32) + + (func (export "get-0") (result i32) (global.get 0)) + (func (export "get-1") (result i32) (global.get 1)) + (func (export "get-x") (result i32) (global.get $x)) + (func (export "get-y") (result i32) (global.get $y)) + + ;; TODO: mutable globals + ;; (func (export "set-0") (param i32) (global.set 0 (local.get 0))) + ;; (func (export "set-1") (param i32) (global.set 1 (local.get 0))) + ;; (func (export "set-x") (param i32) (global.set $x (local.get 0))) + ;; (func (export "set-y") (param i32) (global.set $y (local.get 0))) +) + +(assert_return (invoke "get-0") (i32.const 666)) +(assert_return (invoke "get-1") (i32.const 666)) +(assert_return (invoke "get-x") (i32.const 666)) +(assert_return (invoke "get-y") (i32.const 666)) + +(assert_unlinkable + (module (import "spectest" "unknown" (global i32))) + "unknown import" +) +(assert_unlinkable + (module (import "spectest" "print" (global i32))) + "type mismatch" +) + +(module (import "spectest" "global" (global i64))) +(module (import "spectest" "global" (global f32))) +(module (import "spectest" "global" (global f64))) + + +;; Tables + +(module + (type (func (result i32))) + (import "spectest" "table" (table 10 20 funcref)) + (elem 0 (i32.const 1) $f $g) + + (func (export "call") (param i32) (result i32) (call_indirect (type 0) (local.get 0))) + (func $f (result i32) (i32.const 11)) + (func $g (result i32) (i32.const 22)) +) + +(assert_trap (invoke "call" (i32.const 0)) "uninitialized element") +(assert_return (invoke "call" (i32.const 1)) (i32.const 11)) +(assert_return (invoke "call" (i32.const 2)) (i32.const 22)) +(assert_trap (invoke "call" (i32.const 3)) "uninitialized element") +(assert_trap (invoke "call" (i32.const 100)) "undefined element") + + +(module + (type (func (result i32))) + (table (import "spectest" "table") 10 20 funcref) + (elem 0 (i32.const 1) $f $g) + + (func (export "call") (param i32) (result i32) (call_indirect (type 0) (local.get 0))) + (func $f (result i32) (i32.const 11)) + (func $g (result i32) (i32.const 22)) +) + +(assert_trap (invoke "call" (i32.const 0)) "uninitialized element") +(assert_return (invoke "call" (i32.const 1)) (i32.const 11)) +(assert_return (invoke "call" (i32.const 2)) (i32.const 22)) +(assert_trap (invoke "call" (i32.const 3)) "uninitialized element") +(assert_trap (invoke "call" (i32.const 100)) "undefined element") + + +(assert_invalid + (module (import "" "" (table 10 funcref)) (import "" "" (table 10 funcref))) + "multiple tables" +) +(assert_invalid + (module (import "" "" (table 10 funcref)) (table 10 funcref)) + "multiple tables" +) +(assert_invalid + (module (table 10 funcref) (table 10 funcref)) + "multiple tables" +) + +(assert_unlinkable + (module (import "spectest" "unknown" (table 10 funcref))) + "unknown import" +) +(assert_unlinkable + (module (import "spectest" "print" (table 10 funcref))) + "type mismatch" +) +(assert_unlinkable + (module (import "spectest" "table" (table 12 funcref))) + "actual size smaller than declared" +) +(assert_unlinkable + (module (import "spectest" "table" (table 10 15 funcref))) + "maximum size larger than declared" +) + + +;; Memories + +(module + (import "spectest" "memory" (memory 1 2)) + (data 0 (i32.const 10) "\10") + + (func (export "load") (param i32) (result i32) (i32.load (local.get 0))) +) + +(assert_return (invoke "load" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "load" (i32.const 10)) (i32.const 16)) +(assert_return (invoke "load" (i32.const 8)) (i32.const 0x100000)) +(assert_trap (invoke "load" (i32.const 1000000)) "out of bounds memory access") + +(module + (memory (import "spectest" "memory") 1 2) + (data 0 (i32.const 10) "\10") + + (func (export "load") (param i32) (result i32) (i32.load (local.get 0))) +) +(assert_return (invoke "load" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "load" (i32.const 10)) (i32.const 16)) +(assert_return (invoke "load" (i32.const 8)) (i32.const 0x100000)) +(assert_trap (invoke "load" (i32.const 1000000)) "out of bounds memory access") + +(assert_invalid + (module (import "" "" (memory 1)) (import "" "" (memory 1))) + "multiple memories" +) +(assert_invalid + (module (import "" "" (memory 1)) (memory 0)) + "multiple memories" +) +(assert_invalid + (module (memory 0) (memory 0)) + "multiple memories" +) + +(assert_unlinkable + (module (import "spectest" "unknown" (memory 1))) + "unknown import" +) +(assert_unlinkable + (module (import "spectest" "print" (memory 1))) + "type mismatch" +) +(assert_unlinkable + (module (import "spectest" "memory" (memory 2))) + "actual size smaller than declared" +) +(assert_unlinkable + (module (import "spectest" "memory" (memory 1 1))) + "maximum size larger than declared" +) + +(module + (import "spectest" "memory" (memory 0 3)) ;; actual has max size 2 + (func (export "grow") (param i32) (result i32) (memory.grow (local.get 0))) +) +(assert_return (invoke "grow" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "grow" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "grow" (i32.const 1)) (i32.const -1)) +(assert_return (invoke "grow" (i32.const 0)) (i32.const 2)) diff --git a/test/spec/old_int_literals.wast b/test/spec/old_int_literals.wast new file mode 100644 index 000000000..f0ec04178 --- /dev/null +++ b/test/spec/old_int_literals.wast @@ -0,0 +1,49 @@ +(module + (func (export "i32.test") (result i32) (return (i32.const 0x0bAdD00D))) + (func (export "i32.umax") (result i32) (return (i32.const 0xffffffff))) + (func (export "i32.smax") (result i32) (return (i32.const 0x7fffffff))) + (func (export "i32.neg_smax") (result i32) (return (i32.const -0x7fffffff))) + (func (export "i32.smin") (result i32) (return (i32.const -0x80000000))) + (func (export "i32.alt_smin") (result i32) (return (i32.const 0x80000000))) + (func (export "i32.inc_smin") (result i32) (return (i32.add (i32.const -0x80000000) (i32.const 1)))) + (func (export "i32.neg_zero") (result i32) (return (i32.const -0x0))) + (func (export "i32.not_octal") (result i32) (return (i32.const 010))) + (func (export "i32.unsigned_decimal") (result i32) (return (i32.const 4294967295))) + (func (export "i32.plus_sign") (result i32) (return (i32.const +42))) + + (func (export "i64.test") (result i64) (return (i64.const 0x0CABBA6E0ba66a6e))) + (func (export "i64.umax") (result i64) (return (i64.const 0xffffffffffffffff))) + (func (export "i64.smax") (result i64) (return (i64.const 0x7fffffffffffffff))) + (func (export "i64.neg_smax") (result i64) (return (i64.const -0x7fffffffffffffff))) + (func (export "i64.smin") (result i64) (return (i64.const -0x8000000000000000))) + (func (export "i64.alt_smin") (result i64) (return (i64.const 0x8000000000000000))) + (func (export "i64.inc_smin") (result i64) (return (i64.add (i64.const -0x8000000000000000) (i64.const 1)))) + (func (export "i64.neg_zero") (result i64) (return (i64.const -0x0))) + (func (export "i64.not_octal") (result i64) (return (i64.const 010))) + (func (export "i64.unsigned_decimal") (result i64) (return (i64.const 18446744073709551615))) + (func (export "i64.plus_sign") (result i64) (return (i64.const +42))) +) + +(assert_return (invoke "i32.test") (i32.const 195940365)) +(assert_return (invoke "i32.umax") (i32.const -1)) +(assert_return (invoke "i32.smax") (i32.const 2147483647)) +(assert_return (invoke "i32.neg_smax") (i32.const -2147483647)) +(assert_return (invoke "i32.smin") (i32.const -2147483648)) +(assert_return (invoke "i32.alt_smin") (i32.const -2147483648)) +(assert_return (invoke "i32.inc_smin") (i32.const -2147483647)) +(assert_return (invoke "i32.neg_zero") (i32.const 0)) +(assert_return (invoke "i32.not_octal") (i32.const 10)) +(assert_return (invoke "i32.unsigned_decimal") (i32.const -1)) +(assert_return (invoke "i32.plus_sign") (i32.const 42)) + +(assert_return (invoke "i64.test") (i64.const 913028331277281902)) +(assert_return (invoke "i64.umax") (i64.const -1)) +(assert_return (invoke "i64.smax") (i64.const 9223372036854775807)) +(assert_return (invoke "i64.neg_smax") (i64.const -9223372036854775807)) +(assert_return (invoke "i64.smin") (i64.const -9223372036854775808)) +(assert_return (invoke "i64.alt_smin") (i64.const -9223372036854775808)) +(assert_return (invoke "i64.inc_smin") (i64.const -9223372036854775807)) +(assert_return (invoke "i64.neg_zero") (i64.const 0)) +(assert_return (invoke "i64.not_octal") (i64.const 10)) +(assert_return (invoke "i64.unsigned_decimal") (i64.const -1)) +(assert_return (invoke "i64.plus_sign") (i64.const 42)) diff --git a/test/spec/old_loop.wast b/test/spec/old_loop.wast new file mode 100644 index 000000000..9e51f618c --- /dev/null +++ b/test/spec/old_loop.wast @@ -0,0 +1,282 @@ +;; Test `loop` opcode + +(module + (func $dummy) + + (func (export "empty") + (loop) + (loop $l) + ) + + (func (export "singular") (result i32) + (loop (nop)) + (loop i32 (i32.const 7)) + ) + + (func (export "multi") (result i32) + (loop (call $dummy) (call $dummy) (call $dummy) (call $dummy)) + (loop i32 (call $dummy) (call $dummy) (call $dummy) (i32.const 8)) + ) + + (func (export "nested") (result i32) + (loop i32 + (loop (call $dummy) (block) (nop)) + (loop i32 (call $dummy) (i32.const 9)) + ) + ) + + (func (export "deep") (result i32) + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (loop i32 (block i32 (loop i32 (block i32 + (loop i32 (block i32 (call $dummy) (i32.const 150))) + )))))) + )))))) + )))))) + )))))) + )))))) + )))))) + )))))) + ) + + (func (export "as-unary-operand") (result i32) + (i32.ctz (loop i32 (call $dummy) (i32.const 13))) + ) + (func (export "as-binary-operand") (result i32) + (i32.mul + (loop i32 (call $dummy) (i32.const 3)) + (loop i32 (call $dummy) (i32.const 4)) + ) + ) + (func (export "as-test-operand") (result i32) + (i32.eqz (loop i32 (call $dummy) (i32.const 13))) + ) + (func (export "as-compare-operand") (result i32) + (f32.gt + (loop f32 (call $dummy) (f32.const 3)) + (loop f32 (call $dummy) (f32.const 3)) + ) + ) + + (func (export "break-bare") (result i32) + (block (loop (br 1) (br 0) (unreachable))) + (block (loop (br_if 1 (i32.const 1)) (unreachable))) + (block (loop (br_table 1 (i32.const 0)) (unreachable))) + (block (loop (br_table 1 1 1 (i32.const 1)) (unreachable))) + (i32.const 19) + ) + (func (export "break-value") (result i32) + (block i32 (loop i32 (br 1 (i32.const 18)) (br 0) (i32.const 19))) + ) + (func (export "break-repeated") (result i32) + (block i32 + (loop i32 + (br 1 (i32.const 18)) + (br 1 (i32.const 19)) + (drop (br_if 1 (i32.const 20) (i32.const 0))) + (drop (br_if 1 (i32.const 20) (i32.const 1))) + (br 1 (i32.const 21)) + (br_table 1 (i32.const 22) (i32.const 0)) + (br_table 1 1 1 (i32.const 23) (i32.const 1)) + (i32.const 21) + ) + ) + ) + (func (export "break-inner") (result i32) + (local i32) + (local.set 0 (i32.const 0)) + (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (block i32 (br 2 (i32.const 0x1))))))) + (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (loop i32 (br 2 (i32.const 0x2))))))) + (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (block i32 (loop i32 (br 1 (i32.const 0x4)))))))) + (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (i32.ctz (br 1 (i32.const 0x8))))))) + (local.set 0 (i32.add (local.get 0) (block i32 (loop i32 (i32.ctz (loop i32 (br 2 (i32.const 0x10)))))))) + (local.get 0) + ) + (func (export "cont-inner") (result i32) + (local i32) + (local.set 0 (i32.const 0)) + (local.set 0 (i32.add (local.get 0) (loop i32 (loop i32 (br 1))))) + (local.set 0 (i32.add (local.get 0) (loop i32 (i32.ctz (br 0))))) + (local.set 0 (i32.add (local.get 0) (loop i32 (i32.ctz (loop i32 (br 1)))))) + (local.get 0) + ) + + (func $fx (export "effects") (result i32) + (local i32) + (block + (loop + (local.set 0 (i32.const 1)) + (local.set 0 (i32.mul (local.get 0) (i32.const 3))) + (local.set 0 (i32.sub (local.get 0) (i32.const 5))) + (local.set 0 (i32.mul (local.get 0) (i32.const 7))) + (br 1) + (local.set 0 (i32.mul (local.get 0) (i32.const 100))) + ) + ) + (i32.eq (local.get 0) (i32.const -14)) + ) + + (func (export "while") (param i64) (result i64) + (local i64) + (local.set 1 (i64.const 1)) + (block + (loop + (br_if 1 (i64.eqz (local.get 0))) + (local.set 1 (i64.mul (local.get 0) (local.get 1))) + (local.set 0 (i64.sub (local.get 0) (i64.const 1))) + (br 0) + ) + ) + (local.get 1) + ) + + (func (export "for") (param i64) (result i64) + (local i64 i64) + (local.set 1 (i64.const 1)) + (local.set 2 (i64.const 2)) + (block + (loop + (br_if 1 (i64.gt_u (local.get 2) (local.get 0))) + (local.set 1 (i64.mul (local.get 1) (local.get 2))) + (local.set 2 (i64.add (local.get 2) (i64.const 1))) + (br 0) + ) + ) + (local.get 1) + ) + + (func (export "nesting") (param f32 f32) (result f32) + (local f32 f32) + (block + (loop + (br_if 1 (f32.eq (local.get 0) (f32.const 0))) + (local.set 2 (local.get 1)) + (block + (loop + (br_if 1 (f32.eq (local.get 2) (f32.const 0))) + (br_if 3 (f32.lt (local.get 2) (f32.const 0))) + (local.set 3 (f32.add (local.get 3) (local.get 2))) + (local.set 2 (f32.sub (local.get 2) (f32.const 2))) + (br 0) + ) + ) + (local.set 3 (f32.div (local.get 3) (local.get 0))) + (local.set 0 (f32.sub (local.get 0) (f32.const 1))) + (br 0) + ) + ) + (local.get 3) + ) +) + +(assert_return (invoke "empty")) +(assert_return (invoke "singular") (i32.const 7)) +(assert_return (invoke "multi") (i32.const 8)) +(assert_return (invoke "nested") (i32.const 9)) +(assert_return (invoke "deep") (i32.const 150)) + +(assert_return (invoke "as-unary-operand") (i32.const 0)) +(assert_return (invoke "as-binary-operand") (i32.const 12)) +(assert_return (invoke "as-test-operand") (i32.const 0)) +(assert_return (invoke "as-compare-operand") (i32.const 0)) + +(assert_return (invoke "break-bare") (i32.const 19)) +(assert_return (invoke "break-value") (i32.const 18)) +(assert_return (invoke "break-repeated") (i32.const 18)) +(assert_return (invoke "break-inner") (i32.const 0x1f)) + +(assert_return (invoke "effects") (i32.const 1)) + +(assert_return (invoke "while" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "while" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "while" (i64.const 2)) (i64.const 2)) +(assert_return (invoke "while" (i64.const 3)) (i64.const 6)) +(assert_return (invoke "while" (i64.const 5)) (i64.const 120)) +(assert_return (invoke "while" (i64.const 20)) (i64.const 2432902008176640000)) + +(assert_return (invoke "for" (i64.const 0)) (i64.const 1)) +(assert_return (invoke "for" (i64.const 1)) (i64.const 1)) +(assert_return (invoke "for" (i64.const 2)) (i64.const 2)) +(assert_return (invoke "for" (i64.const 3)) (i64.const 6)) +(assert_return (invoke "for" (i64.const 5)) (i64.const 120)) +(assert_return (invoke "for" (i64.const 20)) (i64.const 2432902008176640000)) + +(assert_return (invoke "nesting" (f32.const 0) (f32.const 7)) (f32.const 0)) +(assert_return (invoke "nesting" (f32.const 7) (f32.const 0)) (f32.const 0)) +(assert_return (invoke "nesting" (f32.const 1) (f32.const 1)) (f32.const 1)) +(assert_return (invoke "nesting" (f32.const 1) (f32.const 2)) (f32.const 2)) +(assert_return (invoke "nesting" (f32.const 1) (f32.const 3)) (f32.const 4)) +(assert_return (invoke "nesting" (f32.const 1) (f32.const 4)) (f32.const 6)) +(assert_return (invoke "nesting" (f32.const 1) (f32.const 100)) (f32.const 2550)) +(assert_return (invoke "nesting" (f32.const 1) (f32.const 101)) (f32.const 2601)) +(assert_return (invoke "nesting" (f32.const 2) (f32.const 1)) (f32.const 1)) +(assert_return (invoke "nesting" (f32.const 3) (f32.const 1)) (f32.const 1)) +(assert_return (invoke "nesting" (f32.const 10) (f32.const 1)) (f32.const 1)) +(assert_return (invoke "nesting" (f32.const 2) (f32.const 2)) (f32.const 3)) +(assert_return (invoke "nesting" (f32.const 2) (f32.const 3)) (f32.const 4)) +(assert_return (invoke "nesting" (f32.const 7) (f32.const 4)) (f32.const 10.3095235825)) +(assert_return (invoke "nesting" (f32.const 7) (f32.const 100)) (f32.const 4381.54785156)) +(assert_return (invoke "nesting" (f32.const 7) (f32.const 101)) (f32.const 2601)) + +(assert_invalid + (module (func $type-empty-i32 (result i32) (loop))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-i64 (result i64) (loop))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f32 (result f32) (loop))) + "type mismatch" +) +(assert_invalid + (module (func $type-empty-f64 (result f64) (loop))) + "type mismatch" +) + +(assert_invalid + (module (func $type-value-void-vs-num (result i32) + (loop (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num (result i32) + (loop (f32.const 0)) + )) + "type mismatch" +) + +(; TODO(stack): soft failure +(assert_invalid + (module (func $type-value-void-vs-num-after-break (result i32) + (loop (br 1 (i32.const 1)) (nop)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-value-num-vs-num-after-break (result i32) + (loop (br 1 (i32.const 1)) (f32.const 0)) + )) + "type mismatch" +) +;) + +(assert_invalid + (module (func $type-cont-last-void-vs-empty (result i32) + (loop (br 0 (nop))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-cont-last-num-vs-empty (result i32) + (loop (br 0 (i32.const 0))) + )) + "type mismatch" +) + diff --git a/test/spec/old_select.wast b/test/spec/old_select.wast new file mode 100644 index 000000000..493f67f0a --- /dev/null +++ b/test/spec/old_select.wast @@ -0,0 +1,57 @@ +(module + (func (export "select_i32") (param $lhs i32) (param $rhs i32) (param $cond i32) (result i32) + (select (local.get $lhs) (local.get $rhs) (local.get $cond))) + + (func (export "select_i64") (param $lhs i64) (param $rhs i64) (param $cond i32) (result i64) + (select (local.get $lhs) (local.get $rhs) (local.get $cond))) + + (func (export "select_f32") (param $lhs f32) (param $rhs f32) (param $cond i32) (result f32) + (select (local.get $lhs) (local.get $rhs) (local.get $cond))) + + (func (export "select_f64") (param $lhs f64) (param $rhs f64) (param $cond i32) (result f64) + (select (local.get $lhs) (local.get $rhs) (local.get $cond))) + + ;; Check that both sides of the select are evaluated + (func (export "select_trap_l") (param $cond i32) (result i32) + (select (unreachable) (i32.const 0) (local.get $cond))) + (func (export "select_trap_r") (param $cond i32) (result i32) + (select (i32.const 0) (unreachable) (local.get $cond))) +) + +(assert_return (invoke "select_i32" (i32.const 1) (i32.const 2) (i32.const 1)) (i32.const 1)) +(assert_return (invoke "select_i64" (i64.const 2) (i64.const 1) (i32.const 1)) (i64.const 2)) +(assert_return (invoke "select_f32" (f32.const 1) (f32.const 2) (i32.const 1)) (f32.const 1)) +(assert_return (invoke "select_f64" (f64.const 1) (f64.const 2) (i32.const 1)) (f64.const 1)) + +(assert_return (invoke "select_i32" (i32.const 1) (i32.const 2) (i32.const 0)) (i32.const 2)) +(assert_return (invoke "select_i32" (i32.const 2) (i32.const 1) (i32.const 0)) (i32.const 1)) +(assert_return (invoke "select_i64" (i64.const 2) (i64.const 1) (i32.const -1)) (i64.const 2)) +(assert_return (invoke "select_i64" (i64.const 2) (i64.const 1) (i32.const 0xf0f0f0f0)) (i64.const 2)) + +(assert_return (invoke "select_f32" (f32.const nan) (f32.const 1) (i32.const 1)) (f32.const nan)) +(assert_return (invoke "select_f32" (f32.const nan:0x20304) (f32.const 1) (i32.const 1)) (f32.const nan:0x20304)) +(assert_return (invoke "select_f32" (f32.const nan) (f32.const 1) (i32.const 0)) (f32.const 1)) +(assert_return (invoke "select_f32" (f32.const nan:0x20304) (f32.const 1) (i32.const 0)) (f32.const 1)) +(assert_return (invoke "select_f32" (f32.const 2) (f32.const nan) (i32.const 1)) (f32.const 2)) +(assert_return (invoke "select_f32" (f32.const 2) (f32.const nan:0x20304) (i32.const 1)) (f32.const 2)) +(assert_return (invoke "select_f32" (f32.const 2) (f32.const nan) (i32.const 0)) (f32.const nan)) +(assert_return (invoke "select_f32" (f32.const 2) (f32.const nan:0x20304) (i32.const 0)) (f32.const nan:0x20304)) + +(assert_return (invoke "select_f64" (f64.const nan) (f64.const 1) (i32.const 1)) (f64.const nan)) +(assert_return (invoke "select_f64" (f64.const nan:0x20304) (f64.const 1) (i32.const 1)) (f64.const nan:0x20304)) +(assert_return (invoke "select_f64" (f64.const nan) (f64.const 1) (i32.const 0)) (f64.const 1)) +(assert_return (invoke "select_f64" (f64.const nan:0x20304) (f64.const 1) (i32.const 0)) (f64.const 1)) +(assert_return (invoke "select_f64" (f64.const 2) (f64.const nan) (i32.const 1)) (f64.const 2)) +(assert_return (invoke "select_f64" (f64.const 2) (f64.const nan:0x20304) (i32.const 1)) (f64.const 2)) +(assert_return (invoke "select_f64" (f64.const 2) (f64.const nan) (i32.const 0)) (f64.const nan)) +(assert_return (invoke "select_f64" (f64.const 2) (f64.const nan:0x20304) (i32.const 0)) (f64.const nan:0x20304)) + +(assert_trap (invoke "select_trap_l" (i32.const 1)) "unreachable executed") +(assert_trap (invoke "select_trap_l" (i32.const 0)) "unreachable executed") +(assert_trap (invoke "select_trap_r" (i32.const 1)) "unreachable executed") +(assert_trap (invoke "select_trap_r" (i32.const 0)) "unreachable executed") + +(assert_invalid + (module (func $arity-0 (select (nop) (nop) (i32.const 1)))) + "type mismatch" +) diff --git a/test/spec/old_start.wast b/test/spec/old_start.wast new file mode 100644 index 000000000..a20c449be --- /dev/null +++ b/test/spec/old_start.wast @@ -0,0 +1,88 @@ +(assert_invalid + (module (func) (start 1)) + "unknown function" +) +(assert_invalid + (module + (func $main (result i32) (return (i32.const 0))) + (start $main) + ) + "start function" +) +(assert_invalid + (module + (func $main (param $a i32)) + (start $main) + ) + "start function" +) +(module + (memory (data "A")) + (func $inc + (i32.store8 + (i32.const 0) + (i32.add + (i32.load8_u (i32.const 0)) + (i32.const 1) + ) + ) + ) + (func $get (result i32) + (return (i32.load8_u (i32.const 0))) + ) + (func $main + (call $inc) + (call $inc) + (call $inc) + ) + + (start $main) + (export "inc" (func $inc)) + (export "get" (func $get)) +) +(assert_return (invoke "get") (i32.const 68)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 69)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 70)) + +(module + (memory (data "A")) + (func $inc + (i32.store8 + (i32.const 0) + (i32.add + (i32.load8_u (i32.const 0)) + (i32.const 1) + ) + ) + ) + (func $get (result i32) + (return (i32.load8_u (i32.const 0))) + ) + (func $main + (call $inc) + (call $inc) + (call $inc) + ) + (start 2) + (export "inc" (func $inc)) + (export "get" (func $get)) +) +(assert_return (invoke "get") (i32.const 68)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 69)) +(invoke "inc") +(assert_return (invoke "get") (i32.const 70)) + +(module + (func $print_i32 (import "spectest" "print") (param i32)) + (func $main (call $print_i32 (i32.const 1))) + (start 1) +) + +(module + (func $print_i32 (import "spectest" "print") (param i32)) + (func $main (call $print_i32 (i32.const 2))) + (start $main) +) diff --git a/test/spec/old_unreachable.wast b/test/spec/old_unreachable.wast new file mode 100644 index 000000000..ee61f794f --- /dev/null +++ b/test/spec/old_unreachable.wast @@ -0,0 +1,262 @@ +;; Test `unreachable` operator + +(module + ;; Auxiliary definitions + (func $dummy) + (func $dummy3 (param i32 i32 i32)) + + (func (export "type-i32") (result i32) (unreachable)) + (func (export "type-i64") (result i32) (unreachable)) + (func (export "type-f32") (result f64) (unreachable)) + (func (export "type-f64") (result f64) (unreachable)) + + (func (export "as-func-first") (result i32) + (unreachable) (i32.const -1) + ) + (func (export "as-func-mid") (result i32) + (call $dummy) (unreachable) (i32.const -1) + ) + (func (export "as-func-last") + (call $dummy) (unreachable) + ) + (func (export "as-func-value") (result i32) + (call $dummy) (unreachable) + ) + + (func (export "as-block-first") (result i32) + (block i32 (unreachable) (i32.const 2)) + ) + (func (export "as-block-mid") (result i32) + (block i32 (call $dummy) (unreachable) (i32.const 2)) + ) + (func (export "as-block-last") + (block (nop) (call $dummy) (unreachable)) + ) + (func (export "as-block-value") (result i32) + (block i32 (nop) (call $dummy) (unreachable)) + ) + (func (export "as-block-broke") (result i32) + (block i32 (call $dummy) (br 0 (i32.const 1)) (unreachable)) + ) + + (func (export "as-loop-first") (result i32) + (loop i32 (unreachable) (i32.const 2)) + ) + (func (export "as-loop-mid") (result i32) + (loop i32 (call $dummy) (unreachable) (i32.const 2)) + ) + (func (export "as-loop-last") + (loop (nop) (call $dummy) (unreachable)) + ) + (func (export "as-loop-broke") (result i32) + (block i32 (loop i32 (call $dummy) (br 1 (i32.const 1)) (unreachable))) + ) + + (func (export "as-br-value") (result i32) + (block i32 (br 0 (unreachable))) + ) + + (func (export "as-br_if-cond") + (block (br_if 0 (unreachable))) + ) + (func (export "as-br_if-value") (result i32) + (block i32 (br_if 0 (unreachable) (i32.const 1)) (i32.const 7)) + ) + (func (export "as-br_if-value-cond") (result i32) + (block i32 (drop (br_if 0 (i32.const 6) (unreachable))) (i32.const 7)) + ) + + (func (export "as-br_table-index") + (block (br_table 0 0 0 (unreachable))) + ) + (func (export "as-br_table-value") (result i32) + (block i32 (br_table 0 0 0 (unreachable) (i32.const 1)) (i32.const 7)) + ) + (func (export "as-br_table-value-index") (result i32) + (block i32 (br_table 0 0 (i32.const 6) (unreachable)) (i32.const 7)) + ) + + (func (export "as-return-value") (result i64) + (return (unreachable)) + ) + + (func (export "as-if-cond") (result i32) + (if i32 (unreachable) (i32.const 0) (i32.const 1)) + ) + (func (export "as-if-then") (param i32 i32) (result i32) + (if i32 (local.get 0) (unreachable) (local.get 1)) + ) + (func (export "as-if-else") (param i32 i32) (result i32) + (if i32 (local.get 0) (local.get 1) (unreachable)) + ) + + (func (export "as-select-first") (param i32 i32) (result i32) + (select (unreachable) (local.get 0) (local.get 1)) + ) + (func (export "as-select-second") (param i32 i32) (result i32) + (select (local.get 0) (unreachable) (local.get 1)) + ) + (func (export "as-select-cond") (result i32) + (select (i32.const 0) (i32.const 1) (unreachable)) + ) + + (func (export "as-call-first") + (call $dummy3 (unreachable) (i32.const 2) (i32.const 3)) + ) + (func (export "as-call-mid") + (call $dummy3 (i32.const 1) (unreachable) (i32.const 3)) + ) + (func (export "as-call-last") + (call $dummy3 (i32.const 1) (i32.const 2) (unreachable)) + ) + + (type $sig (func (param i32 i32 i32))) + (table funcref (elem $dummy3)) + (func (export "as-call_indirect-func") + (call_indirect (type $sig) (unreachable) (i32.const 1) (i32.const 2) (i32.const 3)) + ) + (func (export "as-call_indirect-first") + (call_indirect (type $sig) (i32.const 0) (unreachable) (i32.const 2) (i32.const 3)) + ) + (func (export "as-call_indirect-mid") + (call_indirect (type $sig) (i32.const 0) (i32.const 1) (unreachable) (i32.const 3)) + ) + (func (export "as-call_indirect-last") + (call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (unreachable)) + ) + + (func (export "as-local.set-value") (local f32) + (local.set 0 (unreachable)) + ) + + (memory 1) + (func (export "as-load-address") (result f32) + (f32.load (unreachable)) + ) + (func (export "as-loadN-address") (result i64) + (i64.load8_s (unreachable)) + ) + + (func (export "as-store-address") + (f64.store (unreachable) (f64.const 7)) + ) + (func (export "as-store-value") + (i64.store (i32.const 2) (unreachable)) + ) + + (func (export "as-storeN-address") + (i32.store8 (unreachable) (i32.const 7)) + ) + (func (export "as-storeN-value") + (i64.store16 (i32.const 2) (unreachable)) + ) + + (func (export "as-unary-operand") (result f32) + (f32.neg (unreachable)) + ) + + (func (export "as-binary-left") (result i32) + (i32.add (unreachable) (i32.const 10)) + ) + (func (export "as-binary-right") (result i64) + (i64.sub (i64.const 10) (unreachable)) + ) + + (func (export "as-test-operand") (result i32) + (i32.eqz (unreachable)) + ) + + (func (export "as-compare-left") (result i32) + (f64.le (unreachable) (f64.const 10)) + ) + (func (export "as-compare-right") (result i32) + (f32.ne (f32.const 10) (unreachable)) + ) + + (func (export "as-convert-operand") (result i32) + (i32.wrap_i64 (unreachable)) + ) + + (func (export "as-memory.grow-size") (result i32) + (memory.grow (unreachable)) + ) +) + +(assert_trap (invoke "type-i32") "unreachable") +(assert_trap (invoke "type-i64") "unreachable") +(assert_trap (invoke "type-f32") "unreachable") +(assert_trap (invoke "type-f64") "unreachable") + +(assert_trap (invoke "as-func-first") "unreachable") +(assert_trap (invoke "as-func-mid") "unreachable") +(assert_trap (invoke "as-func-last") "unreachable") +(assert_trap (invoke "as-func-value") "unreachable") + +(assert_trap (invoke "as-block-first") "unreachable") +(assert_trap (invoke "as-block-mid") "unreachable") +(assert_trap (invoke "as-block-last") "unreachable") +(assert_trap (invoke "as-block-value") "unreachable") +(assert_return (invoke "as-block-broke") (i32.const 1)) + +(assert_trap (invoke "as-loop-first") "unreachable") +(assert_trap (invoke "as-loop-mid") "unreachable") +(assert_trap (invoke "as-loop-last") "unreachable") +(assert_return (invoke "as-loop-broke") (i32.const 1)) + +(assert_trap (invoke "as-br-value") "unreachable") + +(assert_trap (invoke "as-br_if-cond") "unreachable") +(assert_trap (invoke "as-br_if-value") "unreachable") +(assert_trap (invoke "as-br_if-value-cond") "unreachable") + +(assert_trap (invoke "as-br_table-index") "unreachable") +(assert_trap (invoke "as-br_table-value") "unreachable") +(assert_trap (invoke "as-br_table-value-index") "unreachable") + +(assert_trap (invoke "as-return-value") "unreachable") + +(assert_trap (invoke "as-if-cond") "unreachable") +(assert_trap (invoke "as-if-then" (i32.const 1) (i32.const 6)) "unreachable") +(assert_return (invoke "as-if-then" (i32.const 0) (i32.const 6)) (i32.const 6)) +(assert_trap (invoke "as-if-else" (i32.const 0) (i32.const 6)) "unreachable") +(assert_return (invoke "as-if-else" (i32.const 1) (i32.const 6)) (i32.const 6)) + +(assert_trap (invoke "as-select-first" (i32.const 0) (i32.const 6)) "unreachable") +(assert_trap (invoke "as-select-first" (i32.const 1) (i32.const 6)) "unreachable") +(assert_trap (invoke "as-select-second" (i32.const 0) (i32.const 6)) "unreachable") +(assert_trap (invoke "as-select-second" (i32.const 1) (i32.const 6)) "unreachable") +(assert_trap (invoke "as-select-cond") "unreachable") + +(assert_trap (invoke "as-call-first") "unreachable") +(assert_trap (invoke "as-call-mid") "unreachable") +(assert_trap (invoke "as-call-last") "unreachable") + +(assert_trap (invoke "as-call_indirect-func") "unreachable") +(assert_trap (invoke "as-call_indirect-first") "unreachable") +(assert_trap (invoke "as-call_indirect-mid") "unreachable") +(assert_trap (invoke "as-call_indirect-last") "unreachable") + +(assert_trap (invoke "as-local.set-value") "unreachable") + +(assert_trap (invoke "as-load-address") "unreachable") +(assert_trap (invoke "as-loadN-address") "unreachable") + +(assert_trap (invoke "as-store-address") "unreachable") +(assert_trap (invoke "as-store-value") "unreachable") +(assert_trap (invoke "as-storeN-address") "unreachable") +(assert_trap (invoke "as-storeN-value") "unreachable") + +(assert_trap (invoke "as-unary-operand") "unreachable") + +(assert_trap (invoke "as-binary-left") "unreachable") +(assert_trap (invoke "as-binary-right") "unreachable") + +(assert_trap (invoke "as-test-operand") "unreachable") + +(assert_trap (invoke "as-compare-left") "unreachable") +(assert_trap (invoke "as-compare-right") "unreachable") + +(assert_trap (invoke "as-convert-operand") "unreachable") + +(assert_trap (invoke "as-memory.grow-size") "unreachable") + diff --git a/test/spec/return.wast b/test/spec/return.wast index 9dca8dda9..7077f25b6 100644 --- a/test/spec/return.wast +++ b/test/spec/return.wast @@ -9,6 +9,19 @@ (func (export "type-f32") (drop (f32.neg (return)))) (func (export "type-f64") (drop (f64.neg (return)))) + (func (export "type-i32-value") (result i32) + (block (result i32) (i32.ctz (return (i32.const 1)))) + ) + (func (export "type-i64-value") (result i64) + (block (result i64) (i64.ctz (return (i64.const 2)))) + ) + (func (export "type-f32-value") (result f32) + (block (result f32) (f32.neg (return (f32.const 3)))) + ) + (func (export "type-f64-value") (result f64) + (block (result f64) (f64.neg (return (f64.const 4)))) + ) + (func (export "nullary") (return)) (func (export "unary") (result f64) (return (f64.const 3))) @@ -35,43 +48,47 @@ (block (nop) (call $dummy) (return)) ) (func (export "as-block-value") (result i32) - (block i32 (nop) (call $dummy) (return (i32.const 2))) + (block (result i32) (nop) (call $dummy) (return (i32.const 2))) ) (func (export "as-loop-first") (result i32) - (loop i32 (return (i32.const 3)) (i32.const 2)) + (loop (result i32) (return (i32.const 3)) (i32.const 2)) ) (func (export "as-loop-mid") (result i32) - (loop i32 (call $dummy) (return (i32.const 4)) (i32.const 2)) + (loop (result i32) (call $dummy) (return (i32.const 4)) (i32.const 2)) ) (func (export "as-loop-last") (result i32) - (loop i32 (nop) (call $dummy) (return (i32.const 5))) + (loop (result i32) (nop) (call $dummy) (return (i32.const 5))) ) (func (export "as-br-value") (result i32) - (block i32 (br 0 (return (i32.const 9)))) + (block (result i32) (br 0 (return (i32.const 9)))) ) (func (export "as-br_if-cond") (block (br_if 0 (return))) ) (func (export "as-br_if-value") (result i32) - (block i32 (br_if 0 (return (i32.const 8)) (i32.const 1)) (i32.const 7)) + (block (result i32) + (drop (br_if 0 (return (i32.const 8)) (i32.const 1))) (i32.const 7) + ) ) (func (export "as-br_if-value-cond") (result i32) - (block i32 (drop (br_if 0 (i32.const 6) (return (i32.const 9)))) (i32.const 7)) + (block (result i32) + (drop (br_if 0 (i32.const 6) (return (i32.const 9)))) (i32.const 7) + ) ) (func (export "as-br_table-index") (result i64) (block (br_table 0 0 0 (return (i64.const 9)))) (i64.const -1) ) (func (export "as-br_table-value") (result i32) - (block i32 + (block (result i32) (br_table 0 0 0 (return (i32.const 10)) (i32.const 1)) (i32.const 7) ) ) (func (export "as-br_table-value-index") (result i32) - (block i32 + (block (result i32) (br_table 0 0 (i32.const 6) (return (i32.const 11))) (i32.const 7) ) ) @@ -81,13 +98,19 @@ ) (func (export "as-if-cond") (result i32) - (if i32 (return (i32.const 2)) (i32.const 0) (i32.const 1)) + (if (result i32) + (return (i32.const 2)) (then (i32.const 0)) (else (i32.const 1)) + ) ) (func (export "as-if-then") (param i32 i32) (result i32) - (if i32 (local.get 0) (return (i32.const 3)) (local.get 1)) + (if (result i32) + (local.get 0) (then (return (i32.const 3))) (else (local.get 1)) + ) ) (func (export "as-if-else") (param i32 i32) (result i32) - (if i32 (local.get 0) (local.get 1) (return (i32.const 4))) + (if (result i32) + (local.get 0) (then (local.get 1)) (else (return (i32.const 4))) + ) ) (func (export "as-select-first") (param i32 i32) (result i32) @@ -114,21 +137,36 @@ (type $sig (func (param i32 i32 i32) (result i32))) (table funcref (elem $f)) (func (export "as-call_indirect-func") (result i32) - (call_indirect (type $sig) (return (i32.const 20)) (i32.const 1) (i32.const 2) (i32.const 3)) + (call_indirect (type $sig) + (return (i32.const 20)) (i32.const 1) (i32.const 2) (i32.const 3) + ) ) (func (export "as-call_indirect-first") (result i32) - (call_indirect (type $sig) (i32.const 0) (return (i32.const 21)) (i32.const 2) (i32.const 3)) + (call_indirect (type $sig) + (i32.const 0) (return (i32.const 21)) (i32.const 2) (i32.const 3) + ) ) (func (export "as-call_indirect-mid") (result i32) - (call_indirect (type $sig) (i32.const 0) (i32.const 1) (return (i32.const 22)) (i32.const 3)) + (call_indirect (type $sig) + (i32.const 0) (i32.const 1) (return (i32.const 22)) (i32.const 3) + ) ) (func (export "as-call_indirect-last") (result i32) - (call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (return (i32.const 23))) + (call_indirect (type $sig) + (i32.const 0) (i32.const 1) (i32.const 2) (return (i32.const 23)) + ) ) (func (export "as-local.set-value") (result i32) (local f32) (local.set 0 (return (i32.const 17))) (i32.const -1) ) + (func (export "as-local.tee-value") (result i32) (local i32) + (local.tee 0 (return (i32.const 1))) + ) + (global $a (mut i32) (i32.const 0)) + (func (export "as-global.set-value") (result i32) + (global.set $a (return (i32.const 1))) + ) (memory 1) (func (export "as-load-address") (result f32) @@ -188,6 +226,11 @@ (assert_return (invoke "type-f32")) (assert_return (invoke "type-f64")) +(assert_return (invoke "type-i32-value") (i32.const 1)) +(assert_return (invoke "type-i64-value") (i64.const 2)) +(assert_return (invoke "type-f32-value") (f32.const 3)) +(assert_return (invoke "type-f64-value") (f64.const 4)) + (assert_return (invoke "nullary")) (assert_return (invoke "unary") (f64.const 3)) @@ -239,6 +282,8 @@ (assert_return (invoke "as-call_indirect-last") (i32.const 23)) (assert_return (invoke "as-local.set-value") (i32.const 17)) +(assert_return (invoke "as-local.tee-value") (i32.const 1)) +(assert_return (invoke "as-global.set-value") (i32.const 1)) (assert_return (invoke "as-load-address") (f32.const 1.7)) (assert_return (invoke "as-loadN-address") (i64.const 30)) @@ -263,7 +308,164 @@ (assert_return (invoke "as-memory.grow-size") (i32.const 40)) (assert_invalid - (module (func $type-value-empty-vs-num (result f64) (return))) + (module (func $type-value-empty-vs-num (result i32) (return))) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-block (result i32) + (i32.const 0) + (block (return)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-loop (result i32) + (i32.const 0) + (loop (return)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-then (result i32) + (i32.const 0) (i32.const 0) + (if (then (return))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-else (result i32) + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (return))) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-br (result i32) + (i32.const 0) + (block (br 0 (return))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-br_if (result i32) + (i32.const 0) + (block (br_if 0 (return) (i32.const 1))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-br_table (result i32) + (i32.const 0) + (block (br_table 0 (return))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-return (result i32) + (return (return)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-select (result i32) + (select (return) (i32.const 1) (i32.const 2)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-call (result i32) + (call 1 (return)) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-value-empty-vs-num-in-call_indirect (result i32) + (block (result i32) + (call_indirect (type $sig) + (return) (i32.const 0) + ) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-local.set (result i32) + (local i32) + (local.set 0 (return)) (local.get 0) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-value-empty-vs-num-in-local.tee (result i32) + (local i32) + (local.tee 0 (return)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (global $x (mut i32) (i32.const 0)) + (func $type-value-empty-vs-num-in-global.set (result i32) + (global.set $x (return)) (global.get $x) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-value-empty-vs-num-in-memory.grow (result i32) + (memory.grow (return)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 0) + (func $type-value-empty-vs-num-in-load (result i32) + (i32.load (return)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-vs-num-in-store (result i32) + (i32.store (return) (i32.const 1)) + ) + ) "type mismatch" ) (assert_invalid diff --git a/test/spec/run.py b/test/spec/run.py new file mode 100755 index 000000000..751895541 --- /dev/null +++ b/test/spec/run.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +from __future__ import print_function +import argparse +import os +import os.path +import unittest +import subprocess +import glob +import sys + + +ownDir = os.path.dirname(os.path.abspath(sys.argv[0])) +inputDir = ownDir +outputDir = os.path.join(inputDir, "_output") + +parser = argparse.ArgumentParser() +parser.add_argument("--wasm", metavar="<wasm-command>", default=os.path.join(os.getcwd(), "wasm")) +parser.add_argument("--js", metavar="<js-command>") +parser.add_argument("--out", metavar="<out-dir>", default=outputDir) +parser.add_argument("file", nargs='*') +arguments = parser.parse_args() +sys.argv = sys.argv[:1] + +wasmCommand = arguments.wasm +jsCommand = arguments.js +outputDir = arguments.out +inputFiles = arguments.file if arguments.file else glob.glob(os.path.join(inputDir, "*.wast")) + +if not os.path.exists(wasmCommand): + sys.stderr.write("""\ +Error: The executable '%s' does not exist. +Provide the correct path with the '--wasm' flag. + +""" % (wasmCommand)) + parser.print_help() + sys.exit(1) + + +class RunTests(unittest.TestCase): + def _runCommand(self, command, logPath, expectedExitCode = 0): + with open(logPath, 'w+') as out: + exitCode = subprocess.call(command, shell=True, stdout=out, stderr=subprocess.STDOUT) + self.assertEqual(expectedExitCode, exitCode, "failed with exit code %i (expected %i) for %s" % (exitCode, expectedExitCode, command)) + + def _auxFile(self, path): + if os.path.exists(path): + os.remove(path) + return path + + def _compareFile(self, expectFile, actualFile): + if os.path.exists(expectFile): + with open(expectFile) as expect: + with open(actualFile) as actual: + expectText = expect.read() + actualText = actual.read() + self.assertEqual(expectText, actualText) + + def _runTestFile(self, inputPath): + dir, inputFile = os.path.split(inputPath) + outputPath = os.path.join(outputDir, inputFile) + + # Run original file + expectedExitCode = 1 if ".fail." in inputFile else 0 + logPath = self._auxFile(outputPath + ".log") + self._runCommand(('%s "%s"') % (wasmCommand, inputPath), logPath, expectedExitCode) + + if expectedExitCode != 0: + return + + # Convert to binary and run again + wasmPath = self._auxFile(outputPath + ".bin.wast") + logPath = self._auxFile(wasmPath + ".log") + self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, inputPath, wasmPath), logPath) + self._runCommand(('%s "%s"') % (wasmCommand, wasmPath), logPath) + + # Convert back to text and run again + wastPath = self._auxFile(wasmPath + ".wast") + logPath = self._auxFile(wastPath + ".log") + self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, wasmPath, wastPath), logPath) + self._runCommand(('%s "%s"') % (wasmCommand, wastPath), logPath) + + # Convert back to binary once more and compare + wasm2Path = self._auxFile(wastPath + ".bin.wast") + logPath = self._auxFile(wasm2Path + ".log") + self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, wastPath, wasm2Path), logPath) + self._compareFile(wasmPath, wasm2Path) + + # Convert back to text once more and compare + wast2Path = self._auxFile(wasm2Path + ".wast") + logPath = self._auxFile(wast2Path + ".log") + self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, wasm2Path, wast2Path), logPath) + self._compareFile(wastPath, wast2Path) + + # Convert to JavaScript + jsPath = self._auxFile(outputPath.replace(".wast", ".js")) + logPath = self._auxFile(jsPath + ".log") + self._runCommand(('%s -d "%s" -o "%s"') % (wasmCommand, inputPath, jsPath), logPath) + if jsCommand != None: + self._runCommand(('%s "%s"') % (jsCommand, jsPath), logPath) + + +if __name__ == "__main__": + if not os.path.exists(outputDir): + os.makedirs(outputDir) + for fileName in inputFiles: + testName = 'test ' + os.path.basename(fileName) + setattr(RunTests, testName, lambda self, file=fileName: self._runTestFile(file)) + unittest.main() diff --git a/test/spec/select.wast b/test/spec/select.wast index 493f67f0a..cee205491 100644 --- a/test/spec/select.wast +++ b/test/spec/select.wast @@ -1,4 +1,9 @@ (module + + (memory 1) + + (func $dummy) + (func (export "select_i32") (param $lhs i32) (param $rhs i32) (param $cond i32) (result i32) (select (local.get $lhs) (local.get $rhs) (local.get $cond))) @@ -13,9 +18,163 @@ ;; Check that both sides of the select are evaluated (func (export "select_trap_l") (param $cond i32) (result i32) - (select (unreachable) (i32.const 0) (local.get $cond))) + (select (unreachable) (i32.const 0) (local.get $cond)) + ) (func (export "select_trap_r") (param $cond i32) (result i32) - (select (i32.const 0) (unreachable) (local.get $cond))) + (select (i32.const 0) (unreachable) (local.get $cond)) + ) + + (func (export "select_unreached") + (unreachable) (select) + (unreachable) (i32.const 0) (select) + (unreachable) (i32.const 0) (i32.const 0) (select) + (unreachable) (f32.const 0) (i32.const 0) (select) + (unreachable) + ) + + ;; As the argument of control constructs and instructions + + (func (export "as-select-first") (param i32) (result i32) + (select (select (i32.const 0) (i32.const 1) (local.get 0)) (i32.const 2) (i32.const 3)) + ) + (func (export "as-select-mid") (param i32) (result i32) + (select (i32.const 2) (select (i32.const 0) (i32.const 1) (local.get 0)) (i32.const 3)) + ) + (func (export "as-select-last") (param i32) (result i32) + (select (i32.const 2) (i32.const 3) (select (i32.const 0) (i32.const 1) (local.get 0))) + ) + + (func (export "as-loop-first") (param i32) (result i32) + (loop (result i32) (select (i32.const 2) (i32.const 3) (local.get 0)) (call $dummy) (call $dummy)) + ) + (func (export "as-loop-mid") (param i32) (result i32) + (loop (result i32) (call $dummy) (select (i32.const 2) (i32.const 3) (local.get 0)) (call $dummy)) + ) + (func (export "as-loop-last") (param i32) (result i32) + (loop (result i32) (call $dummy) (call $dummy) (select (i32.const 2) (i32.const 3) (local.get 0))) + ) + + (func (export "as-if-condition") (param i32) + (select (i32.const 2) (i32.const 3) (local.get 0)) (if (then (call $dummy))) + ) + (func (export "as-if-then") (param i32) (result i32) + (if (result i32) (i32.const 1) (then (select (i32.const 2) (i32.const 3) (local.get 0))) (else (i32.const 4))) + ) + (func (export "as-if-else") (param i32) (result i32) + (if (result i32) (i32.const 0) (then (i32.const 2)) (else (select (i32.const 2) (i32.const 3) (local.get 0)))) + ) + + (func (export "as-br_if-first") (param i32) (result i32) + (block (result i32) (br_if 0 (select (i32.const 2) (i32.const 3) (local.get 0)) (i32.const 4))) + ) + (func (export "as-br_if-last") (param i32) (result i32) + (block (result i32) (br_if 0 (i32.const 2) (select (i32.const 2) (i32.const 3) (local.get 0)))) + ) + + (func (export "as-br_table-first") (param i32) (result i32) + (block (result i32) (select (i32.const 2) (i32.const 3) (local.get 0)) (i32.const 2) (br_table 0 0)) + ) + (func (export "as-br_table-last") (param i32) (result i32) + (block (result i32) (i32.const 2) (select (i32.const 2) (i32.const 3) (local.get 0)) (br_table 0 0)) + ) + + (func $func (param i32 i32) (result i32) (local.get 0)) + (type $check (func (param i32 i32) (result i32))) + (table funcref (elem $func)) + (func (export "as-call_indirect-first") (param i32) (result i32) + (block (result i32) + (call_indirect (type $check) + (select (i32.const 2) (i32.const 3) (local.get 0)) (i32.const 1) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-mid") (param i32) (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (select (i32.const 2) (i32.const 3) (local.get 0)) (i32.const 0) + ) + ) + ) + (func (export "as-call_indirect-last") (param i32) (result i32) + (block (result i32) + (call_indirect (type $check) + (i32.const 1) (i32.const 4) (select (i32.const 2) (i32.const 3) (local.get 0)) + ) + ) + ) + + (func (export "as-store-first") (param i32) + (select (i32.const 0) (i32.const 4) (local.get 0)) (i32.const 1) (i32.store) + ) + (func (export "as-store-last") (param i32) + (i32.const 8) (select (i32.const 1) (i32.const 2) (local.get 0)) (i32.store) + ) + + (func (export "as-memory.grow-value") (param i32) (result i32) + (memory.grow (select (i32.const 1) (i32.const 2) (local.get 0))) + ) + + (func $f (param i32) (result i32) (local.get 0)) + + (func (export "as-call-value") (param i32) (result i32) + (call $f (select (i32.const 1) (i32.const 2) (local.get 0))) + ) + (func (export "as-return-value") (param i32) (result i32) + (select (i32.const 1) (i32.const 2) (local.get 0)) (return) + ) + (func (export "as-drop-operand") (param i32) + (drop (select (i32.const 1) (i32.const 2) (local.get 0))) + ) + (func (export "as-br-value") (param i32) (result i32) + (block (result i32) (br 0 (select (i32.const 1) (i32.const 2) (local.get 0)))) + ) + (func (export "as-local.set-value") (param i32) (result i32) + (local i32) (local.set 0 (select (i32.const 1) (i32.const 2) (local.get 0))) (local.get 0) + ) + (func (export "as-local.tee-value") (param i32) (result i32) + (local.tee 0 (select (i32.const 1) (i32.const 2) (local.get 0))) + ) + (global $a (mut i32) (i32.const 10)) + (func (export "as-global.set-value") (param i32) (result i32) + (global.set $a (select (i32.const 1) (i32.const 2) (local.get 0))) + (global.get $a) + ) + (func (export "as-load-operand") (param i32) (result i32) + (i32.load (select (i32.const 0) (i32.const 4) (local.get 0))) + ) + + (func (export "as-unary-operand") (param i32) (result i32) + (i32.eqz (select (i32.const 0) (i32.const 1) (local.get 0))) + ) + (func (export "as-binary-operand") (param i32) (result i32) + (i32.mul + (select (i32.const 1) (i32.const 2) (local.get 0)) + (select (i32.const 1) (i32.const 2) (local.get 0)) + ) + ) + (func (export "as-test-operand") (param i32) (result i32) + (block (result i32) + (i32.eqz (select (i32.const 0) (i32.const 1) (local.get 0))) + ) + ) + + (func (export "as-compare-left") (param i32) (result i32) + (block (result i32) + (i32.le_s (select (i32.const 1) (i32.const 2) (local.get 0)) (i32.const 1)) + ) + ) + (func (export "as-compare-right") (param i32) (result i32) + (block (result i32) + (i32.ne (i32.const 1) (select (i32.const 0) (i32.const 1) (local.get 0))) + ) + ) + + (func (export "as-convert-operand") (param i32) (result i32) + (block (result i32) + (i32.wrap_i64 (select (i64.const 1) (i64.const 0) (local.get 0))) + ) + ) + ) (assert_return (invoke "select_i32" (i32.const 1) (i32.const 2) (i32.const 1)) (i32.const 1)) @@ -46,12 +205,210 @@ (assert_return (invoke "select_f64" (f64.const 2) (f64.const nan) (i32.const 0)) (f64.const nan)) (assert_return (invoke "select_f64" (f64.const 2) (f64.const nan:0x20304) (i32.const 0)) (f64.const nan:0x20304)) -(assert_trap (invoke "select_trap_l" (i32.const 1)) "unreachable executed") -(assert_trap (invoke "select_trap_l" (i32.const 0)) "unreachable executed") -(assert_trap (invoke "select_trap_r" (i32.const 1)) "unreachable executed") -(assert_trap (invoke "select_trap_r" (i32.const 0)) "unreachable executed") +(assert_trap (invoke "select_trap_l" (i32.const 1)) "unreachable") +(assert_trap (invoke "select_trap_l" (i32.const 0)) "unreachable") +(assert_trap (invoke "select_trap_r" (i32.const 1)) "unreachable") +(assert_trap (invoke "select_trap_r" (i32.const 0)) "unreachable") + +(assert_return (invoke "as-select-first" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-select-first" (i32.const 1)) (i32.const 0)) +(assert_return (invoke "as-select-mid" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-select-mid" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-select-last" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-select-last" (i32.const 1)) (i32.const 3)) + +(assert_return (invoke "as-loop-first" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-loop-first" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-loop-mid" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-loop-mid" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-loop-last" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-loop-last" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-if-condition" (i32.const 0))) +(assert_return (invoke "as-if-condition" (i32.const 1))) +(assert_return (invoke "as-if-then" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-if-then" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-if-else" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-if-else" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-br_if-first" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-br_if-first" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-br_if-last" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-br_if-last" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-br_table-first" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-br_table-first" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-br_table-last" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-br_table-last" (i32.const 1)) (i32.const 2)) + +(assert_return (invoke "as-call_indirect-first" (i32.const 0)) (i32.const 3)) +(assert_return (invoke "as-call_indirect-first" (i32.const 1)) (i32.const 2)) +(assert_return (invoke "as-call_indirect-mid" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-call_indirect-mid" (i32.const 1)) (i32.const 1)) +(assert_trap (invoke "as-call_indirect-last" (i32.const 0)) "undefined element") +(assert_trap (invoke "as-call_indirect-last" (i32.const 1)) "undefined element") + +(assert_return (invoke "as-store-first" (i32.const 0))) +(assert_return (invoke "as-store-first" (i32.const 1))) +(assert_return (invoke "as-store-last" (i32.const 0))) +(assert_return (invoke "as-store-last" (i32.const 1))) + +(assert_return (invoke "as-memory.grow-value" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-memory.grow-value" (i32.const 1)) (i32.const 3)) + +(assert_return (invoke "as-call-value" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-call-value" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-return-value" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-return-value" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-drop-operand" (i32.const 0))) +(assert_return (invoke "as-drop-operand" (i32.const 1))) +(assert_return (invoke "as-br-value" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-br-value" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-local.set-value" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-local.set-value" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-local.tee-value" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-local.tee-value" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-global.set-value" (i32.const 0)) (i32.const 2)) +(assert_return (invoke "as-global.set-value" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-load-operand" (i32.const 0)) (i32.const 1)) +(assert_return (invoke "as-load-operand" (i32.const 1)) (i32.const 1)) + +(assert_return (invoke "as-unary-operand" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-unary-operand" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-binary-operand" (i32.const 0)) (i32.const 4)) +(assert_return (invoke "as-binary-operand" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-test-operand" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-test-operand" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-compare-left" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-compare-left" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-compare-right" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-compare-right" (i32.const 1)) (i32.const 1)) +(assert_return (invoke "as-convert-operand" (i32.const 0)) (i32.const 0)) +(assert_return (invoke "as-convert-operand" (i32.const 1)) (i32.const 1)) (assert_invalid (module (func $arity-0 (select (nop) (nop) (i32.const 1)))) "type mismatch" ) + +;; The first two operands should have the same type as each other + +(assert_invalid + (module (func $type-num-vs-num (select (i32.const 1) (i64.const 1) (i32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (func $type-num-vs-num (select (i32.const 1) (f32.const 1.0) (i32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (func $type-num-vs-num (select (i32.const 1) (f64.const 1.0) (i32.const 1)))) + "type mismatch" +) + + +(assert_invalid + (module + (func $type-1st-operand-empty + (select) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-2nd-operand-empty + (i32.const 0) (select) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-3rd-operand-empty + (i32.const 0) (i32.const 0) (select) (drop) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-1st-operand-empty-in-block + (i32.const 0) (i32.const 0) (i32.const 0) + (block (select) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-2nd-operand-empty-in-block + (i32.const 0) (i32.const 0) + (block (i32.const 0) (select) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-3rd-operand-empty-in-block + (i32.const 0) + (block (i32.const 0) (i32.const 0) (select) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-1st-operand-empty-in-loop + (i32.const 0) (i32.const 0) (i32.const 0) + (loop (select) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-2nd-operand-empty-in-loop + (i32.const 0) (i32.const 0) + (loop (i32.const 0) (select) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-3rd-operand-empty-in-loop + (i32.const 0) + (loop (i32.const 0) (i32.const 0) (select) (drop)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-1st-operand-empty-in-then + (i32.const 0) (i32.const 0) (i32.const 0) + (if (then (select) (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-2nd-operand-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (i32.const 0) (select) (drop))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (func $type-3rd-operand-empty-in-then + (i32.const 0) + (if (then (i32.const 0) (i32.const 0) (select) (drop))) + ) + ) + "type mismatch" +) diff --git a/test/spec/skip-stack-guard-page.wast b/test/spec/skip-stack-guard-page.wast new file mode 100644 index 000000000..a472e6814 --- /dev/null +++ b/test/spec/skip-stack-guard-page.wast @@ -0,0 +1,2284 @@ +;; This tests that the stack overflow guard page can't be skipped by a function with more than a page of locals. +(module + (memory 1) + (export "test-guard-page-skip" (func $test-guard-page-skip)) + + (func $test-guard-page-skip + (param $depth i32) + (if (i32.eq (local.get $depth) (i32.const 0)) + (then (call $function-with-many-locals)) + (else (call $test-guard-page-skip (i32.sub (local.get $depth) (i32.const 1)))) + ) + ) + + (func $function-with-many-locals + + ;; 1056 i64 = 8448 bytes of locals + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x000-0x007 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x008-0x00f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x010-0x017 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x018-0x01f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x020-0x027 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x028-0x02f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x030-0x037 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x038-0x03f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x040-0x047 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x048-0x04f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x050-0x057 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x058-0x05f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x060-0x067 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x068-0x06f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x070-0x077 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x078-0x07f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x080-0x087 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x088-0x08f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x090-0x097 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x098-0x09f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0a0-0x0a7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0a8-0x0af + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0b0-0x0b7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0b8-0x0bf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0c0-0x0c7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0c8-0x0cf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0d0-0x0d7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0d8-0x0df + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0e0-0x0e7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0e8-0x0ef + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0f0-0x0f7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x0f8-0x0ff + + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x100-0x107 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x108-0x10f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x110-0x117 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x118-0x11f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x120-0x127 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x128-0x12f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x130-0x137 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x138-0x13f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x140-0x147 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x148-0x14f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x150-0x157 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x158-0x15f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x160-0x167 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x168-0x16f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x170-0x177 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x178-0x17f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x180-0x187 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x188-0x18f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x190-0x197 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x198-0x19f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1a0-0x1a7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1a8-0x1af + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1b0-0x1b7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1b8-0x1bf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1c0-0x1c7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1c8-0x1cf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1d0-0x1d7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1d8-0x1df + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1e0-0x1e7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1e8-0x1ef + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1f0-0x1f7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x1f8-0x1ff + + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x200-0x207 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x208-0x20f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x210-0x217 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x218-0x21f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x220-0x227 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x228-0x22f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x230-0x237 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x238-0x23f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x240-0x247 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x248-0x24f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x250-0x257 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x258-0x25f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x260-0x267 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x268-0x26f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x270-0x277 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x278-0x27f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x280-0x287 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x288-0x28f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x290-0x297 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x298-0x29f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2a0-0x2a7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2a8-0x2af + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2b0-0x2b7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2b8-0x2bf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2c0-0x2c7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2c8-0x2cf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2d0-0x2d7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2d8-0x2df + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2e0-0x2e7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2e8-0x2ef + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2f0-0x2f7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x2f8-0x2ff + + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x300-0x307 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x308-0x30f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x310-0x317 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x318-0x31f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x320-0x327 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x328-0x32f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x330-0x337 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x338-0x33f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x340-0x347 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x348-0x34f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x350-0x357 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x358-0x35f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x360-0x367 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x368-0x36f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x370-0x377 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x378-0x37f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x380-0x387 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x388-0x38f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x390-0x397 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x398-0x39f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3a0-0x3a7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3a8-0x3af + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3b0-0x3b7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3b8-0x3bf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3c0-0x3c7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3c8-0x3cf + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3d0-0x3d7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3d8-0x3df + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3e0-0x3e7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3e8-0x3ef + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3f0-0x3f7 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x3f8-0x3ff + + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x400-0x407 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x408-0x40f + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x410-0x417 + (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) (local i64) ;; 0x418-0x41f + + ;; recurse first to try to make the callee access the stack below the space allocated for the locals before the locals themselves have been initialized. + (call $function-with-many-locals) + + ;; load from memory into the locals + (local.set 0x000 (i64.load offset=0x000 align=1 (i32.const 0))) + (local.set 0x001 (i64.load offset=0x001 align=1 (i32.const 0))) + (local.set 0x002 (i64.load offset=0x002 align=1 (i32.const 0))) + (local.set 0x003 (i64.load offset=0x003 align=1 (i32.const 0))) + (local.set 0x004 (i64.load offset=0x004 align=1 (i32.const 0))) + (local.set 0x005 (i64.load offset=0x005 align=1 (i32.const 0))) + (local.set 0x006 (i64.load offset=0x006 align=1 (i32.const 0))) + (local.set 0x007 (i64.load offset=0x007 align=1 (i32.const 0))) + (local.set 0x008 (i64.load offset=0x008 align=1 (i32.const 0))) + (local.set 0x009 (i64.load offset=0x009 align=1 (i32.const 0))) + (local.set 0x00a (i64.load offset=0x00a align=1 (i32.const 0))) + (local.set 0x00b (i64.load offset=0x00b align=1 (i32.const 0))) + (local.set 0x00c (i64.load offset=0x00c align=1 (i32.const 0))) + (local.set 0x00d (i64.load offset=0x00d align=1 (i32.const 0))) + (local.set 0x00e (i64.load offset=0x00e align=1 (i32.const 0))) + (local.set 0x00f (i64.load offset=0x00f align=1 (i32.const 0))) + (local.set 0x010 (i64.load offset=0x010 align=1 (i32.const 0))) + (local.set 0x011 (i64.load offset=0x011 align=1 (i32.const 0))) + (local.set 0x012 (i64.load offset=0x012 align=1 (i32.const 0))) + (local.set 0x013 (i64.load offset=0x013 align=1 (i32.const 0))) + (local.set 0x014 (i64.load offset=0x014 align=1 (i32.const 0))) + (local.set 0x015 (i64.load offset=0x015 align=1 (i32.const 0))) + (local.set 0x016 (i64.load offset=0x016 align=1 (i32.const 0))) + (local.set 0x017 (i64.load offset=0x017 align=1 (i32.const 0))) + (local.set 0x018 (i64.load offset=0x018 align=1 (i32.const 0))) + (local.set 0x019 (i64.load offset=0x019 align=1 (i32.const 0))) + (local.set 0x01a (i64.load offset=0x01a align=1 (i32.const 0))) + (local.set 0x01b (i64.load offset=0x01b align=1 (i32.const 0))) + (local.set 0x01c (i64.load offset=0x01c align=1 (i32.const 0))) + (local.set 0x01d (i64.load offset=0x01d align=1 (i32.const 0))) + (local.set 0x01e (i64.load offset=0x01e align=1 (i32.const 0))) + (local.set 0x01f (i64.load offset=0x01f align=1 (i32.const 0))) + (local.set 0x020 (i64.load offset=0x020 align=1 (i32.const 0))) + (local.set 0x021 (i64.load offset=0x021 align=1 (i32.const 0))) + (local.set 0x022 (i64.load offset=0x022 align=1 (i32.const 0))) + (local.set 0x023 (i64.load offset=0x023 align=1 (i32.const 0))) + (local.set 0x024 (i64.load offset=0x024 align=1 (i32.const 0))) + (local.set 0x025 (i64.load offset=0x025 align=1 (i32.const 0))) + (local.set 0x026 (i64.load offset=0x026 align=1 (i32.const 0))) + (local.set 0x027 (i64.load offset=0x027 align=1 (i32.const 0))) + (local.set 0x028 (i64.load offset=0x028 align=1 (i32.const 0))) + (local.set 0x029 (i64.load offset=0x029 align=1 (i32.const 0))) + (local.set 0x02a (i64.load offset=0x02a align=1 (i32.const 0))) + (local.set 0x02b (i64.load offset=0x02b align=1 (i32.const 0))) + (local.set 0x02c (i64.load offset=0x02c align=1 (i32.const 0))) + (local.set 0x02d (i64.load offset=0x02d align=1 (i32.const 0))) + (local.set 0x02e (i64.load offset=0x02e align=1 (i32.const 0))) + (local.set 0x02f (i64.load offset=0x02f align=1 (i32.const 0))) + (local.set 0x030 (i64.load offset=0x030 align=1 (i32.const 0))) + (local.set 0x031 (i64.load offset=0x031 align=1 (i32.const 0))) + (local.set 0x032 (i64.load offset=0x032 align=1 (i32.const 0))) + (local.set 0x033 (i64.load offset=0x033 align=1 (i32.const 0))) + (local.set 0x034 (i64.load offset=0x034 align=1 (i32.const 0))) + (local.set 0x035 (i64.load offset=0x035 align=1 (i32.const 0))) + (local.set 0x036 (i64.load offset=0x036 align=1 (i32.const 0))) + (local.set 0x037 (i64.load offset=0x037 align=1 (i32.const 0))) + (local.set 0x038 (i64.load offset=0x038 align=1 (i32.const 0))) + (local.set 0x039 (i64.load offset=0x039 align=1 (i32.const 0))) + (local.set 0x03a (i64.load offset=0x03a align=1 (i32.const 0))) + (local.set 0x03b (i64.load offset=0x03b align=1 (i32.const 0))) + (local.set 0x03c (i64.load offset=0x03c align=1 (i32.const 0))) + (local.set 0x03d (i64.load offset=0x03d align=1 (i32.const 0))) + (local.set 0x03e (i64.load offset=0x03e align=1 (i32.const 0))) + (local.set 0x03f (i64.load offset=0x03f align=1 (i32.const 0))) + (local.set 0x040 (i64.load offset=0x040 align=1 (i32.const 0))) + (local.set 0x041 (i64.load offset=0x041 align=1 (i32.const 0))) + (local.set 0x042 (i64.load offset=0x042 align=1 (i32.const 0))) + (local.set 0x043 (i64.load offset=0x043 align=1 (i32.const 0))) + (local.set 0x044 (i64.load offset=0x044 align=1 (i32.const 0))) + (local.set 0x045 (i64.load offset=0x045 align=1 (i32.const 0))) + (local.set 0x046 (i64.load offset=0x046 align=1 (i32.const 0))) + (local.set 0x047 (i64.load offset=0x047 align=1 (i32.const 0))) + (local.set 0x048 (i64.load offset=0x048 align=1 (i32.const 0))) + (local.set 0x049 (i64.load offset=0x049 align=1 (i32.const 0))) + (local.set 0x04a (i64.load offset=0x04a align=1 (i32.const 0))) + (local.set 0x04b (i64.load offset=0x04b align=1 (i32.const 0))) + (local.set 0x04c (i64.load offset=0x04c align=1 (i32.const 0))) + (local.set 0x04d (i64.load offset=0x04d align=1 (i32.const 0))) + (local.set 0x04e (i64.load offset=0x04e align=1 (i32.const 0))) + (local.set 0x04f (i64.load offset=0x04f align=1 (i32.const 0))) + (local.set 0x050 (i64.load offset=0x050 align=1 (i32.const 0))) + (local.set 0x051 (i64.load offset=0x051 align=1 (i32.const 0))) + (local.set 0x052 (i64.load offset=0x052 align=1 (i32.const 0))) + (local.set 0x053 (i64.load offset=0x053 align=1 (i32.const 0))) + (local.set 0x054 (i64.load offset=0x054 align=1 (i32.const 0))) + (local.set 0x055 (i64.load offset=0x055 align=1 (i32.const 0))) + (local.set 0x056 (i64.load offset=0x056 align=1 (i32.const 0))) + (local.set 0x057 (i64.load offset=0x057 align=1 (i32.const 0))) + (local.set 0x058 (i64.load offset=0x058 align=1 (i32.const 0))) + (local.set 0x059 (i64.load offset=0x059 align=1 (i32.const 0))) + (local.set 0x05a (i64.load offset=0x05a align=1 (i32.const 0))) + (local.set 0x05b (i64.load offset=0x05b align=1 (i32.const 0))) + (local.set 0x05c (i64.load offset=0x05c align=1 (i32.const 0))) + (local.set 0x05d (i64.load offset=0x05d align=1 (i32.const 0))) + (local.set 0x05e (i64.load offset=0x05e align=1 (i32.const 0))) + (local.set 0x05f (i64.load offset=0x05f align=1 (i32.const 0))) + (local.set 0x060 (i64.load offset=0x060 align=1 (i32.const 0))) + (local.set 0x061 (i64.load offset=0x061 align=1 (i32.const 0))) + (local.set 0x062 (i64.load offset=0x062 align=1 (i32.const 0))) + (local.set 0x063 (i64.load offset=0x063 align=1 (i32.const 0))) + (local.set 0x064 (i64.load offset=0x064 align=1 (i32.const 0))) + (local.set 0x065 (i64.load offset=0x065 align=1 (i32.const 0))) + (local.set 0x066 (i64.load offset=0x066 align=1 (i32.const 0))) + (local.set 0x067 (i64.load offset=0x067 align=1 (i32.const 0))) + (local.set 0x068 (i64.load offset=0x068 align=1 (i32.const 0))) + (local.set 0x069 (i64.load offset=0x069 align=1 (i32.const 0))) + (local.set 0x06a (i64.load offset=0x06a align=1 (i32.const 0))) + (local.set 0x06b (i64.load offset=0x06b align=1 (i32.const 0))) + (local.set 0x06c (i64.load offset=0x06c align=1 (i32.const 0))) + (local.set 0x06d (i64.load offset=0x06d align=1 (i32.const 0))) + (local.set 0x06e (i64.load offset=0x06e align=1 (i32.const 0))) + (local.set 0x06f (i64.load offset=0x06f align=1 (i32.const 0))) + (local.set 0x070 (i64.load offset=0x070 align=1 (i32.const 0))) + (local.set 0x071 (i64.load offset=0x071 align=1 (i32.const 0))) + (local.set 0x072 (i64.load offset=0x072 align=1 (i32.const 0))) + (local.set 0x073 (i64.load offset=0x073 align=1 (i32.const 0))) + (local.set 0x074 (i64.load offset=0x074 align=1 (i32.const 0))) + (local.set 0x075 (i64.load offset=0x075 align=1 (i32.const 0))) + (local.set 0x076 (i64.load offset=0x076 align=1 (i32.const 0))) + (local.set 0x077 (i64.load offset=0x077 align=1 (i32.const 0))) + (local.set 0x078 (i64.load offset=0x078 align=1 (i32.const 0))) + (local.set 0x079 (i64.load offset=0x079 align=1 (i32.const 0))) + (local.set 0x07a (i64.load offset=0x07a align=1 (i32.const 0))) + (local.set 0x07b (i64.load offset=0x07b align=1 (i32.const 0))) + (local.set 0x07c (i64.load offset=0x07c align=1 (i32.const 0))) + (local.set 0x07d (i64.load offset=0x07d align=1 (i32.const 0))) + (local.set 0x07e (i64.load offset=0x07e align=1 (i32.const 0))) + (local.set 0x07f (i64.load offset=0x07f align=1 (i32.const 0))) + (local.set 0x080 (i64.load offset=0x080 align=1 (i32.const 0))) + (local.set 0x081 (i64.load offset=0x081 align=1 (i32.const 0))) + (local.set 0x082 (i64.load offset=0x082 align=1 (i32.const 0))) + (local.set 0x083 (i64.load offset=0x083 align=1 (i32.const 0))) + (local.set 0x084 (i64.load offset=0x084 align=1 (i32.const 0))) + (local.set 0x085 (i64.load offset=0x085 align=1 (i32.const 0))) + (local.set 0x086 (i64.load offset=0x086 align=1 (i32.const 0))) + (local.set 0x087 (i64.load offset=0x087 align=1 (i32.const 0))) + (local.set 0x088 (i64.load offset=0x088 align=1 (i32.const 0))) + (local.set 0x089 (i64.load offset=0x089 align=1 (i32.const 0))) + (local.set 0x08a (i64.load offset=0x08a align=1 (i32.const 0))) + (local.set 0x08b (i64.load offset=0x08b align=1 (i32.const 0))) + (local.set 0x08c (i64.load offset=0x08c align=1 (i32.const 0))) + (local.set 0x08d (i64.load offset=0x08d align=1 (i32.const 0))) + (local.set 0x08e (i64.load offset=0x08e align=1 (i32.const 0))) + (local.set 0x08f (i64.load offset=0x08f align=1 (i32.const 0))) + (local.set 0x090 (i64.load offset=0x090 align=1 (i32.const 0))) + (local.set 0x091 (i64.load offset=0x091 align=1 (i32.const 0))) + (local.set 0x092 (i64.load offset=0x092 align=1 (i32.const 0))) + (local.set 0x093 (i64.load offset=0x093 align=1 (i32.const 0))) + (local.set 0x094 (i64.load offset=0x094 align=1 (i32.const 0))) + (local.set 0x095 (i64.load offset=0x095 align=1 (i32.const 0))) + (local.set 0x096 (i64.load offset=0x096 align=1 (i32.const 0))) + (local.set 0x097 (i64.load offset=0x097 align=1 (i32.const 0))) + (local.set 0x098 (i64.load offset=0x098 align=1 (i32.const 0))) + (local.set 0x099 (i64.load offset=0x099 align=1 (i32.const 0))) + (local.set 0x09a (i64.load offset=0x09a align=1 (i32.const 0))) + (local.set 0x09b (i64.load offset=0x09b align=1 (i32.const 0))) + (local.set 0x09c (i64.load offset=0x09c align=1 (i32.const 0))) + (local.set 0x09d (i64.load offset=0x09d align=1 (i32.const 0))) + (local.set 0x09e (i64.load offset=0x09e align=1 (i32.const 0))) + (local.set 0x09f (i64.load offset=0x09f align=1 (i32.const 0))) + (local.set 0x0a0 (i64.load offset=0x0a0 align=1 (i32.const 0))) + (local.set 0x0a1 (i64.load offset=0x0a1 align=1 (i32.const 0))) + (local.set 0x0a2 (i64.load offset=0x0a2 align=1 (i32.const 0))) + (local.set 0x0a3 (i64.load offset=0x0a3 align=1 (i32.const 0))) + (local.set 0x0a4 (i64.load offset=0x0a4 align=1 (i32.const 0))) + (local.set 0x0a5 (i64.load offset=0x0a5 align=1 (i32.const 0))) + (local.set 0x0a6 (i64.load offset=0x0a6 align=1 (i32.const 0))) + (local.set 0x0a7 (i64.load offset=0x0a7 align=1 (i32.const 0))) + (local.set 0x0a8 (i64.load offset=0x0a8 align=1 (i32.const 0))) + (local.set 0x0a9 (i64.load offset=0x0a9 align=1 (i32.const 0))) + (local.set 0x0aa (i64.load offset=0x0aa align=1 (i32.const 0))) + (local.set 0x0ab (i64.load offset=0x0ab align=1 (i32.const 0))) + (local.set 0x0ac (i64.load offset=0x0ac align=1 (i32.const 0))) + (local.set 0x0ad (i64.load offset=0x0ad align=1 (i32.const 0))) + (local.set 0x0ae (i64.load offset=0x0ae align=1 (i32.const 0))) + (local.set 0x0af (i64.load offset=0x0af align=1 (i32.const 0))) + (local.set 0x0b0 (i64.load offset=0x0b0 align=1 (i32.const 0))) + (local.set 0x0b1 (i64.load offset=0x0b1 align=1 (i32.const 0))) + (local.set 0x0b2 (i64.load offset=0x0b2 align=1 (i32.const 0))) + (local.set 0x0b3 (i64.load offset=0x0b3 align=1 (i32.const 0))) + (local.set 0x0b4 (i64.load offset=0x0b4 align=1 (i32.const 0))) + (local.set 0x0b5 (i64.load offset=0x0b5 align=1 (i32.const 0))) + (local.set 0x0b6 (i64.load offset=0x0b6 align=1 (i32.const 0))) + (local.set 0x0b7 (i64.load offset=0x0b7 align=1 (i32.const 0))) + (local.set 0x0b8 (i64.load offset=0x0b8 align=1 (i32.const 0))) + (local.set 0x0b9 (i64.load offset=0x0b9 align=1 (i32.const 0))) + (local.set 0x0ba (i64.load offset=0x0ba align=1 (i32.const 0))) + (local.set 0x0bb (i64.load offset=0x0bb align=1 (i32.const 0))) + (local.set 0x0bc (i64.load offset=0x0bc align=1 (i32.const 0))) + (local.set 0x0bd (i64.load offset=0x0bd align=1 (i32.const 0))) + (local.set 0x0be (i64.load offset=0x0be align=1 (i32.const 0))) + (local.set 0x0bf (i64.load offset=0x0bf align=1 (i32.const 0))) + (local.set 0x0c0 (i64.load offset=0x0c0 align=1 (i32.const 0))) + (local.set 0x0c1 (i64.load offset=0x0c1 align=1 (i32.const 0))) + (local.set 0x0c2 (i64.load offset=0x0c2 align=1 (i32.const 0))) + (local.set 0x0c3 (i64.load offset=0x0c3 align=1 (i32.const 0))) + (local.set 0x0c4 (i64.load offset=0x0c4 align=1 (i32.const 0))) + (local.set 0x0c5 (i64.load offset=0x0c5 align=1 (i32.const 0))) + (local.set 0x0c6 (i64.load offset=0x0c6 align=1 (i32.const 0))) + (local.set 0x0c7 (i64.load offset=0x0c7 align=1 (i32.const 0))) + (local.set 0x0c8 (i64.load offset=0x0c8 align=1 (i32.const 0))) + (local.set 0x0c9 (i64.load offset=0x0c9 align=1 (i32.const 0))) + (local.set 0x0ca (i64.load offset=0x0ca align=1 (i32.const 0))) + (local.set 0x0cb (i64.load offset=0x0cb align=1 (i32.const 0))) + (local.set 0x0cc (i64.load offset=0x0cc align=1 (i32.const 0))) + (local.set 0x0cd (i64.load offset=0x0cd align=1 (i32.const 0))) + (local.set 0x0ce (i64.load offset=0x0ce align=1 (i32.const 0))) + (local.set 0x0cf (i64.load offset=0x0cf align=1 (i32.const 0))) + (local.set 0x0d0 (i64.load offset=0x0d0 align=1 (i32.const 0))) + (local.set 0x0d1 (i64.load offset=0x0d1 align=1 (i32.const 0))) + (local.set 0x0d2 (i64.load offset=0x0d2 align=1 (i32.const 0))) + (local.set 0x0d3 (i64.load offset=0x0d3 align=1 (i32.const 0))) + (local.set 0x0d4 (i64.load offset=0x0d4 align=1 (i32.const 0))) + (local.set 0x0d5 (i64.load offset=0x0d5 align=1 (i32.const 0))) + (local.set 0x0d6 (i64.load offset=0x0d6 align=1 (i32.const 0))) + (local.set 0x0d7 (i64.load offset=0x0d7 align=1 (i32.const 0))) + (local.set 0x0d8 (i64.load offset=0x0d8 align=1 (i32.const 0))) + (local.set 0x0d9 (i64.load offset=0x0d9 align=1 (i32.const 0))) + (local.set 0x0da (i64.load offset=0x0da align=1 (i32.const 0))) + (local.set 0x0db (i64.load offset=0x0db align=1 (i32.const 0))) + (local.set 0x0dc (i64.load offset=0x0dc align=1 (i32.const 0))) + (local.set 0x0dd (i64.load offset=0x0dd align=1 (i32.const 0))) + (local.set 0x0de (i64.load offset=0x0de align=1 (i32.const 0))) + (local.set 0x0df (i64.load offset=0x0df align=1 (i32.const 0))) + (local.set 0x0e0 (i64.load offset=0x0e0 align=1 (i32.const 0))) + (local.set 0x0e1 (i64.load offset=0x0e1 align=1 (i32.const 0))) + (local.set 0x0e2 (i64.load offset=0x0e2 align=1 (i32.const 0))) + (local.set 0x0e3 (i64.load offset=0x0e3 align=1 (i32.const 0))) + (local.set 0x0e4 (i64.load offset=0x0e4 align=1 (i32.const 0))) + (local.set 0x0e5 (i64.load offset=0x0e5 align=1 (i32.const 0))) + (local.set 0x0e6 (i64.load offset=0x0e6 align=1 (i32.const 0))) + (local.set 0x0e7 (i64.load offset=0x0e7 align=1 (i32.const 0))) + (local.set 0x0e8 (i64.load offset=0x0e8 align=1 (i32.const 0))) + (local.set 0x0e9 (i64.load offset=0x0e9 align=1 (i32.const 0))) + (local.set 0x0ea (i64.load offset=0x0ea align=1 (i32.const 0))) + (local.set 0x0eb (i64.load offset=0x0eb align=1 (i32.const 0))) + (local.set 0x0ec (i64.load offset=0x0ec align=1 (i32.const 0))) + (local.set 0x0ed (i64.load offset=0x0ed align=1 (i32.const 0))) + (local.set 0x0ee (i64.load offset=0x0ee align=1 (i32.const 0))) + (local.set 0x0ef (i64.load offset=0x0ef align=1 (i32.const 0))) + (local.set 0x0f0 (i64.load offset=0x0f0 align=1 (i32.const 0))) + (local.set 0x0f1 (i64.load offset=0x0f1 align=1 (i32.const 0))) + (local.set 0x0f2 (i64.load offset=0x0f2 align=1 (i32.const 0))) + (local.set 0x0f3 (i64.load offset=0x0f3 align=1 (i32.const 0))) + (local.set 0x0f4 (i64.load offset=0x0f4 align=1 (i32.const 0))) + (local.set 0x0f5 (i64.load offset=0x0f5 align=1 (i32.const 0))) + (local.set 0x0f6 (i64.load offset=0x0f6 align=1 (i32.const 0))) + (local.set 0x0f7 (i64.load offset=0x0f7 align=1 (i32.const 0))) + (local.set 0x0f8 (i64.load offset=0x0f8 align=1 (i32.const 0))) + (local.set 0x0f9 (i64.load offset=0x0f9 align=1 (i32.const 0))) + (local.set 0x0fa (i64.load offset=0x0fa align=1 (i32.const 0))) + (local.set 0x0fb (i64.load offset=0x0fb align=1 (i32.const 0))) + (local.set 0x0fc (i64.load offset=0x0fc align=1 (i32.const 0))) + (local.set 0x0fd (i64.load offset=0x0fd align=1 (i32.const 0))) + (local.set 0x0fe (i64.load offset=0x0fe align=1 (i32.const 0))) + (local.set 0x0ff (i64.load offset=0x0ff align=1 (i32.const 0))) + (local.set 0x100 (i64.load offset=0x100 align=1 (i32.const 0))) + (local.set 0x101 (i64.load offset=0x101 align=1 (i32.const 0))) + (local.set 0x102 (i64.load offset=0x102 align=1 (i32.const 0))) + (local.set 0x103 (i64.load offset=0x103 align=1 (i32.const 0))) + (local.set 0x104 (i64.load offset=0x104 align=1 (i32.const 0))) + (local.set 0x105 (i64.load offset=0x105 align=1 (i32.const 0))) + (local.set 0x106 (i64.load offset=0x106 align=1 (i32.const 0))) + (local.set 0x107 (i64.load offset=0x107 align=1 (i32.const 0))) + (local.set 0x108 (i64.load offset=0x108 align=1 (i32.const 0))) + (local.set 0x109 (i64.load offset=0x109 align=1 (i32.const 0))) + (local.set 0x10a (i64.load offset=0x10a align=1 (i32.const 0))) + (local.set 0x10b (i64.load offset=0x10b align=1 (i32.const 0))) + (local.set 0x10c (i64.load offset=0x10c align=1 (i32.const 0))) + (local.set 0x10d (i64.load offset=0x10d align=1 (i32.const 0))) + (local.set 0x10e (i64.load offset=0x10e align=1 (i32.const 0))) + (local.set 0x10f (i64.load offset=0x10f align=1 (i32.const 0))) + (local.set 0x110 (i64.load offset=0x110 align=1 (i32.const 0))) + (local.set 0x111 (i64.load offset=0x111 align=1 (i32.const 0))) + (local.set 0x112 (i64.load offset=0x112 align=1 (i32.const 0))) + (local.set 0x113 (i64.load offset=0x113 align=1 (i32.const 0))) + (local.set 0x114 (i64.load offset=0x114 align=1 (i32.const 0))) + (local.set 0x115 (i64.load offset=0x115 align=1 (i32.const 0))) + (local.set 0x116 (i64.load offset=0x116 align=1 (i32.const 0))) + (local.set 0x117 (i64.load offset=0x117 align=1 (i32.const 0))) + (local.set 0x118 (i64.load offset=0x118 align=1 (i32.const 0))) + (local.set 0x119 (i64.load offset=0x119 align=1 (i32.const 0))) + (local.set 0x11a (i64.load offset=0x11a align=1 (i32.const 0))) + (local.set 0x11b (i64.load offset=0x11b align=1 (i32.const 0))) + (local.set 0x11c (i64.load offset=0x11c align=1 (i32.const 0))) + (local.set 0x11d (i64.load offset=0x11d align=1 (i32.const 0))) + (local.set 0x11e (i64.load offset=0x11e align=1 (i32.const 0))) + (local.set 0x11f (i64.load offset=0x11f align=1 (i32.const 0))) + (local.set 0x120 (i64.load offset=0x120 align=1 (i32.const 0))) + (local.set 0x121 (i64.load offset=0x121 align=1 (i32.const 0))) + (local.set 0x122 (i64.load offset=0x122 align=1 (i32.const 0))) + (local.set 0x123 (i64.load offset=0x123 align=1 (i32.const 0))) + (local.set 0x124 (i64.load offset=0x124 align=1 (i32.const 0))) + (local.set 0x125 (i64.load offset=0x125 align=1 (i32.const 0))) + (local.set 0x126 (i64.load offset=0x126 align=1 (i32.const 0))) + (local.set 0x127 (i64.load offset=0x127 align=1 (i32.const 0))) + (local.set 0x128 (i64.load offset=0x128 align=1 (i32.const 0))) + (local.set 0x129 (i64.load offset=0x129 align=1 (i32.const 0))) + (local.set 0x12a (i64.load offset=0x12a align=1 (i32.const 0))) + (local.set 0x12b (i64.load offset=0x12b align=1 (i32.const 0))) + (local.set 0x12c (i64.load offset=0x12c align=1 (i32.const 0))) + (local.set 0x12d (i64.load offset=0x12d align=1 (i32.const 0))) + (local.set 0x12e (i64.load offset=0x12e align=1 (i32.const 0))) + (local.set 0x12f (i64.load offset=0x12f align=1 (i32.const 0))) + (local.set 0x130 (i64.load offset=0x130 align=1 (i32.const 0))) + (local.set 0x131 (i64.load offset=0x131 align=1 (i32.const 0))) + (local.set 0x132 (i64.load offset=0x132 align=1 (i32.const 0))) + (local.set 0x133 (i64.load offset=0x133 align=1 (i32.const 0))) + (local.set 0x134 (i64.load offset=0x134 align=1 (i32.const 0))) + (local.set 0x135 (i64.load offset=0x135 align=1 (i32.const 0))) + (local.set 0x136 (i64.load offset=0x136 align=1 (i32.const 0))) + (local.set 0x137 (i64.load offset=0x137 align=1 (i32.const 0))) + (local.set 0x138 (i64.load offset=0x138 align=1 (i32.const 0))) + (local.set 0x139 (i64.load offset=0x139 align=1 (i32.const 0))) + (local.set 0x13a (i64.load offset=0x13a align=1 (i32.const 0))) + (local.set 0x13b (i64.load offset=0x13b align=1 (i32.const 0))) + (local.set 0x13c (i64.load offset=0x13c align=1 (i32.const 0))) + (local.set 0x13d (i64.load offset=0x13d align=1 (i32.const 0))) + (local.set 0x13e (i64.load offset=0x13e align=1 (i32.const 0))) + (local.set 0x13f (i64.load offset=0x13f align=1 (i32.const 0))) + (local.set 0x140 (i64.load offset=0x140 align=1 (i32.const 0))) + (local.set 0x141 (i64.load offset=0x141 align=1 (i32.const 0))) + (local.set 0x142 (i64.load offset=0x142 align=1 (i32.const 0))) + (local.set 0x143 (i64.load offset=0x143 align=1 (i32.const 0))) + (local.set 0x144 (i64.load offset=0x144 align=1 (i32.const 0))) + (local.set 0x145 (i64.load offset=0x145 align=1 (i32.const 0))) + (local.set 0x146 (i64.load offset=0x146 align=1 (i32.const 0))) + (local.set 0x147 (i64.load offset=0x147 align=1 (i32.const 0))) + (local.set 0x148 (i64.load offset=0x148 align=1 (i32.const 0))) + (local.set 0x149 (i64.load offset=0x149 align=1 (i32.const 0))) + (local.set 0x14a (i64.load offset=0x14a align=1 (i32.const 0))) + (local.set 0x14b (i64.load offset=0x14b align=1 (i32.const 0))) + (local.set 0x14c (i64.load offset=0x14c align=1 (i32.const 0))) + (local.set 0x14d (i64.load offset=0x14d align=1 (i32.const 0))) + (local.set 0x14e (i64.load offset=0x14e align=1 (i32.const 0))) + (local.set 0x14f (i64.load offset=0x14f align=1 (i32.const 0))) + (local.set 0x150 (i64.load offset=0x150 align=1 (i32.const 0))) + (local.set 0x151 (i64.load offset=0x151 align=1 (i32.const 0))) + (local.set 0x152 (i64.load offset=0x152 align=1 (i32.const 0))) + (local.set 0x153 (i64.load offset=0x153 align=1 (i32.const 0))) + (local.set 0x154 (i64.load offset=0x154 align=1 (i32.const 0))) + (local.set 0x155 (i64.load offset=0x155 align=1 (i32.const 0))) + (local.set 0x156 (i64.load offset=0x156 align=1 (i32.const 0))) + (local.set 0x157 (i64.load offset=0x157 align=1 (i32.const 0))) + (local.set 0x158 (i64.load offset=0x158 align=1 (i32.const 0))) + (local.set 0x159 (i64.load offset=0x159 align=1 (i32.const 0))) + (local.set 0x15a (i64.load offset=0x15a align=1 (i32.const 0))) + (local.set 0x15b (i64.load offset=0x15b align=1 (i32.const 0))) + (local.set 0x15c (i64.load offset=0x15c align=1 (i32.const 0))) + (local.set 0x15d (i64.load offset=0x15d align=1 (i32.const 0))) + (local.set 0x15e (i64.load offset=0x15e align=1 (i32.const 0))) + (local.set 0x15f (i64.load offset=0x15f align=1 (i32.const 0))) + (local.set 0x160 (i64.load offset=0x160 align=1 (i32.const 0))) + (local.set 0x161 (i64.load offset=0x161 align=1 (i32.const 0))) + (local.set 0x162 (i64.load offset=0x162 align=1 (i32.const 0))) + (local.set 0x163 (i64.load offset=0x163 align=1 (i32.const 0))) + (local.set 0x164 (i64.load offset=0x164 align=1 (i32.const 0))) + (local.set 0x165 (i64.load offset=0x165 align=1 (i32.const 0))) + (local.set 0x166 (i64.load offset=0x166 align=1 (i32.const 0))) + (local.set 0x167 (i64.load offset=0x167 align=1 (i32.const 0))) + (local.set 0x168 (i64.load offset=0x168 align=1 (i32.const 0))) + (local.set 0x169 (i64.load offset=0x169 align=1 (i32.const 0))) + (local.set 0x16a (i64.load offset=0x16a align=1 (i32.const 0))) + (local.set 0x16b (i64.load offset=0x16b align=1 (i32.const 0))) + (local.set 0x16c (i64.load offset=0x16c align=1 (i32.const 0))) + (local.set 0x16d (i64.load offset=0x16d align=1 (i32.const 0))) + (local.set 0x16e (i64.load offset=0x16e align=1 (i32.const 0))) + (local.set 0x16f (i64.load offset=0x16f align=1 (i32.const 0))) + (local.set 0x170 (i64.load offset=0x170 align=1 (i32.const 0))) + (local.set 0x171 (i64.load offset=0x171 align=1 (i32.const 0))) + (local.set 0x172 (i64.load offset=0x172 align=1 (i32.const 0))) + (local.set 0x173 (i64.load offset=0x173 align=1 (i32.const 0))) + (local.set 0x174 (i64.load offset=0x174 align=1 (i32.const 0))) + (local.set 0x175 (i64.load offset=0x175 align=1 (i32.const 0))) + (local.set 0x176 (i64.load offset=0x176 align=1 (i32.const 0))) + (local.set 0x177 (i64.load offset=0x177 align=1 (i32.const 0))) + (local.set 0x178 (i64.load offset=0x178 align=1 (i32.const 0))) + (local.set 0x179 (i64.load offset=0x179 align=1 (i32.const 0))) + (local.set 0x17a (i64.load offset=0x17a align=1 (i32.const 0))) + (local.set 0x17b (i64.load offset=0x17b align=1 (i32.const 0))) + (local.set 0x17c (i64.load offset=0x17c align=1 (i32.const 0))) + (local.set 0x17d (i64.load offset=0x17d align=1 (i32.const 0))) + (local.set 0x17e (i64.load offset=0x17e align=1 (i32.const 0))) + (local.set 0x17f (i64.load offset=0x17f align=1 (i32.const 0))) + (local.set 0x180 (i64.load offset=0x180 align=1 (i32.const 0))) + (local.set 0x181 (i64.load offset=0x181 align=1 (i32.const 0))) + (local.set 0x182 (i64.load offset=0x182 align=1 (i32.const 0))) + (local.set 0x183 (i64.load offset=0x183 align=1 (i32.const 0))) + (local.set 0x184 (i64.load offset=0x184 align=1 (i32.const 0))) + (local.set 0x185 (i64.load offset=0x185 align=1 (i32.const 0))) + (local.set 0x186 (i64.load offset=0x186 align=1 (i32.const 0))) + (local.set 0x187 (i64.load offset=0x187 align=1 (i32.const 0))) + (local.set 0x188 (i64.load offset=0x188 align=1 (i32.const 0))) + (local.set 0x189 (i64.load offset=0x189 align=1 (i32.const 0))) + (local.set 0x18a (i64.load offset=0x18a align=1 (i32.const 0))) + (local.set 0x18b (i64.load offset=0x18b align=1 (i32.const 0))) + (local.set 0x18c (i64.load offset=0x18c align=1 (i32.const 0))) + (local.set 0x18d (i64.load offset=0x18d align=1 (i32.const 0))) + (local.set 0x18e (i64.load offset=0x18e align=1 (i32.const 0))) + (local.set 0x18f (i64.load offset=0x18f align=1 (i32.const 0))) + (local.set 0x190 (i64.load offset=0x190 align=1 (i32.const 0))) + (local.set 0x191 (i64.load offset=0x191 align=1 (i32.const 0))) + (local.set 0x192 (i64.load offset=0x192 align=1 (i32.const 0))) + (local.set 0x193 (i64.load offset=0x193 align=1 (i32.const 0))) + (local.set 0x194 (i64.load offset=0x194 align=1 (i32.const 0))) + (local.set 0x195 (i64.load offset=0x195 align=1 (i32.const 0))) + (local.set 0x196 (i64.load offset=0x196 align=1 (i32.const 0))) + (local.set 0x197 (i64.load offset=0x197 align=1 (i32.const 0))) + (local.set 0x198 (i64.load offset=0x198 align=1 (i32.const 0))) + (local.set 0x199 (i64.load offset=0x199 align=1 (i32.const 0))) + (local.set 0x19a (i64.load offset=0x19a align=1 (i32.const 0))) + (local.set 0x19b (i64.load offset=0x19b align=1 (i32.const 0))) + (local.set 0x19c (i64.load offset=0x19c align=1 (i32.const 0))) + (local.set 0x19d (i64.load offset=0x19d align=1 (i32.const 0))) + (local.set 0x19e (i64.load offset=0x19e align=1 (i32.const 0))) + (local.set 0x19f (i64.load offset=0x19f align=1 (i32.const 0))) + (local.set 0x1a0 (i64.load offset=0x1a0 align=1 (i32.const 0))) + (local.set 0x1a1 (i64.load offset=0x1a1 align=1 (i32.const 0))) + (local.set 0x1a2 (i64.load offset=0x1a2 align=1 (i32.const 0))) + (local.set 0x1a3 (i64.load offset=0x1a3 align=1 (i32.const 0))) + (local.set 0x1a4 (i64.load offset=0x1a4 align=1 (i32.const 0))) + (local.set 0x1a5 (i64.load offset=0x1a5 align=1 (i32.const 0))) + (local.set 0x1a6 (i64.load offset=0x1a6 align=1 (i32.const 0))) + (local.set 0x1a7 (i64.load offset=0x1a7 align=1 (i32.const 0))) + (local.set 0x1a8 (i64.load offset=0x1a8 align=1 (i32.const 0))) + (local.set 0x1a9 (i64.load offset=0x1a9 align=1 (i32.const 0))) + (local.set 0x1aa (i64.load offset=0x1aa align=1 (i32.const 0))) + (local.set 0x1ab (i64.load offset=0x1ab align=1 (i32.const 0))) + (local.set 0x1ac (i64.load offset=0x1ac align=1 (i32.const 0))) + (local.set 0x1ad (i64.load offset=0x1ad align=1 (i32.const 0))) + (local.set 0x1ae (i64.load offset=0x1ae align=1 (i32.const 0))) + (local.set 0x1af (i64.load offset=0x1af align=1 (i32.const 0))) + (local.set 0x1b0 (i64.load offset=0x1b0 align=1 (i32.const 0))) + (local.set 0x1b1 (i64.load offset=0x1b1 align=1 (i32.const 0))) + (local.set 0x1b2 (i64.load offset=0x1b2 align=1 (i32.const 0))) + (local.set 0x1b3 (i64.load offset=0x1b3 align=1 (i32.const 0))) + (local.set 0x1b4 (i64.load offset=0x1b4 align=1 (i32.const 0))) + (local.set 0x1b5 (i64.load offset=0x1b5 align=1 (i32.const 0))) + (local.set 0x1b6 (i64.load offset=0x1b6 align=1 (i32.const 0))) + (local.set 0x1b7 (i64.load offset=0x1b7 align=1 (i32.const 0))) + (local.set 0x1b8 (i64.load offset=0x1b8 align=1 (i32.const 0))) + (local.set 0x1b9 (i64.load offset=0x1b9 align=1 (i32.const 0))) + (local.set 0x1ba (i64.load offset=0x1ba align=1 (i32.const 0))) + (local.set 0x1bb (i64.load offset=0x1bb align=1 (i32.const 0))) + (local.set 0x1bc (i64.load offset=0x1bc align=1 (i32.const 0))) + (local.set 0x1bd (i64.load offset=0x1bd align=1 (i32.const 0))) + (local.set 0x1be (i64.load offset=0x1be align=1 (i32.const 0))) + (local.set 0x1bf (i64.load offset=0x1bf align=1 (i32.const 0))) + (local.set 0x1c0 (i64.load offset=0x1c0 align=1 (i32.const 0))) + (local.set 0x1c1 (i64.load offset=0x1c1 align=1 (i32.const 0))) + (local.set 0x1c2 (i64.load offset=0x1c2 align=1 (i32.const 0))) + (local.set 0x1c3 (i64.load offset=0x1c3 align=1 (i32.const 0))) + (local.set 0x1c4 (i64.load offset=0x1c4 align=1 (i32.const 0))) + (local.set 0x1c5 (i64.load offset=0x1c5 align=1 (i32.const 0))) + (local.set 0x1c6 (i64.load offset=0x1c6 align=1 (i32.const 0))) + (local.set 0x1c7 (i64.load offset=0x1c7 align=1 (i32.const 0))) + (local.set 0x1c8 (i64.load offset=0x1c8 align=1 (i32.const 0))) + (local.set 0x1c9 (i64.load offset=0x1c9 align=1 (i32.const 0))) + (local.set 0x1ca (i64.load offset=0x1ca align=1 (i32.const 0))) + (local.set 0x1cb (i64.load offset=0x1cb align=1 (i32.const 0))) + (local.set 0x1cc (i64.load offset=0x1cc align=1 (i32.const 0))) + (local.set 0x1cd (i64.load offset=0x1cd align=1 (i32.const 0))) + (local.set 0x1ce (i64.load offset=0x1ce align=1 (i32.const 0))) + (local.set 0x1cf (i64.load offset=0x1cf align=1 (i32.const 0))) + (local.set 0x1d0 (i64.load offset=0x1d0 align=1 (i32.const 0))) + (local.set 0x1d1 (i64.load offset=0x1d1 align=1 (i32.const 0))) + (local.set 0x1d2 (i64.load offset=0x1d2 align=1 (i32.const 0))) + (local.set 0x1d3 (i64.load offset=0x1d3 align=1 (i32.const 0))) + (local.set 0x1d4 (i64.load offset=0x1d4 align=1 (i32.const 0))) + (local.set 0x1d5 (i64.load offset=0x1d5 align=1 (i32.const 0))) + (local.set 0x1d6 (i64.load offset=0x1d6 align=1 (i32.const 0))) + (local.set 0x1d7 (i64.load offset=0x1d7 align=1 (i32.const 0))) + (local.set 0x1d8 (i64.load offset=0x1d8 align=1 (i32.const 0))) + (local.set 0x1d9 (i64.load offset=0x1d9 align=1 (i32.const 0))) + (local.set 0x1da (i64.load offset=0x1da align=1 (i32.const 0))) + (local.set 0x1db (i64.load offset=0x1db align=1 (i32.const 0))) + (local.set 0x1dc (i64.load offset=0x1dc align=1 (i32.const 0))) + (local.set 0x1dd (i64.load offset=0x1dd align=1 (i32.const 0))) + (local.set 0x1de (i64.load offset=0x1de align=1 (i32.const 0))) + (local.set 0x1df (i64.load offset=0x1df align=1 (i32.const 0))) + (local.set 0x1e0 (i64.load offset=0x1e0 align=1 (i32.const 0))) + (local.set 0x1e1 (i64.load offset=0x1e1 align=1 (i32.const 0))) + (local.set 0x1e2 (i64.load offset=0x1e2 align=1 (i32.const 0))) + (local.set 0x1e3 (i64.load offset=0x1e3 align=1 (i32.const 0))) + (local.set 0x1e4 (i64.load offset=0x1e4 align=1 (i32.const 0))) + (local.set 0x1e5 (i64.load offset=0x1e5 align=1 (i32.const 0))) + (local.set 0x1e6 (i64.load offset=0x1e6 align=1 (i32.const 0))) + (local.set 0x1e7 (i64.load offset=0x1e7 align=1 (i32.const 0))) + (local.set 0x1e8 (i64.load offset=0x1e8 align=1 (i32.const 0))) + (local.set 0x1e9 (i64.load offset=0x1e9 align=1 (i32.const 0))) + (local.set 0x1ea (i64.load offset=0x1ea align=1 (i32.const 0))) + (local.set 0x1eb (i64.load offset=0x1eb align=1 (i32.const 0))) + (local.set 0x1ec (i64.load offset=0x1ec align=1 (i32.const 0))) + (local.set 0x1ed (i64.load offset=0x1ed align=1 (i32.const 0))) + (local.set 0x1ee (i64.load offset=0x1ee align=1 (i32.const 0))) + (local.set 0x1ef (i64.load offset=0x1ef align=1 (i32.const 0))) + (local.set 0x1f0 (i64.load offset=0x1f0 align=1 (i32.const 0))) + (local.set 0x1f1 (i64.load offset=0x1f1 align=1 (i32.const 0))) + (local.set 0x1f2 (i64.load offset=0x1f2 align=1 (i32.const 0))) + (local.set 0x1f3 (i64.load offset=0x1f3 align=1 (i32.const 0))) + (local.set 0x1f4 (i64.load offset=0x1f4 align=1 (i32.const 0))) + (local.set 0x1f5 (i64.load offset=0x1f5 align=1 (i32.const 0))) + (local.set 0x1f6 (i64.load offset=0x1f6 align=1 (i32.const 0))) + (local.set 0x1f7 (i64.load offset=0x1f7 align=1 (i32.const 0))) + (local.set 0x1f8 (i64.load offset=0x1f8 align=1 (i32.const 0))) + (local.set 0x1f9 (i64.load offset=0x1f9 align=1 (i32.const 0))) + (local.set 0x1fa (i64.load offset=0x1fa align=1 (i32.const 0))) + (local.set 0x1fb (i64.load offset=0x1fb align=1 (i32.const 0))) + (local.set 0x1fc (i64.load offset=0x1fc align=1 (i32.const 0))) + (local.set 0x1fd (i64.load offset=0x1fd align=1 (i32.const 0))) + (local.set 0x1fe (i64.load offset=0x1fe align=1 (i32.const 0))) + (local.set 0x1ff (i64.load offset=0x1ff align=1 (i32.const 0))) + (local.set 0x200 (i64.load offset=0x200 align=1 (i32.const 0))) + (local.set 0x201 (i64.load offset=0x201 align=1 (i32.const 0))) + (local.set 0x202 (i64.load offset=0x202 align=1 (i32.const 0))) + (local.set 0x203 (i64.load offset=0x203 align=1 (i32.const 0))) + (local.set 0x204 (i64.load offset=0x204 align=1 (i32.const 0))) + (local.set 0x205 (i64.load offset=0x205 align=1 (i32.const 0))) + (local.set 0x206 (i64.load offset=0x206 align=1 (i32.const 0))) + (local.set 0x207 (i64.load offset=0x207 align=1 (i32.const 0))) + (local.set 0x208 (i64.load offset=0x208 align=1 (i32.const 0))) + (local.set 0x209 (i64.load offset=0x209 align=1 (i32.const 0))) + (local.set 0x20a (i64.load offset=0x20a align=1 (i32.const 0))) + (local.set 0x20b (i64.load offset=0x20b align=1 (i32.const 0))) + (local.set 0x20c (i64.load offset=0x20c align=1 (i32.const 0))) + (local.set 0x20d (i64.load offset=0x20d align=1 (i32.const 0))) + (local.set 0x20e (i64.load offset=0x20e align=1 (i32.const 0))) + (local.set 0x20f (i64.load offset=0x20f align=1 (i32.const 0))) + (local.set 0x210 (i64.load offset=0x210 align=1 (i32.const 0))) + (local.set 0x211 (i64.load offset=0x211 align=1 (i32.const 0))) + (local.set 0x212 (i64.load offset=0x212 align=1 (i32.const 0))) + (local.set 0x213 (i64.load offset=0x213 align=1 (i32.const 0))) + (local.set 0x214 (i64.load offset=0x214 align=1 (i32.const 0))) + (local.set 0x215 (i64.load offset=0x215 align=1 (i32.const 0))) + (local.set 0x216 (i64.load offset=0x216 align=1 (i32.const 0))) + (local.set 0x217 (i64.load offset=0x217 align=1 (i32.const 0))) + (local.set 0x218 (i64.load offset=0x218 align=1 (i32.const 0))) + (local.set 0x219 (i64.load offset=0x219 align=1 (i32.const 0))) + (local.set 0x21a (i64.load offset=0x21a align=1 (i32.const 0))) + (local.set 0x21b (i64.load offset=0x21b align=1 (i32.const 0))) + (local.set 0x21c (i64.load offset=0x21c align=1 (i32.const 0))) + (local.set 0x21d (i64.load offset=0x21d align=1 (i32.const 0))) + (local.set 0x21e (i64.load offset=0x21e align=1 (i32.const 0))) + (local.set 0x21f (i64.load offset=0x21f align=1 (i32.const 0))) + (local.set 0x220 (i64.load offset=0x220 align=1 (i32.const 0))) + (local.set 0x221 (i64.load offset=0x221 align=1 (i32.const 0))) + (local.set 0x222 (i64.load offset=0x222 align=1 (i32.const 0))) + (local.set 0x223 (i64.load offset=0x223 align=1 (i32.const 0))) + (local.set 0x224 (i64.load offset=0x224 align=1 (i32.const 0))) + (local.set 0x225 (i64.load offset=0x225 align=1 (i32.const 0))) + (local.set 0x226 (i64.load offset=0x226 align=1 (i32.const 0))) + (local.set 0x227 (i64.load offset=0x227 align=1 (i32.const 0))) + (local.set 0x228 (i64.load offset=0x228 align=1 (i32.const 0))) + (local.set 0x229 (i64.load offset=0x229 align=1 (i32.const 0))) + (local.set 0x22a (i64.load offset=0x22a align=1 (i32.const 0))) + (local.set 0x22b (i64.load offset=0x22b align=1 (i32.const 0))) + (local.set 0x22c (i64.load offset=0x22c align=1 (i32.const 0))) + (local.set 0x22d (i64.load offset=0x22d align=1 (i32.const 0))) + (local.set 0x22e (i64.load offset=0x22e align=1 (i32.const 0))) + (local.set 0x22f (i64.load offset=0x22f align=1 (i32.const 0))) + (local.set 0x230 (i64.load offset=0x230 align=1 (i32.const 0))) + (local.set 0x231 (i64.load offset=0x231 align=1 (i32.const 0))) + (local.set 0x232 (i64.load offset=0x232 align=1 (i32.const 0))) + (local.set 0x233 (i64.load offset=0x233 align=1 (i32.const 0))) + (local.set 0x234 (i64.load offset=0x234 align=1 (i32.const 0))) + (local.set 0x235 (i64.load offset=0x235 align=1 (i32.const 0))) + (local.set 0x236 (i64.load offset=0x236 align=1 (i32.const 0))) + (local.set 0x237 (i64.load offset=0x237 align=1 (i32.const 0))) + (local.set 0x238 (i64.load offset=0x238 align=1 (i32.const 0))) + (local.set 0x239 (i64.load offset=0x239 align=1 (i32.const 0))) + (local.set 0x23a (i64.load offset=0x23a align=1 (i32.const 0))) + (local.set 0x23b (i64.load offset=0x23b align=1 (i32.const 0))) + (local.set 0x23c (i64.load offset=0x23c align=1 (i32.const 0))) + (local.set 0x23d (i64.load offset=0x23d align=1 (i32.const 0))) + (local.set 0x23e (i64.load offset=0x23e align=1 (i32.const 0))) + (local.set 0x23f (i64.load offset=0x23f align=1 (i32.const 0))) + (local.set 0x240 (i64.load offset=0x240 align=1 (i32.const 0))) + (local.set 0x241 (i64.load offset=0x241 align=1 (i32.const 0))) + (local.set 0x242 (i64.load offset=0x242 align=1 (i32.const 0))) + (local.set 0x243 (i64.load offset=0x243 align=1 (i32.const 0))) + (local.set 0x244 (i64.load offset=0x244 align=1 (i32.const 0))) + (local.set 0x245 (i64.load offset=0x245 align=1 (i32.const 0))) + (local.set 0x246 (i64.load offset=0x246 align=1 (i32.const 0))) + (local.set 0x247 (i64.load offset=0x247 align=1 (i32.const 0))) + (local.set 0x248 (i64.load offset=0x248 align=1 (i32.const 0))) + (local.set 0x249 (i64.load offset=0x249 align=1 (i32.const 0))) + (local.set 0x24a (i64.load offset=0x24a align=1 (i32.const 0))) + (local.set 0x24b (i64.load offset=0x24b align=1 (i32.const 0))) + (local.set 0x24c (i64.load offset=0x24c align=1 (i32.const 0))) + (local.set 0x24d (i64.load offset=0x24d align=1 (i32.const 0))) + (local.set 0x24e (i64.load offset=0x24e align=1 (i32.const 0))) + (local.set 0x24f (i64.load offset=0x24f align=1 (i32.const 0))) + (local.set 0x250 (i64.load offset=0x250 align=1 (i32.const 0))) + (local.set 0x251 (i64.load offset=0x251 align=1 (i32.const 0))) + (local.set 0x252 (i64.load offset=0x252 align=1 (i32.const 0))) + (local.set 0x253 (i64.load offset=0x253 align=1 (i32.const 0))) + (local.set 0x254 (i64.load offset=0x254 align=1 (i32.const 0))) + (local.set 0x255 (i64.load offset=0x255 align=1 (i32.const 0))) + (local.set 0x256 (i64.load offset=0x256 align=1 (i32.const 0))) + (local.set 0x257 (i64.load offset=0x257 align=1 (i32.const 0))) + (local.set 0x258 (i64.load offset=0x258 align=1 (i32.const 0))) + (local.set 0x259 (i64.load offset=0x259 align=1 (i32.const 0))) + (local.set 0x25a (i64.load offset=0x25a align=1 (i32.const 0))) + (local.set 0x25b (i64.load offset=0x25b align=1 (i32.const 0))) + (local.set 0x25c (i64.load offset=0x25c align=1 (i32.const 0))) + (local.set 0x25d (i64.load offset=0x25d align=1 (i32.const 0))) + (local.set 0x25e (i64.load offset=0x25e align=1 (i32.const 0))) + (local.set 0x25f (i64.load offset=0x25f align=1 (i32.const 0))) + (local.set 0x260 (i64.load offset=0x260 align=1 (i32.const 0))) + (local.set 0x261 (i64.load offset=0x261 align=1 (i32.const 0))) + (local.set 0x262 (i64.load offset=0x262 align=1 (i32.const 0))) + (local.set 0x263 (i64.load offset=0x263 align=1 (i32.const 0))) + (local.set 0x264 (i64.load offset=0x264 align=1 (i32.const 0))) + (local.set 0x265 (i64.load offset=0x265 align=1 (i32.const 0))) + (local.set 0x266 (i64.load offset=0x266 align=1 (i32.const 0))) + (local.set 0x267 (i64.load offset=0x267 align=1 (i32.const 0))) + (local.set 0x268 (i64.load offset=0x268 align=1 (i32.const 0))) + (local.set 0x269 (i64.load offset=0x269 align=1 (i32.const 0))) + (local.set 0x26a (i64.load offset=0x26a align=1 (i32.const 0))) + (local.set 0x26b (i64.load offset=0x26b align=1 (i32.const 0))) + (local.set 0x26c (i64.load offset=0x26c align=1 (i32.const 0))) + (local.set 0x26d (i64.load offset=0x26d align=1 (i32.const 0))) + (local.set 0x26e (i64.load offset=0x26e align=1 (i32.const 0))) + (local.set 0x26f (i64.load offset=0x26f align=1 (i32.const 0))) + (local.set 0x270 (i64.load offset=0x270 align=1 (i32.const 0))) + (local.set 0x271 (i64.load offset=0x271 align=1 (i32.const 0))) + (local.set 0x272 (i64.load offset=0x272 align=1 (i32.const 0))) + (local.set 0x273 (i64.load offset=0x273 align=1 (i32.const 0))) + (local.set 0x274 (i64.load offset=0x274 align=1 (i32.const 0))) + (local.set 0x275 (i64.load offset=0x275 align=1 (i32.const 0))) + (local.set 0x276 (i64.load offset=0x276 align=1 (i32.const 0))) + (local.set 0x277 (i64.load offset=0x277 align=1 (i32.const 0))) + (local.set 0x278 (i64.load offset=0x278 align=1 (i32.const 0))) + (local.set 0x279 (i64.load offset=0x279 align=1 (i32.const 0))) + (local.set 0x27a (i64.load offset=0x27a align=1 (i32.const 0))) + (local.set 0x27b (i64.load offset=0x27b align=1 (i32.const 0))) + (local.set 0x27c (i64.load offset=0x27c align=1 (i32.const 0))) + (local.set 0x27d (i64.load offset=0x27d align=1 (i32.const 0))) + (local.set 0x27e (i64.load offset=0x27e align=1 (i32.const 0))) + (local.set 0x27f (i64.load offset=0x27f align=1 (i32.const 0))) + (local.set 0x280 (i64.load offset=0x280 align=1 (i32.const 0))) + (local.set 0x281 (i64.load offset=0x281 align=1 (i32.const 0))) + (local.set 0x282 (i64.load offset=0x282 align=1 (i32.const 0))) + (local.set 0x283 (i64.load offset=0x283 align=1 (i32.const 0))) + (local.set 0x284 (i64.load offset=0x284 align=1 (i32.const 0))) + (local.set 0x285 (i64.load offset=0x285 align=1 (i32.const 0))) + (local.set 0x286 (i64.load offset=0x286 align=1 (i32.const 0))) + (local.set 0x287 (i64.load offset=0x287 align=1 (i32.const 0))) + (local.set 0x288 (i64.load offset=0x288 align=1 (i32.const 0))) + (local.set 0x289 (i64.load offset=0x289 align=1 (i32.const 0))) + (local.set 0x28a (i64.load offset=0x28a align=1 (i32.const 0))) + (local.set 0x28b (i64.load offset=0x28b align=1 (i32.const 0))) + (local.set 0x28c (i64.load offset=0x28c align=1 (i32.const 0))) + (local.set 0x28d (i64.load offset=0x28d align=1 (i32.const 0))) + (local.set 0x28e (i64.load offset=0x28e align=1 (i32.const 0))) + (local.set 0x28f (i64.load offset=0x28f align=1 (i32.const 0))) + (local.set 0x290 (i64.load offset=0x290 align=1 (i32.const 0))) + (local.set 0x291 (i64.load offset=0x291 align=1 (i32.const 0))) + (local.set 0x292 (i64.load offset=0x292 align=1 (i32.const 0))) + (local.set 0x293 (i64.load offset=0x293 align=1 (i32.const 0))) + (local.set 0x294 (i64.load offset=0x294 align=1 (i32.const 0))) + (local.set 0x295 (i64.load offset=0x295 align=1 (i32.const 0))) + (local.set 0x296 (i64.load offset=0x296 align=1 (i32.const 0))) + (local.set 0x297 (i64.load offset=0x297 align=1 (i32.const 0))) + (local.set 0x298 (i64.load offset=0x298 align=1 (i32.const 0))) + (local.set 0x299 (i64.load offset=0x299 align=1 (i32.const 0))) + (local.set 0x29a (i64.load offset=0x29a align=1 (i32.const 0))) + (local.set 0x29b (i64.load offset=0x29b align=1 (i32.const 0))) + (local.set 0x29c (i64.load offset=0x29c align=1 (i32.const 0))) + (local.set 0x29d (i64.load offset=0x29d align=1 (i32.const 0))) + (local.set 0x29e (i64.load offset=0x29e align=1 (i32.const 0))) + (local.set 0x29f (i64.load offset=0x29f align=1 (i32.const 0))) + (local.set 0x2a0 (i64.load offset=0x2a0 align=1 (i32.const 0))) + (local.set 0x2a1 (i64.load offset=0x2a1 align=1 (i32.const 0))) + (local.set 0x2a2 (i64.load offset=0x2a2 align=1 (i32.const 0))) + (local.set 0x2a3 (i64.load offset=0x2a3 align=1 (i32.const 0))) + (local.set 0x2a4 (i64.load offset=0x2a4 align=1 (i32.const 0))) + (local.set 0x2a5 (i64.load offset=0x2a5 align=1 (i32.const 0))) + (local.set 0x2a6 (i64.load offset=0x2a6 align=1 (i32.const 0))) + (local.set 0x2a7 (i64.load offset=0x2a7 align=1 (i32.const 0))) + (local.set 0x2a8 (i64.load offset=0x2a8 align=1 (i32.const 0))) + (local.set 0x2a9 (i64.load offset=0x2a9 align=1 (i32.const 0))) + (local.set 0x2aa (i64.load offset=0x2aa align=1 (i32.const 0))) + (local.set 0x2ab (i64.load offset=0x2ab align=1 (i32.const 0))) + (local.set 0x2ac (i64.load offset=0x2ac align=1 (i32.const 0))) + (local.set 0x2ad (i64.load offset=0x2ad align=1 (i32.const 0))) + (local.set 0x2ae (i64.load offset=0x2ae align=1 (i32.const 0))) + (local.set 0x2af (i64.load offset=0x2af align=1 (i32.const 0))) + (local.set 0x2b0 (i64.load offset=0x2b0 align=1 (i32.const 0))) + (local.set 0x2b1 (i64.load offset=0x2b1 align=1 (i32.const 0))) + (local.set 0x2b2 (i64.load offset=0x2b2 align=1 (i32.const 0))) + (local.set 0x2b3 (i64.load offset=0x2b3 align=1 (i32.const 0))) + (local.set 0x2b4 (i64.load offset=0x2b4 align=1 (i32.const 0))) + (local.set 0x2b5 (i64.load offset=0x2b5 align=1 (i32.const 0))) + (local.set 0x2b6 (i64.load offset=0x2b6 align=1 (i32.const 0))) + (local.set 0x2b7 (i64.load offset=0x2b7 align=1 (i32.const 0))) + (local.set 0x2b8 (i64.load offset=0x2b8 align=1 (i32.const 0))) + (local.set 0x2b9 (i64.load offset=0x2b9 align=1 (i32.const 0))) + (local.set 0x2ba (i64.load offset=0x2ba align=1 (i32.const 0))) + (local.set 0x2bb (i64.load offset=0x2bb align=1 (i32.const 0))) + (local.set 0x2bc (i64.load offset=0x2bc align=1 (i32.const 0))) + (local.set 0x2bd (i64.load offset=0x2bd align=1 (i32.const 0))) + (local.set 0x2be (i64.load offset=0x2be align=1 (i32.const 0))) + (local.set 0x2bf (i64.load offset=0x2bf align=1 (i32.const 0))) + (local.set 0x2c0 (i64.load offset=0x2c0 align=1 (i32.const 0))) + (local.set 0x2c1 (i64.load offset=0x2c1 align=1 (i32.const 0))) + (local.set 0x2c2 (i64.load offset=0x2c2 align=1 (i32.const 0))) + (local.set 0x2c3 (i64.load offset=0x2c3 align=1 (i32.const 0))) + (local.set 0x2c4 (i64.load offset=0x2c4 align=1 (i32.const 0))) + (local.set 0x2c5 (i64.load offset=0x2c5 align=1 (i32.const 0))) + (local.set 0x2c6 (i64.load offset=0x2c6 align=1 (i32.const 0))) + (local.set 0x2c7 (i64.load offset=0x2c7 align=1 (i32.const 0))) + (local.set 0x2c8 (i64.load offset=0x2c8 align=1 (i32.const 0))) + (local.set 0x2c9 (i64.load offset=0x2c9 align=1 (i32.const 0))) + (local.set 0x2ca (i64.load offset=0x2ca align=1 (i32.const 0))) + (local.set 0x2cb (i64.load offset=0x2cb align=1 (i32.const 0))) + (local.set 0x2cc (i64.load offset=0x2cc align=1 (i32.const 0))) + (local.set 0x2cd (i64.load offset=0x2cd align=1 (i32.const 0))) + (local.set 0x2ce (i64.load offset=0x2ce align=1 (i32.const 0))) + (local.set 0x2cf (i64.load offset=0x2cf align=1 (i32.const 0))) + (local.set 0x2d0 (i64.load offset=0x2d0 align=1 (i32.const 0))) + (local.set 0x2d1 (i64.load offset=0x2d1 align=1 (i32.const 0))) + (local.set 0x2d2 (i64.load offset=0x2d2 align=1 (i32.const 0))) + (local.set 0x2d3 (i64.load offset=0x2d3 align=1 (i32.const 0))) + (local.set 0x2d4 (i64.load offset=0x2d4 align=1 (i32.const 0))) + (local.set 0x2d5 (i64.load offset=0x2d5 align=1 (i32.const 0))) + (local.set 0x2d6 (i64.load offset=0x2d6 align=1 (i32.const 0))) + (local.set 0x2d7 (i64.load offset=0x2d7 align=1 (i32.const 0))) + (local.set 0x2d8 (i64.load offset=0x2d8 align=1 (i32.const 0))) + (local.set 0x2d9 (i64.load offset=0x2d9 align=1 (i32.const 0))) + (local.set 0x2da (i64.load offset=0x2da align=1 (i32.const 0))) + (local.set 0x2db (i64.load offset=0x2db align=1 (i32.const 0))) + (local.set 0x2dc (i64.load offset=0x2dc align=1 (i32.const 0))) + (local.set 0x2dd (i64.load offset=0x2dd align=1 (i32.const 0))) + (local.set 0x2de (i64.load offset=0x2de align=1 (i32.const 0))) + (local.set 0x2df (i64.load offset=0x2df align=1 (i32.const 0))) + (local.set 0x2e0 (i64.load offset=0x2e0 align=1 (i32.const 0))) + (local.set 0x2e1 (i64.load offset=0x2e1 align=1 (i32.const 0))) + (local.set 0x2e2 (i64.load offset=0x2e2 align=1 (i32.const 0))) + (local.set 0x2e3 (i64.load offset=0x2e3 align=1 (i32.const 0))) + (local.set 0x2e4 (i64.load offset=0x2e4 align=1 (i32.const 0))) + (local.set 0x2e5 (i64.load offset=0x2e5 align=1 (i32.const 0))) + (local.set 0x2e6 (i64.load offset=0x2e6 align=1 (i32.const 0))) + (local.set 0x2e7 (i64.load offset=0x2e7 align=1 (i32.const 0))) + (local.set 0x2e8 (i64.load offset=0x2e8 align=1 (i32.const 0))) + (local.set 0x2e9 (i64.load offset=0x2e9 align=1 (i32.const 0))) + (local.set 0x2ea (i64.load offset=0x2ea align=1 (i32.const 0))) + (local.set 0x2eb (i64.load offset=0x2eb align=1 (i32.const 0))) + (local.set 0x2ec (i64.load offset=0x2ec align=1 (i32.const 0))) + (local.set 0x2ed (i64.load offset=0x2ed align=1 (i32.const 0))) + (local.set 0x2ee (i64.load offset=0x2ee align=1 (i32.const 0))) + (local.set 0x2ef (i64.load offset=0x2ef align=1 (i32.const 0))) + (local.set 0x2f0 (i64.load offset=0x2f0 align=1 (i32.const 0))) + (local.set 0x2f1 (i64.load offset=0x2f1 align=1 (i32.const 0))) + (local.set 0x2f2 (i64.load offset=0x2f2 align=1 (i32.const 0))) + (local.set 0x2f3 (i64.load offset=0x2f3 align=1 (i32.const 0))) + (local.set 0x2f4 (i64.load offset=0x2f4 align=1 (i32.const 0))) + (local.set 0x2f5 (i64.load offset=0x2f5 align=1 (i32.const 0))) + (local.set 0x2f6 (i64.load offset=0x2f6 align=1 (i32.const 0))) + (local.set 0x2f7 (i64.load offset=0x2f7 align=1 (i32.const 0))) + (local.set 0x2f8 (i64.load offset=0x2f8 align=1 (i32.const 0))) + (local.set 0x2f9 (i64.load offset=0x2f9 align=1 (i32.const 0))) + (local.set 0x2fa (i64.load offset=0x2fa align=1 (i32.const 0))) + (local.set 0x2fb (i64.load offset=0x2fb align=1 (i32.const 0))) + (local.set 0x2fc (i64.load offset=0x2fc align=1 (i32.const 0))) + (local.set 0x2fd (i64.load offset=0x2fd align=1 (i32.const 0))) + (local.set 0x2fe (i64.load offset=0x2fe align=1 (i32.const 0))) + (local.set 0x2ff (i64.load offset=0x2ff align=1 (i32.const 0))) + (local.set 0x300 (i64.load offset=0x300 align=1 (i32.const 0))) + (local.set 0x301 (i64.load offset=0x301 align=1 (i32.const 0))) + (local.set 0x302 (i64.load offset=0x302 align=1 (i32.const 0))) + (local.set 0x303 (i64.load offset=0x303 align=1 (i32.const 0))) + (local.set 0x304 (i64.load offset=0x304 align=1 (i32.const 0))) + (local.set 0x305 (i64.load offset=0x305 align=1 (i32.const 0))) + (local.set 0x306 (i64.load offset=0x306 align=1 (i32.const 0))) + (local.set 0x307 (i64.load offset=0x307 align=1 (i32.const 0))) + (local.set 0x308 (i64.load offset=0x308 align=1 (i32.const 0))) + (local.set 0x309 (i64.load offset=0x309 align=1 (i32.const 0))) + (local.set 0x30a (i64.load offset=0x30a align=1 (i32.const 0))) + (local.set 0x30b (i64.load offset=0x30b align=1 (i32.const 0))) + (local.set 0x30c (i64.load offset=0x30c align=1 (i32.const 0))) + (local.set 0x30d (i64.load offset=0x30d align=1 (i32.const 0))) + (local.set 0x30e (i64.load offset=0x30e align=1 (i32.const 0))) + (local.set 0x30f (i64.load offset=0x30f align=1 (i32.const 0))) + (local.set 0x310 (i64.load offset=0x310 align=1 (i32.const 0))) + (local.set 0x311 (i64.load offset=0x311 align=1 (i32.const 0))) + (local.set 0x312 (i64.load offset=0x312 align=1 (i32.const 0))) + (local.set 0x313 (i64.load offset=0x313 align=1 (i32.const 0))) + (local.set 0x314 (i64.load offset=0x314 align=1 (i32.const 0))) + (local.set 0x315 (i64.load offset=0x315 align=1 (i32.const 0))) + (local.set 0x316 (i64.load offset=0x316 align=1 (i32.const 0))) + (local.set 0x317 (i64.load offset=0x317 align=1 (i32.const 0))) + (local.set 0x318 (i64.load offset=0x318 align=1 (i32.const 0))) + (local.set 0x319 (i64.load offset=0x319 align=1 (i32.const 0))) + (local.set 0x31a (i64.load offset=0x31a align=1 (i32.const 0))) + (local.set 0x31b (i64.load offset=0x31b align=1 (i32.const 0))) + (local.set 0x31c (i64.load offset=0x31c align=1 (i32.const 0))) + (local.set 0x31d (i64.load offset=0x31d align=1 (i32.const 0))) + (local.set 0x31e (i64.load offset=0x31e align=1 (i32.const 0))) + (local.set 0x31f (i64.load offset=0x31f align=1 (i32.const 0))) + (local.set 0x320 (i64.load offset=0x320 align=1 (i32.const 0))) + (local.set 0x321 (i64.load offset=0x321 align=1 (i32.const 0))) + (local.set 0x322 (i64.load offset=0x322 align=1 (i32.const 0))) + (local.set 0x323 (i64.load offset=0x323 align=1 (i32.const 0))) + (local.set 0x324 (i64.load offset=0x324 align=1 (i32.const 0))) + (local.set 0x325 (i64.load offset=0x325 align=1 (i32.const 0))) + (local.set 0x326 (i64.load offset=0x326 align=1 (i32.const 0))) + (local.set 0x327 (i64.load offset=0x327 align=1 (i32.const 0))) + (local.set 0x328 (i64.load offset=0x328 align=1 (i32.const 0))) + (local.set 0x329 (i64.load offset=0x329 align=1 (i32.const 0))) + (local.set 0x32a (i64.load offset=0x32a align=1 (i32.const 0))) + (local.set 0x32b (i64.load offset=0x32b align=1 (i32.const 0))) + (local.set 0x32c (i64.load offset=0x32c align=1 (i32.const 0))) + (local.set 0x32d (i64.load offset=0x32d align=1 (i32.const 0))) + (local.set 0x32e (i64.load offset=0x32e align=1 (i32.const 0))) + (local.set 0x32f (i64.load offset=0x32f align=1 (i32.const 0))) + (local.set 0x330 (i64.load offset=0x330 align=1 (i32.const 0))) + (local.set 0x331 (i64.load offset=0x331 align=1 (i32.const 0))) + (local.set 0x332 (i64.load offset=0x332 align=1 (i32.const 0))) + (local.set 0x333 (i64.load offset=0x333 align=1 (i32.const 0))) + (local.set 0x334 (i64.load offset=0x334 align=1 (i32.const 0))) + (local.set 0x335 (i64.load offset=0x335 align=1 (i32.const 0))) + (local.set 0x336 (i64.load offset=0x336 align=1 (i32.const 0))) + (local.set 0x337 (i64.load offset=0x337 align=1 (i32.const 0))) + (local.set 0x338 (i64.load offset=0x338 align=1 (i32.const 0))) + (local.set 0x339 (i64.load offset=0x339 align=1 (i32.const 0))) + (local.set 0x33a (i64.load offset=0x33a align=1 (i32.const 0))) + (local.set 0x33b (i64.load offset=0x33b align=1 (i32.const 0))) + (local.set 0x33c (i64.load offset=0x33c align=1 (i32.const 0))) + (local.set 0x33d (i64.load offset=0x33d align=1 (i32.const 0))) + (local.set 0x33e (i64.load offset=0x33e align=1 (i32.const 0))) + (local.set 0x33f (i64.load offset=0x33f align=1 (i32.const 0))) + (local.set 0x340 (i64.load offset=0x340 align=1 (i32.const 0))) + (local.set 0x341 (i64.load offset=0x341 align=1 (i32.const 0))) + (local.set 0x342 (i64.load offset=0x342 align=1 (i32.const 0))) + (local.set 0x343 (i64.load offset=0x343 align=1 (i32.const 0))) + (local.set 0x344 (i64.load offset=0x344 align=1 (i32.const 0))) + (local.set 0x345 (i64.load offset=0x345 align=1 (i32.const 0))) + (local.set 0x346 (i64.load offset=0x346 align=1 (i32.const 0))) + (local.set 0x347 (i64.load offset=0x347 align=1 (i32.const 0))) + (local.set 0x348 (i64.load offset=0x348 align=1 (i32.const 0))) + (local.set 0x349 (i64.load offset=0x349 align=1 (i32.const 0))) + (local.set 0x34a (i64.load offset=0x34a align=1 (i32.const 0))) + (local.set 0x34b (i64.load offset=0x34b align=1 (i32.const 0))) + (local.set 0x34c (i64.load offset=0x34c align=1 (i32.const 0))) + (local.set 0x34d (i64.load offset=0x34d align=1 (i32.const 0))) + (local.set 0x34e (i64.load offset=0x34e align=1 (i32.const 0))) + (local.set 0x34f (i64.load offset=0x34f align=1 (i32.const 0))) + (local.set 0x350 (i64.load offset=0x350 align=1 (i32.const 0))) + (local.set 0x351 (i64.load offset=0x351 align=1 (i32.const 0))) + (local.set 0x352 (i64.load offset=0x352 align=1 (i32.const 0))) + (local.set 0x353 (i64.load offset=0x353 align=1 (i32.const 0))) + (local.set 0x354 (i64.load offset=0x354 align=1 (i32.const 0))) + (local.set 0x355 (i64.load offset=0x355 align=1 (i32.const 0))) + (local.set 0x356 (i64.load offset=0x356 align=1 (i32.const 0))) + (local.set 0x357 (i64.load offset=0x357 align=1 (i32.const 0))) + (local.set 0x358 (i64.load offset=0x358 align=1 (i32.const 0))) + (local.set 0x359 (i64.load offset=0x359 align=1 (i32.const 0))) + (local.set 0x35a (i64.load offset=0x35a align=1 (i32.const 0))) + (local.set 0x35b (i64.load offset=0x35b align=1 (i32.const 0))) + (local.set 0x35c (i64.load offset=0x35c align=1 (i32.const 0))) + (local.set 0x35d (i64.load offset=0x35d align=1 (i32.const 0))) + (local.set 0x35e (i64.load offset=0x35e align=1 (i32.const 0))) + (local.set 0x35f (i64.load offset=0x35f align=1 (i32.const 0))) + (local.set 0x360 (i64.load offset=0x360 align=1 (i32.const 0))) + (local.set 0x361 (i64.load offset=0x361 align=1 (i32.const 0))) + (local.set 0x362 (i64.load offset=0x362 align=1 (i32.const 0))) + (local.set 0x363 (i64.load offset=0x363 align=1 (i32.const 0))) + (local.set 0x364 (i64.load offset=0x364 align=1 (i32.const 0))) + (local.set 0x365 (i64.load offset=0x365 align=1 (i32.const 0))) + (local.set 0x366 (i64.load offset=0x366 align=1 (i32.const 0))) + (local.set 0x367 (i64.load offset=0x367 align=1 (i32.const 0))) + (local.set 0x368 (i64.load offset=0x368 align=1 (i32.const 0))) + (local.set 0x369 (i64.load offset=0x369 align=1 (i32.const 0))) + (local.set 0x36a (i64.load offset=0x36a align=1 (i32.const 0))) + (local.set 0x36b (i64.load offset=0x36b align=1 (i32.const 0))) + (local.set 0x36c (i64.load offset=0x36c align=1 (i32.const 0))) + (local.set 0x36d (i64.load offset=0x36d align=1 (i32.const 0))) + (local.set 0x36e (i64.load offset=0x36e align=1 (i32.const 0))) + (local.set 0x36f (i64.load offset=0x36f align=1 (i32.const 0))) + (local.set 0x370 (i64.load offset=0x370 align=1 (i32.const 0))) + (local.set 0x371 (i64.load offset=0x371 align=1 (i32.const 0))) + (local.set 0x372 (i64.load offset=0x372 align=1 (i32.const 0))) + (local.set 0x373 (i64.load offset=0x373 align=1 (i32.const 0))) + (local.set 0x374 (i64.load offset=0x374 align=1 (i32.const 0))) + (local.set 0x375 (i64.load offset=0x375 align=1 (i32.const 0))) + (local.set 0x376 (i64.load offset=0x376 align=1 (i32.const 0))) + (local.set 0x377 (i64.load offset=0x377 align=1 (i32.const 0))) + (local.set 0x378 (i64.load offset=0x378 align=1 (i32.const 0))) + (local.set 0x379 (i64.load offset=0x379 align=1 (i32.const 0))) + (local.set 0x37a (i64.load offset=0x37a align=1 (i32.const 0))) + (local.set 0x37b (i64.load offset=0x37b align=1 (i32.const 0))) + (local.set 0x37c (i64.load offset=0x37c align=1 (i32.const 0))) + (local.set 0x37d (i64.load offset=0x37d align=1 (i32.const 0))) + (local.set 0x37e (i64.load offset=0x37e align=1 (i32.const 0))) + (local.set 0x37f (i64.load offset=0x37f align=1 (i32.const 0))) + (local.set 0x380 (i64.load offset=0x380 align=1 (i32.const 0))) + (local.set 0x381 (i64.load offset=0x381 align=1 (i32.const 0))) + (local.set 0x382 (i64.load offset=0x382 align=1 (i32.const 0))) + (local.set 0x383 (i64.load offset=0x383 align=1 (i32.const 0))) + (local.set 0x384 (i64.load offset=0x384 align=1 (i32.const 0))) + (local.set 0x385 (i64.load offset=0x385 align=1 (i32.const 0))) + (local.set 0x386 (i64.load offset=0x386 align=1 (i32.const 0))) + (local.set 0x387 (i64.load offset=0x387 align=1 (i32.const 0))) + (local.set 0x388 (i64.load offset=0x388 align=1 (i32.const 0))) + (local.set 0x389 (i64.load offset=0x389 align=1 (i32.const 0))) + (local.set 0x38a (i64.load offset=0x38a align=1 (i32.const 0))) + (local.set 0x38b (i64.load offset=0x38b align=1 (i32.const 0))) + (local.set 0x38c (i64.load offset=0x38c align=1 (i32.const 0))) + (local.set 0x38d (i64.load offset=0x38d align=1 (i32.const 0))) + (local.set 0x38e (i64.load offset=0x38e align=1 (i32.const 0))) + (local.set 0x38f (i64.load offset=0x38f align=1 (i32.const 0))) + (local.set 0x390 (i64.load offset=0x390 align=1 (i32.const 0))) + (local.set 0x391 (i64.load offset=0x391 align=1 (i32.const 0))) + (local.set 0x392 (i64.load offset=0x392 align=1 (i32.const 0))) + (local.set 0x393 (i64.load offset=0x393 align=1 (i32.const 0))) + (local.set 0x394 (i64.load offset=0x394 align=1 (i32.const 0))) + (local.set 0x395 (i64.load offset=0x395 align=1 (i32.const 0))) + (local.set 0x396 (i64.load offset=0x396 align=1 (i32.const 0))) + (local.set 0x397 (i64.load offset=0x397 align=1 (i32.const 0))) + (local.set 0x398 (i64.load offset=0x398 align=1 (i32.const 0))) + (local.set 0x399 (i64.load offset=0x399 align=1 (i32.const 0))) + (local.set 0x39a (i64.load offset=0x39a align=1 (i32.const 0))) + (local.set 0x39b (i64.load offset=0x39b align=1 (i32.const 0))) + (local.set 0x39c (i64.load offset=0x39c align=1 (i32.const 0))) + (local.set 0x39d (i64.load offset=0x39d align=1 (i32.const 0))) + (local.set 0x39e (i64.load offset=0x39e align=1 (i32.const 0))) + (local.set 0x39f (i64.load offset=0x39f align=1 (i32.const 0))) + (local.set 0x3a0 (i64.load offset=0x3a0 align=1 (i32.const 0))) + (local.set 0x3a1 (i64.load offset=0x3a1 align=1 (i32.const 0))) + (local.set 0x3a2 (i64.load offset=0x3a2 align=1 (i32.const 0))) + (local.set 0x3a3 (i64.load offset=0x3a3 align=1 (i32.const 0))) + (local.set 0x3a4 (i64.load offset=0x3a4 align=1 (i32.const 0))) + (local.set 0x3a5 (i64.load offset=0x3a5 align=1 (i32.const 0))) + (local.set 0x3a6 (i64.load offset=0x3a6 align=1 (i32.const 0))) + (local.set 0x3a7 (i64.load offset=0x3a7 align=1 (i32.const 0))) + (local.set 0x3a8 (i64.load offset=0x3a8 align=1 (i32.const 0))) + (local.set 0x3a9 (i64.load offset=0x3a9 align=1 (i32.const 0))) + (local.set 0x3aa (i64.load offset=0x3aa align=1 (i32.const 0))) + (local.set 0x3ab (i64.load offset=0x3ab align=1 (i32.const 0))) + (local.set 0x3ac (i64.load offset=0x3ac align=1 (i32.const 0))) + (local.set 0x3ad (i64.load offset=0x3ad align=1 (i32.const 0))) + (local.set 0x3ae (i64.load offset=0x3ae align=1 (i32.const 0))) + (local.set 0x3af (i64.load offset=0x3af align=1 (i32.const 0))) + (local.set 0x3b0 (i64.load offset=0x3b0 align=1 (i32.const 0))) + (local.set 0x3b1 (i64.load offset=0x3b1 align=1 (i32.const 0))) + (local.set 0x3b2 (i64.load offset=0x3b2 align=1 (i32.const 0))) + (local.set 0x3b3 (i64.load offset=0x3b3 align=1 (i32.const 0))) + (local.set 0x3b4 (i64.load offset=0x3b4 align=1 (i32.const 0))) + (local.set 0x3b5 (i64.load offset=0x3b5 align=1 (i32.const 0))) + (local.set 0x3b6 (i64.load offset=0x3b6 align=1 (i32.const 0))) + (local.set 0x3b7 (i64.load offset=0x3b7 align=1 (i32.const 0))) + (local.set 0x3b8 (i64.load offset=0x3b8 align=1 (i32.const 0))) + (local.set 0x3b9 (i64.load offset=0x3b9 align=1 (i32.const 0))) + (local.set 0x3ba (i64.load offset=0x3ba align=1 (i32.const 0))) + (local.set 0x3bb (i64.load offset=0x3bb align=1 (i32.const 0))) + (local.set 0x3bc (i64.load offset=0x3bc align=1 (i32.const 0))) + (local.set 0x3bd (i64.load offset=0x3bd align=1 (i32.const 0))) + (local.set 0x3be (i64.load offset=0x3be align=1 (i32.const 0))) + (local.set 0x3bf (i64.load offset=0x3bf align=1 (i32.const 0))) + (local.set 0x3c0 (i64.load offset=0x3c0 align=1 (i32.const 0))) + (local.set 0x3c1 (i64.load offset=0x3c1 align=1 (i32.const 0))) + (local.set 0x3c2 (i64.load offset=0x3c2 align=1 (i32.const 0))) + (local.set 0x3c3 (i64.load offset=0x3c3 align=1 (i32.const 0))) + (local.set 0x3c4 (i64.load offset=0x3c4 align=1 (i32.const 0))) + (local.set 0x3c5 (i64.load offset=0x3c5 align=1 (i32.const 0))) + (local.set 0x3c6 (i64.load offset=0x3c6 align=1 (i32.const 0))) + (local.set 0x3c7 (i64.load offset=0x3c7 align=1 (i32.const 0))) + (local.set 0x3c8 (i64.load offset=0x3c8 align=1 (i32.const 0))) + (local.set 0x3c9 (i64.load offset=0x3c9 align=1 (i32.const 0))) + (local.set 0x3ca (i64.load offset=0x3ca align=1 (i32.const 0))) + (local.set 0x3cb (i64.load offset=0x3cb align=1 (i32.const 0))) + (local.set 0x3cc (i64.load offset=0x3cc align=1 (i32.const 0))) + (local.set 0x3cd (i64.load offset=0x3cd align=1 (i32.const 0))) + (local.set 0x3ce (i64.load offset=0x3ce align=1 (i32.const 0))) + (local.set 0x3cf (i64.load offset=0x3cf align=1 (i32.const 0))) + (local.set 0x3d0 (i64.load offset=0x3d0 align=1 (i32.const 0))) + (local.set 0x3d1 (i64.load offset=0x3d1 align=1 (i32.const 0))) + (local.set 0x3d2 (i64.load offset=0x3d2 align=1 (i32.const 0))) + (local.set 0x3d3 (i64.load offset=0x3d3 align=1 (i32.const 0))) + (local.set 0x3d4 (i64.load offset=0x3d4 align=1 (i32.const 0))) + (local.set 0x3d5 (i64.load offset=0x3d5 align=1 (i32.const 0))) + (local.set 0x3d6 (i64.load offset=0x3d6 align=1 (i32.const 0))) + (local.set 0x3d7 (i64.load offset=0x3d7 align=1 (i32.const 0))) + (local.set 0x3d8 (i64.load offset=0x3d8 align=1 (i32.const 0))) + (local.set 0x3d9 (i64.load offset=0x3d9 align=1 (i32.const 0))) + (local.set 0x3da (i64.load offset=0x3da align=1 (i32.const 0))) + (local.set 0x3db (i64.load offset=0x3db align=1 (i32.const 0))) + (local.set 0x3dc (i64.load offset=0x3dc align=1 (i32.const 0))) + (local.set 0x3dd (i64.load offset=0x3dd align=1 (i32.const 0))) + (local.set 0x3de (i64.load offset=0x3de align=1 (i32.const 0))) + (local.set 0x3df (i64.load offset=0x3df align=1 (i32.const 0))) + (local.set 0x3e0 (i64.load offset=0x3e0 align=1 (i32.const 0))) + (local.set 0x3e1 (i64.load offset=0x3e1 align=1 (i32.const 0))) + (local.set 0x3e2 (i64.load offset=0x3e2 align=1 (i32.const 0))) + (local.set 0x3e3 (i64.load offset=0x3e3 align=1 (i32.const 0))) + (local.set 0x3e4 (i64.load offset=0x3e4 align=1 (i32.const 0))) + (local.set 0x3e5 (i64.load offset=0x3e5 align=1 (i32.const 0))) + (local.set 0x3e6 (i64.load offset=0x3e6 align=1 (i32.const 0))) + (local.set 0x3e7 (i64.load offset=0x3e7 align=1 (i32.const 0))) + (local.set 0x3e8 (i64.load offset=0x3e8 align=1 (i32.const 0))) + (local.set 0x3e9 (i64.load offset=0x3e9 align=1 (i32.const 0))) + (local.set 0x3ea (i64.load offset=0x3ea align=1 (i32.const 0))) + (local.set 0x3eb (i64.load offset=0x3eb align=1 (i32.const 0))) + (local.set 0x3ec (i64.load offset=0x3ec align=1 (i32.const 0))) + (local.set 0x3ed (i64.load offset=0x3ed align=1 (i32.const 0))) + (local.set 0x3ee (i64.load offset=0x3ee align=1 (i32.const 0))) + (local.set 0x3ef (i64.load offset=0x3ef align=1 (i32.const 0))) + (local.set 0x3f0 (i64.load offset=0x3f0 align=1 (i32.const 0))) + (local.set 0x3f1 (i64.load offset=0x3f1 align=1 (i32.const 0))) + (local.set 0x3f2 (i64.load offset=0x3f2 align=1 (i32.const 0))) + (local.set 0x3f3 (i64.load offset=0x3f3 align=1 (i32.const 0))) + (local.set 0x3f4 (i64.load offset=0x3f4 align=1 (i32.const 0))) + (local.set 0x3f5 (i64.load offset=0x3f5 align=1 (i32.const 0))) + (local.set 0x3f6 (i64.load offset=0x3f6 align=1 (i32.const 0))) + (local.set 0x3f7 (i64.load offset=0x3f7 align=1 (i32.const 0))) + (local.set 0x3f8 (i64.load offset=0x3f8 align=1 (i32.const 0))) + (local.set 0x3f9 (i64.load offset=0x3f9 align=1 (i32.const 0))) + (local.set 0x3fa (i64.load offset=0x3fa align=1 (i32.const 0))) + (local.set 0x3fb (i64.load offset=0x3fb align=1 (i32.const 0))) + (local.set 0x3fc (i64.load offset=0x3fc align=1 (i32.const 0))) + (local.set 0x3fd (i64.load offset=0x3fd align=1 (i32.const 0))) + (local.set 0x3fe (i64.load offset=0x3fe align=1 (i32.const 0))) + (local.set 0x3ff (i64.load offset=0x3ff align=1 (i32.const 0))) + (local.set 0x400 (i64.load offset=0x400 align=1 (i32.const 0))) + (local.set 0x401 (i64.load offset=0x401 align=1 (i32.const 0))) + (local.set 0x402 (i64.load offset=0x402 align=1 (i32.const 0))) + (local.set 0x403 (i64.load offset=0x403 align=1 (i32.const 0))) + (local.set 0x404 (i64.load offset=0x404 align=1 (i32.const 0))) + (local.set 0x405 (i64.load offset=0x405 align=1 (i32.const 0))) + (local.set 0x406 (i64.load offset=0x406 align=1 (i32.const 0))) + (local.set 0x407 (i64.load offset=0x407 align=1 (i32.const 0))) + (local.set 0x408 (i64.load offset=0x408 align=1 (i32.const 0))) + (local.set 0x409 (i64.load offset=0x409 align=1 (i32.const 0))) + (local.set 0x40a (i64.load offset=0x40a align=1 (i32.const 0))) + (local.set 0x40b (i64.load offset=0x40b align=1 (i32.const 0))) + (local.set 0x40c (i64.load offset=0x40c align=1 (i32.const 0))) + (local.set 0x40d (i64.load offset=0x40d align=1 (i32.const 0))) + (local.set 0x40e (i64.load offset=0x40e align=1 (i32.const 0))) + (local.set 0x40f (i64.load offset=0x40f align=1 (i32.const 0))) + (local.set 0x410 (i64.load offset=0x410 align=1 (i32.const 0))) + (local.set 0x411 (i64.load offset=0x411 align=1 (i32.const 0))) + (local.set 0x412 (i64.load offset=0x412 align=1 (i32.const 0))) + (local.set 0x413 (i64.load offset=0x413 align=1 (i32.const 0))) + (local.set 0x414 (i64.load offset=0x414 align=1 (i32.const 0))) + (local.set 0x415 (i64.load offset=0x415 align=1 (i32.const 0))) + (local.set 0x416 (i64.load offset=0x416 align=1 (i32.const 0))) + (local.set 0x417 (i64.load offset=0x417 align=1 (i32.const 0))) + (local.set 0x418 (i64.load offset=0x418 align=1 (i32.const 0))) + (local.set 0x419 (i64.load offset=0x419 align=1 (i32.const 0))) + (local.set 0x41a (i64.load offset=0x41a align=1 (i32.const 0))) + (local.set 0x41b (i64.load offset=0x41b align=1 (i32.const 0))) + (local.set 0x41c (i64.load offset=0x41c align=1 (i32.const 0))) + (local.set 0x41d (i64.load offset=0x41d align=1 (i32.const 0))) + (local.set 0x41e (i64.load offset=0x41e align=1 (i32.const 0))) + (local.set 0x41f (i64.load offset=0x41f align=1 (i32.const 0))) + + ;; store the locals back to memory + (i64.store offset=0x000 align=1 (i32.const 0) (local.get 0x000)) + (i64.store offset=0x001 align=1 (i32.const 0) (local.get 0x001)) + (i64.store offset=0x002 align=1 (i32.const 0) (local.get 0x002)) + (i64.store offset=0x003 align=1 (i32.const 0) (local.get 0x003)) + (i64.store offset=0x004 align=1 (i32.const 0) (local.get 0x004)) + (i64.store offset=0x005 align=1 (i32.const 0) (local.get 0x005)) + (i64.store offset=0x006 align=1 (i32.const 0) (local.get 0x006)) + (i64.store offset=0x007 align=1 (i32.const 0) (local.get 0x007)) + (i64.store offset=0x008 align=1 (i32.const 0) (local.get 0x008)) + (i64.store offset=0x009 align=1 (i32.const 0) (local.get 0x009)) + (i64.store offset=0x00a align=1 (i32.const 0) (local.get 0x00a)) + (i64.store offset=0x00b align=1 (i32.const 0) (local.get 0x00b)) + (i64.store offset=0x00c align=1 (i32.const 0) (local.get 0x00c)) + (i64.store offset=0x00d align=1 (i32.const 0) (local.get 0x00d)) + (i64.store offset=0x00e align=1 (i32.const 0) (local.get 0x00e)) + (i64.store offset=0x00f align=1 (i32.const 0) (local.get 0x00f)) + (i64.store offset=0x010 align=1 (i32.const 0) (local.get 0x010)) + (i64.store offset=0x011 align=1 (i32.const 0) (local.get 0x011)) + (i64.store offset=0x012 align=1 (i32.const 0) (local.get 0x012)) + (i64.store offset=0x013 align=1 (i32.const 0) (local.get 0x013)) + (i64.store offset=0x014 align=1 (i32.const 0) (local.get 0x014)) + (i64.store offset=0x015 align=1 (i32.const 0) (local.get 0x015)) + (i64.store offset=0x016 align=1 (i32.const 0) (local.get 0x016)) + (i64.store offset=0x017 align=1 (i32.const 0) (local.get 0x017)) + (i64.store offset=0x018 align=1 (i32.const 0) (local.get 0x018)) + (i64.store offset=0x019 align=1 (i32.const 0) (local.get 0x019)) + (i64.store offset=0x01a align=1 (i32.const 0) (local.get 0x01a)) + (i64.store offset=0x01b align=1 (i32.const 0) (local.get 0x01b)) + (i64.store offset=0x01c align=1 (i32.const 0) (local.get 0x01c)) + (i64.store offset=0x01d align=1 (i32.const 0) (local.get 0x01d)) + (i64.store offset=0x01e align=1 (i32.const 0) (local.get 0x01e)) + (i64.store offset=0x01f align=1 (i32.const 0) (local.get 0x01f)) + (i64.store offset=0x020 align=1 (i32.const 0) (local.get 0x020)) + (i64.store offset=0x021 align=1 (i32.const 0) (local.get 0x021)) + (i64.store offset=0x022 align=1 (i32.const 0) (local.get 0x022)) + (i64.store offset=0x023 align=1 (i32.const 0) (local.get 0x023)) + (i64.store offset=0x024 align=1 (i32.const 0) (local.get 0x024)) + (i64.store offset=0x025 align=1 (i32.const 0) (local.get 0x025)) + (i64.store offset=0x026 align=1 (i32.const 0) (local.get 0x026)) + (i64.store offset=0x027 align=1 (i32.const 0) (local.get 0x027)) + (i64.store offset=0x028 align=1 (i32.const 0) (local.get 0x028)) + (i64.store offset=0x029 align=1 (i32.const 0) (local.get 0x029)) + (i64.store offset=0x02a align=1 (i32.const 0) (local.get 0x02a)) + (i64.store offset=0x02b align=1 (i32.const 0) (local.get 0x02b)) + (i64.store offset=0x02c align=1 (i32.const 0) (local.get 0x02c)) + (i64.store offset=0x02d align=1 (i32.const 0) (local.get 0x02d)) + (i64.store offset=0x02e align=1 (i32.const 0) (local.get 0x02e)) + (i64.store offset=0x02f align=1 (i32.const 0) (local.get 0x02f)) + (i64.store offset=0x030 align=1 (i32.const 0) (local.get 0x030)) + (i64.store offset=0x031 align=1 (i32.const 0) (local.get 0x031)) + (i64.store offset=0x032 align=1 (i32.const 0) (local.get 0x032)) + (i64.store offset=0x033 align=1 (i32.const 0) (local.get 0x033)) + (i64.store offset=0x034 align=1 (i32.const 0) (local.get 0x034)) + (i64.store offset=0x035 align=1 (i32.const 0) (local.get 0x035)) + (i64.store offset=0x036 align=1 (i32.const 0) (local.get 0x036)) + (i64.store offset=0x037 align=1 (i32.const 0) (local.get 0x037)) + (i64.store offset=0x038 align=1 (i32.const 0) (local.get 0x038)) + (i64.store offset=0x039 align=1 (i32.const 0) (local.get 0x039)) + (i64.store offset=0x03a align=1 (i32.const 0) (local.get 0x03a)) + (i64.store offset=0x03b align=1 (i32.const 0) (local.get 0x03b)) + (i64.store offset=0x03c align=1 (i32.const 0) (local.get 0x03c)) + (i64.store offset=0x03d align=1 (i32.const 0) (local.get 0x03d)) + (i64.store offset=0x03e align=1 (i32.const 0) (local.get 0x03e)) + (i64.store offset=0x03f align=1 (i32.const 0) (local.get 0x03f)) + (i64.store offset=0x040 align=1 (i32.const 0) (local.get 0x040)) + (i64.store offset=0x041 align=1 (i32.const 0) (local.get 0x041)) + (i64.store offset=0x042 align=1 (i32.const 0) (local.get 0x042)) + (i64.store offset=0x043 align=1 (i32.const 0) (local.get 0x043)) + (i64.store offset=0x044 align=1 (i32.const 0) (local.get 0x044)) + (i64.store offset=0x045 align=1 (i32.const 0) (local.get 0x045)) + (i64.store offset=0x046 align=1 (i32.const 0) (local.get 0x046)) + (i64.store offset=0x047 align=1 (i32.const 0) (local.get 0x047)) + (i64.store offset=0x048 align=1 (i32.const 0) (local.get 0x048)) + (i64.store offset=0x049 align=1 (i32.const 0) (local.get 0x049)) + (i64.store offset=0x04a align=1 (i32.const 0) (local.get 0x04a)) + (i64.store offset=0x04b align=1 (i32.const 0) (local.get 0x04b)) + (i64.store offset=0x04c align=1 (i32.const 0) (local.get 0x04c)) + (i64.store offset=0x04d align=1 (i32.const 0) (local.get 0x04d)) + (i64.store offset=0x04e align=1 (i32.const 0) (local.get 0x04e)) + (i64.store offset=0x04f align=1 (i32.const 0) (local.get 0x04f)) + (i64.store offset=0x050 align=1 (i32.const 0) (local.get 0x050)) + (i64.store offset=0x051 align=1 (i32.const 0) (local.get 0x051)) + (i64.store offset=0x052 align=1 (i32.const 0) (local.get 0x052)) + (i64.store offset=0x053 align=1 (i32.const 0) (local.get 0x053)) + (i64.store offset=0x054 align=1 (i32.const 0) (local.get 0x054)) + (i64.store offset=0x055 align=1 (i32.const 0) (local.get 0x055)) + (i64.store offset=0x056 align=1 (i32.const 0) (local.get 0x056)) + (i64.store offset=0x057 align=1 (i32.const 0) (local.get 0x057)) + (i64.store offset=0x058 align=1 (i32.const 0) (local.get 0x058)) + (i64.store offset=0x059 align=1 (i32.const 0) (local.get 0x059)) + (i64.store offset=0x05a align=1 (i32.const 0) (local.get 0x05a)) + (i64.store offset=0x05b align=1 (i32.const 0) (local.get 0x05b)) + (i64.store offset=0x05c align=1 (i32.const 0) (local.get 0x05c)) + (i64.store offset=0x05d align=1 (i32.const 0) (local.get 0x05d)) + (i64.store offset=0x05e align=1 (i32.const 0) (local.get 0x05e)) + (i64.store offset=0x05f align=1 (i32.const 0) (local.get 0x05f)) + (i64.store offset=0x060 align=1 (i32.const 0) (local.get 0x060)) + (i64.store offset=0x061 align=1 (i32.const 0) (local.get 0x061)) + (i64.store offset=0x062 align=1 (i32.const 0) (local.get 0x062)) + (i64.store offset=0x063 align=1 (i32.const 0) (local.get 0x063)) + (i64.store offset=0x064 align=1 (i32.const 0) (local.get 0x064)) + (i64.store offset=0x065 align=1 (i32.const 0) (local.get 0x065)) + (i64.store offset=0x066 align=1 (i32.const 0) (local.get 0x066)) + (i64.store offset=0x067 align=1 (i32.const 0) (local.get 0x067)) + (i64.store offset=0x068 align=1 (i32.const 0) (local.get 0x068)) + (i64.store offset=0x069 align=1 (i32.const 0) (local.get 0x069)) + (i64.store offset=0x06a align=1 (i32.const 0) (local.get 0x06a)) + (i64.store offset=0x06b align=1 (i32.const 0) (local.get 0x06b)) + (i64.store offset=0x06c align=1 (i32.const 0) (local.get 0x06c)) + (i64.store offset=0x06d align=1 (i32.const 0) (local.get 0x06d)) + (i64.store offset=0x06e align=1 (i32.const 0) (local.get 0x06e)) + (i64.store offset=0x06f align=1 (i32.const 0) (local.get 0x06f)) + (i64.store offset=0x070 align=1 (i32.const 0) (local.get 0x070)) + (i64.store offset=0x071 align=1 (i32.const 0) (local.get 0x071)) + (i64.store offset=0x072 align=1 (i32.const 0) (local.get 0x072)) + (i64.store offset=0x073 align=1 (i32.const 0) (local.get 0x073)) + (i64.store offset=0x074 align=1 (i32.const 0) (local.get 0x074)) + (i64.store offset=0x075 align=1 (i32.const 0) (local.get 0x075)) + (i64.store offset=0x076 align=1 (i32.const 0) (local.get 0x076)) + (i64.store offset=0x077 align=1 (i32.const 0) (local.get 0x077)) + (i64.store offset=0x078 align=1 (i32.const 0) (local.get 0x078)) + (i64.store offset=0x079 align=1 (i32.const 0) (local.get 0x079)) + (i64.store offset=0x07a align=1 (i32.const 0) (local.get 0x07a)) + (i64.store offset=0x07b align=1 (i32.const 0) (local.get 0x07b)) + (i64.store offset=0x07c align=1 (i32.const 0) (local.get 0x07c)) + (i64.store offset=0x07d align=1 (i32.const 0) (local.get 0x07d)) + (i64.store offset=0x07e align=1 (i32.const 0) (local.get 0x07e)) + (i64.store offset=0x07f align=1 (i32.const 0) (local.get 0x07f)) + (i64.store offset=0x080 align=1 (i32.const 0) (local.get 0x080)) + (i64.store offset=0x081 align=1 (i32.const 0) (local.get 0x081)) + (i64.store offset=0x082 align=1 (i32.const 0) (local.get 0x082)) + (i64.store offset=0x083 align=1 (i32.const 0) (local.get 0x083)) + (i64.store offset=0x084 align=1 (i32.const 0) (local.get 0x084)) + (i64.store offset=0x085 align=1 (i32.const 0) (local.get 0x085)) + (i64.store offset=0x086 align=1 (i32.const 0) (local.get 0x086)) + (i64.store offset=0x087 align=1 (i32.const 0) (local.get 0x087)) + (i64.store offset=0x088 align=1 (i32.const 0) (local.get 0x088)) + (i64.store offset=0x089 align=1 (i32.const 0) (local.get 0x089)) + (i64.store offset=0x08a align=1 (i32.const 0) (local.get 0x08a)) + (i64.store offset=0x08b align=1 (i32.const 0) (local.get 0x08b)) + (i64.store offset=0x08c align=1 (i32.const 0) (local.get 0x08c)) + (i64.store offset=0x08d align=1 (i32.const 0) (local.get 0x08d)) + (i64.store offset=0x08e align=1 (i32.const 0) (local.get 0x08e)) + (i64.store offset=0x08f align=1 (i32.const 0) (local.get 0x08f)) + (i64.store offset=0x090 align=1 (i32.const 0) (local.get 0x090)) + (i64.store offset=0x091 align=1 (i32.const 0) (local.get 0x091)) + (i64.store offset=0x092 align=1 (i32.const 0) (local.get 0x092)) + (i64.store offset=0x093 align=1 (i32.const 0) (local.get 0x093)) + (i64.store offset=0x094 align=1 (i32.const 0) (local.get 0x094)) + (i64.store offset=0x095 align=1 (i32.const 0) (local.get 0x095)) + (i64.store offset=0x096 align=1 (i32.const 0) (local.get 0x096)) + (i64.store offset=0x097 align=1 (i32.const 0) (local.get 0x097)) + (i64.store offset=0x098 align=1 (i32.const 0) (local.get 0x098)) + (i64.store offset=0x099 align=1 (i32.const 0) (local.get 0x099)) + (i64.store offset=0x09a align=1 (i32.const 0) (local.get 0x09a)) + (i64.store offset=0x09b align=1 (i32.const 0) (local.get 0x09b)) + (i64.store offset=0x09c align=1 (i32.const 0) (local.get 0x09c)) + (i64.store offset=0x09d align=1 (i32.const 0) (local.get 0x09d)) + (i64.store offset=0x09e align=1 (i32.const 0) (local.get 0x09e)) + (i64.store offset=0x09f align=1 (i32.const 0) (local.get 0x09f)) + (i64.store offset=0x0a0 align=1 (i32.const 0) (local.get 0x0a0)) + (i64.store offset=0x0a1 align=1 (i32.const 0) (local.get 0x0a1)) + (i64.store offset=0x0a2 align=1 (i32.const 0) (local.get 0x0a2)) + (i64.store offset=0x0a3 align=1 (i32.const 0) (local.get 0x0a3)) + (i64.store offset=0x0a4 align=1 (i32.const 0) (local.get 0x0a4)) + (i64.store offset=0x0a5 align=1 (i32.const 0) (local.get 0x0a5)) + (i64.store offset=0x0a6 align=1 (i32.const 0) (local.get 0x0a6)) + (i64.store offset=0x0a7 align=1 (i32.const 0) (local.get 0x0a7)) + (i64.store offset=0x0a8 align=1 (i32.const 0) (local.get 0x0a8)) + (i64.store offset=0x0a9 align=1 (i32.const 0) (local.get 0x0a9)) + (i64.store offset=0x0aa align=1 (i32.const 0) (local.get 0x0aa)) + (i64.store offset=0x0ab align=1 (i32.const 0) (local.get 0x0ab)) + (i64.store offset=0x0ac align=1 (i32.const 0) (local.get 0x0ac)) + (i64.store offset=0x0ad align=1 (i32.const 0) (local.get 0x0ad)) + (i64.store offset=0x0ae align=1 (i32.const 0) (local.get 0x0ae)) + (i64.store offset=0x0af align=1 (i32.const 0) (local.get 0x0af)) + (i64.store offset=0x0b0 align=1 (i32.const 0) (local.get 0x0b0)) + (i64.store offset=0x0b1 align=1 (i32.const 0) (local.get 0x0b1)) + (i64.store offset=0x0b2 align=1 (i32.const 0) (local.get 0x0b2)) + (i64.store offset=0x0b3 align=1 (i32.const 0) (local.get 0x0b3)) + (i64.store offset=0x0b4 align=1 (i32.const 0) (local.get 0x0b4)) + (i64.store offset=0x0b5 align=1 (i32.const 0) (local.get 0x0b5)) + (i64.store offset=0x0b6 align=1 (i32.const 0) (local.get 0x0b6)) + (i64.store offset=0x0b7 align=1 (i32.const 0) (local.get 0x0b7)) + (i64.store offset=0x0b8 align=1 (i32.const 0) (local.get 0x0b8)) + (i64.store offset=0x0b9 align=1 (i32.const 0) (local.get 0x0b9)) + (i64.store offset=0x0ba align=1 (i32.const 0) (local.get 0x0ba)) + (i64.store offset=0x0bb align=1 (i32.const 0) (local.get 0x0bb)) + (i64.store offset=0x0bc align=1 (i32.const 0) (local.get 0x0bc)) + (i64.store offset=0x0bd align=1 (i32.const 0) (local.get 0x0bd)) + (i64.store offset=0x0be align=1 (i32.const 0) (local.get 0x0be)) + (i64.store offset=0x0bf align=1 (i32.const 0) (local.get 0x0bf)) + (i64.store offset=0x0c0 align=1 (i32.const 0) (local.get 0x0c0)) + (i64.store offset=0x0c1 align=1 (i32.const 0) (local.get 0x0c1)) + (i64.store offset=0x0c2 align=1 (i32.const 0) (local.get 0x0c2)) + (i64.store offset=0x0c3 align=1 (i32.const 0) (local.get 0x0c3)) + (i64.store offset=0x0c4 align=1 (i32.const 0) (local.get 0x0c4)) + (i64.store offset=0x0c5 align=1 (i32.const 0) (local.get 0x0c5)) + (i64.store offset=0x0c6 align=1 (i32.const 0) (local.get 0x0c6)) + (i64.store offset=0x0c7 align=1 (i32.const 0) (local.get 0x0c7)) + (i64.store offset=0x0c8 align=1 (i32.const 0) (local.get 0x0c8)) + (i64.store offset=0x0c9 align=1 (i32.const 0) (local.get 0x0c9)) + (i64.store offset=0x0ca align=1 (i32.const 0) (local.get 0x0ca)) + (i64.store offset=0x0cb align=1 (i32.const 0) (local.get 0x0cb)) + (i64.store offset=0x0cc align=1 (i32.const 0) (local.get 0x0cc)) + (i64.store offset=0x0cd align=1 (i32.const 0) (local.get 0x0cd)) + (i64.store offset=0x0ce align=1 (i32.const 0) (local.get 0x0ce)) + (i64.store offset=0x0cf align=1 (i32.const 0) (local.get 0x0cf)) + (i64.store offset=0x0d0 align=1 (i32.const 0) (local.get 0x0d0)) + (i64.store offset=0x0d1 align=1 (i32.const 0) (local.get 0x0d1)) + (i64.store offset=0x0d2 align=1 (i32.const 0) (local.get 0x0d2)) + (i64.store offset=0x0d3 align=1 (i32.const 0) (local.get 0x0d3)) + (i64.store offset=0x0d4 align=1 (i32.const 0) (local.get 0x0d4)) + (i64.store offset=0x0d5 align=1 (i32.const 0) (local.get 0x0d5)) + (i64.store offset=0x0d6 align=1 (i32.const 0) (local.get 0x0d6)) + (i64.store offset=0x0d7 align=1 (i32.const 0) (local.get 0x0d7)) + (i64.store offset=0x0d8 align=1 (i32.const 0) (local.get 0x0d8)) + (i64.store offset=0x0d9 align=1 (i32.const 0) (local.get 0x0d9)) + (i64.store offset=0x0da align=1 (i32.const 0) (local.get 0x0da)) + (i64.store offset=0x0db align=1 (i32.const 0) (local.get 0x0db)) + (i64.store offset=0x0dc align=1 (i32.const 0) (local.get 0x0dc)) + (i64.store offset=0x0dd align=1 (i32.const 0) (local.get 0x0dd)) + (i64.store offset=0x0de align=1 (i32.const 0) (local.get 0x0de)) + (i64.store offset=0x0df align=1 (i32.const 0) (local.get 0x0df)) + (i64.store offset=0x0e0 align=1 (i32.const 0) (local.get 0x0e0)) + (i64.store offset=0x0e1 align=1 (i32.const 0) (local.get 0x0e1)) + (i64.store offset=0x0e2 align=1 (i32.const 0) (local.get 0x0e2)) + (i64.store offset=0x0e3 align=1 (i32.const 0) (local.get 0x0e3)) + (i64.store offset=0x0e4 align=1 (i32.const 0) (local.get 0x0e4)) + (i64.store offset=0x0e5 align=1 (i32.const 0) (local.get 0x0e5)) + (i64.store offset=0x0e6 align=1 (i32.const 0) (local.get 0x0e6)) + (i64.store offset=0x0e7 align=1 (i32.const 0) (local.get 0x0e7)) + (i64.store offset=0x0e8 align=1 (i32.const 0) (local.get 0x0e8)) + (i64.store offset=0x0e9 align=1 (i32.const 0) (local.get 0x0e9)) + (i64.store offset=0x0ea align=1 (i32.const 0) (local.get 0x0ea)) + (i64.store offset=0x0eb align=1 (i32.const 0) (local.get 0x0eb)) + (i64.store offset=0x0ec align=1 (i32.const 0) (local.get 0x0ec)) + (i64.store offset=0x0ed align=1 (i32.const 0) (local.get 0x0ed)) + (i64.store offset=0x0ee align=1 (i32.const 0) (local.get 0x0ee)) + (i64.store offset=0x0ef align=1 (i32.const 0) (local.get 0x0ef)) + (i64.store offset=0x0f0 align=1 (i32.const 0) (local.get 0x0f0)) + (i64.store offset=0x0f1 align=1 (i32.const 0) (local.get 0x0f1)) + (i64.store offset=0x0f2 align=1 (i32.const 0) (local.get 0x0f2)) + (i64.store offset=0x0f3 align=1 (i32.const 0) (local.get 0x0f3)) + (i64.store offset=0x0f4 align=1 (i32.const 0) (local.get 0x0f4)) + (i64.store offset=0x0f5 align=1 (i32.const 0) (local.get 0x0f5)) + (i64.store offset=0x0f6 align=1 (i32.const 0) (local.get 0x0f6)) + (i64.store offset=0x0f7 align=1 (i32.const 0) (local.get 0x0f7)) + (i64.store offset=0x0f8 align=1 (i32.const 0) (local.get 0x0f8)) + (i64.store offset=0x0f9 align=1 (i32.const 0) (local.get 0x0f9)) + (i64.store offset=0x0fa align=1 (i32.const 0) (local.get 0x0fa)) + (i64.store offset=0x0fb align=1 (i32.const 0) (local.get 0x0fb)) + (i64.store offset=0x0fc align=1 (i32.const 0) (local.get 0x0fc)) + (i64.store offset=0x0fd align=1 (i32.const 0) (local.get 0x0fd)) + (i64.store offset=0x0fe align=1 (i32.const 0) (local.get 0x0fe)) + (i64.store offset=0x0ff align=1 (i32.const 0) (local.get 0x0ff)) + (i64.store offset=0x100 align=1 (i32.const 0) (local.get 0x100)) + (i64.store offset=0x101 align=1 (i32.const 0) (local.get 0x101)) + (i64.store offset=0x102 align=1 (i32.const 0) (local.get 0x102)) + (i64.store offset=0x103 align=1 (i32.const 0) (local.get 0x103)) + (i64.store offset=0x104 align=1 (i32.const 0) (local.get 0x104)) + (i64.store offset=0x105 align=1 (i32.const 0) (local.get 0x105)) + (i64.store offset=0x106 align=1 (i32.const 0) (local.get 0x106)) + (i64.store offset=0x107 align=1 (i32.const 0) (local.get 0x107)) + (i64.store offset=0x108 align=1 (i32.const 0) (local.get 0x108)) + (i64.store offset=0x109 align=1 (i32.const 0) (local.get 0x109)) + (i64.store offset=0x10a align=1 (i32.const 0) (local.get 0x10a)) + (i64.store offset=0x10b align=1 (i32.const 0) (local.get 0x10b)) + (i64.store offset=0x10c align=1 (i32.const 0) (local.get 0x10c)) + (i64.store offset=0x10d align=1 (i32.const 0) (local.get 0x10d)) + (i64.store offset=0x10e align=1 (i32.const 0) (local.get 0x10e)) + (i64.store offset=0x10f align=1 (i32.const 0) (local.get 0x10f)) + (i64.store offset=0x110 align=1 (i32.const 0) (local.get 0x110)) + (i64.store offset=0x111 align=1 (i32.const 0) (local.get 0x111)) + (i64.store offset=0x112 align=1 (i32.const 0) (local.get 0x112)) + (i64.store offset=0x113 align=1 (i32.const 0) (local.get 0x113)) + (i64.store offset=0x114 align=1 (i32.const 0) (local.get 0x114)) + (i64.store offset=0x115 align=1 (i32.const 0) (local.get 0x115)) + (i64.store offset=0x116 align=1 (i32.const 0) (local.get 0x116)) + (i64.store offset=0x117 align=1 (i32.const 0) (local.get 0x117)) + (i64.store offset=0x118 align=1 (i32.const 0) (local.get 0x118)) + (i64.store offset=0x119 align=1 (i32.const 0) (local.get 0x119)) + (i64.store offset=0x11a align=1 (i32.const 0) (local.get 0x11a)) + (i64.store offset=0x11b align=1 (i32.const 0) (local.get 0x11b)) + (i64.store offset=0x11c align=1 (i32.const 0) (local.get 0x11c)) + (i64.store offset=0x11d align=1 (i32.const 0) (local.get 0x11d)) + (i64.store offset=0x11e align=1 (i32.const 0) (local.get 0x11e)) + (i64.store offset=0x11f align=1 (i32.const 0) (local.get 0x11f)) + (i64.store offset=0x120 align=1 (i32.const 0) (local.get 0x120)) + (i64.store offset=0x121 align=1 (i32.const 0) (local.get 0x121)) + (i64.store offset=0x122 align=1 (i32.const 0) (local.get 0x122)) + (i64.store offset=0x123 align=1 (i32.const 0) (local.get 0x123)) + (i64.store offset=0x124 align=1 (i32.const 0) (local.get 0x124)) + (i64.store offset=0x125 align=1 (i32.const 0) (local.get 0x125)) + (i64.store offset=0x126 align=1 (i32.const 0) (local.get 0x126)) + (i64.store offset=0x127 align=1 (i32.const 0) (local.get 0x127)) + (i64.store offset=0x128 align=1 (i32.const 0) (local.get 0x128)) + (i64.store offset=0x129 align=1 (i32.const 0) (local.get 0x129)) + (i64.store offset=0x12a align=1 (i32.const 0) (local.get 0x12a)) + (i64.store offset=0x12b align=1 (i32.const 0) (local.get 0x12b)) + (i64.store offset=0x12c align=1 (i32.const 0) (local.get 0x12c)) + (i64.store offset=0x12d align=1 (i32.const 0) (local.get 0x12d)) + (i64.store offset=0x12e align=1 (i32.const 0) (local.get 0x12e)) + (i64.store offset=0x12f align=1 (i32.const 0) (local.get 0x12f)) + (i64.store offset=0x130 align=1 (i32.const 0) (local.get 0x130)) + (i64.store offset=0x131 align=1 (i32.const 0) (local.get 0x131)) + (i64.store offset=0x132 align=1 (i32.const 0) (local.get 0x132)) + (i64.store offset=0x133 align=1 (i32.const 0) (local.get 0x133)) + (i64.store offset=0x134 align=1 (i32.const 0) (local.get 0x134)) + (i64.store offset=0x135 align=1 (i32.const 0) (local.get 0x135)) + (i64.store offset=0x136 align=1 (i32.const 0) (local.get 0x136)) + (i64.store offset=0x137 align=1 (i32.const 0) (local.get 0x137)) + (i64.store offset=0x138 align=1 (i32.const 0) (local.get 0x138)) + (i64.store offset=0x139 align=1 (i32.const 0) (local.get 0x139)) + (i64.store offset=0x13a align=1 (i32.const 0) (local.get 0x13a)) + (i64.store offset=0x13b align=1 (i32.const 0) (local.get 0x13b)) + (i64.store offset=0x13c align=1 (i32.const 0) (local.get 0x13c)) + (i64.store offset=0x13d align=1 (i32.const 0) (local.get 0x13d)) + (i64.store offset=0x13e align=1 (i32.const 0) (local.get 0x13e)) + (i64.store offset=0x13f align=1 (i32.const 0) (local.get 0x13f)) + (i64.store offset=0x140 align=1 (i32.const 0) (local.get 0x140)) + (i64.store offset=0x141 align=1 (i32.const 0) (local.get 0x141)) + (i64.store offset=0x142 align=1 (i32.const 0) (local.get 0x142)) + (i64.store offset=0x143 align=1 (i32.const 0) (local.get 0x143)) + (i64.store offset=0x144 align=1 (i32.const 0) (local.get 0x144)) + (i64.store offset=0x145 align=1 (i32.const 0) (local.get 0x145)) + (i64.store offset=0x146 align=1 (i32.const 0) (local.get 0x146)) + (i64.store offset=0x147 align=1 (i32.const 0) (local.get 0x147)) + (i64.store offset=0x148 align=1 (i32.const 0) (local.get 0x148)) + (i64.store offset=0x149 align=1 (i32.const 0) (local.get 0x149)) + (i64.store offset=0x14a align=1 (i32.const 0) (local.get 0x14a)) + (i64.store offset=0x14b align=1 (i32.const 0) (local.get 0x14b)) + (i64.store offset=0x14c align=1 (i32.const 0) (local.get 0x14c)) + (i64.store offset=0x14d align=1 (i32.const 0) (local.get 0x14d)) + (i64.store offset=0x14e align=1 (i32.const 0) (local.get 0x14e)) + (i64.store offset=0x14f align=1 (i32.const 0) (local.get 0x14f)) + (i64.store offset=0x150 align=1 (i32.const 0) (local.get 0x150)) + (i64.store offset=0x151 align=1 (i32.const 0) (local.get 0x151)) + (i64.store offset=0x152 align=1 (i32.const 0) (local.get 0x152)) + (i64.store offset=0x153 align=1 (i32.const 0) (local.get 0x153)) + (i64.store offset=0x154 align=1 (i32.const 0) (local.get 0x154)) + (i64.store offset=0x155 align=1 (i32.const 0) (local.get 0x155)) + (i64.store offset=0x156 align=1 (i32.const 0) (local.get 0x156)) + (i64.store offset=0x157 align=1 (i32.const 0) (local.get 0x157)) + (i64.store offset=0x158 align=1 (i32.const 0) (local.get 0x158)) + (i64.store offset=0x159 align=1 (i32.const 0) (local.get 0x159)) + (i64.store offset=0x15a align=1 (i32.const 0) (local.get 0x15a)) + (i64.store offset=0x15b align=1 (i32.const 0) (local.get 0x15b)) + (i64.store offset=0x15c align=1 (i32.const 0) (local.get 0x15c)) + (i64.store offset=0x15d align=1 (i32.const 0) (local.get 0x15d)) + (i64.store offset=0x15e align=1 (i32.const 0) (local.get 0x15e)) + (i64.store offset=0x15f align=1 (i32.const 0) (local.get 0x15f)) + (i64.store offset=0x160 align=1 (i32.const 0) (local.get 0x160)) + (i64.store offset=0x161 align=1 (i32.const 0) (local.get 0x161)) + (i64.store offset=0x162 align=1 (i32.const 0) (local.get 0x162)) + (i64.store offset=0x163 align=1 (i32.const 0) (local.get 0x163)) + (i64.store offset=0x164 align=1 (i32.const 0) (local.get 0x164)) + (i64.store offset=0x165 align=1 (i32.const 0) (local.get 0x165)) + (i64.store offset=0x166 align=1 (i32.const 0) (local.get 0x166)) + (i64.store offset=0x167 align=1 (i32.const 0) (local.get 0x167)) + (i64.store offset=0x168 align=1 (i32.const 0) (local.get 0x168)) + (i64.store offset=0x169 align=1 (i32.const 0) (local.get 0x169)) + (i64.store offset=0x16a align=1 (i32.const 0) (local.get 0x16a)) + (i64.store offset=0x16b align=1 (i32.const 0) (local.get 0x16b)) + (i64.store offset=0x16c align=1 (i32.const 0) (local.get 0x16c)) + (i64.store offset=0x16d align=1 (i32.const 0) (local.get 0x16d)) + (i64.store offset=0x16e align=1 (i32.const 0) (local.get 0x16e)) + (i64.store offset=0x16f align=1 (i32.const 0) (local.get 0x16f)) + (i64.store offset=0x170 align=1 (i32.const 0) (local.get 0x170)) + (i64.store offset=0x171 align=1 (i32.const 0) (local.get 0x171)) + (i64.store offset=0x172 align=1 (i32.const 0) (local.get 0x172)) + (i64.store offset=0x173 align=1 (i32.const 0) (local.get 0x173)) + (i64.store offset=0x174 align=1 (i32.const 0) (local.get 0x174)) + (i64.store offset=0x175 align=1 (i32.const 0) (local.get 0x175)) + (i64.store offset=0x176 align=1 (i32.const 0) (local.get 0x176)) + (i64.store offset=0x177 align=1 (i32.const 0) (local.get 0x177)) + (i64.store offset=0x178 align=1 (i32.const 0) (local.get 0x178)) + (i64.store offset=0x179 align=1 (i32.const 0) (local.get 0x179)) + (i64.store offset=0x17a align=1 (i32.const 0) (local.get 0x17a)) + (i64.store offset=0x17b align=1 (i32.const 0) (local.get 0x17b)) + (i64.store offset=0x17c align=1 (i32.const 0) (local.get 0x17c)) + (i64.store offset=0x17d align=1 (i32.const 0) (local.get 0x17d)) + (i64.store offset=0x17e align=1 (i32.const 0) (local.get 0x17e)) + (i64.store offset=0x17f align=1 (i32.const 0) (local.get 0x17f)) + (i64.store offset=0x180 align=1 (i32.const 0) (local.get 0x180)) + (i64.store offset=0x181 align=1 (i32.const 0) (local.get 0x181)) + (i64.store offset=0x182 align=1 (i32.const 0) (local.get 0x182)) + (i64.store offset=0x183 align=1 (i32.const 0) (local.get 0x183)) + (i64.store offset=0x184 align=1 (i32.const 0) (local.get 0x184)) + (i64.store offset=0x185 align=1 (i32.const 0) (local.get 0x185)) + (i64.store offset=0x186 align=1 (i32.const 0) (local.get 0x186)) + (i64.store offset=0x187 align=1 (i32.const 0) (local.get 0x187)) + (i64.store offset=0x188 align=1 (i32.const 0) (local.get 0x188)) + (i64.store offset=0x189 align=1 (i32.const 0) (local.get 0x189)) + (i64.store offset=0x18a align=1 (i32.const 0) (local.get 0x18a)) + (i64.store offset=0x18b align=1 (i32.const 0) (local.get 0x18b)) + (i64.store offset=0x18c align=1 (i32.const 0) (local.get 0x18c)) + (i64.store offset=0x18d align=1 (i32.const 0) (local.get 0x18d)) + (i64.store offset=0x18e align=1 (i32.const 0) (local.get 0x18e)) + (i64.store offset=0x18f align=1 (i32.const 0) (local.get 0x18f)) + (i64.store offset=0x190 align=1 (i32.const 0) (local.get 0x190)) + (i64.store offset=0x191 align=1 (i32.const 0) (local.get 0x191)) + (i64.store offset=0x192 align=1 (i32.const 0) (local.get 0x192)) + (i64.store offset=0x193 align=1 (i32.const 0) (local.get 0x193)) + (i64.store offset=0x194 align=1 (i32.const 0) (local.get 0x194)) + (i64.store offset=0x195 align=1 (i32.const 0) (local.get 0x195)) + (i64.store offset=0x196 align=1 (i32.const 0) (local.get 0x196)) + (i64.store offset=0x197 align=1 (i32.const 0) (local.get 0x197)) + (i64.store offset=0x198 align=1 (i32.const 0) (local.get 0x198)) + (i64.store offset=0x199 align=1 (i32.const 0) (local.get 0x199)) + (i64.store offset=0x19a align=1 (i32.const 0) (local.get 0x19a)) + (i64.store offset=0x19b align=1 (i32.const 0) (local.get 0x19b)) + (i64.store offset=0x19c align=1 (i32.const 0) (local.get 0x19c)) + (i64.store offset=0x19d align=1 (i32.const 0) (local.get 0x19d)) + (i64.store offset=0x19e align=1 (i32.const 0) (local.get 0x19e)) + (i64.store offset=0x19f align=1 (i32.const 0) (local.get 0x19f)) + (i64.store offset=0x1a0 align=1 (i32.const 0) (local.get 0x1a0)) + (i64.store offset=0x1a1 align=1 (i32.const 0) (local.get 0x1a1)) + (i64.store offset=0x1a2 align=1 (i32.const 0) (local.get 0x1a2)) + (i64.store offset=0x1a3 align=1 (i32.const 0) (local.get 0x1a3)) + (i64.store offset=0x1a4 align=1 (i32.const 0) (local.get 0x1a4)) + (i64.store offset=0x1a5 align=1 (i32.const 0) (local.get 0x1a5)) + (i64.store offset=0x1a6 align=1 (i32.const 0) (local.get 0x1a6)) + (i64.store offset=0x1a7 align=1 (i32.const 0) (local.get 0x1a7)) + (i64.store offset=0x1a8 align=1 (i32.const 0) (local.get 0x1a8)) + (i64.store offset=0x1a9 align=1 (i32.const 0) (local.get 0x1a9)) + (i64.store offset=0x1aa align=1 (i32.const 0) (local.get 0x1aa)) + (i64.store offset=0x1ab align=1 (i32.const 0) (local.get 0x1ab)) + (i64.store offset=0x1ac align=1 (i32.const 0) (local.get 0x1ac)) + (i64.store offset=0x1ad align=1 (i32.const 0) (local.get 0x1ad)) + (i64.store offset=0x1ae align=1 (i32.const 0) (local.get 0x1ae)) + (i64.store offset=0x1af align=1 (i32.const 0) (local.get 0x1af)) + (i64.store offset=0x1b0 align=1 (i32.const 0) (local.get 0x1b0)) + (i64.store offset=0x1b1 align=1 (i32.const 0) (local.get 0x1b1)) + (i64.store offset=0x1b2 align=1 (i32.const 0) (local.get 0x1b2)) + (i64.store offset=0x1b3 align=1 (i32.const 0) (local.get 0x1b3)) + (i64.store offset=0x1b4 align=1 (i32.const 0) (local.get 0x1b4)) + (i64.store offset=0x1b5 align=1 (i32.const 0) (local.get 0x1b5)) + (i64.store offset=0x1b6 align=1 (i32.const 0) (local.get 0x1b6)) + (i64.store offset=0x1b7 align=1 (i32.const 0) (local.get 0x1b7)) + (i64.store offset=0x1b8 align=1 (i32.const 0) (local.get 0x1b8)) + (i64.store offset=0x1b9 align=1 (i32.const 0) (local.get 0x1b9)) + (i64.store offset=0x1ba align=1 (i32.const 0) (local.get 0x1ba)) + (i64.store offset=0x1bb align=1 (i32.const 0) (local.get 0x1bb)) + (i64.store offset=0x1bc align=1 (i32.const 0) (local.get 0x1bc)) + (i64.store offset=0x1bd align=1 (i32.const 0) (local.get 0x1bd)) + (i64.store offset=0x1be align=1 (i32.const 0) (local.get 0x1be)) + (i64.store offset=0x1bf align=1 (i32.const 0) (local.get 0x1bf)) + (i64.store offset=0x1c0 align=1 (i32.const 0) (local.get 0x1c0)) + (i64.store offset=0x1c1 align=1 (i32.const 0) (local.get 0x1c1)) + (i64.store offset=0x1c2 align=1 (i32.const 0) (local.get 0x1c2)) + (i64.store offset=0x1c3 align=1 (i32.const 0) (local.get 0x1c3)) + (i64.store offset=0x1c4 align=1 (i32.const 0) (local.get 0x1c4)) + (i64.store offset=0x1c5 align=1 (i32.const 0) (local.get 0x1c5)) + (i64.store offset=0x1c6 align=1 (i32.const 0) (local.get 0x1c6)) + (i64.store offset=0x1c7 align=1 (i32.const 0) (local.get 0x1c7)) + (i64.store offset=0x1c8 align=1 (i32.const 0) (local.get 0x1c8)) + (i64.store offset=0x1c9 align=1 (i32.const 0) (local.get 0x1c9)) + (i64.store offset=0x1ca align=1 (i32.const 0) (local.get 0x1ca)) + (i64.store offset=0x1cb align=1 (i32.const 0) (local.get 0x1cb)) + (i64.store offset=0x1cc align=1 (i32.const 0) (local.get 0x1cc)) + (i64.store offset=0x1cd align=1 (i32.const 0) (local.get 0x1cd)) + (i64.store offset=0x1ce align=1 (i32.const 0) (local.get 0x1ce)) + (i64.store offset=0x1cf align=1 (i32.const 0) (local.get 0x1cf)) + (i64.store offset=0x1d0 align=1 (i32.const 0) (local.get 0x1d0)) + (i64.store offset=0x1d1 align=1 (i32.const 0) (local.get 0x1d1)) + (i64.store offset=0x1d2 align=1 (i32.const 0) (local.get 0x1d2)) + (i64.store offset=0x1d3 align=1 (i32.const 0) (local.get 0x1d3)) + (i64.store offset=0x1d4 align=1 (i32.const 0) (local.get 0x1d4)) + (i64.store offset=0x1d5 align=1 (i32.const 0) (local.get 0x1d5)) + (i64.store offset=0x1d6 align=1 (i32.const 0) (local.get 0x1d6)) + (i64.store offset=0x1d7 align=1 (i32.const 0) (local.get 0x1d7)) + (i64.store offset=0x1d8 align=1 (i32.const 0) (local.get 0x1d8)) + (i64.store offset=0x1d9 align=1 (i32.const 0) (local.get 0x1d9)) + (i64.store offset=0x1da align=1 (i32.const 0) (local.get 0x1da)) + (i64.store offset=0x1db align=1 (i32.const 0) (local.get 0x1db)) + (i64.store offset=0x1dc align=1 (i32.const 0) (local.get 0x1dc)) + (i64.store offset=0x1dd align=1 (i32.const 0) (local.get 0x1dd)) + (i64.store offset=0x1de align=1 (i32.const 0) (local.get 0x1de)) + (i64.store offset=0x1df align=1 (i32.const 0) (local.get 0x1df)) + (i64.store offset=0x1e0 align=1 (i32.const 0) (local.get 0x1e0)) + (i64.store offset=0x1e1 align=1 (i32.const 0) (local.get 0x1e1)) + (i64.store offset=0x1e2 align=1 (i32.const 0) (local.get 0x1e2)) + (i64.store offset=0x1e3 align=1 (i32.const 0) (local.get 0x1e3)) + (i64.store offset=0x1e4 align=1 (i32.const 0) (local.get 0x1e4)) + (i64.store offset=0x1e5 align=1 (i32.const 0) (local.get 0x1e5)) + (i64.store offset=0x1e6 align=1 (i32.const 0) (local.get 0x1e6)) + (i64.store offset=0x1e7 align=1 (i32.const 0) (local.get 0x1e7)) + (i64.store offset=0x1e8 align=1 (i32.const 0) (local.get 0x1e8)) + (i64.store offset=0x1e9 align=1 (i32.const 0) (local.get 0x1e9)) + (i64.store offset=0x1ea align=1 (i32.const 0) (local.get 0x1ea)) + (i64.store offset=0x1eb align=1 (i32.const 0) (local.get 0x1eb)) + (i64.store offset=0x1ec align=1 (i32.const 0) (local.get 0x1ec)) + (i64.store offset=0x1ed align=1 (i32.const 0) (local.get 0x1ed)) + (i64.store offset=0x1ee align=1 (i32.const 0) (local.get 0x1ee)) + (i64.store offset=0x1ef align=1 (i32.const 0) (local.get 0x1ef)) + (i64.store offset=0x1f0 align=1 (i32.const 0) (local.get 0x1f0)) + (i64.store offset=0x1f1 align=1 (i32.const 0) (local.get 0x1f1)) + (i64.store offset=0x1f2 align=1 (i32.const 0) (local.get 0x1f2)) + (i64.store offset=0x1f3 align=1 (i32.const 0) (local.get 0x1f3)) + (i64.store offset=0x1f4 align=1 (i32.const 0) (local.get 0x1f4)) + (i64.store offset=0x1f5 align=1 (i32.const 0) (local.get 0x1f5)) + (i64.store offset=0x1f6 align=1 (i32.const 0) (local.get 0x1f6)) + (i64.store offset=0x1f7 align=1 (i32.const 0) (local.get 0x1f7)) + (i64.store offset=0x1f8 align=1 (i32.const 0) (local.get 0x1f8)) + (i64.store offset=0x1f9 align=1 (i32.const 0) (local.get 0x1f9)) + (i64.store offset=0x1fa align=1 (i32.const 0) (local.get 0x1fa)) + (i64.store offset=0x1fb align=1 (i32.const 0) (local.get 0x1fb)) + (i64.store offset=0x1fc align=1 (i32.const 0) (local.get 0x1fc)) + (i64.store offset=0x1fd align=1 (i32.const 0) (local.get 0x1fd)) + (i64.store offset=0x1fe align=1 (i32.const 0) (local.get 0x1fe)) + (i64.store offset=0x1ff align=1 (i32.const 0) (local.get 0x1ff)) + (i64.store offset=0x200 align=1 (i32.const 0) (local.get 0x200)) + (i64.store offset=0x201 align=1 (i32.const 0) (local.get 0x201)) + (i64.store offset=0x202 align=1 (i32.const 0) (local.get 0x202)) + (i64.store offset=0x203 align=1 (i32.const 0) (local.get 0x203)) + (i64.store offset=0x204 align=1 (i32.const 0) (local.get 0x204)) + (i64.store offset=0x205 align=1 (i32.const 0) (local.get 0x205)) + (i64.store offset=0x206 align=1 (i32.const 0) (local.get 0x206)) + (i64.store offset=0x207 align=1 (i32.const 0) (local.get 0x207)) + (i64.store offset=0x208 align=1 (i32.const 0) (local.get 0x208)) + (i64.store offset=0x209 align=1 (i32.const 0) (local.get 0x209)) + (i64.store offset=0x20a align=1 (i32.const 0) (local.get 0x20a)) + (i64.store offset=0x20b align=1 (i32.const 0) (local.get 0x20b)) + (i64.store offset=0x20c align=1 (i32.const 0) (local.get 0x20c)) + (i64.store offset=0x20d align=1 (i32.const 0) (local.get 0x20d)) + (i64.store offset=0x20e align=1 (i32.const 0) (local.get 0x20e)) + (i64.store offset=0x20f align=1 (i32.const 0) (local.get 0x20f)) + (i64.store offset=0x210 align=1 (i32.const 0) (local.get 0x210)) + (i64.store offset=0x211 align=1 (i32.const 0) (local.get 0x211)) + (i64.store offset=0x212 align=1 (i32.const 0) (local.get 0x212)) + (i64.store offset=0x213 align=1 (i32.const 0) (local.get 0x213)) + (i64.store offset=0x214 align=1 (i32.const 0) (local.get 0x214)) + (i64.store offset=0x215 align=1 (i32.const 0) (local.get 0x215)) + (i64.store offset=0x216 align=1 (i32.const 0) (local.get 0x216)) + (i64.store offset=0x217 align=1 (i32.const 0) (local.get 0x217)) + (i64.store offset=0x218 align=1 (i32.const 0) (local.get 0x218)) + (i64.store offset=0x219 align=1 (i32.const 0) (local.get 0x219)) + (i64.store offset=0x21a align=1 (i32.const 0) (local.get 0x21a)) + (i64.store offset=0x21b align=1 (i32.const 0) (local.get 0x21b)) + (i64.store offset=0x21c align=1 (i32.const 0) (local.get 0x21c)) + (i64.store offset=0x21d align=1 (i32.const 0) (local.get 0x21d)) + (i64.store offset=0x21e align=1 (i32.const 0) (local.get 0x21e)) + (i64.store offset=0x21f align=1 (i32.const 0) (local.get 0x21f)) + (i64.store offset=0x220 align=1 (i32.const 0) (local.get 0x220)) + (i64.store offset=0x221 align=1 (i32.const 0) (local.get 0x221)) + (i64.store offset=0x222 align=1 (i32.const 0) (local.get 0x222)) + (i64.store offset=0x223 align=1 (i32.const 0) (local.get 0x223)) + (i64.store offset=0x224 align=1 (i32.const 0) (local.get 0x224)) + (i64.store offset=0x225 align=1 (i32.const 0) (local.get 0x225)) + (i64.store offset=0x226 align=1 (i32.const 0) (local.get 0x226)) + (i64.store offset=0x227 align=1 (i32.const 0) (local.get 0x227)) + (i64.store offset=0x228 align=1 (i32.const 0) (local.get 0x228)) + (i64.store offset=0x229 align=1 (i32.const 0) (local.get 0x229)) + (i64.store offset=0x22a align=1 (i32.const 0) (local.get 0x22a)) + (i64.store offset=0x22b align=1 (i32.const 0) (local.get 0x22b)) + (i64.store offset=0x22c align=1 (i32.const 0) (local.get 0x22c)) + (i64.store offset=0x22d align=1 (i32.const 0) (local.get 0x22d)) + (i64.store offset=0x22e align=1 (i32.const 0) (local.get 0x22e)) + (i64.store offset=0x22f align=1 (i32.const 0) (local.get 0x22f)) + (i64.store offset=0x230 align=1 (i32.const 0) (local.get 0x230)) + (i64.store offset=0x231 align=1 (i32.const 0) (local.get 0x231)) + (i64.store offset=0x232 align=1 (i32.const 0) (local.get 0x232)) + (i64.store offset=0x233 align=1 (i32.const 0) (local.get 0x233)) + (i64.store offset=0x234 align=1 (i32.const 0) (local.get 0x234)) + (i64.store offset=0x235 align=1 (i32.const 0) (local.get 0x235)) + (i64.store offset=0x236 align=1 (i32.const 0) (local.get 0x236)) + (i64.store offset=0x237 align=1 (i32.const 0) (local.get 0x237)) + (i64.store offset=0x238 align=1 (i32.const 0) (local.get 0x238)) + (i64.store offset=0x239 align=1 (i32.const 0) (local.get 0x239)) + (i64.store offset=0x23a align=1 (i32.const 0) (local.get 0x23a)) + (i64.store offset=0x23b align=1 (i32.const 0) (local.get 0x23b)) + (i64.store offset=0x23c align=1 (i32.const 0) (local.get 0x23c)) + (i64.store offset=0x23d align=1 (i32.const 0) (local.get 0x23d)) + (i64.store offset=0x23e align=1 (i32.const 0) (local.get 0x23e)) + (i64.store offset=0x23f align=1 (i32.const 0) (local.get 0x23f)) + (i64.store offset=0x240 align=1 (i32.const 0) (local.get 0x240)) + (i64.store offset=0x241 align=1 (i32.const 0) (local.get 0x241)) + (i64.store offset=0x242 align=1 (i32.const 0) (local.get 0x242)) + (i64.store offset=0x243 align=1 (i32.const 0) (local.get 0x243)) + (i64.store offset=0x244 align=1 (i32.const 0) (local.get 0x244)) + (i64.store offset=0x245 align=1 (i32.const 0) (local.get 0x245)) + (i64.store offset=0x246 align=1 (i32.const 0) (local.get 0x246)) + (i64.store offset=0x247 align=1 (i32.const 0) (local.get 0x247)) + (i64.store offset=0x248 align=1 (i32.const 0) (local.get 0x248)) + (i64.store offset=0x249 align=1 (i32.const 0) (local.get 0x249)) + (i64.store offset=0x24a align=1 (i32.const 0) (local.get 0x24a)) + (i64.store offset=0x24b align=1 (i32.const 0) (local.get 0x24b)) + (i64.store offset=0x24c align=1 (i32.const 0) (local.get 0x24c)) + (i64.store offset=0x24d align=1 (i32.const 0) (local.get 0x24d)) + (i64.store offset=0x24e align=1 (i32.const 0) (local.get 0x24e)) + (i64.store offset=0x24f align=1 (i32.const 0) (local.get 0x24f)) + (i64.store offset=0x250 align=1 (i32.const 0) (local.get 0x250)) + (i64.store offset=0x251 align=1 (i32.const 0) (local.get 0x251)) + (i64.store offset=0x252 align=1 (i32.const 0) (local.get 0x252)) + (i64.store offset=0x253 align=1 (i32.const 0) (local.get 0x253)) + (i64.store offset=0x254 align=1 (i32.const 0) (local.get 0x254)) + (i64.store offset=0x255 align=1 (i32.const 0) (local.get 0x255)) + (i64.store offset=0x256 align=1 (i32.const 0) (local.get 0x256)) + (i64.store offset=0x257 align=1 (i32.const 0) (local.get 0x257)) + (i64.store offset=0x258 align=1 (i32.const 0) (local.get 0x258)) + (i64.store offset=0x259 align=1 (i32.const 0) (local.get 0x259)) + (i64.store offset=0x25a align=1 (i32.const 0) (local.get 0x25a)) + (i64.store offset=0x25b align=1 (i32.const 0) (local.get 0x25b)) + (i64.store offset=0x25c align=1 (i32.const 0) (local.get 0x25c)) + (i64.store offset=0x25d align=1 (i32.const 0) (local.get 0x25d)) + (i64.store offset=0x25e align=1 (i32.const 0) (local.get 0x25e)) + (i64.store offset=0x25f align=1 (i32.const 0) (local.get 0x25f)) + (i64.store offset=0x260 align=1 (i32.const 0) (local.get 0x260)) + (i64.store offset=0x261 align=1 (i32.const 0) (local.get 0x261)) + (i64.store offset=0x262 align=1 (i32.const 0) (local.get 0x262)) + (i64.store offset=0x263 align=1 (i32.const 0) (local.get 0x263)) + (i64.store offset=0x264 align=1 (i32.const 0) (local.get 0x264)) + (i64.store offset=0x265 align=1 (i32.const 0) (local.get 0x265)) + (i64.store offset=0x266 align=1 (i32.const 0) (local.get 0x266)) + (i64.store offset=0x267 align=1 (i32.const 0) (local.get 0x267)) + (i64.store offset=0x268 align=1 (i32.const 0) (local.get 0x268)) + (i64.store offset=0x269 align=1 (i32.const 0) (local.get 0x269)) + (i64.store offset=0x26a align=1 (i32.const 0) (local.get 0x26a)) + (i64.store offset=0x26b align=1 (i32.const 0) (local.get 0x26b)) + (i64.store offset=0x26c align=1 (i32.const 0) (local.get 0x26c)) + (i64.store offset=0x26d align=1 (i32.const 0) (local.get 0x26d)) + (i64.store offset=0x26e align=1 (i32.const 0) (local.get 0x26e)) + (i64.store offset=0x26f align=1 (i32.const 0) (local.get 0x26f)) + (i64.store offset=0x270 align=1 (i32.const 0) (local.get 0x270)) + (i64.store offset=0x271 align=1 (i32.const 0) (local.get 0x271)) + (i64.store offset=0x272 align=1 (i32.const 0) (local.get 0x272)) + (i64.store offset=0x273 align=1 (i32.const 0) (local.get 0x273)) + (i64.store offset=0x274 align=1 (i32.const 0) (local.get 0x274)) + (i64.store offset=0x275 align=1 (i32.const 0) (local.get 0x275)) + (i64.store offset=0x276 align=1 (i32.const 0) (local.get 0x276)) + (i64.store offset=0x277 align=1 (i32.const 0) (local.get 0x277)) + (i64.store offset=0x278 align=1 (i32.const 0) (local.get 0x278)) + (i64.store offset=0x279 align=1 (i32.const 0) (local.get 0x279)) + (i64.store offset=0x27a align=1 (i32.const 0) (local.get 0x27a)) + (i64.store offset=0x27b align=1 (i32.const 0) (local.get 0x27b)) + (i64.store offset=0x27c align=1 (i32.const 0) (local.get 0x27c)) + (i64.store offset=0x27d align=1 (i32.const 0) (local.get 0x27d)) + (i64.store offset=0x27e align=1 (i32.const 0) (local.get 0x27e)) + (i64.store offset=0x27f align=1 (i32.const 0) (local.get 0x27f)) + (i64.store offset=0x280 align=1 (i32.const 0) (local.get 0x280)) + (i64.store offset=0x281 align=1 (i32.const 0) (local.get 0x281)) + (i64.store offset=0x282 align=1 (i32.const 0) (local.get 0x282)) + (i64.store offset=0x283 align=1 (i32.const 0) (local.get 0x283)) + (i64.store offset=0x284 align=1 (i32.const 0) (local.get 0x284)) + (i64.store offset=0x285 align=1 (i32.const 0) (local.get 0x285)) + (i64.store offset=0x286 align=1 (i32.const 0) (local.get 0x286)) + (i64.store offset=0x287 align=1 (i32.const 0) (local.get 0x287)) + (i64.store offset=0x288 align=1 (i32.const 0) (local.get 0x288)) + (i64.store offset=0x289 align=1 (i32.const 0) (local.get 0x289)) + (i64.store offset=0x28a align=1 (i32.const 0) (local.get 0x28a)) + (i64.store offset=0x28b align=1 (i32.const 0) (local.get 0x28b)) + (i64.store offset=0x28c align=1 (i32.const 0) (local.get 0x28c)) + (i64.store offset=0x28d align=1 (i32.const 0) (local.get 0x28d)) + (i64.store offset=0x28e align=1 (i32.const 0) (local.get 0x28e)) + (i64.store offset=0x28f align=1 (i32.const 0) (local.get 0x28f)) + (i64.store offset=0x290 align=1 (i32.const 0) (local.get 0x290)) + (i64.store offset=0x291 align=1 (i32.const 0) (local.get 0x291)) + (i64.store offset=0x292 align=1 (i32.const 0) (local.get 0x292)) + (i64.store offset=0x293 align=1 (i32.const 0) (local.get 0x293)) + (i64.store offset=0x294 align=1 (i32.const 0) (local.get 0x294)) + (i64.store offset=0x295 align=1 (i32.const 0) (local.get 0x295)) + (i64.store offset=0x296 align=1 (i32.const 0) (local.get 0x296)) + (i64.store offset=0x297 align=1 (i32.const 0) (local.get 0x297)) + (i64.store offset=0x298 align=1 (i32.const 0) (local.get 0x298)) + (i64.store offset=0x299 align=1 (i32.const 0) (local.get 0x299)) + (i64.store offset=0x29a align=1 (i32.const 0) (local.get 0x29a)) + (i64.store offset=0x29b align=1 (i32.const 0) (local.get 0x29b)) + (i64.store offset=0x29c align=1 (i32.const 0) (local.get 0x29c)) + (i64.store offset=0x29d align=1 (i32.const 0) (local.get 0x29d)) + (i64.store offset=0x29e align=1 (i32.const 0) (local.get 0x29e)) + (i64.store offset=0x29f align=1 (i32.const 0) (local.get 0x29f)) + (i64.store offset=0x2a0 align=1 (i32.const 0) (local.get 0x2a0)) + (i64.store offset=0x2a1 align=1 (i32.const 0) (local.get 0x2a1)) + (i64.store offset=0x2a2 align=1 (i32.const 0) (local.get 0x2a2)) + (i64.store offset=0x2a3 align=1 (i32.const 0) (local.get 0x2a3)) + (i64.store offset=0x2a4 align=1 (i32.const 0) (local.get 0x2a4)) + (i64.store offset=0x2a5 align=1 (i32.const 0) (local.get 0x2a5)) + (i64.store offset=0x2a6 align=1 (i32.const 0) (local.get 0x2a6)) + (i64.store offset=0x2a7 align=1 (i32.const 0) (local.get 0x2a7)) + (i64.store offset=0x2a8 align=1 (i32.const 0) (local.get 0x2a8)) + (i64.store offset=0x2a9 align=1 (i32.const 0) (local.get 0x2a9)) + (i64.store offset=0x2aa align=1 (i32.const 0) (local.get 0x2aa)) + (i64.store offset=0x2ab align=1 (i32.const 0) (local.get 0x2ab)) + (i64.store offset=0x2ac align=1 (i32.const 0) (local.get 0x2ac)) + (i64.store offset=0x2ad align=1 (i32.const 0) (local.get 0x2ad)) + (i64.store offset=0x2ae align=1 (i32.const 0) (local.get 0x2ae)) + (i64.store offset=0x2af align=1 (i32.const 0) (local.get 0x2af)) + (i64.store offset=0x2b0 align=1 (i32.const 0) (local.get 0x2b0)) + (i64.store offset=0x2b1 align=1 (i32.const 0) (local.get 0x2b1)) + (i64.store offset=0x2b2 align=1 (i32.const 0) (local.get 0x2b2)) + (i64.store offset=0x2b3 align=1 (i32.const 0) (local.get 0x2b3)) + (i64.store offset=0x2b4 align=1 (i32.const 0) (local.get 0x2b4)) + (i64.store offset=0x2b5 align=1 (i32.const 0) (local.get 0x2b5)) + (i64.store offset=0x2b6 align=1 (i32.const 0) (local.get 0x2b6)) + (i64.store offset=0x2b7 align=1 (i32.const 0) (local.get 0x2b7)) + (i64.store offset=0x2b8 align=1 (i32.const 0) (local.get 0x2b8)) + (i64.store offset=0x2b9 align=1 (i32.const 0) (local.get 0x2b9)) + (i64.store offset=0x2ba align=1 (i32.const 0) (local.get 0x2ba)) + (i64.store offset=0x2bb align=1 (i32.const 0) (local.get 0x2bb)) + (i64.store offset=0x2bc align=1 (i32.const 0) (local.get 0x2bc)) + (i64.store offset=0x2bd align=1 (i32.const 0) (local.get 0x2bd)) + (i64.store offset=0x2be align=1 (i32.const 0) (local.get 0x2be)) + (i64.store offset=0x2bf align=1 (i32.const 0) (local.get 0x2bf)) + (i64.store offset=0x2c0 align=1 (i32.const 0) (local.get 0x2c0)) + (i64.store offset=0x2c1 align=1 (i32.const 0) (local.get 0x2c1)) + (i64.store offset=0x2c2 align=1 (i32.const 0) (local.get 0x2c2)) + (i64.store offset=0x2c3 align=1 (i32.const 0) (local.get 0x2c3)) + (i64.store offset=0x2c4 align=1 (i32.const 0) (local.get 0x2c4)) + (i64.store offset=0x2c5 align=1 (i32.const 0) (local.get 0x2c5)) + (i64.store offset=0x2c6 align=1 (i32.const 0) (local.get 0x2c6)) + (i64.store offset=0x2c7 align=1 (i32.const 0) (local.get 0x2c7)) + (i64.store offset=0x2c8 align=1 (i32.const 0) (local.get 0x2c8)) + (i64.store offset=0x2c9 align=1 (i32.const 0) (local.get 0x2c9)) + (i64.store offset=0x2ca align=1 (i32.const 0) (local.get 0x2ca)) + (i64.store offset=0x2cb align=1 (i32.const 0) (local.get 0x2cb)) + (i64.store offset=0x2cc align=1 (i32.const 0) (local.get 0x2cc)) + (i64.store offset=0x2cd align=1 (i32.const 0) (local.get 0x2cd)) + (i64.store offset=0x2ce align=1 (i32.const 0) (local.get 0x2ce)) + (i64.store offset=0x2cf align=1 (i32.const 0) (local.get 0x2cf)) + (i64.store offset=0x2d0 align=1 (i32.const 0) (local.get 0x2d0)) + (i64.store offset=0x2d1 align=1 (i32.const 0) (local.get 0x2d1)) + (i64.store offset=0x2d2 align=1 (i32.const 0) (local.get 0x2d2)) + (i64.store offset=0x2d3 align=1 (i32.const 0) (local.get 0x2d3)) + (i64.store offset=0x2d4 align=1 (i32.const 0) (local.get 0x2d4)) + (i64.store offset=0x2d5 align=1 (i32.const 0) (local.get 0x2d5)) + (i64.store offset=0x2d6 align=1 (i32.const 0) (local.get 0x2d6)) + (i64.store offset=0x2d7 align=1 (i32.const 0) (local.get 0x2d7)) + (i64.store offset=0x2d8 align=1 (i32.const 0) (local.get 0x2d8)) + (i64.store offset=0x2d9 align=1 (i32.const 0) (local.get 0x2d9)) + (i64.store offset=0x2da align=1 (i32.const 0) (local.get 0x2da)) + (i64.store offset=0x2db align=1 (i32.const 0) (local.get 0x2db)) + (i64.store offset=0x2dc align=1 (i32.const 0) (local.get 0x2dc)) + (i64.store offset=0x2dd align=1 (i32.const 0) (local.get 0x2dd)) + (i64.store offset=0x2de align=1 (i32.const 0) (local.get 0x2de)) + (i64.store offset=0x2df align=1 (i32.const 0) (local.get 0x2df)) + (i64.store offset=0x2e0 align=1 (i32.const 0) (local.get 0x2e0)) + (i64.store offset=0x2e1 align=1 (i32.const 0) (local.get 0x2e1)) + (i64.store offset=0x2e2 align=1 (i32.const 0) (local.get 0x2e2)) + (i64.store offset=0x2e3 align=1 (i32.const 0) (local.get 0x2e3)) + (i64.store offset=0x2e4 align=1 (i32.const 0) (local.get 0x2e4)) + (i64.store offset=0x2e5 align=1 (i32.const 0) (local.get 0x2e5)) + (i64.store offset=0x2e6 align=1 (i32.const 0) (local.get 0x2e6)) + (i64.store offset=0x2e7 align=1 (i32.const 0) (local.get 0x2e7)) + (i64.store offset=0x2e8 align=1 (i32.const 0) (local.get 0x2e8)) + (i64.store offset=0x2e9 align=1 (i32.const 0) (local.get 0x2e9)) + (i64.store offset=0x2ea align=1 (i32.const 0) (local.get 0x2ea)) + (i64.store offset=0x2eb align=1 (i32.const 0) (local.get 0x2eb)) + (i64.store offset=0x2ec align=1 (i32.const 0) (local.get 0x2ec)) + (i64.store offset=0x2ed align=1 (i32.const 0) (local.get 0x2ed)) + (i64.store offset=0x2ee align=1 (i32.const 0) (local.get 0x2ee)) + (i64.store offset=0x2ef align=1 (i32.const 0) (local.get 0x2ef)) + (i64.store offset=0x2f0 align=1 (i32.const 0) (local.get 0x2f0)) + (i64.store offset=0x2f1 align=1 (i32.const 0) (local.get 0x2f1)) + (i64.store offset=0x2f2 align=1 (i32.const 0) (local.get 0x2f2)) + (i64.store offset=0x2f3 align=1 (i32.const 0) (local.get 0x2f3)) + (i64.store offset=0x2f4 align=1 (i32.const 0) (local.get 0x2f4)) + (i64.store offset=0x2f5 align=1 (i32.const 0) (local.get 0x2f5)) + (i64.store offset=0x2f6 align=1 (i32.const 0) (local.get 0x2f6)) + (i64.store offset=0x2f7 align=1 (i32.const 0) (local.get 0x2f7)) + (i64.store offset=0x2f8 align=1 (i32.const 0) (local.get 0x2f8)) + (i64.store offset=0x2f9 align=1 (i32.const 0) (local.get 0x2f9)) + (i64.store offset=0x2fa align=1 (i32.const 0) (local.get 0x2fa)) + (i64.store offset=0x2fb align=1 (i32.const 0) (local.get 0x2fb)) + (i64.store offset=0x2fc align=1 (i32.const 0) (local.get 0x2fc)) + (i64.store offset=0x2fd align=1 (i32.const 0) (local.get 0x2fd)) + (i64.store offset=0x2fe align=1 (i32.const 0) (local.get 0x2fe)) + (i64.store offset=0x2ff align=1 (i32.const 0) (local.get 0x2ff)) + (i64.store offset=0x300 align=1 (i32.const 0) (local.get 0x300)) + (i64.store offset=0x301 align=1 (i32.const 0) (local.get 0x301)) + (i64.store offset=0x302 align=1 (i32.const 0) (local.get 0x302)) + (i64.store offset=0x303 align=1 (i32.const 0) (local.get 0x303)) + (i64.store offset=0x304 align=1 (i32.const 0) (local.get 0x304)) + (i64.store offset=0x305 align=1 (i32.const 0) (local.get 0x305)) + (i64.store offset=0x306 align=1 (i32.const 0) (local.get 0x306)) + (i64.store offset=0x307 align=1 (i32.const 0) (local.get 0x307)) + (i64.store offset=0x308 align=1 (i32.const 0) (local.get 0x308)) + (i64.store offset=0x309 align=1 (i32.const 0) (local.get 0x309)) + (i64.store offset=0x30a align=1 (i32.const 0) (local.get 0x30a)) + (i64.store offset=0x30b align=1 (i32.const 0) (local.get 0x30b)) + (i64.store offset=0x30c align=1 (i32.const 0) (local.get 0x30c)) + (i64.store offset=0x30d align=1 (i32.const 0) (local.get 0x30d)) + (i64.store offset=0x30e align=1 (i32.const 0) (local.get 0x30e)) + (i64.store offset=0x30f align=1 (i32.const 0) (local.get 0x30f)) + (i64.store offset=0x310 align=1 (i32.const 0) (local.get 0x310)) + (i64.store offset=0x311 align=1 (i32.const 0) (local.get 0x311)) + (i64.store offset=0x312 align=1 (i32.const 0) (local.get 0x312)) + (i64.store offset=0x313 align=1 (i32.const 0) (local.get 0x313)) + (i64.store offset=0x314 align=1 (i32.const 0) (local.get 0x314)) + (i64.store offset=0x315 align=1 (i32.const 0) (local.get 0x315)) + (i64.store offset=0x316 align=1 (i32.const 0) (local.get 0x316)) + (i64.store offset=0x317 align=1 (i32.const 0) (local.get 0x317)) + (i64.store offset=0x318 align=1 (i32.const 0) (local.get 0x318)) + (i64.store offset=0x319 align=1 (i32.const 0) (local.get 0x319)) + (i64.store offset=0x31a align=1 (i32.const 0) (local.get 0x31a)) + (i64.store offset=0x31b align=1 (i32.const 0) (local.get 0x31b)) + (i64.store offset=0x31c align=1 (i32.const 0) (local.get 0x31c)) + (i64.store offset=0x31d align=1 (i32.const 0) (local.get 0x31d)) + (i64.store offset=0x31e align=1 (i32.const 0) (local.get 0x31e)) + (i64.store offset=0x31f align=1 (i32.const 0) (local.get 0x31f)) + (i64.store offset=0x320 align=1 (i32.const 0) (local.get 0x320)) + (i64.store offset=0x321 align=1 (i32.const 0) (local.get 0x321)) + (i64.store offset=0x322 align=1 (i32.const 0) (local.get 0x322)) + (i64.store offset=0x323 align=1 (i32.const 0) (local.get 0x323)) + (i64.store offset=0x324 align=1 (i32.const 0) (local.get 0x324)) + (i64.store offset=0x325 align=1 (i32.const 0) (local.get 0x325)) + (i64.store offset=0x326 align=1 (i32.const 0) (local.get 0x326)) + (i64.store offset=0x327 align=1 (i32.const 0) (local.get 0x327)) + (i64.store offset=0x328 align=1 (i32.const 0) (local.get 0x328)) + (i64.store offset=0x329 align=1 (i32.const 0) (local.get 0x329)) + (i64.store offset=0x32a align=1 (i32.const 0) (local.get 0x32a)) + (i64.store offset=0x32b align=1 (i32.const 0) (local.get 0x32b)) + (i64.store offset=0x32c align=1 (i32.const 0) (local.get 0x32c)) + (i64.store offset=0x32d align=1 (i32.const 0) (local.get 0x32d)) + (i64.store offset=0x32e align=1 (i32.const 0) (local.get 0x32e)) + (i64.store offset=0x32f align=1 (i32.const 0) (local.get 0x32f)) + (i64.store offset=0x330 align=1 (i32.const 0) (local.get 0x330)) + (i64.store offset=0x331 align=1 (i32.const 0) (local.get 0x331)) + (i64.store offset=0x332 align=1 (i32.const 0) (local.get 0x332)) + (i64.store offset=0x333 align=1 (i32.const 0) (local.get 0x333)) + (i64.store offset=0x334 align=1 (i32.const 0) (local.get 0x334)) + (i64.store offset=0x335 align=1 (i32.const 0) (local.get 0x335)) + (i64.store offset=0x336 align=1 (i32.const 0) (local.get 0x336)) + (i64.store offset=0x337 align=1 (i32.const 0) (local.get 0x337)) + (i64.store offset=0x338 align=1 (i32.const 0) (local.get 0x338)) + (i64.store offset=0x339 align=1 (i32.const 0) (local.get 0x339)) + (i64.store offset=0x33a align=1 (i32.const 0) (local.get 0x33a)) + (i64.store offset=0x33b align=1 (i32.const 0) (local.get 0x33b)) + (i64.store offset=0x33c align=1 (i32.const 0) (local.get 0x33c)) + (i64.store offset=0x33d align=1 (i32.const 0) (local.get 0x33d)) + (i64.store offset=0x33e align=1 (i32.const 0) (local.get 0x33e)) + (i64.store offset=0x33f align=1 (i32.const 0) (local.get 0x33f)) + (i64.store offset=0x340 align=1 (i32.const 0) (local.get 0x340)) + (i64.store offset=0x341 align=1 (i32.const 0) (local.get 0x341)) + (i64.store offset=0x342 align=1 (i32.const 0) (local.get 0x342)) + (i64.store offset=0x343 align=1 (i32.const 0) (local.get 0x343)) + (i64.store offset=0x344 align=1 (i32.const 0) (local.get 0x344)) + (i64.store offset=0x345 align=1 (i32.const 0) (local.get 0x345)) + (i64.store offset=0x346 align=1 (i32.const 0) (local.get 0x346)) + (i64.store offset=0x347 align=1 (i32.const 0) (local.get 0x347)) + (i64.store offset=0x348 align=1 (i32.const 0) (local.get 0x348)) + (i64.store offset=0x349 align=1 (i32.const 0) (local.get 0x349)) + (i64.store offset=0x34a align=1 (i32.const 0) (local.get 0x34a)) + (i64.store offset=0x34b align=1 (i32.const 0) (local.get 0x34b)) + (i64.store offset=0x34c align=1 (i32.const 0) (local.get 0x34c)) + (i64.store offset=0x34d align=1 (i32.const 0) (local.get 0x34d)) + (i64.store offset=0x34e align=1 (i32.const 0) (local.get 0x34e)) + (i64.store offset=0x34f align=1 (i32.const 0) (local.get 0x34f)) + (i64.store offset=0x350 align=1 (i32.const 0) (local.get 0x350)) + (i64.store offset=0x351 align=1 (i32.const 0) (local.get 0x351)) + (i64.store offset=0x352 align=1 (i32.const 0) (local.get 0x352)) + (i64.store offset=0x353 align=1 (i32.const 0) (local.get 0x353)) + (i64.store offset=0x354 align=1 (i32.const 0) (local.get 0x354)) + (i64.store offset=0x355 align=1 (i32.const 0) (local.get 0x355)) + (i64.store offset=0x356 align=1 (i32.const 0) (local.get 0x356)) + (i64.store offset=0x357 align=1 (i32.const 0) (local.get 0x357)) + (i64.store offset=0x358 align=1 (i32.const 0) (local.get 0x358)) + (i64.store offset=0x359 align=1 (i32.const 0) (local.get 0x359)) + (i64.store offset=0x35a align=1 (i32.const 0) (local.get 0x35a)) + (i64.store offset=0x35b align=1 (i32.const 0) (local.get 0x35b)) + (i64.store offset=0x35c align=1 (i32.const 0) (local.get 0x35c)) + (i64.store offset=0x35d align=1 (i32.const 0) (local.get 0x35d)) + (i64.store offset=0x35e align=1 (i32.const 0) (local.get 0x35e)) + (i64.store offset=0x35f align=1 (i32.const 0) (local.get 0x35f)) + (i64.store offset=0x360 align=1 (i32.const 0) (local.get 0x360)) + (i64.store offset=0x361 align=1 (i32.const 0) (local.get 0x361)) + (i64.store offset=0x362 align=1 (i32.const 0) (local.get 0x362)) + (i64.store offset=0x363 align=1 (i32.const 0) (local.get 0x363)) + (i64.store offset=0x364 align=1 (i32.const 0) (local.get 0x364)) + (i64.store offset=0x365 align=1 (i32.const 0) (local.get 0x365)) + (i64.store offset=0x366 align=1 (i32.const 0) (local.get 0x366)) + (i64.store offset=0x367 align=1 (i32.const 0) (local.get 0x367)) + (i64.store offset=0x368 align=1 (i32.const 0) (local.get 0x368)) + (i64.store offset=0x369 align=1 (i32.const 0) (local.get 0x369)) + (i64.store offset=0x36a align=1 (i32.const 0) (local.get 0x36a)) + (i64.store offset=0x36b align=1 (i32.const 0) (local.get 0x36b)) + (i64.store offset=0x36c align=1 (i32.const 0) (local.get 0x36c)) + (i64.store offset=0x36d align=1 (i32.const 0) (local.get 0x36d)) + (i64.store offset=0x36e align=1 (i32.const 0) (local.get 0x36e)) + (i64.store offset=0x36f align=1 (i32.const 0) (local.get 0x36f)) + (i64.store offset=0x370 align=1 (i32.const 0) (local.get 0x370)) + (i64.store offset=0x371 align=1 (i32.const 0) (local.get 0x371)) + (i64.store offset=0x372 align=1 (i32.const 0) (local.get 0x372)) + (i64.store offset=0x373 align=1 (i32.const 0) (local.get 0x373)) + (i64.store offset=0x374 align=1 (i32.const 0) (local.get 0x374)) + (i64.store offset=0x375 align=1 (i32.const 0) (local.get 0x375)) + (i64.store offset=0x376 align=1 (i32.const 0) (local.get 0x376)) + (i64.store offset=0x377 align=1 (i32.const 0) (local.get 0x377)) + (i64.store offset=0x378 align=1 (i32.const 0) (local.get 0x378)) + (i64.store offset=0x379 align=1 (i32.const 0) (local.get 0x379)) + (i64.store offset=0x37a align=1 (i32.const 0) (local.get 0x37a)) + (i64.store offset=0x37b align=1 (i32.const 0) (local.get 0x37b)) + (i64.store offset=0x37c align=1 (i32.const 0) (local.get 0x37c)) + (i64.store offset=0x37d align=1 (i32.const 0) (local.get 0x37d)) + (i64.store offset=0x37e align=1 (i32.const 0) (local.get 0x37e)) + (i64.store offset=0x37f align=1 (i32.const 0) (local.get 0x37f)) + (i64.store offset=0x380 align=1 (i32.const 0) (local.get 0x380)) + (i64.store offset=0x381 align=1 (i32.const 0) (local.get 0x381)) + (i64.store offset=0x382 align=1 (i32.const 0) (local.get 0x382)) + (i64.store offset=0x383 align=1 (i32.const 0) (local.get 0x383)) + (i64.store offset=0x384 align=1 (i32.const 0) (local.get 0x384)) + (i64.store offset=0x385 align=1 (i32.const 0) (local.get 0x385)) + (i64.store offset=0x386 align=1 (i32.const 0) (local.get 0x386)) + (i64.store offset=0x387 align=1 (i32.const 0) (local.get 0x387)) + (i64.store offset=0x388 align=1 (i32.const 0) (local.get 0x388)) + (i64.store offset=0x389 align=1 (i32.const 0) (local.get 0x389)) + (i64.store offset=0x38a align=1 (i32.const 0) (local.get 0x38a)) + (i64.store offset=0x38b align=1 (i32.const 0) (local.get 0x38b)) + (i64.store offset=0x38c align=1 (i32.const 0) (local.get 0x38c)) + (i64.store offset=0x38d align=1 (i32.const 0) (local.get 0x38d)) + (i64.store offset=0x38e align=1 (i32.const 0) (local.get 0x38e)) + (i64.store offset=0x38f align=1 (i32.const 0) (local.get 0x38f)) + (i64.store offset=0x390 align=1 (i32.const 0) (local.get 0x390)) + (i64.store offset=0x391 align=1 (i32.const 0) (local.get 0x391)) + (i64.store offset=0x392 align=1 (i32.const 0) (local.get 0x392)) + (i64.store offset=0x393 align=1 (i32.const 0) (local.get 0x393)) + (i64.store offset=0x394 align=1 (i32.const 0) (local.get 0x394)) + (i64.store offset=0x395 align=1 (i32.const 0) (local.get 0x395)) + (i64.store offset=0x396 align=1 (i32.const 0) (local.get 0x396)) + (i64.store offset=0x397 align=1 (i32.const 0) (local.get 0x397)) + (i64.store offset=0x398 align=1 (i32.const 0) (local.get 0x398)) + (i64.store offset=0x399 align=1 (i32.const 0) (local.get 0x399)) + (i64.store offset=0x39a align=1 (i32.const 0) (local.get 0x39a)) + (i64.store offset=0x39b align=1 (i32.const 0) (local.get 0x39b)) + (i64.store offset=0x39c align=1 (i32.const 0) (local.get 0x39c)) + (i64.store offset=0x39d align=1 (i32.const 0) (local.get 0x39d)) + (i64.store offset=0x39e align=1 (i32.const 0) (local.get 0x39e)) + (i64.store offset=0x39f align=1 (i32.const 0) (local.get 0x39f)) + (i64.store offset=0x3a0 align=1 (i32.const 0) (local.get 0x3a0)) + (i64.store offset=0x3a1 align=1 (i32.const 0) (local.get 0x3a1)) + (i64.store offset=0x3a2 align=1 (i32.const 0) (local.get 0x3a2)) + (i64.store offset=0x3a3 align=1 (i32.const 0) (local.get 0x3a3)) + (i64.store offset=0x3a4 align=1 (i32.const 0) (local.get 0x3a4)) + (i64.store offset=0x3a5 align=1 (i32.const 0) (local.get 0x3a5)) + (i64.store offset=0x3a6 align=1 (i32.const 0) (local.get 0x3a6)) + (i64.store offset=0x3a7 align=1 (i32.const 0) (local.get 0x3a7)) + (i64.store offset=0x3a8 align=1 (i32.const 0) (local.get 0x3a8)) + (i64.store offset=0x3a9 align=1 (i32.const 0) (local.get 0x3a9)) + (i64.store offset=0x3aa align=1 (i32.const 0) (local.get 0x3aa)) + (i64.store offset=0x3ab align=1 (i32.const 0) (local.get 0x3ab)) + (i64.store offset=0x3ac align=1 (i32.const 0) (local.get 0x3ac)) + (i64.store offset=0x3ad align=1 (i32.const 0) (local.get 0x3ad)) + (i64.store offset=0x3ae align=1 (i32.const 0) (local.get 0x3ae)) + (i64.store offset=0x3af align=1 (i32.const 0) (local.get 0x3af)) + (i64.store offset=0x3b0 align=1 (i32.const 0) (local.get 0x3b0)) + (i64.store offset=0x3b1 align=1 (i32.const 0) (local.get 0x3b1)) + (i64.store offset=0x3b2 align=1 (i32.const 0) (local.get 0x3b2)) + (i64.store offset=0x3b3 align=1 (i32.const 0) (local.get 0x3b3)) + (i64.store offset=0x3b4 align=1 (i32.const 0) (local.get 0x3b4)) + (i64.store offset=0x3b5 align=1 (i32.const 0) (local.get 0x3b5)) + (i64.store offset=0x3b6 align=1 (i32.const 0) (local.get 0x3b6)) + (i64.store offset=0x3b7 align=1 (i32.const 0) (local.get 0x3b7)) + (i64.store offset=0x3b8 align=1 (i32.const 0) (local.get 0x3b8)) + (i64.store offset=0x3b9 align=1 (i32.const 0) (local.get 0x3b9)) + (i64.store offset=0x3ba align=1 (i32.const 0) (local.get 0x3ba)) + (i64.store offset=0x3bb align=1 (i32.const 0) (local.get 0x3bb)) + (i64.store offset=0x3bc align=1 (i32.const 0) (local.get 0x3bc)) + (i64.store offset=0x3bd align=1 (i32.const 0) (local.get 0x3bd)) + (i64.store offset=0x3be align=1 (i32.const 0) (local.get 0x3be)) + (i64.store offset=0x3bf align=1 (i32.const 0) (local.get 0x3bf)) + (i64.store offset=0x3c0 align=1 (i32.const 0) (local.get 0x3c0)) + (i64.store offset=0x3c1 align=1 (i32.const 0) (local.get 0x3c1)) + (i64.store offset=0x3c2 align=1 (i32.const 0) (local.get 0x3c2)) + (i64.store offset=0x3c3 align=1 (i32.const 0) (local.get 0x3c3)) + (i64.store offset=0x3c4 align=1 (i32.const 0) (local.get 0x3c4)) + (i64.store offset=0x3c5 align=1 (i32.const 0) (local.get 0x3c5)) + (i64.store offset=0x3c6 align=1 (i32.const 0) (local.get 0x3c6)) + (i64.store offset=0x3c7 align=1 (i32.const 0) (local.get 0x3c7)) + (i64.store offset=0x3c8 align=1 (i32.const 0) (local.get 0x3c8)) + (i64.store offset=0x3c9 align=1 (i32.const 0) (local.get 0x3c9)) + (i64.store offset=0x3ca align=1 (i32.const 0) (local.get 0x3ca)) + (i64.store offset=0x3cb align=1 (i32.const 0) (local.get 0x3cb)) + (i64.store offset=0x3cc align=1 (i32.const 0) (local.get 0x3cc)) + (i64.store offset=0x3cd align=1 (i32.const 0) (local.get 0x3cd)) + (i64.store offset=0x3ce align=1 (i32.const 0) (local.get 0x3ce)) + (i64.store offset=0x3cf align=1 (i32.const 0) (local.get 0x3cf)) + (i64.store offset=0x3d0 align=1 (i32.const 0) (local.get 0x3d0)) + (i64.store offset=0x3d1 align=1 (i32.const 0) (local.get 0x3d1)) + (i64.store offset=0x3d2 align=1 (i32.const 0) (local.get 0x3d2)) + (i64.store offset=0x3d3 align=1 (i32.const 0) (local.get 0x3d3)) + (i64.store offset=0x3d4 align=1 (i32.const 0) (local.get 0x3d4)) + (i64.store offset=0x3d5 align=1 (i32.const 0) (local.get 0x3d5)) + (i64.store offset=0x3d6 align=1 (i32.const 0) (local.get 0x3d6)) + (i64.store offset=0x3d7 align=1 (i32.const 0) (local.get 0x3d7)) + (i64.store offset=0x3d8 align=1 (i32.const 0) (local.get 0x3d8)) + (i64.store offset=0x3d9 align=1 (i32.const 0) (local.get 0x3d9)) + (i64.store offset=0x3da align=1 (i32.const 0) (local.get 0x3da)) + (i64.store offset=0x3db align=1 (i32.const 0) (local.get 0x3db)) + (i64.store offset=0x3dc align=1 (i32.const 0) (local.get 0x3dc)) + (i64.store offset=0x3dd align=1 (i32.const 0) (local.get 0x3dd)) + (i64.store offset=0x3de align=1 (i32.const 0) (local.get 0x3de)) + (i64.store offset=0x3df align=1 (i32.const 0) (local.get 0x3df)) + (i64.store offset=0x3e0 align=1 (i32.const 0) (local.get 0x3e0)) + (i64.store offset=0x3e1 align=1 (i32.const 0) (local.get 0x3e1)) + (i64.store offset=0x3e2 align=1 (i32.const 0) (local.get 0x3e2)) + (i64.store offset=0x3e3 align=1 (i32.const 0) (local.get 0x3e3)) + (i64.store offset=0x3e4 align=1 (i32.const 0) (local.get 0x3e4)) + (i64.store offset=0x3e5 align=1 (i32.const 0) (local.get 0x3e5)) + (i64.store offset=0x3e6 align=1 (i32.const 0) (local.get 0x3e6)) + (i64.store offset=0x3e7 align=1 (i32.const 0) (local.get 0x3e7)) + (i64.store offset=0x3e8 align=1 (i32.const 0) (local.get 0x3e8)) + (i64.store offset=0x3e9 align=1 (i32.const 0) (local.get 0x3e9)) + (i64.store offset=0x3ea align=1 (i32.const 0) (local.get 0x3ea)) + (i64.store offset=0x3eb align=1 (i32.const 0) (local.get 0x3eb)) + (i64.store offset=0x3ec align=1 (i32.const 0) (local.get 0x3ec)) + (i64.store offset=0x3ed align=1 (i32.const 0) (local.get 0x3ed)) + (i64.store offset=0x3ee align=1 (i32.const 0) (local.get 0x3ee)) + (i64.store offset=0x3ef align=1 (i32.const 0) (local.get 0x3ef)) + (i64.store offset=0x3f0 align=1 (i32.const 0) (local.get 0x3f0)) + (i64.store offset=0x3f1 align=1 (i32.const 0) (local.get 0x3f1)) + (i64.store offset=0x3f2 align=1 (i32.const 0) (local.get 0x3f2)) + (i64.store offset=0x3f3 align=1 (i32.const 0) (local.get 0x3f3)) + (i64.store offset=0x3f4 align=1 (i32.const 0) (local.get 0x3f4)) + (i64.store offset=0x3f5 align=1 (i32.const 0) (local.get 0x3f5)) + (i64.store offset=0x3f6 align=1 (i32.const 0) (local.get 0x3f6)) + (i64.store offset=0x3f7 align=1 (i32.const 0) (local.get 0x3f7)) + (i64.store offset=0x3f8 align=1 (i32.const 0) (local.get 0x3f8)) + (i64.store offset=0x3f9 align=1 (i32.const 0) (local.get 0x3f9)) + (i64.store offset=0x3fa align=1 (i32.const 0) (local.get 0x3fa)) + (i64.store offset=0x3fb align=1 (i32.const 0) (local.get 0x3fb)) + (i64.store offset=0x3fc align=1 (i32.const 0) (local.get 0x3fc)) + (i64.store offset=0x3fd align=1 (i32.const 0) (local.get 0x3fd)) + (i64.store offset=0x3fe align=1 (i32.const 0) (local.get 0x3fe)) + (i64.store offset=0x3ff align=1 (i32.const 0) (local.get 0x3ff)) + (i64.store offset=0x400 align=1 (i32.const 0) (local.get 0x400)) + (i64.store offset=0x401 align=1 (i32.const 0) (local.get 0x401)) + (i64.store offset=0x402 align=1 (i32.const 0) (local.get 0x402)) + (i64.store offset=0x403 align=1 (i32.const 0) (local.get 0x403)) + (i64.store offset=0x404 align=1 (i32.const 0) (local.get 0x404)) + (i64.store offset=0x405 align=1 (i32.const 0) (local.get 0x405)) + (i64.store offset=0x406 align=1 (i32.const 0) (local.get 0x406)) + (i64.store offset=0x407 align=1 (i32.const 0) (local.get 0x407)) + (i64.store offset=0x408 align=1 (i32.const 0) (local.get 0x408)) + (i64.store offset=0x409 align=1 (i32.const 0) (local.get 0x409)) + (i64.store offset=0x40a align=1 (i32.const 0) (local.get 0x40a)) + (i64.store offset=0x40b align=1 (i32.const 0) (local.get 0x40b)) + (i64.store offset=0x40c align=1 (i32.const 0) (local.get 0x40c)) + (i64.store offset=0x40d align=1 (i32.const 0) (local.get 0x40d)) + (i64.store offset=0x40e align=1 (i32.const 0) (local.get 0x40e)) + (i64.store offset=0x40f align=1 (i32.const 0) (local.get 0x40f)) + (i64.store offset=0x410 align=1 (i32.const 0) (local.get 0x410)) + (i64.store offset=0x411 align=1 (i32.const 0) (local.get 0x411)) + (i64.store offset=0x412 align=1 (i32.const 0) (local.get 0x412)) + (i64.store offset=0x413 align=1 (i32.const 0) (local.get 0x413)) + (i64.store offset=0x414 align=1 (i32.const 0) (local.get 0x414)) + (i64.store offset=0x415 align=1 (i32.const 0) (local.get 0x415)) + (i64.store offset=0x416 align=1 (i32.const 0) (local.get 0x416)) + (i64.store offset=0x417 align=1 (i32.const 0) (local.get 0x417)) + (i64.store offset=0x418 align=1 (i32.const 0) (local.get 0x418)) + (i64.store offset=0x419 align=1 (i32.const 0) (local.get 0x419)) + (i64.store offset=0x41a align=1 (i32.const 0) (local.get 0x41a)) + (i64.store offset=0x41b align=1 (i32.const 0) (local.get 0x41b)) + (i64.store offset=0x41c align=1 (i32.const 0) (local.get 0x41c)) + (i64.store offset=0x41d align=1 (i32.const 0) (local.get 0x41d)) + (i64.store offset=0x41e align=1 (i32.const 0) (local.get 0x41e)) + (i64.store offset=0x41f align=1 (i32.const 0) (local.get 0x41f)) + ) +) + +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 0)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 100)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 200)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 300)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 400)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 500)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 600)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 700)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 800)) "call stack exhausted") +(assert_exhaustion (invoke "test-guard-page-skip" (i32.const 900)) "call stack exhausted") diff --git a/test/spec/stack.wast b/test/spec/stack.wast index b3933b394..d0c46955d 100644 --- a/test/spec/stack.wast +++ b/test/spec/stack.wast @@ -8,8 +8,8 @@ (loop $loop (if (i64.eq (local.get $i) (i64.const 0)) - (br $done) - (block + (then (br $done)) + (else (local.set $res (i64.mul (local.get $i) (local.get $res))) (local.set $i (i64.sub (local.get $i) (i64.const 1))) ) @@ -63,9 +63,9 @@ local.get $i i64.const 0 i64.eq - if + if $body br $done - else + else $body local.get $i local.get $res i64.mul @@ -74,10 +74,10 @@ i64.const 1 i64.sub local.set $i - end + end $body br $loop - end - end + end $loop + end $done local.get $res ) @@ -131,8 +131,90 @@ (assert_return (invoke "fac-stack" (i64.const 25)) (i64.const 7034535277573963776)) (assert_return (invoke "fac-mixed" (i64.const 25)) (i64.const 7034535277573963776)) -;; from br_table.wast -(module (func $type-arg-num-vs-void - (block (br_table 0 (i32.const 0) (i32.const 1))) -)) +;; Syntax of flat call_indirect + +(module + (type $proc (func)) + (table 1 funcref) + + (func + (block i32.const 0 call_indirect) + (loop i32.const 0 call_indirect) + (if (i32.const 0) (then i32.const 0 call_indirect)) + (if (i32.const 0) + (then i32.const 0 call_indirect) + (else i32.const 0 call_indirect) + ) + (block i32.const 0 call_indirect (type $proc)) + (loop i32.const 0 call_indirect (type $proc)) + (if (i32.const 0) (then i32.const 0 call_indirect (type $proc))) + (if (i32.const 0) + (then i32.const 0 call_indirect (type $proc)) + (else i32.const 0 call_indirect (type $proc)) + ) + (block i32.const 0 i32.const 0 call_indirect (param i32)) + (loop i32.const 0 i32.const 0 call_indirect (param i32)) + (if (i32.const 0) (then i32.const 0 i32.const 0 call_indirect (param i32))) + (if (i32.const 0) + (then i32.const 0 i32.const 0 call_indirect (param i32)) + (else i32.const 0 i32.const 0 call_indirect (param i32)) + ) + (block (result i32) i32.const 0 call_indirect (result i32)) (drop) + (loop (result i32) i32.const 0 call_indirect (result i32)) (drop) + (if (result i32) (i32.const 0) + (then i32.const 0 call_indirect (result i32)) + (else i32.const 0 call_indirect (result i32)) + ) (drop) + (block i32.const 0 call_indirect (type $proc) (param) (result)) + (loop i32.const 0 call_indirect (type $proc) (param) (result)) + (if (i32.const 0) + (then i32.const 0 call_indirect (type $proc) (param) (result)) + ) + (if (i32.const 0) + (then i32.const 0 call_indirect (type $proc) (param) (param) (result)) + (else i32.const 0 call_indirect (type $proc) (param) (result) (result)) + ) + + block i32.const 0 call_indirect end + loop i32.const 0 call_indirect end + i32.const 0 if i32.const 0 call_indirect end + i32.const 0 if i32.const 0 call_indirect else i32.const 0 call_indirect end + block i32.const 0 call_indirect (type $proc) end + loop i32.const 0 call_indirect (type $proc) end + i32.const 0 if i32.const 0 call_indirect (type $proc) end + i32.const 0 + if + i32.const 0 call_indirect (type $proc) + else + i32.const 0 call_indirect (type $proc) + end + block i32.const 0 i32.const 0 call_indirect (param i32) end + loop i32.const 0 i32.const 0 call_indirect (param i32) end + i32.const 0 if i32.const 0 i32.const 0 call_indirect (param i32) end + i32.const 0 + if + i32.const 0 i32.const 0 call_indirect (param i32) + else + i32.const 0 i32.const 0 call_indirect (param i32) + end + block (result i32) i32.const 0 call_indirect (result i32) end drop + loop (result i32) i32.const 0 call_indirect (result i32) end drop + i32.const 0 + if (result i32) + i32.const 0 call_indirect (result i32) + else + i32.const 0 call_indirect (result i32) + end drop + block i32.const 0 call_indirect (type $proc) (param) (result) end + loop i32.const 0 call_indirect (type $proc) (param) (result) end + i32.const 0 if i32.const 0 call_indirect (type $proc) (param) (result) end + i32.const 0 + if + i32.const 0 call_indirect (type $proc) (param) (result) + else + i32.const 0 call_indirect (type $proc) (param) (param) (result) (result) + end + i32.const 0 call_indirect + ) +) diff --git a/test/spec/start.wast b/test/spec/start.wast index a20c449be..bf88a6a4a 100644 --- a/test/spec/start.wast +++ b/test/spec/start.wast @@ -2,6 +2,7 @@ (module (func) (start 1)) "unknown function" ) + (assert_invalid (module (func $main (result i32) (return (i32.const 0))) @@ -16,6 +17,7 @@ ) "start function" ) + (module (memory (data "A")) (func $inc @@ -76,13 +78,28 @@ (assert_return (invoke "get") (i32.const 70)) (module - (func $print_i32 (import "spectest" "print") (param i32)) + (func $print_i32 (import "spectest" "print_i32") (param i32)) (func $main (call $print_i32 (i32.const 1))) (start 1) ) (module - (func $print_i32 (import "spectest" "print") (param i32)) + (func $print_i32 (import "spectest" "print_i32") (param i32)) (func $main (call $print_i32 (i32.const 2))) (start $main) ) + +(module + (func $print (import "spectest" "print")) + (start $print) +) + +(assert_trap + (module (func $main (unreachable)) (start $main)) + "unreachable" +) + +(assert_malformed + (module quote "(module (func $a (unreachable)) (func $b (unreachable)) (start $a) (start $b))") + "multiple start sections" +) diff --git a/test/spec/store.wast b/test/spec/store.wast new file mode 100644 index 000000000..01c3a2dd6 --- /dev/null +++ b/test/spec/store.wast @@ -0,0 +1,417 @@ +;; Store operator as the argument of control constructs and instructions + +(module + (memory 1) + + (func (export "as-block-value") + (block (i32.store (i32.const 0) (i32.const 1))) + ) + (func (export "as-loop-value") + (loop (i32.store (i32.const 0) (i32.const 1))) + ) + + (func (export "as-br-value") + (block (br 0 (i32.store (i32.const 0) (i32.const 1)))) + ) + (func (export "as-br_if-value") + (block + (br_if 0 (i32.store (i32.const 0) (i32.const 1)) (i32.const 1)) + ) + ) + (func (export "as-br_if-value-cond") + (block + (br_if 0 (i32.const 6) (i32.store (i32.const 0) (i32.const 1))) + ) + ) + (func (export "as-br_table-value") + (block + (br_table 0 (i32.store (i32.const 0) (i32.const 1)) (i32.const 1)) + ) + ) + + (func (export "as-return-value") + (return (i32.store (i32.const 0) (i32.const 1))) + ) + + (func (export "as-if-then") + (if (i32.const 1) (then (i32.store (i32.const 0) (i32.const 1)))) + ) + (func (export "as-if-else") + (if (i32.const 0) (then) (else (i32.store (i32.const 0) (i32.const 1)))) + ) +) + +(assert_return (invoke "as-block-value")) +(assert_return (invoke "as-loop-value")) + +(assert_return (invoke "as-br-value")) +(assert_return (invoke "as-br_if-value")) +(assert_return (invoke "as-br_if-value-cond")) +(assert_return (invoke "as-br_table-value")) + +(assert_return (invoke "as-return-value")) + +(assert_return (invoke "as-if-then")) +(assert_return (invoke "as-if-else")) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (i32.store32 (local.get 0) (i32.const 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (i32.store64 (local.get 0) (i64.const 0)))" + ) + "unknown operator" +) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (i64.store64 (local.get 0) (i64.const 0)))" + ) + "unknown operator" +) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (f32.store32 (local.get 0) (f32.const 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (f32.store64 (local.get 0) (f64.const 0)))" + ) + "unknown operator" +) + +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (f64.store32 (local.get 0) (f32.const 0)))" + ) + "unknown operator" +) +(assert_malformed + (module quote + "(memory 1)" + "(func (param i32) (f64.store64 (local.get 0) (f64.const 0)))" + ) + "unknown operator" +) +;; store should have no retval + +(assert_invalid + (module (memory 1) (func (param i32) (result i32) (i32.store (i32.const 0) (i32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param i64) (result i64) (i64.store (i32.const 0) (i64.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param f32) (result f32) (f32.store (i32.const 0) (f32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param f64) (result f64) (f64.store (i32.const 0) (f64.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param i32) (result i32) (i32.store8 (i32.const 0) (i32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param i32) (result i32) (i32.store16 (i32.const 0) (i32.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param i64) (result i64) (i64.store8 (i32.const 0) (i64.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param i64) (result i64) (i64.store16 (i32.const 0) (i64.const 1)))) + "type mismatch" +) +(assert_invalid + (module (memory 1) (func (param i64) (result i64) (i64.store32 (i32.const 0) (i64.const 1)))) + "type mismatch" +) + + +(assert_invalid + (module + (memory 1) + (func $type-address-empty + (i32.store) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty + (i32.const 0) (i32.store) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-block + (i32.const 0) (i32.const 0) + (block (i32.store)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-block + (i32.const 0) + (block (i32.const 0) (i32.store)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-loop + (i32.const 0) (i32.const 0) + (loop (i32.store)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-loop + (i32.const 0) + (loop (i32.const 0) (i32.store)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-then + (i32.const 0) (i32.const 0) + (if (then (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-then + (i32.const 0) + (if (then (i32.const 0) (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-else + (i32.const 0) (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-else + (i32.const 0) + (if (result i32) (then (i32.const 0)) (else (i32.const 0) (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-br + (i32.const 0) (i32.const 0) + (block (br 0 (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-br + (i32.const 0) + (block (br 0 (i32.const 0) (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-br_if + (i32.const 0) (i32.const 0) + (block (br_if 0 (i32.store) (i32.const 1)) ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-br_if + (i32.const 0) + (block (br_if 0 (i32.const 0) (i32.store) (i32.const 1)) ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-br_table + (i32.const 0) (i32.const 0) + (block (br_table 0 (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-br_table + (i32.const 0) + (block (br_table 0 (i32.const 0) (i32.store))) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-return + (return (i32.store)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-return + (return (i32.const 0) (i32.store)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-select + (select (i32.store) (i32.const 1) (i32.const 2)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-select + (select (i32.const 0) (i32.store) (i32.const 1) (i32.const 2)) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-address-empty-in-call + (call 1 (i32.store)) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $type-value-empty-in-call + (call 1 (i32.const 0) (i32.store)) + ) + (func (param i32) (result i32) (local.get 0)) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-address-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (i32.store) (i32.const 0) + ) + ) + ) + ) + "type mismatch" +) +(assert_invalid + (module + (memory 1) + (func $f (param i32) (result i32) (local.get 0)) + (type $sig (func (param i32) (result i32))) + (table funcref (elem $f)) + (func $type-value-empty-in-call_indirect + (block (result i32) + (call_indirect (type $sig) + (i32.const 0) (i32.store) (i32.const 0) + ) + ) + ) + ) + "type mismatch" +) + + +;; Type check + +(assert_invalid (module (memory 1) (func (i32.store (f32.const 0) (i32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i32.store8 (f32.const 0) (i32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i32.store16 (f32.const 0) (i32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store (f32.const 0) (i32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store8 (f32.const 0) (i64.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store16 (f32.const 0) (i64.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store32 (f32.const 0) (i64.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (f32.store (f32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (f64.store (f32.const 0) (f64.const 0)))) "type mismatch") + +(assert_invalid (module (memory 1) (func (i32.store (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i32.store8 (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i32.store16 (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store8 (i32.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store16 (i32.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (i64.store32 (i32.const 0) (f64.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (f32.store (i32.const 0) (i32.const 0)))) "type mismatch") +(assert_invalid (module (memory 1) (func (f64.store (i32.const 0) (i64.const 0)))) "type mismatch") diff --git a/test/spec/switch.wast b/test/spec/switch.wast index 2e8a503a4..e9ae24dc1 100644 --- a/test/spec/switch.wast +++ b/test/spec/switch.wast @@ -47,7 +47,7 @@ (local $j i64) (local.set $j (i64.const 100)) (return - (block $switch i64 + (block $switch (result i64) (block $7 (block $default (block $4 @@ -87,13 +87,13 @@ ;; Argument switch (func (export "arg") (param $i i32) (result i32) (return - (block $2 i32 + (block $2 (result i32) (i32.add (i32.const 10) - (block $1 i32 + (block $1 (result i32) (i32.add (i32.const 100) - (block $0 i32 + (block $0 (result i32) (i32.add (i32.const 1000) - (block $default i32 + (block $default (result i32) (br_table $0 $1 $2 $default (i32.mul (i32.const 2) (local.get $i)) (i32.and (i32.const 3) (local.get $i)) diff --git a/test/spec/token.wast b/test/spec/token.wast new file mode 100644 index 000000000..1dcd32e7f --- /dev/null +++ b/test/spec/token.wast @@ -0,0 +1,10 @@ +;; Test tokenization + +(assert_malformed + (module quote "(func (drop (i32.const0)))") + "unknown operator" +) +(assert_malformed + (module quote "(func br 0drop)") + "unknown operator" +) diff --git a/test/spec/traps.wast b/test/spec/traps.wast index 3959aa947..142fa22b2 100644 --- a/test/spec/traps.wast +++ b/test/spec/traps.wast @@ -3,30 +3,32 @@ ;; discard its return value. (module - (func (export "no_dce.i32.div_s") (param $x i32) (param $y i32) (result i32) - (i32.div_s (local.get $x) (local.get $y))) - (func (export "no_dce.i32.div_u") (param $x i32) (param $y i32) (result i32) - (i32.div_u (local.get $x) (local.get $y))) - (func (export "no_dce.i64.div_s") (param $x i64) (param $y i64) (result i64) - (i64.div_s (local.get $x) (local.get $y))) - (func (export "no_dce.i64.div_u") (param $x i64) (param $y i64) (result i64) - (i64.div_u (local.get $x) (local.get $y))) + (func (export "no_dce.i32.div_s") (param $x i32) (param $y i32) + (drop (i32.div_s (local.get $x) (local.get $y)))) + (func (export "no_dce.i32.div_u") (param $x i32) (param $y i32) + (drop (i32.div_u (local.get $x) (local.get $y)))) + (func (export "no_dce.i64.div_s") (param $x i64) (param $y i64) + (drop (i64.div_s (local.get $x) (local.get $y)))) + (func (export "no_dce.i64.div_u") (param $x i64) (param $y i64) + (drop (i64.div_u (local.get $x) (local.get $y)))) ) (assert_trap (invoke "no_dce.i32.div_s" (i32.const 1) (i32.const 0)) "integer divide by zero") (assert_trap (invoke "no_dce.i32.div_u" (i32.const 1) (i32.const 0)) "integer divide by zero") (assert_trap (invoke "no_dce.i64.div_s" (i64.const 1) (i64.const 0)) "integer divide by zero") (assert_trap (invoke "no_dce.i64.div_u" (i64.const 1) (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "no_dce.i32.div_s" (i32.const 0x80000000) (i32.const -1)) "integer overflow") +(assert_trap (invoke "no_dce.i64.div_s" (i64.const 0x8000000000000000) (i64.const -1)) "integer overflow") (module - (func (export "no_dce.i32.rem_s") (param $x i32) (param $y i32) (result i32) - (i32.rem_s (local.get $x) (local.get $y))) - (func (export "no_dce.i32.rem_u") (param $x i32) (param $y i32) (result i32) - (i32.rem_u (local.get $x) (local.get $y))) - (func (export "no_dce.i64.rem_s") (param $x i64) (param $y i64) (result i64) - (i64.rem_s (local.get $x) (local.get $y))) - (func (export "no_dce.i64.rem_u") (param $x i64) (param $y i64) (result i64) - (i64.rem_u (local.get $x) (local.get $y))) + (func (export "no_dce.i32.rem_s") (param $x i32) (param $y i32) + (drop (i32.rem_s (local.get $x) (local.get $y)))) + (func (export "no_dce.i32.rem_u") (param $x i32) (param $y i32) + (drop (i32.rem_u (local.get $x) (local.get $y)))) + (func (export "no_dce.i64.rem_s") (param $x i64) (param $y i64) + (drop (i64.rem_s (local.get $x) (local.get $y)))) + (func (export "no_dce.i64.rem_u") (param $x i64) (param $y i64) + (drop (i64.rem_u (local.get $x) (local.get $y)))) ) (assert_trap (invoke "no_dce.i32.rem_s" (i32.const 1) (i32.const 0)) "integer divide by zero") @@ -35,35 +37,55 @@ (assert_trap (invoke "no_dce.i64.rem_u" (i64.const 1) (i64.const 0)) "integer divide by zero") (module - (func (export "no_dce.i32.trunc_s_f32") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x))) - (func (export "no_dce.i32.trunc_u_f32") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x))) - (func (export "no_dce.i32.trunc_s_f64") (param $x f64) (result i32) (i32.trunc_f64_s (local.get $x))) - (func (export "no_dce.i32.trunc_u_f64") (param $x f64) (result i32) (i32.trunc_f64_u (local.get $x))) - (func (export "no_dce.i64.trunc_s_f32") (param $x f32) (result i64) (i64.trunc_f32_s (local.get $x))) - (func (export "no_dce.i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_f32_u (local.get $x))) - (func (export "no_dce.i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_f64_s (local.get $x))) - (func (export "no_dce.i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_f64_u (local.get $x))) + (func (export "no_dce.i32.trunc_f32_s") (param $x f32) (drop (i32.trunc_f32_s (local.get $x)))) + (func (export "no_dce.i32.trunc_f32_u") (param $x f32) (drop (i32.trunc_f32_u (local.get $x)))) + (func (export "no_dce.i32.trunc_f64_s") (param $x f64) (drop (i32.trunc_f64_s (local.get $x)))) + (func (export "no_dce.i32.trunc_f64_u") (param $x f64) (drop (i32.trunc_f64_u (local.get $x)))) + (func (export "no_dce.i64.trunc_f32_s") (param $x f32) (drop (i64.trunc_f32_s (local.get $x)))) + (func (export "no_dce.i64.trunc_f32_u") (param $x f32) (drop (i64.trunc_f32_u (local.get $x)))) + (func (export "no_dce.i64.trunc_f64_s") (param $x f64) (drop (i64.trunc_f64_s (local.get $x)))) + (func (export "no_dce.i64.trunc_f64_u") (param $x f64) (drop (i64.trunc_f64_u (local.get $x)))) ) -(assert_trap (invoke "no_dce.i32.trunc_s_f32" (f32.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i32.trunc_u_f32" (f32.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i32.trunc_s_f64" (f64.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i32.trunc_u_f64" (f64.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i64.trunc_s_f32" (f32.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i64.trunc_u_f32" (f32.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i64.trunc_s_f64" (f64.const nan)) "invalid conversion to integer") -(assert_trap (invoke "no_dce.i64.trunc_u_f64" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i32.trunc_f32_s" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i32.trunc_f32_u" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i32.trunc_f64_s" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i32.trunc_f64_u" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i64.trunc_f32_s" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i64.trunc_f32_u" (f32.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i64.trunc_f64_s" (f64.const nan)) "invalid conversion to integer") +(assert_trap (invoke "no_dce.i64.trunc_f64_u" (f64.const nan)) "invalid conversion to integer") (module (memory 1) - (func (export "no_dce.i32.load") (param $i i32) (result i32) (i32.load (local.get $i))) - (func (export "no_dce.i64.load") (param $i i32) (result i64) (i64.load (local.get $i))) - (func (export "no_dce.f32.load") (param $i i32) (result f32) (f32.load (local.get $i))) - (func (export "no_dce.f64.load") (param $i i32) (result f64) (f64.load (local.get $i))) + (func (export "no_dce.i32.load") (param $i i32) (drop (i32.load (local.get $i)))) + (func (export "no_dce.i32.load16_s") (param $i i32) (drop (i32.load16_s (local.get $i)))) + (func (export "no_dce.i32.load16_u") (param $i i32) (drop (i32.load16_u (local.get $i)))) + (func (export "no_dce.i32.load8_s") (param $i i32) (drop (i32.load8_s (local.get $i)))) + (func (export "no_dce.i32.load8_u") (param $i i32) (drop (i32.load8_u (local.get $i)))) + (func (export "no_dce.i64.load") (param $i i32) (drop (i64.load (local.get $i)))) + (func (export "no_dce.i64.load32_s") (param $i i32) (drop (i64.load32_s (local.get $i)))) + (func (export "no_dce.i64.load32_u") (param $i i32) (drop (i64.load32_u (local.get $i)))) + (func (export "no_dce.i64.load16_s") (param $i i32) (drop (i64.load16_s (local.get $i)))) + (func (export "no_dce.i64.load16_u") (param $i i32) (drop (i64.load16_u (local.get $i)))) + (func (export "no_dce.i64.load8_s") (param $i i32) (drop (i64.load8_s (local.get $i)))) + (func (export "no_dce.i64.load8_u") (param $i i32) (drop (i64.load8_u (local.get $i)))) + (func (export "no_dce.f32.load") (param $i i32) (drop (f32.load (local.get $i)))) + (func (export "no_dce.f64.load") (param $i i32) (drop (f64.load (local.get $i)))) ) (assert_trap (invoke "no_dce.i32.load" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i32.load16_s" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i32.load16_u" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i32.load8_s" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i32.load8_u" (i32.const 65536)) "out of bounds memory access") (assert_trap (invoke "no_dce.i64.load" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i64.load32_s" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i64.load32_u" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i64.load16_s" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i64.load16_u" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i64.load8_s" (i32.const 65536)) "out of bounds memory access") +(assert_trap (invoke "no_dce.i64.load8_u" (i32.const 65536)) "out of bounds memory access") (assert_trap (invoke "no_dce.f32.load" (i32.const 65536)) "out of bounds memory access") (assert_trap (invoke "no_dce.f64.load" (i32.const 65536)) "out of bounds memory access") diff --git a/test/spec/type.wast b/test/spec/type.wast new file mode 100644 index 000000000..5ceeeb269 --- /dev/null +++ b/test/spec/type.wast @@ -0,0 +1,59 @@ +;; Test type definitions + +(module + (type (func)) + (type $t (func)) + + (type (func (param i32))) + (type (func (param $x i32))) + (type (func (result i32))) + (type (func (param i32) (result i32))) + (type (func (param $x i32) (result i32))) + + (type (func (param f32 f64))) + ;; (type (func (result i64 f32))) + ;; (type (func (param i32 i64) (result f32 f64))) + + (type (func (param f32) (param f64))) + (type (func (param $x f32) (param f64))) + (type (func (param f32) (param $y f64))) + (type (func (param $x f32) (param $y f64))) + ;; (type (func (result i64) (result f32))) + ;; (type (func (param i32) (param i64) (result f32) (result f64))) + ;; (type (func (param $x i32) (param $y i64) (result f32) (result f64))) + + (type (func (param f32 f64) (param $x i32) (param f64 i32 i32))) + ;; (type (func (result i64 i64 f32) (result f32 i32))) + ;; (type + ;; (func (param i32 i32) (param i64 i32) (result f32 f64) (result f64 i32)) + ;; ) + + (type (func (param) (param $x f32) (param) (param) (param f64 i32) (param))) + ;; (type + ;; (func (result) (result) (result i64 i64) (result) (result f32) (result)) + ;; ) + ;; (type + ;; (func + ;; (param i32 i32) (param i64 i32) (param) (param $x i32) (param) + ;; (result) (result f32 f64) (result f64 i32) (result) + ;; ) + ;; ) +) + +(assert_malformed + (module quote "(type (func (result i32) (param i32)))") + "result before parameter" +) +(assert_malformed + (module quote "(type (func (result $x i32)))") + "unexpected token" +) + +(assert_invalid + (module (type (func (result i32 i32)))) + "invalid result arity" +) +(assert_invalid + (module (type (func (result i32) (result i32)))) + "invalid result arity" +) diff --git a/test/spec/unreachable.wast b/test/spec/unreachable.wast index ee61f794f..3074847a3 100644 --- a/test/spec/unreachable.wast +++ b/test/spec/unreachable.wast @@ -24,56 +24,74 @@ ) (func (export "as-block-first") (result i32) - (block i32 (unreachable) (i32.const 2)) + (block (result i32) (unreachable) (i32.const 2)) ) (func (export "as-block-mid") (result i32) - (block i32 (call $dummy) (unreachable) (i32.const 2)) + (block (result i32) (call $dummy) (unreachable) (i32.const 2)) ) (func (export "as-block-last") (block (nop) (call $dummy) (unreachable)) ) (func (export "as-block-value") (result i32) - (block i32 (nop) (call $dummy) (unreachable)) + (block (result i32) (nop) (call $dummy) (unreachable)) ) (func (export "as-block-broke") (result i32) - (block i32 (call $dummy) (br 0 (i32.const 1)) (unreachable)) + (block (result i32) (call $dummy) (br 0 (i32.const 1)) (unreachable)) ) (func (export "as-loop-first") (result i32) - (loop i32 (unreachable) (i32.const 2)) + (loop (result i32) (unreachable) (i32.const 2)) ) (func (export "as-loop-mid") (result i32) - (loop i32 (call $dummy) (unreachable) (i32.const 2)) + (loop (result i32) (call $dummy) (unreachable) (i32.const 2)) ) (func (export "as-loop-last") (loop (nop) (call $dummy) (unreachable)) ) (func (export "as-loop-broke") (result i32) - (block i32 (loop i32 (call $dummy) (br 1 (i32.const 1)) (unreachable))) + (block (result i32) + (loop (result i32) (call $dummy) (br 1 (i32.const 1)) (unreachable)) + ) ) (func (export "as-br-value") (result i32) - (block i32 (br 0 (unreachable))) + (block (result i32) (br 0 (unreachable))) ) (func (export "as-br_if-cond") (block (br_if 0 (unreachable))) ) (func (export "as-br_if-value") (result i32) - (block i32 (br_if 0 (unreachable) (i32.const 1)) (i32.const 7)) + (block (result i32) + (drop (br_if 0 (unreachable) (i32.const 1))) (i32.const 7) + ) ) (func (export "as-br_if-value-cond") (result i32) - (block i32 (drop (br_if 0 (i32.const 6) (unreachable))) (i32.const 7)) + (block (result i32) + (drop (br_if 0 (i32.const 6) (unreachable))) (i32.const 7) + ) ) (func (export "as-br_table-index") (block (br_table 0 0 0 (unreachable))) ) (func (export "as-br_table-value") (result i32) - (block i32 (br_table 0 0 0 (unreachable) (i32.const 1)) (i32.const 7)) + (block (result i32) + (br_table 0 0 0 (unreachable) (i32.const 1)) (i32.const 7) + ) + ) + (func (export "as-br_table-value-2") (result i32) + (block (result i32) + (block (result i32) (br_table 0 1 (unreachable) (i32.const 1))) + ) ) (func (export "as-br_table-value-index") (result i32) - (block i32 (br_table 0 0 (i32.const 6) (unreachable)) (i32.const 7)) + (block (result i32) + (br_table 0 0 (i32.const 6) (unreachable)) (i32.const 7) + ) + ) + (func (export "as-br_table-value-and-index") (result i32) + (block (result i32) (br_table 0 0 (unreachable)) (i32.const 8)) ) (func (export "as-return-value") (result i64) @@ -81,13 +99,16 @@ ) (func (export "as-if-cond") (result i32) - (if i32 (unreachable) (i32.const 0) (i32.const 1)) + (if (result i32) (unreachable) (then (i32.const 0)) (else (i32.const 1))) ) (func (export "as-if-then") (param i32 i32) (result i32) - (if i32 (local.get 0) (unreachable) (local.get 1)) + (if (result i32) (local.get 0) (then (unreachable)) (else (local.get 1))) ) (func (export "as-if-else") (param i32 i32) (result i32) - (if i32 (local.get 0) (local.get 1) (unreachable)) + (if (result i32) (local.get 0) (then (local.get 1)) (else (unreachable))) + ) + (func (export "as-if-then-no-else") (param i32 i32) (result i32) + (if (local.get 0) (then (unreachable))) (local.get 1) ) (func (export "as-select-first") (param i32 i32) (result i32) @@ -113,21 +134,36 @@ (type $sig (func (param i32 i32 i32))) (table funcref (elem $dummy3)) (func (export "as-call_indirect-func") - (call_indirect (type $sig) (unreachable) (i32.const 1) (i32.const 2) (i32.const 3)) + (call_indirect (type $sig) + (unreachable) (i32.const 1) (i32.const 2) (i32.const 3) + ) ) (func (export "as-call_indirect-first") - (call_indirect (type $sig) (i32.const 0) (unreachable) (i32.const 2) (i32.const 3)) + (call_indirect (type $sig) + (i32.const 0) (unreachable) (i32.const 2) (i32.const 3) + ) ) (func (export "as-call_indirect-mid") - (call_indirect (type $sig) (i32.const 0) (i32.const 1) (unreachable) (i32.const 3)) + (call_indirect (type $sig) + (i32.const 0) (i32.const 1) (unreachable) (i32.const 3) + ) ) (func (export "as-call_indirect-last") - (call_indirect (type $sig) (i32.const 0) (i32.const 1) (i32.const 2) (unreachable)) + (call_indirect (type $sig) + (i32.const 0) (i32.const 1) (i32.const 2) (unreachable) + ) ) (func (export "as-local.set-value") (local f32) (local.set 0 (unreachable)) ) + (func (export "as-local.tee-value") (result f32) (local f32) + (local.tee 0 (unreachable)) + ) + (global $a (mut f32) (f32.const 0)) + (func (export "as-global.set-value") (result f32) + (global.set $a (unreachable)) + ) (memory 1) (func (export "as-load-address") (result f32) @@ -211,7 +247,9 @@ (assert_trap (invoke "as-br_table-index") "unreachable") (assert_trap (invoke "as-br_table-value") "unreachable") +(assert_trap (invoke "as-br_table-value-2") "unreachable") (assert_trap (invoke "as-br_table-value-index") "unreachable") +(assert_trap (invoke "as-br_table-value-and-index") "unreachable") (assert_trap (invoke "as-return-value") "unreachable") @@ -220,6 +258,8 @@ (assert_return (invoke "as-if-then" (i32.const 0) (i32.const 6)) (i32.const 6)) (assert_trap (invoke "as-if-else" (i32.const 0) (i32.const 6)) "unreachable") (assert_return (invoke "as-if-else" (i32.const 1) (i32.const 6)) (i32.const 6)) +(assert_trap (invoke "as-if-then-no-else" (i32.const 1) (i32.const 6)) "unreachable") +(assert_return (invoke "as-if-then-no-else" (i32.const 0) (i32.const 6)) (i32.const 6)) (assert_trap (invoke "as-select-first" (i32.const 0) (i32.const 6)) "unreachable") (assert_trap (invoke "as-select-first" (i32.const 1) (i32.const 6)) "unreachable") @@ -237,6 +277,8 @@ (assert_trap (invoke "as-call_indirect-last") "unreachable") (assert_trap (invoke "as-local.set-value") "unreachable") +(assert_trap (invoke "as-local.tee-value") "unreachable") +(assert_trap (invoke "as-global.set-value") "unreachable") (assert_trap (invoke "as-load-address") "unreachable") (assert_trap (invoke "as-loadN-address") "unreachable") diff --git a/test/spec/unreached-invalid.wast b/test/spec/unreached-invalid.wast new file mode 100644 index 000000000..6ef4ac552 --- /dev/null +++ b/test/spec/unreached-invalid.wast @@ -0,0 +1,709 @@ +;; Failures in unreachable code. + +(assert_invalid + (module (func $local-index (unreachable) (drop (local.get 0)))) + "unknown local" +) +(assert_invalid + (module (func $global-index (unreachable) (drop (global.get 0)))) + "unknown global" +) +(assert_invalid + (module (func $func-index (unreachable) (call 1))) + "unknown function" +) +(assert_invalid + (module (func $label-index (unreachable) (br 1))) + "unknown label" +) + +(assert_invalid + (module (func $type-num-vs-num + (unreachable) (drop (i64.eqz (i32.const 0)))) + ) + "type mismatch" +) +(assert_invalid + (module (func $type-poly-num-vs-num (result i32) + (unreachable) (i64.const 0) (i32.const 0) (select) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-poly-transitive-num-vs-num (result i32) + (unreachable) + (i64.const 0) (i32.const 0) (select) + (i32.const 0) (i32.const 0) (select) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unconsumed-const (unreachable) (i32.const 0))) + "type mismatch" +) +(assert_invalid + (module (func $type-unconsumed-result (unreachable) (i32.eqz))) + "type mismatch" +) +(assert_invalid + (module (func $type-unconsumed-result2 + (unreachable) (i32.const 0) (i32.add) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unconsumed-poly0 (unreachable) (select))) + "type mismatch" +) +(assert_invalid + (module (func $type-unconsumed-poly1 (unreachable) (i32.const 0) (select))) + "type mismatch" +) +(assert_invalid + (module (func $type-unconsumed-poly2 + (unreachable) (i32.const 0) (i32.const 0) (select) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unary-num-vs-void-after-break + (block (br 0) (block (drop (i32.eqz (nop))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-num-after-break + (block (br 0) (drop (i32.eqz (f32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-void-after-break + (block (br 0) (block (drop (f32.eq (i32.const 1))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-num-after-break + (block (br 0) (drop (f32.eq (i32.const 1) (f32.const 0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-after-break + (block (br 0) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-after-break (result i32) + (block (result i32) (i32.const 1) (br 0) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-void-after-break + (block (loop (br 1) (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-num-after-break (result i32) + (loop (result i32) (br 1 (i32.const 1)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-void-after-break + (br 0) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-num-after-break (result i32) + (br 0 (i32.const 1)) (f32.const 0) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unary-num-vs-void-after-return + (return) (block (drop (i32.eqz (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-num-after-return + (return) (drop (i32.eqz (f32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-void-after-return + (return) (block (drop (f32.eq (i32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-num-after-return + (return) (drop (f32.eq (i32.const 1) (f32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-after-return + (block (return) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-after-return (result i32) + (block (result i32) (i32.const 1) (return (i32.const 0)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-void-after-return + (block (loop (return) (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-num-after-return (result i32) + (loop (result i32) (return (i32.const 1)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-void-after-return + (return) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-num-after-return (result i32) + (return (i32.const 1)) (f32.const 0) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unary-num-vs-void-after-unreachable + (unreachable) (block (drop (i32.eqz (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-void-in-loop-after-unreachable + (unreachable) (loop (drop (i32.eqz (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-void-in-i32-loop-after-unreachable + (unreachable) (loop (result i32) (i32.eqz (nop))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-num-after-unreachable + (unreachable) (drop (i32.eqz (f32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-void-after-unreachable + (unreachable) (block (drop (f32.eq (i32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-num-after-unreachable + (unreachable) (drop (f32.eq (i32.const 1) (f32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-after-unreachable + (block (unreachable) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-after-unreachable (result i32) + (block (result i32) (i32.const 1) (unreachable) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-void-after-unreachable + (block (loop (unreachable) (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-num-after-unreachable (result i32) + (loop (result i32) (unreachable) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-void-after-unreachable + (unreachable) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-num-after-unreachable (result i32) + (unreachable) (f32.const 0) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-void-in-if-after-unreachable + (unreachable) (if (i32.const 0) (then (drop (i32.eqz (nop))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-void-in-else-after-unreachable + (unreachable) (if (i32.const 0) (then (nop)) (else (drop (i32.eqz (nop))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-void-in-else-after-unreachable-if + (if (i32.const 0) (then (unreachable)) (else (drop (i32.eqz (nop))))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unary-num-vs-void-after-nested-unreachable + (block (unreachable)) (block (drop (i32.eqz (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-num-after-nested-unreachable + (block (unreachable)) (drop (i32.eqz (f32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-void-after-nested-unreachable + (block (unreachable)) (block (drop (f32.eq (i32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-num-after-nested-unreachable + (block (unreachable)) (drop (f32.eq (i32.const 1) (f32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-after-nested-unreachable + (block (block (unreachable)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-after-nested-unreachable + (result i32) + (block (result i32) (i32.const 1) (block (unreachable)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-void-after-nested-unreachable + (block (loop (block (unreachable)) (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-num-after-nested-unreachable + (result i32) + (loop (result i32) (block (unreachable)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-void-after-nested-unreachable + (block (unreachable)) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-num-after-nested-unreachable + (result i32) + (block (unreachable)) (f32.const 0) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unary-num-vs-void-after-infinite-loop + (loop (br 0)) (block (drop (i32.eqz (nop)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-num-after-infinite-loop + (loop (br 0)) (drop (i32.eqz (f32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-void-after-infinite-loop + (loop (br 0)) (block (drop (f32.eq (i32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-num-after-infinite-loop + (loop (br 0)) (drop (f32.eq (i32.const 1) (f32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-after-infinite-loop + (block (loop (br 0)) (i32.const 1)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-after-infinite-loop (result i32) + (block (result i32) (i32.const 1) (loop (br 0)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-void-after-infinite-loop + (block (loop (loop (br 0)) (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-num-vs-num-after-infinite-loop (result i32) + (loop (result i32) (loop (br 0)) (f32.const 0)) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-void-after-infinite-loop + (loop (br 0)) (i32.const 1) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-func-value-num-vs-num-after-infinite-loop (result i32) + (loop (br 0)) (f32.const 0) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-unary-num-vs-void-in-dead-body + (if (i32.const 0) (then (drop (i32.eqz (nop))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-unary-num-vs-num-in-dead-body + (if (i32.const 0) (then (drop (i32.eqz (f32.const 1))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-void-in-dead-body + (if (i32.const 0) (then (drop (f32.eq (i32.const 1))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-binary-num-vs-num-in-dead-body + (if (i32.const 0) (then (drop (f32.eq (i32.const 1) (f32.const 0))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-if-value-num-vs-void-in-dead-body + (if (i32.const 0) (then (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-if-value-num-vs-num-in-dead-body (result i32) + (if (result i32) (i32.const 0) (then (f32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-in-dead-body + (if (i32.const 0) (then (block (i32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-in-dead-body (result i32) + (if (result i32) (i32.const 0) (then (block (result i32) (f32.const 0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-void-in-dead-body + (if (i32.const 0) (then (loop (i32.const 1)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-num-vs-num-in-dead-body (result i32) + (if (result i32) (i32.const 0) (then (loop (result i32) (f32.const 0)))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-return-second-num-vs-num (result i32) + (return (i32.const 1)) (return (f64.const 1)) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-br-second-num-vs-num (result i32) + (block (result i32) (br 0 (i32.const 1)) (br 0 (f64.const 1))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-br_if-cond-num-vs-num-after-unreachable + (block (br_if 0 (unreachable) (f32.const 0))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_if-num-vs-void-after-unreachable (result i32) + (block (result i32) + (block (unreachable) (br_if 1 (i32.const 0) (i32.const 0))) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_if-num-vs-num-after-unreachable (result i32) + (block (result i32) + (block (result f32) (unreachable) (br_if 1 (i32.const 0) (i32.const 0))) + (drop) (i32.const 0) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_if-num2-vs-num-after-unreachable (result i32) + (block (result i32) + (unreachable) (br_if 0 (i32.const 0) (i32.const 0)) (i32.const 0) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_table-num-vs-num-after-unreachable + (block (br_table 0 (unreachable) (f32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_table-label-num-vs-num-after-unreachable (result i32) + (block (result i32) (unreachable) (br_table 0 (f32.const 0) (i32.const 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_table-label-num-vs-label-void-after-unreachable + (block + (block (result f32) + (unreachable) + (br_table 0 1 0 (i32.const 1)) + ) + (drop) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-br_table-label-num-vs-label-num-after-unreachable + (block (result f64) + (block (result f32) + (unreachable) + (br_table 0 1 1 (i32.const 1)) + ) + (drop) + (f64.const 0) + ) + (drop) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-block-value-nested-unreachable-num-vs-void + (block (i32.const 3) (block (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-unreachable-void-vs-num (result i32) + (block (block (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-unreachable-num-vs-num (result i32) + (block (result i64) (i64.const 0) (block (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-unreachable-num2-vs-void (result i32) + (block (i32.const 3) (block (i64.const 1) (unreachable))) (i32.const 9) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-block-value-nested-br-num-vs-void + (block (i32.const 3) (block (br 1))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-br-void-vs-num (result i32) + (block (result i32) (block (br 1 (i32.const 0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-br-num-vs-num (result i32) + (block (result i32) (i64.const 0) (block (br 1 (i32.const 0)))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-block-value-nested2-br-num-vs-void + (block (block (i32.const 3) (block (br 2)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested2-br-void-vs-num (result i32) + (block (result i32) (block (block (br 2 (i32.const 0))))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested2-br-num-vs-num (result i32) + (block (result i32) + (block (result i64) (i64.const 0) (block (br 2 (i32.const 0)))) + ) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested2-br-num2-vs-void (result i32) + (block (i32.const 3) (block (i64.const 1) (br 1))) (i32.const 9) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-block-value-nested-return-num-vs-void + (block (i32.const 3) (block (return))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-return-void-vs-num (result i32) + (block (block (return (i32.const 0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-return-num-vs-num (result i32) + (block (result i64) (i64.const 0) (block (return (i32.const 0)))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-block-value-nested-return-num2-vs-void (result i32) + (block (i32.const 3) (block (i64.const 1) (return (i32.const 0)))) + (i32.const 9) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-loop-value-nested-unreachable-num-vs-void + (loop (i32.const 3) (block (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-nested-unreachable-void-vs-num (result i32) + (loop (block (unreachable))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-loop-value-nested-unreachable-num-vs-num (result i32) + (loop (result i64) (i64.const 0) (block (unreachable))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $type-cont-last-void-vs-empty (result i32) + (loop (br 0 (nop))) + )) + "type mismatch" +) +(assert_invalid + (module (func $type-cont-last-num-vs-empty (result i32) + (loop (br 0 (i32.const 0))) + )) + "type mismatch" +) + +(assert_invalid + (module (func $tee-local-unreachable-value + (local i32) + (local.tee 0 (unreachable)) + )) + "type mismatch" +) +(assert_invalid + (module (func $br_if-unreachable (result i32) + (block (result i32) + (block + (br_if 1 (unreachable) (i32.const 0)) + ) + (i32.const 0) + ) + )) + "type mismatch" +) +(assert_invalid + (module + (func $type-br_if-after-unreachable (result i64) + unreachable + br_if 0 + i64.extend_i32_u + ) + ) + "type mismatch" +) diff --git a/test/spec/unwind.wast b/test/spec/unwind.wast index 8db16c75b..85db60b59 100644 --- a/test/spec/unwind.wast +++ b/test/spec/unwind.wast @@ -1,6 +1,31 @@ ;; Test that control-flow transfer unwinds stack and it can be anything after. (module + (func (export "func-unwind-by-unreachable") + (i32.const 3) (i64.const 1) (unreachable) + ) + (func (export "func-unwind-by-br") + (i32.const 3) (i64.const 1) (br 0) + ) + (func (export "func-unwind-by-br-value") (result i32) + (i32.const 3) (i64.const 1) (br 0 (i32.const 9)) + ) + (func (export "func-unwind-by-br_if") + (i32.const 3) (i64.const 1) (drop (drop (br_if 0 (i32.const 1)))) + ) + (func (export "func-unwind-by-br_if-value") (result i32) + (i32.const 3) (i64.const 1) (drop (drop (br_if 0 (i32.const 9) (i32.const 1)))) + ) + (func (export "func-unwind-by-br_table") + (i32.const 3) (i64.const 1) (br_table 0 (i32.const 0)) + ) + (func (export "func-unwind-by-br_table-value") (result i32) + (i32.const 3) (i64.const 1) (br_table 0 (i32.const 9) (i32.const 0)) + ) + (func (export "func-unwind-by-return") (result i32) + (i32.const 3) (i64.const 1) (return (i32.const 9)) + ) + (func (export "block-unwind-by-unreachable") (block (i32.const 3) (i64.const 1) (unreachable)) ) @@ -8,28 +33,46 @@ (block (i32.const 3) (i64.const 1) (br 0)) (i32.const 9) ) (func (export "block-unwind-by-br-value") (result i32) - (block i32 (i32.const 3) (i64.const 1) (br 0 (i32.const 9))) + (block (result i32) (i32.const 3) (i64.const 1) (br 0 (i32.const 9))) + ) + (func (export "block-unwind-by-br_if") (result i32) + (block (i32.const 3) (i64.const 1) (drop (drop (br_if 0 (i32.const 1))))) (i32.const 9) + ) + (func (export "block-unwind-by-br_if-value") (result i32) + (block (result i32) + (i32.const 3) (i64.const 1) (drop (drop (br_if 0 (i32.const 9) (i32.const 1)))) + ) ) (func (export "block-unwind-by-br_table") (result i32) (block (i32.const 3) (i64.const 1) (br_table 0 (i32.const 0))) (i32.const 9) ) (func (export "block-unwind-by-br_table-value") (result i32) - (block i32 + (block (result i32) (i32.const 3) (i64.const 1) (br_table 0 (i32.const 9) (i32.const 0)) ) ) (func (export "block-unwind-by-return") (result i32) - (block i32 (i32.const 3) (i64.const 1) (return (i32.const 9))) + (block (result i32) (i32.const 3) (i64.const 1) (return (i32.const 9))) ) (func (export "block-nested-unwind-by-unreachable") (result i32) - (block i32 (i32.const 3) (block (i64.const 1) (unreachable))) + (block (result i32) (i32.const 3) (block (i64.const 1) (unreachable))) ) (func (export "block-nested-unwind-by-br") (result i32) (block (i32.const 3) (block (i64.const 1) (br 1)) (drop)) (i32.const 9) ) (func (export "block-nested-unwind-by-br-value") (result i32) - (block i32 (i32.const 3) (block (i64.const 1) (br 1 (i32.const 9)))) + (block (result i32) + (i32.const 3) (block (i64.const 1) (br 1 (i32.const 9))) + ) + ) + (func (export "block-nested-unwind-by-br_if") (result i32) + (block (i32.const 3) (block (i64.const 1) (drop (br_if 1 (i32.const 1)))) (drop)) (i32.const 9) + ) + (func (export "block-nested-unwind-by-br_if-value") (result i32) + (block (result i32) + (i32.const 3) (block (i64.const 1) (drop (drop (br_if 1 (i32.const 9) (i32.const 1))))) + ) ) (func (export "block-nested-unwind-by-br_table") (result i32) (block @@ -39,23 +82,30 @@ (i32.const 9) ) (func (export "block-nested-unwind-by-br_table-value") (result i32) - (block i32 + (block (result i32) (i32.const 3) (block (i64.const 1) (br_table 1 (i32.const 9) (i32.const 1))) ) ) (func (export "block-nested-unwind-by-return") (result i32) - (block i32 (i32.const 3) (block (i64.const 1) (return (i32.const 9)))) + (block (result i32) + (i32.const 3) (block (i64.const 1) (return (i32.const 9))) + ) ) (func (export "unary-after-unreachable") (result i32) (f32.const 0) (unreachable) (i64.eqz) ) (func (export "unary-after-br") (result i32) - (block i32 (f32.const 0) (br 0 (i32.const 9)) (i64.eqz)) + (block (result i32) (f32.const 0) (br 0 (i32.const 9)) (i64.eqz)) + ) + (func (export "unary-after-br_if") (result i32) + (block (result i32) + (i64.const 0) (drop (br_if 0 (i32.const 9) (i32.const 1))) (i64.eqz) + ) ) (func (export "unary-after-br_table") (result i32) - (block i32 + (block (result i32) (f32.const 0) (br_table 0 0 (i32.const 9) (i32.const 0)) (i64.eqz) ) ) @@ -67,10 +117,18 @@ (f32.const 0) (f64.const 1) (unreachable) (i64.eq) ) (func (export "binary-after-br") (result i32) - (block i32 (f32.const 0) (f64.const 1) (br 0 (i32.const 9)) (i64.eq)) + (block (result i32) + (f32.const 0) (f64.const 1) (br 0 (i32.const 9)) (i64.eq) + ) + ) + (func (export "binary-after-br_if") (result i32) + (block (result i32) + (i64.const 0) (i64.const 1) (drop (br_if 0 (i32.const 9) (i32.const 1))) + (i64.eq) + ) ) (func (export "binary-after-br_table") (result i32) - (block i32 + (block (result i32) (f32.const 0) (f64.const 1) (br_table 0 (i32.const 9) (i32.const 0)) (i64.eq) ) @@ -83,12 +141,19 @@ (f32.const 0) (f64.const 1) (i64.const 0) (unreachable) (select) ) (func (export "select-after-br") (result i32) - (block i32 + (block (result i32) (f32.const 0) (f64.const 1) (i64.const 0) (br 0 (i32.const 9)) (select) ) ) + (func (export "select-after-br_if") (result i32) + (block (result i32) + (i32.const 0) (i32.const 1) (i32.const 0) + (drop (br_if 0 (i32.const 9) (i32.const 1))) + (select) + ) + ) (func (export "select-after-br_table") (result i32) - (block i32 + (block (result i32) (f32.const 0) (f64.const 1) (i64.const 0) (br_table 0 (i32.const 9) (i32.const 0)) (select) @@ -99,37 +164,65 @@ ) (func (export "block-value-after-unreachable") (result i32) - (block i32 (f32.const 0) (unreachable)) + (block (result i32) (f32.const 0) (unreachable)) ) (func (export "block-value-after-br") (result i32) - (block i32 (f32.const 0) (br 0 (i32.const 9))) + (block (result i32) (f32.const 0) (br 0 (i32.const 9))) + ) + (func (export "block-value-after-br_if") (result i32) + (block (result i32) + (i32.const 0) (drop (br_if 0 (i32.const 9) (i32.const 1))) + ) ) (func (export "block-value-after-br_table") (result i32) - (block i32 (f32.const 0) (br_table 0 0 (i32.const 9) (i32.const 0))) + (block (result i32) + (f32.const 0) (br_table 0 0 (i32.const 9) (i32.const 0)) + ) ) (func (export "block-value-after-return") (result i32) - (block i32 (f32.const 0) (return (i32.const 9))) + (block (result i32) (f32.const 0) (return (i32.const 9))) ) (func (export "loop-value-after-unreachable") (result i32) - (loop i32 (f32.const 0) (unreachable)) + (loop (result i32) (f32.const 0) (unreachable)) ) (func (export "loop-value-after-br") (result i32) - (block i32 (loop i32 (f32.const 0) (br 1 (i32.const 9)))) + (block (result i32) (loop (result i32) (f32.const 0) (br 1 (i32.const 9)))) ) + (func (export "loop-value-after-br_if") (result i32) + (block (result i32) + (loop (result i32) + (i32.const 0) (drop (br_if 1 (i32.const 9) (i32.const 1))) + ) + ) + ) + (func (export "loop-value-after-br_table") (result i32) - (block i32 - (loop i32 (f32.const 0) (br_table 1 1 (i32.const 9) (i32.const 0))) + (block (result i32) + (loop (result i32) + (f32.const 0) (br_table 1 1 (i32.const 9) (i32.const 0)) + ) ) ) (func (export "loop-value-after-return") (result i32) - (loop i32 (f32.const 0) (return (i32.const 9))) + (loop (result i32) (f32.const 0) (return (i32.const 9))) ) ) +(assert_trap (invoke "func-unwind-by-unreachable") "unreachable") +(assert_return (invoke "func-unwind-by-br")) +(assert_return (invoke "func-unwind-by-br-value") (i32.const 9)) +(assert_return (invoke "func-unwind-by-br_if")) +(assert_return (invoke "func-unwind-by-br_if-value") (i32.const 9)) +(assert_return (invoke "func-unwind-by-br_table")) +(assert_return (invoke "func-unwind-by-br_table-value") (i32.const 9)) +(assert_return (invoke "func-unwind-by-return") (i32.const 9)) + (assert_trap (invoke "block-unwind-by-unreachable") "unreachable") (assert_return (invoke "block-unwind-by-br") (i32.const 9)) (assert_return (invoke "block-unwind-by-br-value") (i32.const 9)) +(assert_return (invoke "block-unwind-by-br_if") (i32.const 9)) +(assert_return (invoke "block-unwind-by-br_if-value") (i32.const 9)) (assert_return (invoke "block-unwind-by-br_table") (i32.const 9)) (assert_return (invoke "block-unwind-by-br_table-value") (i32.const 9)) (assert_return (invoke "block-unwind-by-return") (i32.const 9)) @@ -137,31 +230,38 @@ (assert_trap (invoke "block-nested-unwind-by-unreachable") "unreachable") (assert_return (invoke "block-nested-unwind-by-br") (i32.const 9)) (assert_return (invoke "block-nested-unwind-by-br-value") (i32.const 9)) +(assert_return (invoke "block-nested-unwind-by-br_if") (i32.const 9)) +(assert_return (invoke "block-nested-unwind-by-br_if-value") (i32.const 9)) (assert_return (invoke "block-nested-unwind-by-br_table") (i32.const 9)) (assert_return (invoke "block-nested-unwind-by-br_table-value") (i32.const 9)) (assert_return (invoke "block-nested-unwind-by-return") (i32.const 9)) (assert_trap (invoke "unary-after-unreachable") "unreachable") (assert_return (invoke "unary-after-br") (i32.const 9)) +(assert_return (invoke "unary-after-br_if") (i32.const 9)) (assert_return (invoke "unary-after-br_table") (i32.const 9)) (assert_return (invoke "unary-after-return") (i32.const 9)) (assert_trap (invoke "binary-after-unreachable") "unreachable") (assert_return (invoke "binary-after-br") (i32.const 9)) +(assert_return (invoke "binary-after-br_if") (i32.const 9)) (assert_return (invoke "binary-after-br_table") (i32.const 9)) (assert_return (invoke "binary-after-return") (i32.const 9)) (assert_trap (invoke "select-after-unreachable") "unreachable") (assert_return (invoke "select-after-br") (i32.const 9)) +(assert_return (invoke "select-after-br_if") (i32.const 9)) (assert_return (invoke "select-after-br_table") (i32.const 9)) (assert_return (invoke "select-after-return") (i32.const 9)) (assert_trap (invoke "block-value-after-unreachable") "unreachable") (assert_return (invoke "block-value-after-br") (i32.const 9)) +(assert_return (invoke "block-value-after-br_if") (i32.const 9)) (assert_return (invoke "block-value-after-br_table") (i32.const 9)) (assert_return (invoke "block-value-after-return") (i32.const 9)) (assert_trap (invoke "loop-value-after-unreachable") "unreachable") (assert_return (invoke "loop-value-after-br") (i32.const 9)) +(assert_return (invoke "loop-value-after-br_if") (i32.const 9)) (assert_return (invoke "loop-value-after-br_table") (i32.const 9)) (assert_return (invoke "loop-value-after-return") (i32.const 9)) diff --git a/test/spec/utf8-custom-section-id.wast b/test/spec/utf8-custom-section-id.wast new file mode 100644 index 000000000..129d2b913 --- /dev/null +++ b/test/spec/utf8-custom-section-id.wast @@ -0,0 +1,1792 @@ +;;;;;; Invalid UTF-8 custom section names + +;;;; Continuation bytes not preceded by prefixes + +;; encoding starts with (first) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\80" ;; "\80" + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x8f) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\8f" ;; "\8f" + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x90) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\90" ;; "\90" + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x9f) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\9f" ;; "\9f" + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0xa0) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\a0" ;; "\a0" + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (last) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\bf" ;; "\bf" + ) + "invalid UTF-8 encoding" +) + +;;;; 2-byte sequences + +;; 2-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\c2\80\80" ;; "\c2\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 2-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\c2" ;; "\c2" + ) + "invalid UTF-8 encoding" +) + +;; 2-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c2\2e" ;; "\c2." + ) + "invalid UTF-8 encoding" +) + +;;;; 2-byte sequence contents + +;; overlong encoding after 0xc0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c0\80" ;; "\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c0\bf" ;; "\c0\bf" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc1 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c1\80" ;; "\c1\80" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc1 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c1\bf" ;; "\c1\bf" + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a contination byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c2\00" ;; "\c2\00" + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c2\7f" ;; "\c2\7f" + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c2\c0" ;; "\c2\c0" + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\c2\fd" ;; "\c2\fd" + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\df\00" ;; "\df\00" + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\df\7f" ;; "\df\7f" + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\df\c0" ;; "\df\c0" + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\df\fd" ;; "\df\fd" + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequences + +;; 3-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\e1\80\80\80" ;; "\e1\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\e1\80" ;; "\e1\80" + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\80\2e" ;; "\e1\80." + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\e1" ;; "\e1" + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\e1\2e" ;; "\e1." + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequence contents + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\00\a0" ;; "\e0\00\a0" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\7f\a0" ;; "\e0\7f\a0" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\80\80" ;; "\e0\80\80" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\80\a0" ;; "\e0\80\a0" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\9f\a0" ;; "\e0\9f\a0" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\9f\bf" ;; "\e0\9f\bf" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\c0\a0" ;; "\e0\c0\a0" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\fd\a0" ;; "\e0\fd\a0" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\00\80" ;; "\e1\00\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\7f\80" ;; "\e1\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\c0\80" ;; "\e1\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\fd\80" ;; "\e1\fd\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\00\80" ;; "\ec\00\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\7f\80" ;; "\ec\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\c0\80" ;; "\ec\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\fd\80" ;; "\ec\fd\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\00\80" ;; "\ed\00\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\7f\80" ;; "\ed\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\a0\80" ;; "\ed\a0\80" + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\a0\bf" ;; "\ed\a0\bf" + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\bf\80" ;; "\ed\bf\80" + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\bf\bf" ;; "\ed\bf\bf" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\c0\80" ;; "\ed\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\fd\80" ;; "\ed\fd\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\00\80" ;; "\ee\00\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\7f\80" ;; "\ee\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\c0\80" ;; "\ee\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\fd\80" ;; "\ee\fd\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\00\80" ;; "\ef\00\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\7f\80" ;; "\ef\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\c0\80" ;; "\ef\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\fd\80" ;; "\ef\fd\80" + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequence contents (third byte) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\a0\00" ;; "\e0\a0\00" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\a0\7f" ;; "\e0\a0\7f" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\a0\c0" ;; "\e0\a0\c0" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e0\a0\fd" ;; "\e0\a0\fd" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\80\00" ;; "\e1\80\00" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\80\7f" ;; "\e1\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\80\c0" ;; "\e1\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\e1\80\fd" ;; "\e1\80\fd" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\80\00" ;; "\ec\80\00" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\80\7f" ;; "\ec\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\80\c0" ;; "\ec\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ec\80\fd" ;; "\ec\80\fd" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\80\00" ;; "\ed\80\00" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\80\7f" ;; "\ed\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\80\c0" ;; "\ed\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ed\80\fd" ;; "\ed\80\fd" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\80\00" ;; "\ee\80\00" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\80\7f" ;; "\ee\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\80\c0" ;; "\ee\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ee\80\fd" ;; "\ee\80\fd" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\80\00" ;; "\ef\80\00" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\80\7f" ;; "\ef\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\80\c0" ;; "\ef\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\ef\80\fd" ;; "\ef\80\fd" + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequences + +;; 4-byte sequence contains 5 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\06" ;; custom section + "\05\f1\80\80\80\80" ;; "\f1\80\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\f1\80\80" ;; "\f1\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\80\23" ;; "\f1\80\80#" + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\f1\80" ;; "\f1\80" + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\f1\80\23" ;; "\f1\80#" + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\f1" ;; "\f1" + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\f1\23" ;; "\f1#" + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\00\90\90" ;; "\f0\00\90\90" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\7f\90\90" ;; "\f0\7f\90\90" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\80\80\80" ;; "\f0\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\80\90\90" ;; "\f0\80\90\90" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\8f\90\90" ;; "\f0\8f\90\90" + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\8f\bf\bf" ;; "\f0\8f\bf\bf" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\c0\90\90" ;; "\f0\c0\90\90" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\fd\90\90" ;; "\f0\fd\90\90" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\00\80\80" ;; "\f1\00\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\7f\80\80" ;; "\f1\7f\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\c0\80\80" ;; "\f1\c0\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\fd\80\80" ;; "\f1\fd\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\00\80\80" ;; "\f3\00\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\7f\80\80" ;; "\f3\7f\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\c0\80\80" ;; "\f3\c0\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\fd\80\80" ;; "\f3\fd\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\00\80\80" ;; "\f4\00\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\7f\80\80" ;; "\f4\7f\80\80" + ) + "invalid UTF-8 encoding" +) + +;; (first) invalid code point +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\90\80\80" ;; "\f4\90\80\80" + ) + "invalid UTF-8 encoding" +) + +;; invalid code point +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\bf\80\80" ;; "\f4\bf\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\c0\80\80" ;; "\f4\c0\80\80" + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\fd\80\80" ;; "\f4\fd\80\80" + ) + "invalid UTF-8 encoding" +) + +;; (first) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f5\80\80\80" ;; "\f5\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f7\80\80\80" ;; "\f7\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f7\bf\bf\bf" ;; "\f7\bf\bf\bf" + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents (third byte) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\00\90" ;; "\f0\90\00\90" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\7f\90" ;; "\f0\90\7f\90" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\c0\90" ;; "\f0\90\c0\90" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\fd\90" ;; "\f0\90\fd\90" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\00\80" ;; "\f1\80\00\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\7f\80" ;; "\f1\80\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\c0\80" ;; "\f1\80\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\fd\80" ;; "\f1\80\fd\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\00\80" ;; "\f3\80\00\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\7f\80" ;; "\f3\80\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\c0\80" ;; "\f3\80\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\fd\80" ;; "\f3\80\fd\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\00\80" ;; "\f4\80\00\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\7f\80" ;; "\f4\80\7f\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\c0\80" ;; "\f4\80\c0\80" + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\fd\80" ;; "\f4\80\fd\80" + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents (fourth byte) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\90\00" ;; "\f0\90\90\00" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\90\7f" ;; "\f0\90\90\7f" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\90\c0" ;; "\f0\90\90\c0" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f0\90\90\fd" ;; "\f0\90\90\fd" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\80\00" ;; "\f1\80\80\00" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\80\7f" ;; "\f1\80\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\80\c0" ;; "\f1\80\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f1\80\80\fd" ;; "\f1\80\80\fd" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\80\00" ;; "\f3\80\80\00" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\80\7f" ;; "\f3\80\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\80\c0" ;; "\f3\80\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f3\80\80\fd" ;; "\f3\80\80\fd" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\80\00" ;; "\f4\80\80\00" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\80\7f" ;; "\f4\80\80\7f" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\80\c0" ;; "\f4\80\80\c0" + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f4\80\80\fd" ;; "\f4\80\80\fd" + ) + "invalid UTF-8 encoding" +) + +;;;; 5-byte sequences + +;; 5-byte sequence contains 6 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\07" ;; custom section + "\06\f8\80\80\80\80\80" ;; "\f8\80\80\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 4 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f8\80\80\80" ;; "\f8\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\06" ;; custom section + "\05\f8\80\80\80\23" ;; "\f8\80\80\80#" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\f8\80\80" ;; "\f8\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\f8\80\80\23" ;; "\f8\80\80#" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\f8\80" ;; "\f8\80" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\f8\80\23" ;; "\f8\80#" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\f8" ;; "\f8" + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\f8\23" ;; "\f8#" + ) + "invalid UTF-8 encoding" +) + +;;;; 5-byte sequence contents + +;; (first) invalid 5-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\06" ;; custom section + "\05\f8\80\80\80\80" ;; "\f8\80\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 5-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\06" ;; custom section + "\05\fb\bf\bf\bf\bf" ;; "\fb\bf\bf\bf\bf" + ) + "invalid UTF-8 encoding" +) + +;;;; 6-byte sequences + +;; 6-byte sequence contains 7 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\08" ;; custom section + "\07\fc\80\80\80\80\80\80" ;; "\fc\80\80\80\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 5 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\06" ;; custom section + "\05\fc\80\80\80\80" ;; "\fc\80\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 5 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\07" ;; custom section + "\06\fc\80\80\80\80\23" ;; "\fc\80\80\80\80#" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 4 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\fc\80\80\80" ;; "\fc\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\06" ;; custom section + "\05\fc\80\80\80\23" ;; "\fc\80\80\80#" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\fc\80\80" ;; "\fc\80\80" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\fc\80\80\23" ;; "\fc\80\80#" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\fc\80" ;; "\fc\80" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\04" ;; custom section + "\03\fc\80\23" ;; "\fc\80#" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\fc" ;; "\fc" + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\fc\23" ;; "\fc#" + ) + "invalid UTF-8 encoding" +) + +;;;; 6-byte sequence contents + +;; (first) invalid 6-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\07" ;; custom section + "\06\fc\80\80\80\80\80" ;; "\fc\80\80\80\80\80" + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 6-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\07" ;; custom section + "\06\fd\bf\bf\bf\bf\bf" ;; "\fd\bf\bf\bf\bf\bf" + ) + "invalid UTF-8 encoding" +) + +;;;; Miscellaneous invalid bytes + +;; invalid byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\fe" ;; "\fe" + ) + "invalid UTF-8 encoding" +) + +;; invalid byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\02" ;; custom section + "\01\ff" ;; "\ff" + ) + "invalid UTF-8 encoding" +) + +;; UTF-16BE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\fe\ff" ;; "\fe\ff" + ) + "invalid UTF-8 encoding" +) + +;; UTF-32BE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\00\00\fe\ff" ;; "\00\00\fe\ff" + ) + "invalid UTF-8 encoding" +) + +;; UTF-16LE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\03" ;; custom section + "\02\ff\fe" ;; "\ff\fe" + ) + "invalid UTF-8 encoding" +) + +;; UTF-32LE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\00\05" ;; custom section + "\04\ff\fe\00\00" ;; "\ff\fe\00\00" + ) + "invalid UTF-8 encoding" +) + diff --git a/test/spec/utf8-import-field.wast b/test/spec/utf8-import-field.wast new file mode 100644 index 000000000..1ff2aa030 --- /dev/null +++ b/test/spec/utf8-import-field.wast @@ -0,0 +1,2672 @@ +;;;;;; Invalid UTF-8 import field names + +;;;; Continuation bytes not preceded by prefixes + +;; encoding starts with (first) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\80" ;; "\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x8f) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\8f" ;; "\8f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x90) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\90" ;; "\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x9f) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\9f" ;; "\9f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0xa0) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\a0" ;; "\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (last) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\bf" ;; "\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 2-byte sequences + +;; 2-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\c2\80\80" ;; "\c2\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 2-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\c2" ;; "\c2" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 2-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c2\2e" ;; "\c2." + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 2-byte sequence contents + +;; overlong encoding after 0xc0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c0\80" ;; "\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c0\bf" ;; "\c0\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc1 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c1\80" ;; "\c1\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc1 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c1\bf" ;; "\c1\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a contination byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c2\00" ;; "\c2\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c2\7f" ;; "\c2\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c2\c0" ;; "\c2\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\c2\fd" ;; "\c2\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\df\00" ;; "\df\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\df\7f" ;; "\df\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\df\c0" ;; "\df\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\df\fd" ;; "\df\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequences + +;; 3-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\e1\80\80\80" ;; "\e1\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\e1\80" ;; "\e1\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\80\2e" ;; "\e1\80." + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\e1" ;; "\e1" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\e1\2e" ;; "\e1." + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequence contents + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\00\a0" ;; "\e0\00\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\7f\a0" ;; "\e0\7f\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\80\80" ;; "\e0\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\80\a0" ;; "\e0\80\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\9f\a0" ;; "\e0\9f\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\9f\bf" ;; "\e0\9f\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\c0\a0" ;; "\e0\c0\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\fd\a0" ;; "\e0\fd\a0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\00\80" ;; "\e1\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\7f\80" ;; "\e1\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\c0\80" ;; "\e1\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\fd\80" ;; "\e1\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\00\80" ;; "\ec\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\7f\80" ;; "\ec\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\c0\80" ;; "\ec\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\fd\80" ;; "\ec\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\00\80" ;; "\ed\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\7f\80" ;; "\ed\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\a0\80" ;; "\ed\a0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\a0\bf" ;; "\ed\a0\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\bf\80" ;; "\ed\bf\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\bf\bf" ;; "\ed\bf\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\c0\80" ;; "\ed\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\fd\80" ;; "\ed\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\00\80" ;; "\ee\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\7f\80" ;; "\ee\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\c0\80" ;; "\ee\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\fd\80" ;; "\ee\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\00\80" ;; "\ef\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\7f\80" ;; "\ef\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\c0\80" ;; "\ef\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\fd\80" ;; "\ef\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequence contents (third byte) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\a0\00" ;; "\e0\a0\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\a0\7f" ;; "\e0\a0\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\a0\c0" ;; "\e0\a0\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e0\a0\fd" ;; "\e0\a0\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\80\00" ;; "\e1\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\80\7f" ;; "\e1\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\80\c0" ;; "\e1\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\e1\80\fd" ;; "\e1\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\80\00" ;; "\ec\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\80\7f" ;; "\ec\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\80\c0" ;; "\ec\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ec\80\fd" ;; "\ec\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\80\00" ;; "\ed\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\80\7f" ;; "\ed\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\80\c0" ;; "\ed\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ed\80\fd" ;; "\ed\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\80\00" ;; "\ee\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\80\7f" ;; "\ee\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\80\c0" ;; "\ee\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ee\80\fd" ;; "\ee\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\80\00" ;; "\ef\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\80\7f" ;; "\ef\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\80\c0" ;; "\ef\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\ef\80\fd" ;; "\ef\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequences + +;; 4-byte sequence contains 5 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\05\f1\80\80\80\80" ;; "\f1\80\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\f1\80\80" ;; "\f1\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\80\23" ;; "\f1\80\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\f1\80" ;; "\f1\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\f1\80\23" ;; "\f1\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\f1" ;; "\f1" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\f1\23" ;; "\f1#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\00\90\90" ;; "\f0\00\90\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\7f\90\90" ;; "\f0\7f\90\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\80\80\80" ;; "\f0\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\80\90\90" ;; "\f0\80\90\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\8f\90\90" ;; "\f0\8f\90\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\8f\bf\bf" ;; "\f0\8f\bf\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\c0\90\90" ;; "\f0\c0\90\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\fd\90\90" ;; "\f0\fd\90\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\00\80\80" ;; "\f1\00\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\7f\80\80" ;; "\f1\7f\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\c0\80\80" ;; "\f1\c0\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\fd\80\80" ;; "\f1\fd\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\00\80\80" ;; "\f3\00\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\7f\80\80" ;; "\f3\7f\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\c0\80\80" ;; "\f3\c0\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\fd\80\80" ;; "\f3\fd\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\00\80\80" ;; "\f4\00\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\7f\80\80" ;; "\f4\7f\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (first) invalid code point +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\90\80\80" ;; "\f4\90\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; invalid code point +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\bf\80\80" ;; "\f4\bf\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\c0\80\80" ;; "\f4\c0\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\fd\80\80" ;; "\f4\fd\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (first) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f5\80\80\80" ;; "\f5\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f7\80\80\80" ;; "\f7\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f7\bf\bf\bf" ;; "\f7\bf\bf\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents (third byte) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\00\90" ;; "\f0\90\00\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\7f\90" ;; "\f0\90\7f\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\c0\90" ;; "\f0\90\c0\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\fd\90" ;; "\f0\90\fd\90" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\00\80" ;; "\f1\80\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\7f\80" ;; "\f1\80\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\c0\80" ;; "\f1\80\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\fd\80" ;; "\f1\80\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\00\80" ;; "\f3\80\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\7f\80" ;; "\f3\80\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\c0\80" ;; "\f3\80\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\fd\80" ;; "\f3\80\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\00\80" ;; "\f4\80\00\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\7f\80" ;; "\f4\80\7f\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\c0\80" ;; "\f4\80\c0\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\fd\80" ;; "\f4\80\fd\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents (fourth byte) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\90\00" ;; "\f0\90\90\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\90\7f" ;; "\f0\90\90\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\90\c0" ;; "\f0\90\90\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f0\90\90\fd" ;; "\f0\90\90\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\80\00" ;; "\f1\80\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\80\7f" ;; "\f1\80\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\80\c0" ;; "\f1\80\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f1\80\80\fd" ;; "\f1\80\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\80\00" ;; "\f3\80\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\80\7f" ;; "\f3\80\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\80\c0" ;; "\f3\80\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f3\80\80\fd" ;; "\f3\80\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\80\00" ;; "\f4\80\80\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\80\7f" ;; "\f4\80\80\7f" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\80\c0" ;; "\f4\80\80\c0" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f4\80\80\fd" ;; "\f4\80\80\fd" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 5-byte sequences + +;; 5-byte sequence contains 6 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\06\f8\80\80\80\80\80" ;; "\f8\80\80\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 4 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f8\80\80\80" ;; "\f8\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\05\f8\80\80\80\23" ;; "\f8\80\80\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\f8\80\80" ;; "\f8\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\f8\80\80\23" ;; "\f8\80\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\f8\80" ;; "\f8\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\f8\80\23" ;; "\f8\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\f8" ;; "\f8" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\f8\23" ;; "\f8#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 5-byte sequence contents + +;; (first) invalid 5-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\05\f8\80\80\80\80" ;; "\f8\80\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 5-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\05\fb\bf\bf\bf\bf" ;; "\fb\bf\bf\bf\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 6-byte sequences + +;; 6-byte sequence contains 7 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\11" ;; import section + "\01" ;; length 1 + "\07\fc\80\80\80\80\80\80" ;; "\fc\80\80\80\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 5 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\05\fc\80\80\80\80" ;; "\fc\80\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 5 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\06\fc\80\80\80\80\23" ;; "\fc\80\80\80\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 4 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\fc\80\80\80" ;; "\fc\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\05\fc\80\80\80\23" ;; "\fc\80\80\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\fc\80\80" ;; "\fc\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\fc\80\80\23" ;; "\fc\80\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\fc\80" ;; "\fc\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\03\fc\80\23" ;; "\fc\80#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\fc" ;; "\fc" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\fc\23" ;; "\fc#" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 6-byte sequence contents + +;; (first) invalid 6-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\06\fc\80\80\80\80\80" ;; "\fc\80\80\80\80\80" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 6-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\06\fd\bf\bf\bf\bf\bf" ;; "\fd\bf\bf\bf\bf\bf" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; Miscellaneous invalid bytes + +;; invalid byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\fe" ;; "\fe" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; invalid byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\01\ff" ;; "\ff" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-16BE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\fe\ff" ;; "\fe\ff" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-32BE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\00\00\fe\ff" ;; "\00\00\fe\ff" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-16LE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\02\ff\fe" ;; "\ff\fe" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-32LE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\ff\fe\00\00" ;; "\ff\fe\00\00" + "\04\74\65\73\74" ;; "test" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + diff --git a/test/spec/utf8-import-module.wast b/test/spec/utf8-import-module.wast new file mode 100644 index 000000000..ceabbeb7c --- /dev/null +++ b/test/spec/utf8-import-module.wast @@ -0,0 +1,2672 @@ +;;;;;; Invalid UTF-8 import module names + +;;;; Continuation bytes not preceded by prefixes + +;; encoding starts with (first) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\80" ;; "\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x8f) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\8f" ;; "\8f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x90) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\90" ;; "\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0x9f) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\9f" ;; "\9f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (0xa0) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\a0" ;; "\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; encoding starts with (last) continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\bf" ;; "\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 2-byte sequences + +;; 2-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\c2\80\80" ;; "\c2\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 2-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\c2" ;; "\c2" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 2-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c2\2e" ;; "\c2." + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 2-byte sequence contents + +;; overlong encoding after 0xc0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c0\80" ;; "\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c0\bf" ;; "\c0\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc1 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c1\80" ;; "\c1\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xc1 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c1\bf" ;; "\c1\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a contination byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c2\00" ;; "\c2\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c2\7f" ;; "\c2\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c2\c0" ;; "\c2\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (first) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\c2\fd" ;; "\c2\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\df\00" ;; "\df\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\df\7f" ;; "\df\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\df\c0" ;; "\df\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte after (last) 2-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\df\fd" ;; "\df\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequences + +;; 3-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\e1\80\80\80" ;; "\e1\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\e1\80" ;; "\e1\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\80\2e" ;; "\e1\80." + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\e1" ;; "\e1" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 3-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\e1\2e" ;; "\e1." + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequence contents + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\00\a0" ;; "\e0\00\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\7f\a0" ;; "\e0\7f\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\80\80" ;; "\e0\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\80\a0" ;; "\e0\80\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\9f\a0" ;; "\e0\9f\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xe0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\9f\bf" ;; "\e0\9f\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\c0\a0" ;; "\e0\c0\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\fd\a0" ;; "\e0\fd\a0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\00\80" ;; "\e1\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\7f\80" ;; "\e1\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\c0\80" ;; "\e1\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\fd\80" ;; "\e1\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\00\80" ;; "\ec\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\7f\80" ;; "\ec\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\c0\80" ;; "\ec\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\fd\80" ;; "\ec\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\00\80" ;; "\ed\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\7f\80" ;; "\ed\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\a0\80" ;; "\ed\a0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\a0\bf" ;; "\ed\a0\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\bf\80" ;; "\ed\bf\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; byte sequence reserved for UTF-16 surrogate half +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\bf\bf" ;; "\ed\bf\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\c0\80" ;; "\ed\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\fd\80" ;; "\ed\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\00\80" ;; "\ee\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\7f\80" ;; "\ee\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\c0\80" ;; "\ee\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\fd\80" ;; "\ee\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\00\80" ;; "\ef\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\7f\80" ;; "\ef\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\c0\80" ;; "\ef\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\fd\80" ;; "\ef\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 3-byte sequence contents (third byte) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\a0\00" ;; "\e0\a0\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\a0\7f" ;; "\e0\a0\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\a0\c0" ;; "\e0\a0\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xe0) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e0\a0\fd" ;; "\e0\a0\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\80\00" ;; "\e1\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\80\7f" ;; "\e1\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\80\c0" ;; "\e1\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\e1\80\fd" ;; "\e1\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\80\00" ;; "\ec\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\80\7f" ;; "\ec\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\80\c0" ;; "\ec\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ec\80\fd" ;; "\ec\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\80\00" ;; "\ed\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\80\7f" ;; "\ed\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\80\c0" ;; "\ed\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xed) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ed\80\fd" ;; "\ed\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\80\00" ;; "\ee\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\80\7f" ;; "\ee\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\80\c0" ;; "\ee\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ee\80\fd" ;; "\ee\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\80\00" ;; "\ef\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\80\7f" ;; "\ef\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\80\c0" ;; "\ef\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 3-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\ef\80\fd" ;; "\ef\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequences + +;; 4-byte sequence contains 5 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\05\f1\80\80\80\80" ;; "\f1\80\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\f1\80\80" ;; "\f1\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\80\23" ;; "\f1\80\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\f1\80" ;; "\f1\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\f1\80\23" ;; "\f1\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\f1" ;; "\f1" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 4-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\f1\23" ;; "\f1#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\00\90\90" ;; "\f0\00\90\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\7f\90\90" ;; "\f0\7f\90\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\80\80\80" ;; "\f0\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\80\90\90" ;; "\f0\80\90\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\8f\90\90" ;; "\f0\8f\90\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; overlong encoding after 0xf0 prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\8f\bf\bf" ;; "\f0\8f\bf\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\c0\90\90" ;; "\f0\c0\90\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\fd\90\90" ;; "\f0\fd\90\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\00\80\80" ;; "\f1\00\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\7f\80\80" ;; "\f1\7f\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\c0\80\80" ;; "\f1\c0\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\fd\80\80" ;; "\f1\fd\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\00\80\80" ;; "\f3\00\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\7f\80\80" ;; "\f3\7f\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\c0\80\80" ;; "\f3\c0\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\fd\80\80" ;; "\f3\fd\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\00\80\80" ;; "\f4\00\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\7f\80\80" ;; "\f4\7f\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (first) invalid code point +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\90\80\80" ;; "\f4\90\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; invalid code point +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\bf\80\80" ;; "\f4\bf\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\c0\80\80" ;; "\f4\c0\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; first byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\fd\80\80" ;; "\f4\fd\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (first) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f5\80\80\80" ;; "\f5\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f7\80\80\80" ;; "\f7\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 4-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f7\bf\bf\bf" ;; "\f7\bf\bf\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents (third byte) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\00\90" ;; "\f0\90\00\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\7f\90" ;; "\f0\90\7f\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\c0\90" ;; "\f0\90\c0\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\fd\90" ;; "\f0\90\fd\90" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\00\80" ;; "\f1\80\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\7f\80" ;; "\f1\80\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\c0\80" ;; "\f1\80\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\fd\80" ;; "\f1\80\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\00\80" ;; "\f3\80\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\7f\80" ;; "\f3\80\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\c0\80" ;; "\f3\80\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\fd\80" ;; "\f3\80\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\00\80" ;; "\f4\80\00\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\7f\80" ;; "\f4\80\7f\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\c0\80" ;; "\f4\80\c0\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; second byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\fd\80" ;; "\f4\80\fd\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 4-byte sequence contents (fourth byte) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\90\00" ;; "\f0\90\90\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\90\7f" ;; "\f0\90\90\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\90\c0" ;; "\f0\90\90\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf0) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f0\90\90\fd" ;; "\f0\90\90\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\80\00" ;; "\f1\80\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\80\7f" ;; "\f1\80\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\80\c0" ;; "\f1\80\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (first normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f1\80\80\fd" ;; "\f1\80\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\80\00" ;; "\f3\80\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\80\7f" ;; "\f3\80\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\80\c0" ;; "\f3\80\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (last normal) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f3\80\80\fd" ;; "\f3\80\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\80\00" ;; "\f4\80\80\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\80\7f" ;; "\f4\80\80\7f" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\80\c0" ;; "\f4\80\80\c0" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; third byte after (0xf4) 4-byte prefix not a continuation byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f4\80\80\fd" ;; "\f4\80\80\fd" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 5-byte sequences + +;; 5-byte sequence contains 6 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\06\f8\80\80\80\80\80" ;; "\f8\80\80\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 4 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f8\80\80\80" ;; "\f8\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\05\f8\80\80\80\23" ;; "\f8\80\80\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\f8\80\80" ;; "\f8\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\f8\80\80\23" ;; "\f8\80\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\f8\80" ;; "\f8\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\f8\80\23" ;; "\f8\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\f8" ;; "\f8" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 5-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\f8\23" ;; "\f8#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 5-byte sequence contents + +;; (first) invalid 5-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\05\f8\80\80\80\80" ;; "\f8\80\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 5-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\05\fb\bf\bf\bf\bf" ;; "\fb\bf\bf\bf\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 6-byte sequences + +;; 6-byte sequence contains 7 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\11" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\07\fc\80\80\80\80\80\80" ;; "\fc\80\80\80\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 5 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\05\fc\80\80\80\80" ;; "\fc\80\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 5 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\06\fc\80\80\80\80\23" ;; "\fc\80\80\80\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 4 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\fc\80\80\80" ;; "\fc\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 4 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0f" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\05\fc\80\80\80\23" ;; "\fc\80\80\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 3 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\fc\80\80" ;; "\fc\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 3 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\fc\80\80\23" ;; "\fc\80\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 2 bytes at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\fc\80" ;; "\fc\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 2 bytes +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0d" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\03\fc\80\23" ;; "\fc\80#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 1 byte at end of string +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\fc" ;; "\fc" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; 6-byte sequence contains 1 byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\fc\23" ;; "\fc#" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; 6-byte sequence contents + +;; (first) invalid 6-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\06\fc\80\80\80\80\80" ;; "\fc\80\80\80\80\80" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; (last) invalid 6-byte prefix +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\10" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\06\fd\bf\bf\bf\bf\bf" ;; "\fd\bf\bf\bf\bf\bf" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;;;; Miscellaneous invalid bytes + +;; invalid byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\fe" ;; "\fe" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; invalid byte +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0b" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\01\ff" ;; "\ff" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-16BE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\fe\ff" ;; "\fe\ff" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-32BE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\00\00\fe\ff" ;; "\00\00\fe\ff" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-16LE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0c" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\02\ff\fe" ;; "\ff\fe" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + +;; UTF-32LE BOM +(assert_malformed + (module binary + "\00asm" "\01\00\00\00" + "\02\0e" ;; import section + "\01" ;; length 1 + "\04\74\65\73\74" ;; "test" + "\04\ff\fe\00\00" ;; "\ff\fe\00\00" + "\03" ;; GlobalImport + "\7f" ;; i32 + "\00" ;; immutable + ) + "invalid UTF-8 encoding" +) + diff --git a/test/spec/utf8-invalid-encoding.wast b/test/spec/utf8-invalid-encoding.wast new file mode 100644 index 000000000..3b3573098 --- /dev/null +++ b/test/spec/utf8-invalid-encoding.wast @@ -0,0 +1,176 @@ +(assert_malformed (module quote "(func (export \"\\00\\00\\fe\\ff\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\8f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\9f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c0\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c1\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c1\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\\2e\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\c2\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\df\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\df\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\df\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\df\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\00\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\7f\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\80\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\9f\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\9f\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\a0\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\a0\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\a0\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\a0\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\c0\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e0\\fd\\a0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\2e\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\\2e\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\e1\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ec\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\a0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\a0\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\bf\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\bf\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ed\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ee\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ef\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\00\\90\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\7f\\90\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\80\\90\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\8f\\90\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\8f\\bf\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\00\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\7f\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\90\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\90\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\90\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\90\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\c0\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\90\\fd\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\c0\\90\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f0\\fd\\90\\90\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\00\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\7f\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\80\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\c0\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f1\\fd\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\00\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\7f\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\80\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\c0\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f3\\fd\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\00\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\7f\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\00\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\7f\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\80\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\80\\7f\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\80\\c0\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\80\\fd\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\c0\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\80\\fd\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\90\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\bf\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\c0\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f4\\fd\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f5\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f7\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f7\\bf\\bf\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\80\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\80\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\f8\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fb\\bf\\bf\\bf\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\80\\80\\23\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\80\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\\80\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fc\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fd\\bf\\bf\\bf\\bf\\bf\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fe\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\fe\\ff\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ff\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ff\\fe\\00\\00\"))") "invalid UTF-8 encoding") +(assert_malformed (module quote "(func (export \"\\ff\\fe\"))") "invalid UTF-8 encoding") diff --git a/test/wasm2js/address.2asm.js b/test/wasm2js/address.2asm.js index d0b9e4a2a..4ff161a02 100644 --- a/test/wasm2js/address.2asm.js +++ b/test/wasm2js/address.2asm.js @@ -1,4 +1,3 @@ -import { print } from 'spectest'; function asmFunc(global, env, buffer) { var HEAP8 = new global.Int8Array(buffer); @@ -21,26 +20,167 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var print = env.print; function $0(i) { i = i | 0; - print(HEAPU8[i >> 0] | 0 | 0); - print(HEAPU8[(i + 1 | 0) >> 0] | 0 | 0); - print(HEAPU8[(i + 2 | 0) >> 0] | 0 | 0); - print(HEAPU8[(i + 25 | 0) >> 0] | 0 | 0); - print(HEAPU16[i >> 1] | 0 | 0); - print(HEAPU8[i >> 0] | 0 | ((HEAPU8[(i + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | 0); - print(HEAPU8[(i + 1 | 0) >> 0] | 0 | ((HEAPU8[(i + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | 0); - print(HEAPU16[(i + 2 | 0) >> 1] | 0 | 0); - print(HEAPU8[(i + 25 | 0) >> 0] | 0 | ((HEAPU8[(i + 26 | 0) >> 0] | 0) << 8 | 0) | 0 | 0); - print(HEAP32[i >> 2] | 0 | 0); - print(HEAPU8[(i + 1 | 0) >> 0] | 0 | ((HEAPU8[(i + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[(i + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[(i + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0 | 0); - print(HEAPU16[(i + 2 | 0) >> 1] | 0 | ((HEAPU16[(i + 4 | 0) >> 1] | 0) << 16 | 0) | 0 | 0); - print(HEAPU8[(i + 25 | 0) >> 0] | 0 | ((HEAPU8[(i + 26 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[(i + 27 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[(i + 28 | 0) >> 0] | 0) << 24 | 0) | 0) | 0 | 0); + return HEAPU8[i >> 0] | 0 | 0; } function $1(i) { i = i | 0; + return HEAPU8[i >> 0] | 0 | 0; + } + + function $2(i) { + i = i | 0; + return HEAPU8[(i + 1 | 0) >> 0] | 0 | 0; + } + + function $3(i) { + i = i | 0; + return HEAPU8[(i + 2 | 0) >> 0] | 0 | 0; + } + + function $4(i) { + i = i | 0; + return HEAPU8[(i + 25 | 0) >> 0] | 0 | 0; + } + + function $5(i) { + i = i | 0; + return HEAP8[i >> 0] | 0 | 0; + } + + function $6(i) { + i = i | 0; + return HEAP8[i >> 0] | 0 | 0; + } + + function $7(i) { + i = i | 0; + return HEAP8[(i + 1 | 0) >> 0] | 0 | 0; + } + + function $8(i) { + i = i | 0; + return HEAP8[(i + 2 | 0) >> 0] | 0 | 0; + } + + function $9(i) { + i = i | 0; + return HEAP8[(i + 25 | 0) >> 0] | 0 | 0; + } + + function $10(i) { + i = i | 0; + return HEAPU16[i >> 1] | 0 | 0; + } + + function $11(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return HEAPU8[$1_1 >> 0] | 0 | ((HEAPU8[($1_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | 0; + } + + function $12(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return HEAPU8[($1_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($1_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | 0; + } + + function $13(i) { + i = i | 0; + return HEAPU16[(i + 2 | 0) >> 1] | 0 | 0; + } + + function $14(i) { + i = i | 0; + return HEAPU16[(i + 25 | 0) >> 1] | 0 | 0; + } + + function $15(i) { + i = i | 0; + return HEAP16[i >> 1] | 0 | 0; + } + + function $16(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return ((HEAPU8[$1_1 >> 0] | 0 | ((HEAPU8[($1_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0) << 16 | 0) >> 16 | 0 | 0; + } + + function $17(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return ((HEAPU8[($1_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($1_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0) << 16 | 0) >> 16 | 0 | 0; + } + + function $18(i) { + i = i | 0; + return HEAP16[(i + 2 | 0) >> 1] | 0 | 0; + } + + function $19(i) { + i = i | 0; + return HEAP16[(i + 25 | 0) >> 1] | 0 | 0; + } + + function $20(i) { + i = i | 0; + return HEAP32[i >> 2] | 0 | 0; + } + + function $21(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return HEAPU8[$1_1 >> 0] | 0 | ((HEAPU8[($1_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($1_1 + 2 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($1_1 + 3 | 0) >> 0] | 0) << 24 | 0) | 0) | 0 | 0; + } + + function $22(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return HEAPU8[($1_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($1_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($1_1 + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($1_1 + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0 | 0; + } + + function $23(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return HEAPU16[($1_1 + 2 | 0) >> 1] | 0 | ((HEAPU16[($1_1 + 4 | 0) >> 1] | 0) << 16 | 0) | 0 | 0; + } + + function $24(i) { + i = i | 0; + return HEAP32[(i + 25 | 0) >> 2] | 0 | 0; + } + + function $25(i) { + i = i | 0; + HEAPU8[(i + 4294967295 | 0) >> 0] | 0; + } + + function $26(i) { + i = i | 0; + HEAP8[(i + 4294967295 | 0) >> 0] | 0; + } + + function $27(i) { + i = i | 0; + HEAPU16[(i + 4294967295 | 0) >> 1] | 0; + } + + function $28(i) { + i = i | 0; + HEAP16[(i + 4294967295 | 0) >> 1] | 0; + } + + function $29(i) { + i = i | 0; HEAP32[(i + 4294967295 | 0) >> 2] | 0; } @@ -72,8 +212,1360 @@ function asmFunc(global, env, buffer) { } return { - "good": $0, - "bad": $1 + "$8u_good1": $0, + "$8u_good2": $1, + "$8u_good3": $2, + "$8u_good4": $3, + "$8u_good5": $4, + "$8s_good1": $5, + "$8s_good2": $6, + "$8s_good3": $7, + "$8s_good4": $8, + "$8s_good5": $9, + "$16u_good1": $10, + "$16u_good2": $11, + "$16u_good3": $12, + "$16u_good4": $13, + "$16u_good5": $14, + "$16s_good1": $15, + "$16s_good2": $16, + "$16s_good3": $17, + "$16s_good4": $18, + "$16s_good5": $19, + "$32_good1": $20, + "$32_good2": $21, + "$32_good3": $22, + "$32_good4": $23, + "$32_good5": $24, + "$8u_bad": $25, + "$8s_bad": $26, + "$16u_bad": $27, + "$16s_bad": $28, + "$32_bad": $29 + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var assignasmFunc = ( + function(mem) { + var _mem = new Uint8Array(mem); + return function(offset, s) { + var bytes, i; + if (typeof Buffer === 'undefined') { + bytes = atob(s); + for (i = 0; i < bytes.length; i++) + _mem[offset + i] = bytes.charCodeAt(i); + } else { + bytes = Buffer.from(s, 'base64'); + for (i = 0; i < bytes.length; i++) + _mem[offset + i] = bytes[i]; + } + } + } + )(memasmFunc); +assignasmFunc(0, "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +export var $8u_good1 = retasmFunc.$8u_good1; +export var $8u_good2 = retasmFunc.$8u_good2; +export var $8u_good3 = retasmFunc.$8u_good3; +export var $8u_good4 = retasmFunc.$8u_good4; +export var $8u_good5 = retasmFunc.$8u_good5; +export var $8s_good1 = retasmFunc.$8s_good1; +export var $8s_good2 = retasmFunc.$8s_good2; +export var $8s_good3 = retasmFunc.$8s_good3; +export var $8s_good4 = retasmFunc.$8s_good4; +export var $8s_good5 = retasmFunc.$8s_good5; +export var $16u_good1 = retasmFunc.$16u_good1; +export var $16u_good2 = retasmFunc.$16u_good2; +export var $16u_good3 = retasmFunc.$16u_good3; +export var $16u_good4 = retasmFunc.$16u_good4; +export var $16u_good5 = retasmFunc.$16u_good5; +export var $16s_good1 = retasmFunc.$16s_good1; +export var $16s_good2 = retasmFunc.$16s_good2; +export var $16s_good3 = retasmFunc.$16s_good3; +export var $16s_good4 = retasmFunc.$16s_good4; +export var $16s_good5 = retasmFunc.$16s_good5; +export var $32_good1 = retasmFunc.$32_good1; +export var $32_good2 = retasmFunc.$32_good2; +export var $32_good3 = retasmFunc.$32_good3; +export var $32_good4 = retasmFunc.$32_good4; +export var $32_good5 = retasmFunc.$32_good5; +export var $8u_bad = retasmFunc.$8u_bad; +export var $8s_bad = retasmFunc.$8s_bad; +export var $16u_bad = retasmFunc.$16u_bad; +export var $16s_bad = retasmFunc.$16s_bad; +export var $32_bad = retasmFunc.$32_bad; +import { setTempRet0 } from 'env'; + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + var setTempRet0 = env.setTempRet0; + var i64toi32_i32$HIGH_BITS = 0; + function $0(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU8[i >> 0] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $1(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU8[i >> 0] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $2(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU8[(i + 1 | 0) >> 0] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $3(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU8[(i + 2 | 0) >> 0] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $4(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU8[(i + 25 | 0) >> 0] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $5(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP8[i >> 0] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $6(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP8[i >> 0] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $7(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP8[(i + 1 | 0) >> 0] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $8(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP8[(i + 2 | 0) >> 0] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $9(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP8[(i + 25 | 0) >> 0] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $10(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU16[i >> 1] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $11(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[$3_1 >> 0] | 0 | ((HEAPU8[($3_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $12(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[($3_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $13(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU16[(i + 2 | 0) >> 1] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $14(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAPU16[(i + 25 | 0) >> 1] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $15(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP16[i >> 1] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $16(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = ((HEAPU8[$3_1 >> 0] | 0 | ((HEAPU8[($3_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0) << 16 | 0) >> 16 | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $17(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = ((HEAPU8[($3_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0) << 16 | 0) >> 16 | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $18(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP16[(i + 2 | 0) >> 1] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $19(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP16[(i + 25 | 0) >> 1] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $20(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP32[i >> 2] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $21(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[$3_1 >> 0] | 0 | ((HEAPU8[($3_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 3 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $22(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[($3_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $23(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU16[($3_1 + 2 | 0) >> 1] | 0 | ((HEAPU16[($3_1 + 4 | 0) >> 1] | 0) << 16 | 0) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $24(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP32[(i + 25 | 0) >> 2] | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $25(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP32[i >> 2] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $26(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[$3_1 >> 0] | 0 | ((HEAPU8[($3_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 3 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $27(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[($3_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $28(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU16[($3_1 + 2 | 0) >> 1] | 0 | ((HEAPU16[($3_1 + 4 | 0) >> 1] | 0) << 16 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $29(i) { + i = i | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = HEAP32[(i + 25 | 0) >> 2] | 0; + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $30(i) { + i = i | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$2 = i; + i64toi32_i32$0 = HEAP32[i64toi32_i32$2 >> 2] | 0; + i64toi32_i32$1 = HEAP32[(i64toi32_i32$2 + 4 | 0) >> 2] | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $31(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[$3_1 >> 0] | 0 | ((HEAPU8[($3_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 3 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$1 = HEAPU8[($3_1 + 4 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 5 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 6 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 7 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $32(i) { + i = i | 0; + var $3_1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + $3_1 = i; + i64toi32_i32$0 = HEAPU8[($3_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$1 = HEAPU8[($3_1 + 5 | 0) >> 0] | 0 | ((HEAPU8[($3_1 + 6 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($3_1 + 7 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($3_1 + 8 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $33(i) { + i = i | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$2 = i; + i64toi32_i32$0 = HEAPU16[(i64toi32_i32$2 + 2 | 0) >> 1] | 0 | ((HEAPU16[(i64toi32_i32$2 + 4 | 0) >> 1] | 0) << 16 | 0) | 0; + i64toi32_i32$1 = HEAPU16[(i64toi32_i32$2 + 6 | 0) >> 1] | 0 | ((HEAPU16[(i64toi32_i32$2 + 8 | 0) >> 1] | 0) << 16 | 0) | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $34(i) { + i = i | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$2 = i; + i64toi32_i32$0 = HEAP32[(i64toi32_i32$2 + 25 | 0) >> 2] | 0; + i64toi32_i32$1 = HEAP32[(i64toi32_i32$2 + 29 | 0) >> 2] | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function $35(i) { + i = i | 0; + HEAPU8[(i + 4294967295 | 0) >> 0] | 0; + } + + function $36(i) { + i = i | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = HEAP8[(i + 4294967295 | 0) >> 0] | 0; + } + + function $37(i) { + i = i | 0; + HEAPU16[(i + 4294967295 | 0) >> 1] | 0; + } + + function $38(i) { + i = i | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = HEAP16[(i + 4294967295 | 0) >> 1] | 0; + } + + function $39(i) { + i = i | 0; + HEAP32[(i + 4294967295 | 0) >> 2] | 0; + } + + function $40(i) { + i = i | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = HEAP32[(i + 4294967295 | 0) >> 2] | 0; + } + + function $41(i) { + i = i | 0; + var i64toi32_i32$2 = 0; + i64toi32_i32$2 = i; + HEAP32[(i64toi32_i32$2 + 3 | 0) >> 2] | 0; + HEAP32[(i64toi32_i32$2 + 4294967295 | 0) >> 2] | 0; + } + + function legalstub$0($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $0($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$1($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $1($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$2($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $2($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$3($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $3($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$4($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $4($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$5($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $5($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$6($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $6($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$7($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $7($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$8($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $8($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$9($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $9($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$10($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $10($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$11($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $11($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$12($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $12($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$13($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $13($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$14($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $14($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$15($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $15($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$16($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $16($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$17($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $17($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$18($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $18($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$19($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $19($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$20($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $20($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$21($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $21($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$22($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $22($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$23($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $23($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$24($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $24($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$25($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $25($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$26($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $26($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$27($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $27($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$28($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $28($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$29($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $29($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$30($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $30($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$31($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $31($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$32($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $32($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$33($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $33($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + function legalstub$34($0_1) { + $0_1 = $0_1 | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8_1 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $34($0_1 | 0) | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $1_1 = i64toi32_i32$0; + $1$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$0 = 0; + $8_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $8_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($8_1 | 0); + i64toi32_i32$0 = $1$hi; + return $1_1 | 0; + } + + var FUNCTION_TABLE = []; + function __wasm_memory_size() { + return buffer.byteLength / 65536 | 0; + } + + function __wasm_memory_grow(pagesToAdd) { + pagesToAdd = pagesToAdd | 0; + var oldPages = __wasm_memory_size() | 0; + var newPages = oldPages + pagesToAdd | 0; + if ((oldPages < newPages) && (newPages < 65536)) { + var newBuffer = new ArrayBuffer(Math_imul(newPages, 65536)); + var newHEAP8 = new global.Int8Array(newBuffer); + newHEAP8.set(HEAP8); + HEAP8 = newHEAP8; + HEAP8 = new global.Int8Array(newBuffer); + HEAP16 = new global.Int16Array(newBuffer); + HEAP32 = new global.Int32Array(newBuffer); + HEAPU8 = new global.Uint8Array(newBuffer); + HEAPU16 = new global.Uint16Array(newBuffer); + HEAPU32 = new global.Uint32Array(newBuffer); + HEAPF32 = new global.Float32Array(newBuffer); + HEAPF64 = new global.Float64Array(newBuffer); + buffer = newBuffer; + } + return oldPages; + } + + return { + "$8u_good1": legalstub$0, + "$8u_good2": legalstub$1, + "$8u_good3": legalstub$2, + "$8u_good4": legalstub$3, + "$8u_good5": legalstub$4, + "$8s_good1": legalstub$5, + "$8s_good2": legalstub$6, + "$8s_good3": legalstub$7, + "$8s_good4": legalstub$8, + "$8s_good5": legalstub$9, + "$16u_good1": legalstub$10, + "$16u_good2": legalstub$11, + "$16u_good3": legalstub$12, + "$16u_good4": legalstub$13, + "$16u_good5": legalstub$14, + "$16s_good1": legalstub$15, + "$16s_good2": legalstub$16, + "$16s_good3": legalstub$17, + "$16s_good4": legalstub$18, + "$16s_good5": legalstub$19, + "$32u_good1": legalstub$20, + "$32u_good2": legalstub$21, + "$32u_good3": legalstub$22, + "$32u_good4": legalstub$23, + "$32u_good5": legalstub$24, + "$32s_good1": legalstub$25, + "$32s_good2": legalstub$26, + "$32s_good3": legalstub$27, + "$32s_good4": legalstub$28, + "$32s_good5": legalstub$29, + "$64_good1": legalstub$30, + "$64_good2": legalstub$31, + "$64_good3": legalstub$32, + "$64_good4": legalstub$33, + "$64_good5": legalstub$34, + "$8u_bad": $35, + "$8s_bad": $36, + "$16u_bad": $37, + "$16s_bad": $38, + "$32u_bad": $39, + "$32s_bad": $40, + "$64_bad": $41 }; } @@ -96,6 +1588,325 @@ var assignasmFunc = ( } )(memasmFunc); assignasmFunc(0, "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },print},memasmFunc); -export var good = retasmFunc.good; -export var bad = retasmFunc.bad; +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +export var $8u_good1 = retasmFunc.$8u_good1; +export var $8u_good2 = retasmFunc.$8u_good2; +export var $8u_good3 = retasmFunc.$8u_good3; +export var $8u_good4 = retasmFunc.$8u_good4; +export var $8u_good5 = retasmFunc.$8u_good5; +export var $8s_good1 = retasmFunc.$8s_good1; +export var $8s_good2 = retasmFunc.$8s_good2; +export var $8s_good3 = retasmFunc.$8s_good3; +export var $8s_good4 = retasmFunc.$8s_good4; +export var $8s_good5 = retasmFunc.$8s_good5; +export var $16u_good1 = retasmFunc.$16u_good1; +export var $16u_good2 = retasmFunc.$16u_good2; +export var $16u_good3 = retasmFunc.$16u_good3; +export var $16u_good4 = retasmFunc.$16u_good4; +export var $16u_good5 = retasmFunc.$16u_good5; +export var $16s_good1 = retasmFunc.$16s_good1; +export var $16s_good2 = retasmFunc.$16s_good2; +export var $16s_good3 = retasmFunc.$16s_good3; +export var $16s_good4 = retasmFunc.$16s_good4; +export var $16s_good5 = retasmFunc.$16s_good5; +export var $32u_good1 = retasmFunc.$32u_good1; +export var $32u_good2 = retasmFunc.$32u_good2; +export var $32u_good3 = retasmFunc.$32u_good3; +export var $32u_good4 = retasmFunc.$32u_good4; +export var $32u_good5 = retasmFunc.$32u_good5; +export var $32s_good1 = retasmFunc.$32s_good1; +export var $32s_good2 = retasmFunc.$32s_good2; +export var $32s_good3 = retasmFunc.$32s_good3; +export var $32s_good4 = retasmFunc.$32s_good4; +export var $32s_good5 = retasmFunc.$32s_good5; +export var $64_good1 = retasmFunc.$64_good1; +export var $64_good2 = retasmFunc.$64_good2; +export var $64_good3 = retasmFunc.$64_good3; +export var $64_good4 = retasmFunc.$64_good4; +export var $64_good5 = retasmFunc.$64_good5; +export var $8u_bad = retasmFunc.$8u_bad; +export var $8s_bad = retasmFunc.$8s_bad; +export var $16u_bad = retasmFunc.$16u_bad; +export var $16s_bad = retasmFunc.$16s_bad; +export var $32u_bad = retasmFunc.$32u_bad; +export var $32s_bad = retasmFunc.$32s_bad; +export var $64_bad = retasmFunc.$64_bad; + + + var scratchBuffer = new ArrayBuffer(8); + var i32ScratchView = new Int32Array(scratchBuffer); + var f32ScratchView = new Float32Array(scratchBuffer); + var f64ScratchView = new Float64Array(scratchBuffer); + + function wasm2js_scratch_store_i32(index, value) { + i32ScratchView[index] = value; + } + + function wasm2js_scratch_load_f32() { + return f32ScratchView[0]; + } + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + function $0(i) { + i = i | 0; + return Math_fround(Math_fround(HEAPF32[i >> 2])); + } + + function $1(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return Math_fround((wasm2js_scratch_store_i32(0, HEAPU8[$1_1 >> 0] | 0 | ((HEAPU8[($1_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($1_1 + 2 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($1_1 + 3 | 0) >> 0] | 0) << 24 | 0) | 0) | 0), wasm2js_scratch_load_f32())); + } + + function $2(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return Math_fround((wasm2js_scratch_store_i32(0, HEAPU8[($1_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($1_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($1_1 + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($1_1 + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0), wasm2js_scratch_load_f32())); + } + + function $3(i) { + i = i | 0; + var $1_1 = 0; + $1_1 = i; + return Math_fround((wasm2js_scratch_store_i32(0, HEAPU16[($1_1 + 2 | 0) >> 1] | 0 | ((HEAPU16[($1_1 + 4 | 0) >> 1] | 0) << 16 | 0) | 0), wasm2js_scratch_load_f32())); + } + + function $4(i) { + i = i | 0; + return Math_fround(Math_fround(HEAPF32[(i + 8 | 0) >> 2])); + } + + function $5(i) { + i = i | 0; + Math_fround(HEAPF32[(i + 4294967295 | 0) >> 2]); + } + + var FUNCTION_TABLE = []; + function __wasm_memory_size() { + return buffer.byteLength / 65536 | 0; + } + + function __wasm_memory_grow(pagesToAdd) { + pagesToAdd = pagesToAdd | 0; + var oldPages = __wasm_memory_size() | 0; + var newPages = oldPages + pagesToAdd | 0; + if ((oldPages < newPages) && (newPages < 65536)) { + var newBuffer = new ArrayBuffer(Math_imul(newPages, 65536)); + var newHEAP8 = new global.Int8Array(newBuffer); + newHEAP8.set(HEAP8); + HEAP8 = newHEAP8; + HEAP8 = new global.Int8Array(newBuffer); + HEAP16 = new global.Int16Array(newBuffer); + HEAP32 = new global.Int32Array(newBuffer); + HEAPU8 = new global.Uint8Array(newBuffer); + HEAPU16 = new global.Uint16Array(newBuffer); + HEAPU32 = new global.Uint32Array(newBuffer); + HEAPF32 = new global.Float32Array(newBuffer); + HEAPF64 = new global.Float64Array(newBuffer); + buffer = newBuffer; + } + return oldPages; + } + + return { + "$32_good1": $0, + "$32_good2": $1, + "$32_good3": $2, + "$32_good4": $3, + "$32_good5": $4, + "$32_bad": $5 + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var assignasmFunc = ( + function(mem) { + var _mem = new Uint8Array(mem); + return function(offset, s) { + var bytes, i; + if (typeof Buffer === 'undefined') { + bytes = atob(s); + for (i = 0; i < bytes.length; i++) + _mem[offset + i] = bytes.charCodeAt(i); + } else { + bytes = Buffer.from(s, 'base64'); + for (i = 0; i < bytes.length; i++) + _mem[offset + i] = bytes[i]; + } + } + } + )(memasmFunc); +assignasmFunc(0, "AAAAAAAAoH8BANB/"); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +export var $32_good1 = retasmFunc.$32_good1; +export var $32_good2 = retasmFunc.$32_good2; +export var $32_good3 = retasmFunc.$32_good3; +export var $32_good4 = retasmFunc.$32_good4; +export var $32_good5 = retasmFunc.$32_good5; +export var $32_bad = retasmFunc.$32_bad; + + + var scratchBuffer = new ArrayBuffer(8); + var i32ScratchView = new Int32Array(scratchBuffer); + var f32ScratchView = new Float32Array(scratchBuffer); + var f64ScratchView = new Float64Array(scratchBuffer); + + function wasm2js_scratch_store_i32(index, value) { + i32ScratchView[index] = value; + } + + function wasm2js_scratch_load_f64() { + return f64ScratchView[0]; + } + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + function $0(i) { + i = i | 0; + return +(+HEAPF64[i >> 3]); + } + + function $1(i) { + i = i | 0; + var $2_1 = 0, i64toi32_i32$1 = 0; + $2_1 = i; + i64toi32_i32$1 = HEAPU8[($2_1 + 4 | 0) >> 0] | 0 | ((HEAPU8[($2_1 + 5 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($2_1 + 6 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($2_1 + 7 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + wasm2js_scratch_store_i32(0 | 0, HEAPU8[$2_1 >> 0] | 0 | ((HEAPU8[($2_1 + 1 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($2_1 + 2 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($2_1 + 3 | 0) >> 0] | 0) << 24 | 0) | 0) | 0 | 0); + wasm2js_scratch_store_i32(1 | 0, i64toi32_i32$1 | 0); + return +(+wasm2js_scratch_load_f64()); + } + + function $2(i) { + i = i | 0; + var $2_1 = 0, i64toi32_i32$1 = 0; + $2_1 = i; + i64toi32_i32$1 = HEAPU8[($2_1 + 5 | 0) >> 0] | 0 | ((HEAPU8[($2_1 + 6 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($2_1 + 7 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($2_1 + 8 | 0) >> 0] | 0) << 24 | 0) | 0) | 0; + wasm2js_scratch_store_i32(0 | 0, HEAPU8[($2_1 + 1 | 0) >> 0] | 0 | ((HEAPU8[($2_1 + 2 | 0) >> 0] | 0) << 8 | 0) | 0 | ((HEAPU8[($2_1 + 3 | 0) >> 0] | 0) << 16 | 0 | ((HEAPU8[($2_1 + 4 | 0) >> 0] | 0) << 24 | 0) | 0) | 0 | 0); + wasm2js_scratch_store_i32(1 | 0, i64toi32_i32$1 | 0); + return +(+wasm2js_scratch_load_f64()); + } + + function $3(i) { + i = i | 0; + var $2_1 = 0, i64toi32_i32$1 = 0; + $2_1 = i; + i64toi32_i32$1 = HEAPU16[($2_1 + 6 | 0) >> 1] | 0 | ((HEAPU16[($2_1 + 8 | 0) >> 1] | 0) << 16 | 0) | 0; + wasm2js_scratch_store_i32(0 | 0, HEAPU16[($2_1 + 2 | 0) >> 1] | 0 | ((HEAPU16[($2_1 + 4 | 0) >> 1] | 0) << 16 | 0) | 0 | 0); + wasm2js_scratch_store_i32(1 | 0, i64toi32_i32$1 | 0); + return +(+wasm2js_scratch_load_f64()); + } + + function $4(i) { + i = i | 0; + return +(+HEAPF64[(i + 18 | 0) >> 3]); + } + + function $5(i) { + i = i | 0; + +HEAPF64[(i + 4294967295 | 0) >> 3]; + } + + var FUNCTION_TABLE = []; + function __wasm_memory_size() { + return buffer.byteLength / 65536 | 0; + } + + function __wasm_memory_grow(pagesToAdd) { + pagesToAdd = pagesToAdd | 0; + var oldPages = __wasm_memory_size() | 0; + var newPages = oldPages + pagesToAdd | 0; + if ((oldPages < newPages) && (newPages < 65536)) { + var newBuffer = new ArrayBuffer(Math_imul(newPages, 65536)); + var newHEAP8 = new global.Int8Array(newBuffer); + newHEAP8.set(HEAP8); + HEAP8 = newHEAP8; + HEAP8 = new global.Int8Array(newBuffer); + HEAP16 = new global.Int16Array(newBuffer); + HEAP32 = new global.Int32Array(newBuffer); + HEAPU8 = new global.Uint8Array(newBuffer); + HEAPU16 = new global.Uint16Array(newBuffer); + HEAPU32 = new global.Uint32Array(newBuffer); + HEAPF32 = new global.Float32Array(newBuffer); + HEAPF64 = new global.Float64Array(newBuffer); + buffer = newBuffer; + } + return oldPages; + } + + return { + "$64_good1": $0, + "$64_good2": $1, + "$64_good3": $2, + "$64_good4": $3, + "$64_good5": $4, + "$64_bad": $5 + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var assignasmFunc = ( + function(mem) { + var _mem = new Uint8Array(mem); + return function(offset, s) { + var bytes, i; + if (typeof Buffer === 'undefined') { + bytes = atob(s); + for (i = 0; i < bytes.length; i++) + _mem[offset + i] = bytes.charCodeAt(i); + } else { + bytes = Buffer.from(s, 'base64'); + for (i = 0; i < bytes.length; i++) + _mem[offset + i] = bytes[i]; + } + } + } + )(memasmFunc); +assignasmFunc(0, "AAAAAAAAAAAAAAAAAAAAAPR/AQAAAAAA/H8="); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +export var $64_good1 = retasmFunc.$64_good1; +export var $64_good2 = retasmFunc.$64_good2; +export var $64_good3 = retasmFunc.$64_good3; +export var $64_good4 = retasmFunc.$64_good4; +export var $64_good5 = retasmFunc.$64_good5; +export var $64_bad = retasmFunc.$64_bad; diff --git a/test/wasm2js/br.2asm.js b/test/wasm2js/br.2asm.js index cff3f0bc0..2a5f6a9ea 100644 --- a/test/wasm2js/br.2asm.js +++ b/test/wasm2js/br.2asm.js @@ -213,7 +213,7 @@ function asmFunc(global, env, buffer) { } function $24() { - var $0 = 0, $1_1 = 0; + var $0 = 0, $5_1 = 0; if_ : { $0 = 2; break if_; @@ -224,15 +224,15 @@ function asmFunc(global, env, buffer) { function $25($0, $1_1) { $0 = $0 | 0; $1_1 = $1_1 | 0; - var $3_1 = 0, $5_1 = 0; + var $3_1 = 0, $7_1 = 0; block : { if ($0) { $3_1 = 3; break block; } else { - $5_1 = $1_1 + $7_1 = $1_1 } - $3_1 = $5_1; + $3_1 = $7_1; } return $3_1 | 0; } @@ -240,17 +240,17 @@ function asmFunc(global, env, buffer) { function $26($0, $1_1) { $0 = $0 | 0; $1_1 = $1_1 | 0; - var $4_1 = 0, $5_1 = 0; + var $6_1 = 0, $7_1 = 0; block : { if ($0) { - $5_1 = $1_1 + $7_1 = $1_1 } else { - $4_1 = 4; + $6_1 = 4; break block; } - $4_1 = $5_1; + $6_1 = $7_1; } - return $4_1 | 0; + return $6_1 | 0; } function $27($0, $1_1) { @@ -365,6 +365,24 @@ function asmFunc(global, env, buffer) { } function $39() { + var $1_1 = 0; + block : { + $1_1 = 1; + break block; + } + return $1_1 | 0; + } + + function $40() { + var $0 = 0; + block : { + $0 = 1; + break block; + } + return $0 | 0; + } + + function $41() { var $0 = Math_fround(0); block : { $0 = Math_fround(1.7000000476837158); @@ -373,7 +391,7 @@ function asmFunc(global, env, buffer) { return Math_fround($0); } - function $40() { + function $42() { var i64toi32_i32$0 = 0, $0 = 0, $0$hi = 0; block : { i64toi32_i32$0 = 0; @@ -386,7 +404,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $41() { + function $43() { var $0 = 0; block : { $0 = 30; @@ -395,7 +413,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $42() { + function $44() { var $0 = 0; block : { $0 = 31; @@ -404,7 +422,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $43() { + function $45() { var $0 = 0; block : { $0 = 32; @@ -413,7 +431,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $44() { + function $46() { var $0 = 0; block : { $0 = 33; @@ -422,7 +440,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $45() { + function $47() { var $0 = Math_fround(0); block : { $0 = Math_fround(3.4000000953674316); @@ -431,7 +449,7 @@ function asmFunc(global, env, buffer) { return Math_fround($0); } - function $46() { + function $48() { var $0 = 0; block : { $0 = 3; @@ -440,7 +458,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $47() { + function $49() { var $0 = 0, $0$hi = 0, i64toi32_i32$1 = 0; block : { $0 = 45; @@ -452,7 +470,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $48() { + function $50() { var $0 = 0; block : { $0 = 44; @@ -461,7 +479,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $49() { + function $51() { var $0 = 0; block : { $0 = 43; @@ -470,7 +488,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $50() { + function $52() { var $0 = 0; block : { $0 = 42; @@ -479,7 +497,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $51() { + function $53() { var $0 = 0; block : { $0 = 41; @@ -488,7 +506,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $52() { + function $54() { var $0 = 0; block : { $0 = 40; @@ -497,7 +515,7 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function $53() { + function $55() { var $0 = 0; block : { dummy(); @@ -507,7 +525,7 @@ function asmFunc(global, env, buffer) { return 1 + $0 | 0 | 0; } - function $54() { + function $56() { var $0 = 0; block : { block0 : { @@ -518,7 +536,7 @@ function asmFunc(global, env, buffer) { return 1 + $0 | 0 | 0; } - function $55() { + function $57() { var $0 = 0, $1_1 = 0; block : { $0 = 8; @@ -527,7 +545,7 @@ function asmFunc(global, env, buffer) { return 1 + $0 | 0 | 0; } - function $56() { + function $58() { var $0 = 0; block : { $0 = 8; @@ -536,7 +554,7 @@ function asmFunc(global, env, buffer) { return 1 + $0 | 0 | 0; } - function $57() { + function $59() { var $0 = 0; block : { $0 = 8; @@ -545,7 +563,7 @@ function asmFunc(global, env, buffer) { return 1 + $0 | 0 | 0; } - function $58() { + function $60() { var $0 = 0; block : { $0 = 8; @@ -598,9 +616,9 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function legalstub$40() { + function legalstub$42() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $40() | 0; + i64toi32_i32$0 = $42() | 0; i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $0 = i64toi32_i32$0; $0$hi = i64toi32_i32$1; @@ -620,9 +638,9 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function legalstub$47() { + function legalstub$49() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $47() | 0; + i64toi32_i32$0 = $49() | 0; i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $0 = i64toi32_i32$0; $0$hi = i64toi32_i32$1; @@ -681,26 +699,28 @@ function asmFunc(global, env, buffer) { "as_call_indirect_mid": $36, "as_call_indirect_last": $37, "as_local_set_value": $38, - "as_load_address": $39, - "as_loadN_address": legalstub$40, - "as_store_address": $41, - "as_store_value": $42, - "as_storeN_address": $43, - "as_storeN_value": $44, - "as_unary_operand": $45, - "as_binary_left": $46, - "as_binary_right": legalstub$47, - "as_test_operand": $48, - "as_compare_left": $49, - "as_compare_right": $50, - "as_convert_operand": $51, - "as_memory_grow_size": $52, - "nested_block_value": $53, - "nested_br_value": $54, - "nested_br_if_value": $55, - "nested_br_if_value_cond": $56, - "nested_br_table_value": $57, - "nested_br_table_value_index": $58 + "as_local_tee_value": $39, + "as_global_set_value": $40, + "as_load_address": $41, + "as_loadN_address": legalstub$42, + "as_store_address": $43, + "as_store_value": $44, + "as_storeN_address": $45, + "as_storeN_value": $46, + "as_unary_operand": $47, + "as_binary_left": $48, + "as_binary_right": legalstub$49, + "as_test_operand": $50, + "as_compare_left": $51, + "as_compare_right": $52, + "as_convert_operand": $53, + "as_memory_grow_size": $54, + "nested_block_value": $55, + "nested_br_value": $56, + "nested_br_if_value": $57, + "nested_br_if_value_cond": $58, + "nested_br_table_value": $59, + "nested_br_table_value_index": $60 }; } @@ -743,6 +763,8 @@ export var as_call_indirect_first = retasmFunc.as_call_indirect_first; export var as_call_indirect_mid = retasmFunc.as_call_indirect_mid; export var as_call_indirect_last = retasmFunc.as_call_indirect_last; export var as_local_set_value = retasmFunc.as_local_set_value; +export var as_local_tee_value = retasmFunc.as_local_tee_value; +export var as_global_set_value = retasmFunc.as_global_set_value; export var as_load_address = retasmFunc.as_load_address; export var as_loadN_address = retasmFunc.as_loadN_address; export var as_store_address = retasmFunc.as_store_address; @@ -763,33 +785,3 @@ export var nested_br_if_value = retasmFunc.nested_br_if_value; export var nested_br_if_value_cond = retasmFunc.nested_br_if_value_cond; export var nested_br_table_value = retasmFunc.nested_br_table_value; export var nested_br_table_value_index = retasmFunc.nested_br_table_value_index; - -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); - var Math_imul = global.Math.imul; - var Math_fround = global.Math.fround; - var Math_abs = global.Math.abs; - var Math_clz32 = global.Math.clz32; - var Math_min = global.Math.min; - var Math_max = global.Math.max; - var Math_floor = global.Math.floor; - var Math_ceil = global.Math.ceil; - var Math_sqrt = global.Math.sqrt; - var abort = env.abort; - var nan = global.NaN; - var infinity = global.Infinity; - var FUNCTION_TABLE = []; - return { - - }; -} - -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); diff --git a/test/wasm2js/br_table.2asm.js b/test/wasm2js/br_table.2asm.js index c9be99dfa..39c89bae7 100644 --- a/test/wasm2js/br_table.2asm.js +++ b/test/wasm2js/br_table.2asm.js @@ -12610,12 +12610,15 @@ function asmFunc(global, env, buffer) { } function $23() { - var $0 = 0; + var $1_1 = 0; block : { - $0 = 9; - break block; + $1_1 = 9; + switch (0 | 0) { + default: + break block; + }; } - return $0 | 0; + return $1_1 | 0; } function $24() { @@ -12691,7 +12694,7 @@ function asmFunc(global, env, buffer) { } function $31() { - var $1_1 = 0, $2_1 = 0; + var $1_1 = 0, $6_1 = 0; if_ : { $1_1 = 2; switch (0 | 0) { @@ -12705,7 +12708,7 @@ function asmFunc(global, env, buffer) { function $32($0, $1_1) { $0 = $0 | 0; $1_1 = $1_1 | 0; - var $4_1 = 0, $6_1 = 0; + var $4_1 = 0, $8_1 = 0; block : { if ($0) { $4_1 = 3; @@ -12714,9 +12717,9 @@ function asmFunc(global, env, buffer) { break block; }; } else { - $6_1 = $1_1 + $8_1 = $1_1 } - $4_1 = $6_1; + $4_1 = $8_1; } return $4_1 | 0; } @@ -12724,15 +12727,15 @@ function asmFunc(global, env, buffer) { function $33($0, $1_1) { $0 = $0 | 0; $1_1 = $1_1 | 0; - var $4_1 = 0, $5_1 = 0, $6_1 = 0, $7_1 = 0; + var $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0; block : { if_ : { if ($0) { - $7_1 = $1_1 + $9_1 = $1_1 } else { - $4_1 = 4; - $5_1 = $4_1; - $6_1 = $4_1; + $6_1 = 4; + $7_1 = $6_1; + $8_1 = $6_1; switch (0 | 0) { case 0: break block; @@ -12740,11 +12743,11 @@ function asmFunc(global, env, buffer) { break if_; }; } - $6_1 = $7_1; + $8_1 = $9_1; } - $5_1 = $6_1; + $7_1 = $8_1; } - return $5_1 | 0; + return $7_1 | 0; } function $34($0, $1_1) { @@ -12892,6 +12895,30 @@ function asmFunc(global, env, buffer) { } function $46() { + var $2_1 = 0; + block : { + $2_1 = 1; + switch (1 | 0) { + default: + break block; + }; + } + return $2_1 | 0; + } + + function $47() { + var $1_1 = 0; + block : { + $1_1 = 1; + switch (1 | 0) { + default: + break block; + }; + } + return $1_1 | 0; + } + + function $48() { var $1_1 = Math_fround(0); block : { $1_1 = Math_fround(1.7000000476837158); @@ -12903,7 +12930,7 @@ function asmFunc(global, env, buffer) { return Math_fround($1_1); } - function $47() { + function $49() { var i64toi32_i32$0 = 0, $1_1 = 0, $1$hi = 0; block : { i64toi32_i32$0 = 0; @@ -12919,7 +12946,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $48() { + function $50() { var $1_1 = 0; block : { $1_1 = 30; @@ -12931,7 +12958,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $49() { + function $51() { var $1_1 = 0; block : { $1_1 = 31; @@ -12943,7 +12970,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $50() { + function $52() { var $1_1 = 0; block : { $1_1 = 32; @@ -12955,7 +12982,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $51() { + function $53() { var $1_1 = 0; block : { $1_1 = 33; @@ -12967,7 +12994,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $52() { + function $54() { var $1_1 = Math_fround(0); block : { $1_1 = Math_fround(3.4000000953674316); @@ -12979,7 +13006,7 @@ function asmFunc(global, env, buffer) { return Math_fround($1_1); } - function $53() { + function $55() { var $1_1 = 0; block : { $1_1 = 3; @@ -12991,7 +13018,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $54() { + function $56() { var i64toi32_i32$0 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$1 = 0; block : { i64toi32_i32$0 = 0; @@ -13007,7 +13034,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $55() { + function $57() { var $1_1 = 0; block : { $1_1 = 44; @@ -13019,7 +13046,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $56() { + function $58() { var $1_1 = 0; block : { $1_1 = 43; @@ -13031,7 +13058,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $57() { + function $59() { var $1_1 = 0; block : { $1_1 = 42; @@ -13043,7 +13070,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $58() { + function $60() { var $1_1 = 0; block : { $1_1 = 41; @@ -13055,7 +13082,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $59() { + function $61() { var $1_1 = 0; block : { $1_1 = 40; @@ -13067,7 +13094,7 @@ function asmFunc(global, env, buffer) { return $1_1 | 0; } - function $60($0) { + function $62($0) { $0 = $0 | 0; var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; block : { @@ -13093,7 +13120,7 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function $61($0) { + function $63($0) { $0 = $0 | 0; var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; block : { @@ -13119,7 +13146,7 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function $62($0) { + function $64($0) { $0 = $0 | 0; var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; block : { @@ -13145,7 +13172,7 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function $63($0) { + function $65($0) { $0 = $0 | 0; var $4_1 = 0, $2_1 = 0, $3_1 = 0; block : { @@ -13165,7 +13192,7 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function $64($0) { + function $66($0) { $0 = $0 | 0; var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; block : { @@ -13191,7 +13218,7 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function $65($0) { + function $67($0) { $0 = $0 | 0; var $4_1 = 0, $2_1 = 0, $3_1 = 0; block : { @@ -13211,6 +13238,37 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } + function $68($0) { + $0 = $0 | 0; + var $4_1 = 0, $9_1 = 0; + loop_in : while (1) { + block : { + switch ($0 | 0) { + case 0: + continue loop_in; + default: + break block; + }; + } + $4_1 = 0; + break loop_in; + }; + $0 = $4_1; + loop_in21 : while (1) { + block22 : { + switch ($0 | 0) { + case 0: + break block22; + default: + continue loop_in21; + }; + } + $9_1 = 3; + break loop_in21; + }; + return $9_1 | 0; + } + function legalstub$6() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; i64toi32_i32$0 = $6() | 0; @@ -13255,9 +13313,9 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function legalstub$47() { + function legalstub$49() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $47() | 0; + i64toi32_i32$0 = $49() | 0; i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $0 = i64toi32_i32$0; $0$hi = i64toi32_i32$1; @@ -13277,9 +13335,9 @@ function asmFunc(global, env, buffer) { return $0 | 0; } - function legalstub$54() { + function legalstub$56() { var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0 = 0, $0$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $54() | 0; + i64toi32_i32$0 = $56() | 0; i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; $0 = i64toi32_i32$0; $0$hi = i64toi32_i32$1; @@ -13345,26 +13403,29 @@ function asmFunc(global, env, buffer) { "as_call_indirect_last": $43, "as_call_indirect_func": $44, "as_local_set_value": $45, - "as_load_address": $46, - "as_loadN_address": legalstub$47, - "as_store_address": $48, - "as_store_value": $49, - "as_storeN_address": $50, - "as_storeN_value": $51, - "as_unary_operand": $52, - "as_binary_left": $53, - "as_binary_right": legalstub$54, - "as_test_operand": $55, - "as_compare_left": $56, - "as_compare_right": $57, - "as_convert_operand": $58, - "as_memory_grow_size": $59, - "nested_block_value": $60, - "nested_br_value": $61, - "nested_br_if_value": $62, - "nested_br_if_value_cond": $63, - "nested_br_table_value": $64, - "nested_br_table_value_index": $65 + "as_local_tee_value": $46, + "as_global_set_value": $47, + "as_load_address": $48, + "as_loadN_address": legalstub$49, + "as_store_address": $50, + "as_store_value": $51, + "as_storeN_address": $52, + "as_storeN_value": $53, + "as_unary_operand": $54, + "as_binary_left": $55, + "as_binary_right": legalstub$56, + "as_test_operand": $57, + "as_compare_left": $58, + "as_compare_right": $59, + "as_convert_operand": $60, + "as_memory_grow_size": $61, + "nested_block_value": $62, + "nested_br_value": $63, + "nested_br_if_value": $64, + "nested_br_if_value_cond": $65, + "nested_br_table_value": $66, + "nested_br_table_value_index": $67, + "nested_br_table_loop_block": $68 }; } @@ -13414,6 +13475,8 @@ export var as_call_indirect_mid = retasmFunc.as_call_indirect_mid; export var as_call_indirect_last = retasmFunc.as_call_indirect_last; export var as_call_indirect_func = retasmFunc.as_call_indirect_func; export var as_local_set_value = retasmFunc.as_local_set_value; +export var as_local_tee_value = retasmFunc.as_local_tee_value; +export var as_global_set_value = retasmFunc.as_global_set_value; export var as_load_address = retasmFunc.as_load_address; export var as_loadN_address = retasmFunc.as_loadN_address; export var as_store_address = retasmFunc.as_store_address; @@ -13434,3 +13497,4 @@ export var nested_br_if_value = retasmFunc.nested_br_if_value; export var nested_br_if_value_cond = retasmFunc.nested_br_if_value_cond; export var nested_br_table_value = retasmFunc.nested_br_table_value; export var nested_br_table_value_index = retasmFunc.nested_br_table_value_index; +export var nested_br_table_loop_block = retasmFunc.nested_br_table_loop_block; diff --git a/test/wasm2js/comments.2asm.js b/test/wasm2js/comments.2asm.js index e31607d1d..81100c40c 100644 --- a/test/wasm2js/comments.2asm.js +++ b/test/wasm2js/comments.2asm.js @@ -28,3 +28,33 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + var FUNCTION_TABLE = []; + return { + + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); diff --git a/test/wasm2js/f32.2asm.js b/test/wasm2js/f32.2asm.js index 80c8f8d24..20683a5f8 100644 --- a/test/wasm2js/f32.2asm.js +++ b/test/wasm2js/f32.2asm.js @@ -1,26 +1,4 @@ - - var scratchBuffer = new ArrayBuffer(8); - var i32ScratchView = new Int32Array(scratchBuffer); - var f32ScratchView = new Float32Array(scratchBuffer); - var f64ScratchView = new Float64Array(scratchBuffer); - - function wasm2js_scratch_store_i32(index, value) { - i32ScratchView[index] = value; - } - - function wasm2js_scratch_load_f32() { - return f32ScratchView[0]; - } - - function wasm2js_scratch_store_f32(value) { - f32ScratchView[0] = value; - } - - function wasm2js_scratch_load_i32(index) { - return i32ScratchView[index]; - } - function asmFunc(global, env, buffer) { var HEAP8 = new global.Int8Array(buffer); var HEAP16 = new global.Int16Array(buffer); @@ -103,22 +81,6 @@ function asmFunc(global, env, buffer) { return Math_fround(Math_fround(__wasm_nearest_f32(Math_fround(x)))); } - function $11(x) { - x = Math_fround(x); - return Math_fround(Math_fround(Math_abs(x))); - } - - function $12(x) { - x = Math_fround(x); - return Math_fround(Math_fround(-x)); - } - - function $13(x, y) { - x = Math_fround(x); - y = Math_fround(y); - return Math_fround((wasm2js_scratch_store_i32(0, (wasm2js_scratch_store_f32(x), wasm2js_scratch_load_i32(0)) & 2147483647 | 0 | ((wasm2js_scratch_store_f32(y), wasm2js_scratch_load_i32(0)) & -2147483648 | 0) | 0), wasm2js_scratch_load_f32())); - } - function __wasm_nearest_f32(var$0) { var$0 = Math_fround(var$0); var var$1 = Math_fround(0), var$2 = Math_fround(0); @@ -154,10 +116,7 @@ function asmFunc(global, env, buffer) { "ceil": $7, "floor": $8, "trunc": $9, - "nearest": $10, - "abs": $11, - "neg": $12, - "copysign": $13 + "nearest": $10 }; } @@ -174,6 +133,3 @@ export var ceil = retasmFunc.ceil; export var floor = retasmFunc.floor; export var trunc = retasmFunc.trunc; export var nearest = retasmFunc.nearest; -export var abs = retasmFunc.abs; -export var neg = retasmFunc.neg; -export var copysign = retasmFunc.copysign; diff --git a/test/wasm2js/f64.2asm.js b/test/wasm2js/f64.2asm.js index 51dc8fcf6..cd18a7bab 100644 --- a/test/wasm2js/f64.2asm.js +++ b/test/wasm2js/f64.2asm.js @@ -1,26 +1,4 @@ - - var scratchBuffer = new ArrayBuffer(8); - var i32ScratchView = new Int32Array(scratchBuffer); - var f32ScratchView = new Float32Array(scratchBuffer); - var f64ScratchView = new Float64Array(scratchBuffer); - - function wasm2js_scratch_load_i32(index) { - return i32ScratchView[index]; - } - - function wasm2js_scratch_store_i32(index, value) { - i32ScratchView[index] = value; - } - - function wasm2js_scratch_load_f64() { - return f64ScratchView[0]; - } - - function wasm2js_scratch_store_f64(value) { - f64ScratchView[0] = value; - } - function asmFunc(global, env, buffer) { var HEAP8 = new global.Int8Array(buffer); var HEAP16 = new global.Int16Array(buffer); @@ -103,46 +81,6 @@ function asmFunc(global, env, buffer) { return +(+__wasm_nearest_f64(+x)); } - function $11(x) { - x = +x; - return +Math_abs(x); - } - - function $12(x) { - x = +x; - return +-x; - } - - function $13(x, y) { - x = +x; - y = +y; - var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $4_1 = 0, $4$hi = 0, $7_1 = 0, $7$hi = 0; - wasm2js_scratch_store_f64(+x); - i64toi32_i32$0 = wasm2js_scratch_load_i32(1 | 0) | 0; - i64toi32_i32$2 = wasm2js_scratch_load_i32(0 | 0) | 0; - i64toi32_i32$1 = 2147483647; - i64toi32_i32$3 = -1; - i64toi32_i32$1 = i64toi32_i32$0 & i64toi32_i32$1 | 0; - $4_1 = i64toi32_i32$2 & i64toi32_i32$3 | 0; - $4$hi = i64toi32_i32$1; - wasm2js_scratch_store_f64(+y); - i64toi32_i32$1 = wasm2js_scratch_load_i32(1 | 0) | 0; - i64toi32_i32$0 = wasm2js_scratch_load_i32(0 | 0) | 0; - i64toi32_i32$2 = -2147483648; - i64toi32_i32$3 = 0; - i64toi32_i32$2 = i64toi32_i32$1 & i64toi32_i32$2 | 0; - $7_1 = i64toi32_i32$0 & i64toi32_i32$3 | 0; - $7$hi = i64toi32_i32$2; - i64toi32_i32$2 = $4$hi; - i64toi32_i32$1 = $4_1; - i64toi32_i32$0 = $7$hi; - i64toi32_i32$3 = $7_1; - i64toi32_i32$0 = i64toi32_i32$2 | i64toi32_i32$0 | 0; - wasm2js_scratch_store_i32(0 | 0, i64toi32_i32$1 | i64toi32_i32$3 | 0 | 0); - wasm2js_scratch_store_i32(1 | 0, i64toi32_i32$0 | 0); - return +(+wasm2js_scratch_load_f64()); - } - function __wasm_nearest_f64(var$0) { var$0 = +var$0; var var$1 = 0.0, var$2 = 0.0; @@ -178,10 +116,7 @@ function asmFunc(global, env, buffer) { "ceil": $7, "floor": $8, "trunc": $9, - "nearest": $10, - "abs": $11, - "neg": $12, - "copysign": $13 + "nearest": $10 }; } @@ -198,6 +133,3 @@ export var ceil = retasmFunc.ceil; export var floor = retasmFunc.floor; export var trunc = retasmFunc.trunc; export var nearest = retasmFunc.nearest; -export var abs = retasmFunc.abs; -export var neg = retasmFunc.neg; -export var copysign = retasmFunc.copysign; diff --git a/test/wasm2js/fac.2asm.js b/test/wasm2js/fac.2asm.js index 8704e8808..f66ed55e0 100644 --- a/test/wasm2js/fac.2asm.js +++ b/test/wasm2js/fac.2asm.js @@ -26,30 +26,33 @@ function asmFunc(global, env, buffer) { function $0($0_1, $0$hi) { $0_1 = $0_1 | 0; $0$hi = $0$hi | 0; - var i64toi32_i32$3 = 0, i64toi32_i32$5 = 0, i64toi32_i32$1 = 0, $8 = 0, $8$hi = 0, $6 = 0, $6$hi = 0; + var i64toi32_i32$3 = 0, i64toi32_i32$5 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, $12 = 0, $12$hi = 0, $8 = 0, $8$hi = 0; + i64toi32_i32$2 = $0_1; i64toi32_i32$1 = 0; i64toi32_i32$3 = 0; - if (($0_1 | 0) == (i64toi32_i32$3 | 0) & ($0$hi | 0) == (i64toi32_i32$1 | 0) | 0) { - $8 = 1; - $8$hi = 0; + if ((i64toi32_i32$2 | 0) == (i64toi32_i32$3 | 0) & ($0$hi | 0) == (i64toi32_i32$1 | 0) | 0) { + i64toi32_i32$2 = 0; + $12 = 1; + $12$hi = i64toi32_i32$2; } else { + i64toi32_i32$2 = $0$hi; i64toi32_i32$3 = $0_1; i64toi32_i32$1 = 1; i64toi32_i32$5 = (i64toi32_i32$3 >>> 0 < i64toi32_i32$1 >>> 0) + 0 | 0; i64toi32_i32$5 = $0$hi - i64toi32_i32$5 | 0; i64toi32_i32$5 = $0(i64toi32_i32$3 - i64toi32_i32$1 | 0 | 0, i64toi32_i32$5 | 0) | 0; i64toi32_i32$3 = i64toi32_i32$HIGH_BITS; - $6 = i64toi32_i32$5; - $6$hi = i64toi32_i32$3; - i64toi32_i32$3 = $0$hi; - i64toi32_i32$5 = $6$hi; - i64toi32_i32$5 = __wasm_i64_mul($0_1 | 0, $0$hi | 0, $6 | 0, i64toi32_i32$5 | 0) | 0; - i64toi32_i32$3 = i64toi32_i32$HIGH_BITS; $8 = i64toi32_i32$5; $8$hi = i64toi32_i32$3; + i64toi32_i32$3 = $0$hi; + i64toi32_i32$5 = $8$hi; + i64toi32_i32$5 = __wasm_i64_mul($0_1 | 0, i64toi32_i32$3 | 0, $8 | 0, i64toi32_i32$5 | 0) | 0; + i64toi32_i32$3 = i64toi32_i32$HIGH_BITS; + $12 = i64toi32_i32$5; + $12$hi = i64toi32_i32$3; } - i64toi32_i32$3 = $8$hi; - i64toi32_i32$5 = $8; + i64toi32_i32$3 = $12$hi; + i64toi32_i32$5 = $12; i64toi32_i32$HIGH_BITS = i64toi32_i32$3; return i64toi32_i32$5 | 0; } @@ -57,30 +60,33 @@ function asmFunc(global, env, buffer) { function fac_rec_named(n, n$hi) { n = n | 0; n$hi = n$hi | 0; - var i64toi32_i32$3 = 0, i64toi32_i32$5 = 0, i64toi32_i32$1 = 0, $8 = 0, $8$hi = 0, $6 = 0, $6$hi = 0; + var i64toi32_i32$3 = 0, i64toi32_i32$5 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, $12 = 0, $12$hi = 0, $8 = 0, $8$hi = 0; + i64toi32_i32$2 = n; i64toi32_i32$1 = 0; i64toi32_i32$3 = 0; - if ((n | 0) == (i64toi32_i32$3 | 0) & (n$hi | 0) == (i64toi32_i32$1 | 0) | 0) { - $8 = 1; - $8$hi = 0; + if ((i64toi32_i32$2 | 0) == (i64toi32_i32$3 | 0) & (n$hi | 0) == (i64toi32_i32$1 | 0) | 0) { + i64toi32_i32$2 = 0; + $12 = 1; + $12$hi = i64toi32_i32$2; } else { + i64toi32_i32$2 = n$hi; i64toi32_i32$3 = n; i64toi32_i32$1 = 1; i64toi32_i32$5 = (i64toi32_i32$3 >>> 0 < i64toi32_i32$1 >>> 0) + 0 | 0; i64toi32_i32$5 = n$hi - i64toi32_i32$5 | 0; i64toi32_i32$5 = fac_rec_named(i64toi32_i32$3 - i64toi32_i32$1 | 0 | 0, i64toi32_i32$5 | 0) | 0; i64toi32_i32$3 = i64toi32_i32$HIGH_BITS; - $6 = i64toi32_i32$5; - $6$hi = i64toi32_i32$3; - i64toi32_i32$3 = n$hi; - i64toi32_i32$5 = $6$hi; - i64toi32_i32$5 = __wasm_i64_mul(n | 0, n$hi | 0, $6 | 0, i64toi32_i32$5 | 0) | 0; - i64toi32_i32$3 = i64toi32_i32$HIGH_BITS; $8 = i64toi32_i32$5; $8$hi = i64toi32_i32$3; + i64toi32_i32$3 = n$hi; + i64toi32_i32$5 = $8$hi; + i64toi32_i32$5 = __wasm_i64_mul(n | 0, i64toi32_i32$3 | 0, $8 | 0, i64toi32_i32$5 | 0) | 0; + i64toi32_i32$3 = i64toi32_i32$HIGH_BITS; + $12 = i64toi32_i32$5; + $12$hi = i64toi32_i32$3; } - i64toi32_i32$3 = $8$hi; - i64toi32_i32$5 = $8; + i64toi32_i32$3 = $12$hi; + i64toi32_i32$5 = $12; i64toi32_i32$HIGH_BITS = i64toi32_i32$3; return i64toi32_i32$5 | 0; } @@ -104,24 +110,22 @@ function asmFunc(global, env, buffer) { if ((i64toi32_i32$2 | 0) == (i64toi32_i32$3 | 0) & (i64toi32_i32$0 | 0) == (i64toi32_i32$1 | 0) | 0) { break block } else { - block0 : { - i64toi32_i32$2 = $1$hi; - i64toi32_i32$2 = $2$hi; - i64toi32_i32$2 = $1$hi; - i64toi32_i32$0 = $2$hi; - i64toi32_i32$0 = __wasm_i64_mul($1 | 0, i64toi32_i32$2 | 0, $2_1 | 0, i64toi32_i32$0 | 0) | 0; - i64toi32_i32$2 = i64toi32_i32$HIGH_BITS; - $2_1 = i64toi32_i32$0; - $2$hi = i64toi32_i32$2; - i64toi32_i32$2 = $1$hi; - i64toi32_i32$3 = $1; - i64toi32_i32$0 = 0; - i64toi32_i32$1 = 1; - i64toi32_i32$5 = (i64toi32_i32$3 >>> 0 < i64toi32_i32$1 >>> 0) + i64toi32_i32$0 | 0; - i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; - $1 = i64toi32_i32$3 - i64toi32_i32$1 | 0; - $1$hi = i64toi32_i32$5; - } + i64toi32_i32$2 = $1$hi; + i64toi32_i32$2 = $2$hi; + i64toi32_i32$2 = $1$hi; + i64toi32_i32$0 = $2$hi; + i64toi32_i32$0 = __wasm_i64_mul($1 | 0, i64toi32_i32$2 | 0, $2_1 | 0, i64toi32_i32$0 | 0) | 0; + i64toi32_i32$2 = i64toi32_i32$HIGH_BITS; + $2_1 = i64toi32_i32$0; + $2$hi = i64toi32_i32$2; + i64toi32_i32$2 = $1$hi; + i64toi32_i32$3 = $1; + i64toi32_i32$0 = 0; + i64toi32_i32$1 = 1; + i64toi32_i32$5 = (i64toi32_i32$3 >>> 0 < i64toi32_i32$1 >>> 0) + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; + $1 = i64toi32_i32$3 - i64toi32_i32$1 | 0; + $1$hi = i64toi32_i32$5; } continue loop_in; }; @@ -151,24 +155,22 @@ function asmFunc(global, env, buffer) { if ((i64toi32_i32$2 | 0) == (i64toi32_i32$3 | 0) & (i64toi32_i32$0 | 0) == (i64toi32_i32$1 | 0) | 0) { break done } else { - block : { - i64toi32_i32$2 = i$hi; - i64toi32_i32$2 = res$hi; - i64toi32_i32$2 = i$hi; - i64toi32_i32$0 = res$hi; - i64toi32_i32$0 = __wasm_i64_mul(i | 0, i64toi32_i32$2 | 0, res | 0, i64toi32_i32$0 | 0) | 0; - i64toi32_i32$2 = i64toi32_i32$HIGH_BITS; - res = i64toi32_i32$0; - res$hi = i64toi32_i32$2; - i64toi32_i32$2 = i$hi; - i64toi32_i32$3 = i; - i64toi32_i32$0 = 0; - i64toi32_i32$1 = 1; - i64toi32_i32$5 = (i64toi32_i32$3 >>> 0 < i64toi32_i32$1 >>> 0) + i64toi32_i32$0 | 0; - i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; - i = i64toi32_i32$3 - i64toi32_i32$1 | 0; - i$hi = i64toi32_i32$5; - } + i64toi32_i32$2 = i$hi; + i64toi32_i32$2 = res$hi; + i64toi32_i32$2 = i$hi; + i64toi32_i32$0 = res$hi; + i64toi32_i32$0 = __wasm_i64_mul(i | 0, i64toi32_i32$2 | 0, res | 0, i64toi32_i32$0 | 0) | 0; + i64toi32_i32$2 = i64toi32_i32$HIGH_BITS; + res = i64toi32_i32$0; + res$hi = i64toi32_i32$2; + i64toi32_i32$2 = i$hi; + i64toi32_i32$3 = i; + i64toi32_i32$0 = 0; + i64toi32_i32$1 = 1; + i64toi32_i32$5 = (i64toi32_i32$3 >>> 0 < i64toi32_i32$1 >>> 0) + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; + i = i64toi32_i32$3 - i64toi32_i32$1 | 0; + i$hi = i64toi32_i32$5; } continue loop; }; diff --git a/test/wasm2js/forward.2asm.js b/test/wasm2js/forward.2asm.js index d1210c1b8..3d3d5bf9b 100644 --- a/test/wasm2js/forward.2asm.js +++ b/test/wasm2js/forward.2asm.js @@ -22,24 +22,24 @@ function asmFunc(global, env, buffer) { var infinity = global.Infinity; function even(n) { n = n | 0; - var $6 = 0; + var $10 = 0; if ((n | 0) == (0 | 0)) { - $6 = 1 + $10 = 1 } else { - $6 = odd(n - 1 | 0 | 0) | 0 + $10 = odd(n - 1 | 0 | 0) | 0 } - return $6 | 0; + return $10 | 0; } function odd(n) { n = n | 0; - var $6 = 0; + var $10 = 0; if ((n | 0) == (0 | 0)) { - $6 = 0 + $10 = 0 } else { - $6 = even(n - 1 | 0 | 0) | 0 + $10 = even(n - 1 | 0 | 0) | 0 } - return $6 | 0; + return $10 | 0; } var FUNCTION_TABLE = []; diff --git a/test/wasm2js/func_ptrs.2asm.js b/test/wasm2js/func_ptrs.2asm.js index 230cb95ce..45e0a8697 100644 --- a/test/wasm2js/func_ptrs.2asm.js +++ b/test/wasm2js/func_ptrs.2asm.js @@ -1,4 +1,4 @@ -import { print } from 'spectest'; +import { print_i32 } from 'spectest'; function asmFunc(global, env, buffer) { var HEAP8 = new global.Int8Array(buffer); @@ -21,7 +21,7 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var print = env.print; + var print = env.print_i32; function $3() { return 13 | 0; } @@ -51,7 +51,7 @@ function asmFunc(global, env, buffer) { } var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },print},memasmFunc); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },print_i32},memasmFunc); export var one = retasmFunc.one; export var two = retasmFunc.two; export var three = retasmFunc.three; diff --git a/test/wasm2js/int_exprs.2asm.js b/test/wasm2js/int_exprs.2asm.js index 6c4ad059a..af1673aa2 100644 --- a/test/wasm2js/int_exprs.2asm.js +++ b/test/wasm2js/int_exprs.2asm.js @@ -1715,6 +1715,1527 @@ function asmFunc(global, env, buffer) { var i64toi32_i32$HIGH_BITS = 0; function $0(x) { x = x | 0; + return (x | 0) / (x | 0) | 0 | 0; + } + + function $1(x) { + x = x | 0; + return (x >>> 0) / (x >>> 0) | 0 | 0; + } + + function $2(x, x$hi) { + x = x | 0; + x$hi = x$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = x$hi; + i64toi32_i32$1 = i64toi32_i32$0; + i64toi32_i32$1 = __wasm_i64_sdiv(x | 0, i64toi32_i32$0 | 0, x | 0, i64toi32_i32$0 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function $3(x, x$hi) { + x = x | 0; + x$hi = x$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = x$hi; + i64toi32_i32$1 = i64toi32_i32$0; + i64toi32_i32$1 = __wasm_i64_udiv(x | 0, i64toi32_i32$0 | 0, x | 0, i64toi32_i32$0 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function legalstub$2($0_1, $1_1) { + $0_1 = $0_1 | 0; + $1_1 = $1_1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + i64toi32_i32$0 = 0; + $4 = $0_1; + $4$hi = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$2 = $1_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $12 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; + $12 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $7$hi = i64toi32_i32$1; + i64toi32_i32$1 = $4$hi; + i64toi32_i32$0 = $4; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$3 = $12; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$2 = $2(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + $2_1 = i64toi32_i32$2; + $2$hi = i64toi32_i32$0; + i64toi32_i32$1 = i64toi32_i32$2; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $13 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $13 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$1 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($13 | 0); + i64toi32_i32$2 = $2$hi; + return $2_1 | 0; + } + + function legalstub$3($0_1, $1_1) { + $0_1 = $0_1 | 0; + $1_1 = $1_1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + i64toi32_i32$0 = 0; + $4 = $0_1; + $4$hi = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$2 = $1_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $12 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; + $12 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $7$hi = i64toi32_i32$1; + i64toi32_i32$1 = $4$hi; + i64toi32_i32$0 = $4; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$3 = $12; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$2 = $3(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + $2_1 = i64toi32_i32$2; + $2$hi = i64toi32_i32$0; + i64toi32_i32$1 = i64toi32_i32$2; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $13 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $13 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$1 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($13 | 0); + i64toi32_i32$2 = $2$hi; + return $2_1 | 0; + } + + function legalfunc$wasm2js_scratch_store_i64($0_1, $0$hi) { + $0_1 = $0_1 | 0; + $0$hi = $0$hi | 0; + var i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $2_1 = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $0$hi; + $2_1 = $0_1; + i64toi32_i32$2 = $0_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $8 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + legalimport$wasm2js_scratch_store_i64($2_1 | 0, $8 | 0); + } + + function _ZN17compiler_builtins3int4sdiv3Div3div17he78fc483e41d7ec7E(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$1 = 0, i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, i64toi32_i32$0 = 0, i64toi32_i32$5 = 0, var$2 = 0, var$2$hi = 0, i64toi32_i32$6 = 0, $21 = 0, $22 = 0, $23 = 0, $7$hi = 0, $9 = 0, $9$hi = 0, $14$hi = 0, $16$hi = 0, $17 = 0, $17$hi = 0, $23$hi = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + $21 = i64toi32_i32$0 >> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >> i64toi32_i32$4 | 0; + $21 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$2 = $21; + var$2$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$0 = var$2; + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$2 | 0; + $7$hi = i64toi32_i32$2; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$1 = i64toi32_i32$0 ^ i64toi32_i32$3 | 0; + i64toi32_i32$0 = var$2$hi; + i64toi32_i32$3 = var$2; + i64toi32_i32$4 = i64toi32_i32$1 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$1 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$5 = i64toi32_i32$6 + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; + $9 = i64toi32_i32$4; + $9$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$1$hi; + i64toi32_i32$2 = var$1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$0 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$5 >> 31 | 0; + $22 = i64toi32_i32$5 >> i64toi32_i32$0 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$5 >> i64toi32_i32$0 | 0; + $22 = (((1 << i64toi32_i32$0 | 0) - 1 | 0) & i64toi32_i32$5 | 0) << (32 - i64toi32_i32$0 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$0 | 0) | 0; + } + var$2 = $22; + var$2$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$5 = var$2; + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$3 = var$1; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$2 | 0; + $14$hi = i64toi32_i32$2; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$2 = $14$hi; + i64toi32_i32$1 = i64toi32_i32$5 ^ i64toi32_i32$3 | 0; + i64toi32_i32$5 = var$2$hi; + i64toi32_i32$3 = var$2; + i64toi32_i32$0 = i64toi32_i32$1 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$1 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$4 = i64toi32_i32$6 + i64toi32_i32$5 | 0; + i64toi32_i32$4 = i64toi32_i32$2 - i64toi32_i32$4 | 0; + $16$hi = i64toi32_i32$4; + i64toi32_i32$4 = $9$hi; + i64toi32_i32$1 = $16$hi; + i64toi32_i32$1 = __wasm_i64_udiv($9 | 0, i64toi32_i32$4 | 0, i64toi32_i32$0 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$4 = i64toi32_i32$HIGH_BITS; + $17 = i64toi32_i32$1; + $17$hi = i64toi32_i32$4; + i64toi32_i32$4 = var$1$hi; + i64toi32_i32$4 = var$0$hi; + i64toi32_i32$4 = var$1$hi; + i64toi32_i32$2 = var$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$1 = i64toi32_i32$4 ^ i64toi32_i32$1 | 0; + i64toi32_i32$4 = i64toi32_i32$2 ^ i64toi32_i32$3 | 0; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$5 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$1 >> 31 | 0; + $23 = i64toi32_i32$1 >> i64toi32_i32$5 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >> i64toi32_i32$5 | 0; + $23 = (((1 << i64toi32_i32$5 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$5 | 0) | 0 | (i64toi32_i32$4 >>> i64toi32_i32$5 | 0) | 0; + } + var$0 = $23; + var$0$hi = i64toi32_i32$2; + i64toi32_i32$2 = $17$hi; + i64toi32_i32$1 = $17; + i64toi32_i32$4 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$4 = i64toi32_i32$2 ^ i64toi32_i32$4 | 0; + $23$hi = i64toi32_i32$4; + i64toi32_i32$4 = var$0$hi; + i64toi32_i32$4 = $23$hi; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$3 | 0; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$0 = i64toi32_i32$6 + i64toi32_i32$1 | 0; + i64toi32_i32$0 = i64toi32_i32$4 - i64toi32_i32$0 | 0; + i64toi32_i32$2 = i64toi32_i32$5; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$2 | 0; + } + + function _ZN17compiler_builtins3int4udiv10divmod_u6417h6026910b5ed08e40E(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$3 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$5 = 0, var$2 = 0, var$3 = 0, var$4 = 0, var$5 = 0, var$5$hi = 0, var$6 = 0, var$6$hi = 0, i64toi32_i32$6 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, var$8$hi = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, var$7$hi = 0, $49 = 0, $63$hi = 0, $65 = 0, $65$hi = 0, $120$hi = 0, $129$hi = 0, $134$hi = 0, var$8 = 0, $140 = 0, $140$hi = 0, $142$hi = 0, $144 = 0, $144$hi = 0, $151 = 0, $151$hi = 0, $154$hi = 0, var$7 = 0, $165$hi = 0; + label$1 : { + label$2 : { + label$3 : { + label$4 : { + label$5 : { + label$6 : { + label$7 : { + label$8 : { + label$9 : { + label$10 : { + label$11 : { + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $37 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $37 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$2 = $37; + if (var$2) { + block : { + i64toi32_i32$1 = var$1$hi; + var$3 = var$1; + if (!var$3) { + break label$11 + } + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$0 = var$1; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $38 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $38 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; + } + var$4 = $38; + if (!var$4) { + break label$9 + } + var$2 = Math_clz32(var$4) - Math_clz32(var$2) | 0; + if (var$2 >>> 0 <= 31 >>> 0) { + break label$8 + } + break label$2; + } + } + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$1 = var$1; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = 0; + if (i64toi32_i32$2 >>> 0 > i64toi32_i32$0 >>> 0 | ((i64toi32_i32$2 | 0) == (i64toi32_i32$0 | 0) & i64toi32_i32$1 >>> 0 >= i64toi32_i32$3 >>> 0 | 0) | 0) { + break label$2 + } + i64toi32_i32$1 = var$0$hi; + var$2 = var$0; + i64toi32_i32$1 = var$1$hi; + var$3 = var$1; + var$2 = (var$2 >>> 0) / (var$3 >>> 0) | 0; + i64toi32_i32$1 = 0; + legalfunc$wasm2js_scratch_store_i64(var$0 - Math_imul(var$2, var$3) | 0 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$2; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$2 | 0; + } + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$3 = var$1; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $39 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + $39 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$2 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$3 >>> i64toi32_i32$4 | 0) | 0; + } + var$3 = $39; + i64toi32_i32$1 = var$0$hi; + if (!var$0) { + break label$7 + } + if (!var$3) { + break label$6 + } + var$4 = var$3 + -1 | 0; + if (var$4 & var$3 | 0) { + break label$6 + } + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$4 & var$2 | 0; + i64toi32_i32$3 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$3 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $40 = 0; + } else { + i64toi32_i32$3 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; + $40 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $63$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$1 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = -1; + i64toi32_i32$2 = i64toi32_i32$3 & i64toi32_i32$2 | 0; + $65 = i64toi32_i32$1 & i64toi32_i32$0 | 0; + $65$hi = i64toi32_i32$2; + i64toi32_i32$2 = $63$hi; + i64toi32_i32$3 = $40; + i64toi32_i32$1 = $65$hi; + i64toi32_i32$0 = $65; + i64toi32_i32$1 = i64toi32_i32$2 | i64toi32_i32$1 | 0; + legalfunc$wasm2js_scratch_store_i64(i64toi32_i32$3 | i64toi32_i32$0 | 0 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$3 = var$2 >>> ((__wasm_ctz_i32(var$3 | 0) | 0) & 31 | 0) | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$3 | 0; + } + } + var$4 = var$3 + -1 | 0; + if (!(var$4 & var$3 | 0)) { + break label$5 + } + var$2 = (Math_clz32(var$3) + 33 | 0) - Math_clz32(var$2) | 0; + var$3 = 0 - var$2 | 0; + break label$3; + } + var$3 = 63 - var$2 | 0; + var$2 = var$2 + 1 | 0; + break label$3; + } + var$4 = (var$2 >>> 0) / (var$3 >>> 0) | 0; + i64toi32_i32$3 = 0; + i64toi32_i32$2 = var$2 - Math_imul(var$4, var$3) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $41 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $41 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + legalfunc$wasm2js_scratch_store_i64($41 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$4; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$2 | 0; + } + var$2 = Math_clz32(var$3) - Math_clz32(var$2) | 0; + if (var$2 >>> 0 < 31 >>> 0) { + break label$4 + } + break label$2; + } + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$2 = 0; + legalfunc$wasm2js_scratch_store_i64(var$4 & var$0 | 0 | 0, i64toi32_i32$2 | 0); + if ((var$3 | 0) == (1 | 0)) { + break label$1 + } + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$2 = 0; + $120$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$1 = $120$hi; + i64toi32_i32$0 = __wasm_ctz_i32(var$3 | 0) | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $42 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + $42 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$2 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$3 >>> i64toi32_i32$4 | 0) | 0; + } + i64toi32_i32$3 = $42; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$3 | 0; + } + var$3 = 63 - var$2 | 0; + var$2 = var$2 + 1 | 0; + } + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$3 = 0; + $129$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = $129$hi; + i64toi32_i32$0 = var$2 & 63 | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $43 = i64toi32_i32$3 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$3 >>> i64toi32_i32$4 | 0; + $43 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$3 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$5 = $43; + var$5$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$1 = 0; + $134$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$2 = $134$hi; + i64toi32_i32$0 = var$3 & 63 | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$3 << i64toi32_i32$4 | 0; + $44 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$3 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; + $44 = i64toi32_i32$3 << i64toi32_i32$4 | 0; + } + var$0 = $44; + var$0$hi = i64toi32_i32$2; + label$13 : { + if (var$2) { + block3 : { + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$1 = var$1; + i64toi32_i32$3 = -1; + i64toi32_i32$0 = -1; + i64toi32_i32$4 = i64toi32_i32$1 + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 + i64toi32_i32$3 | 0; + if (i64toi32_i32$4 >>> 0 < i64toi32_i32$0 >>> 0) { + i64toi32_i32$5 = i64toi32_i32$5 + 1 | 0 + } + var$8 = i64toi32_i32$4; + var$8$hi = i64toi32_i32$5; + label$15 : while (1) { + i64toi32_i32$5 = var$5$hi; + i64toi32_i32$2 = var$5; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$3 | 0; + $45 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$3 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$3 | 0) | 0) | 0 | (i64toi32_i32$5 << i64toi32_i32$3 | 0) | 0; + $45 = i64toi32_i32$2 << i64toi32_i32$3 | 0; + } + $140 = $45; + $140$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 63; + i64toi32_i32$3 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $46 = i64toi32_i32$1 >>> i64toi32_i32$3 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$3 | 0; + $46 = (((1 << i64toi32_i32$3 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$3 | 0) | 0 | (i64toi32_i32$5 >>> i64toi32_i32$3 | 0) | 0; + } + $142$hi = i64toi32_i32$2; + i64toi32_i32$2 = $140$hi; + i64toi32_i32$1 = $140; + i64toi32_i32$5 = $142$hi; + i64toi32_i32$0 = $46; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + var$5 = i64toi32_i32$1 | i64toi32_i32$0 | 0; + var$5$hi = i64toi32_i32$5; + $144 = var$5; + $144$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$8$hi; + i64toi32_i32$5 = var$5$hi; + i64toi32_i32$5 = var$8$hi; + i64toi32_i32$2 = var$8; + i64toi32_i32$1 = var$5$hi; + i64toi32_i32$0 = var$5; + i64toi32_i32$3 = i64toi32_i32$2 - i64toi32_i32$0 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$0 >>> 0; + i64toi32_i32$4 = i64toi32_i32$6 + i64toi32_i32$1 | 0; + i64toi32_i32$4 = i64toi32_i32$5 - i64toi32_i32$4 | 0; + i64toi32_i32$5 = i64toi32_i32$3; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 63; + i64toi32_i32$1 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$4 >> 31 | 0; + $47 = i64toi32_i32$4 >> i64toi32_i32$1 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$4 >> i64toi32_i32$1 | 0; + $47 = (((1 << i64toi32_i32$1 | 0) - 1 | 0) & i64toi32_i32$4 | 0) << (32 - i64toi32_i32$1 | 0) | 0 | (i64toi32_i32$5 >>> i64toi32_i32$1 | 0) | 0; + } + var$6 = $47; + var$6$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$2 = var$6$hi; + i64toi32_i32$4 = var$6; + i64toi32_i32$5 = var$1$hi; + i64toi32_i32$0 = var$1; + i64toi32_i32$5 = i64toi32_i32$2 & i64toi32_i32$5 | 0; + $151 = i64toi32_i32$4 & i64toi32_i32$0 | 0; + $151$hi = i64toi32_i32$5; + i64toi32_i32$5 = $144$hi; + i64toi32_i32$2 = $144; + i64toi32_i32$4 = $151$hi; + i64toi32_i32$0 = $151; + i64toi32_i32$1 = i64toi32_i32$2 - i64toi32_i32$0 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$0 >>> 0; + i64toi32_i32$3 = i64toi32_i32$6 + i64toi32_i32$4 | 0; + i64toi32_i32$3 = i64toi32_i32$5 - i64toi32_i32$3 | 0; + var$5 = i64toi32_i32$1; + var$5$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + $48 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$5 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $48 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + } + $154$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$7$hi; + i64toi32_i32$2 = $154$hi; + i64toi32_i32$3 = $48; + i64toi32_i32$5 = var$7$hi; + i64toi32_i32$0 = var$7; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + var$0 = i64toi32_i32$3 | i64toi32_i32$0 | 0; + var$0$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$6$hi; + i64toi32_i32$2 = var$6; + i64toi32_i32$3 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = i64toi32_i32$5 & i64toi32_i32$3 | 0; + var$6 = i64toi32_i32$2 & i64toi32_i32$0 | 0; + var$6$hi = i64toi32_i32$3; + var$7 = var$6; + var$7$hi = i64toi32_i32$3; + var$2 = var$2 + -1 | 0; + if (var$2) { + continue label$15 + } + break label$15; + }; + break label$13; + } + } + } + i64toi32_i32$3 = var$5$hi; + legalfunc$wasm2js_scratch_store_i64(var$5 | 0, i64toi32_i32$3 | 0); + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + $49 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$5 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $49 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + } + $165$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$6$hi; + i64toi32_i32$2 = $165$hi; + i64toi32_i32$3 = $49; + i64toi32_i32$5 = var$6$hi; + i64toi32_i32$0 = var$6; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + i64toi32_i32$3 = i64toi32_i32$3 | i64toi32_i32$0 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$5; + return i64toi32_i32$3 | 0; + } + i64toi32_i32$3 = var$0$hi; + legalfunc$wasm2js_scratch_store_i64(var$0 | 0, i64toi32_i32$3 | 0); + i64toi32_i32$3 = 0; + var$0 = 0; + var$0$hi = i64toi32_i32$3; + } + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$3; + return i64toi32_i32$5 | 0; + } + + function __wasm_i64_sdiv(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$0 = var$1$hi; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = _ZN17compiler_builtins3int4sdiv3Div3div17he78fc483e41d7ec7E(var$0 | 0, i64toi32_i32$0 | 0, var$1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function __wasm_i64_udiv(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$0 = var$1$hi; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = _ZN17compiler_builtins3int4udiv10divmod_u6417h6026910b5ed08e40E(var$0 | 0, i64toi32_i32$0 | 0, var$1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function __wasm_ctz_i32(var$0) { + var$0 = var$0 | 0; + if (var$0) { + return 31 - Math_clz32((var$0 + -1 | 0) ^ var$0 | 0) | 0 | 0 + } + return 32 | 0; + } + + var FUNCTION_TABLE = []; + return { + "i32_no_fold_div_s_self": $0, + "i32_no_fold_div_u_self": $1, + "i64_no_fold_div_s_self": legalstub$2, + "i64_no_fold_div_u_self": legalstub$3 + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +export var i32_no_fold_div_s_self = retasmFunc.i32_no_fold_div_s_self; +export var i32_no_fold_div_u_self = retasmFunc.i32_no_fold_div_u_self; +export var i64_no_fold_div_s_self = retasmFunc.i64_no_fold_div_s_self; +export var i64_no_fold_div_u_self = retasmFunc.i64_no_fold_div_u_self; +import { setTempRet0 } from 'env'; +import { getTempRet0 } from 'env'; + + + var scratchBuffer = new ArrayBuffer(8); + var i32ScratchView = new Int32Array(scratchBuffer); + var f32ScratchView = new Float32Array(scratchBuffer); + var f64ScratchView = new Float64Array(scratchBuffer); + + function legalimport$wasm2js_scratch_load_i64() { + if (typeof setTempRet0 === 'function') setTempRet0(i32ScratchView[1]); + return i32ScratchView[0]; + } + + function legalimport$wasm2js_scratch_store_i64(low, high) { + i32ScratchView[0] = low; + i32ScratchView[1] = high; + } + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + var setTempRet0 = env.setTempRet0; + var getTempRet0 = env.getTempRet0; + var i64toi32_i32$HIGH_BITS = 0; + function $0(x) { + x = x | 0; + return (x | 0) % (x | 0) | 0 | 0; + } + + function $1(x) { + x = x | 0; + return (x >>> 0) % (x >>> 0) | 0 | 0; + } + + function $2(x, x$hi) { + x = x | 0; + x$hi = x$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = x$hi; + i64toi32_i32$1 = i64toi32_i32$0; + i64toi32_i32$1 = __wasm_i64_srem(x | 0, i64toi32_i32$0 | 0, x | 0, i64toi32_i32$0 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function $3(x, x$hi) { + x = x | 0; + x$hi = x$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = x$hi; + i64toi32_i32$1 = i64toi32_i32$0; + i64toi32_i32$1 = __wasm_i64_urem(x | 0, i64toi32_i32$0 | 0, x | 0, i64toi32_i32$0 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function legalstub$2($0_1, $1_1) { + $0_1 = $0_1 | 0; + $1_1 = $1_1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + i64toi32_i32$0 = 0; + $4 = $0_1; + $4$hi = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$2 = $1_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $12 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; + $12 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $7$hi = i64toi32_i32$1; + i64toi32_i32$1 = $4$hi; + i64toi32_i32$0 = $4; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$3 = $12; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$2 = $2(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + $2_1 = i64toi32_i32$2; + $2$hi = i64toi32_i32$0; + i64toi32_i32$1 = i64toi32_i32$2; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $13 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $13 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$1 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($13 | 0); + i64toi32_i32$2 = $2$hi; + return $2_1 | 0; + } + + function legalstub$3($0_1, $1_1) { + $0_1 = $0_1 | 0; + $1_1 = $1_1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + i64toi32_i32$0 = 0; + $4 = $0_1; + $4$hi = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$2 = $1_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $12 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; + $12 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $7$hi = i64toi32_i32$1; + i64toi32_i32$1 = $4$hi; + i64toi32_i32$0 = $4; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$3 = $12; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$2 = $3(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + $2_1 = i64toi32_i32$2; + $2$hi = i64toi32_i32$0; + i64toi32_i32$1 = i64toi32_i32$2; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $13 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $13 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$1 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($13 | 0); + i64toi32_i32$2 = $2$hi; + return $2_1 | 0; + } + + function legalfunc$wasm2js_scratch_load_i64() { + var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, $4$hi = 0; + i64toi32_i32$0 = 0; + $1_1 = legalimport$wasm2js_scratch_load_i64() | 0; + $1$hi = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$2 = getTempRet0() | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $8 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; + $8 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $4$hi = i64toi32_i32$1; + i64toi32_i32$1 = $1$hi; + i64toi32_i32$0 = $1_1; + i64toi32_i32$2 = $4$hi; + i64toi32_i32$3 = $8; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$0 = i64toi32_i32$0 | i64toi32_i32$3 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$2; + return i64toi32_i32$0 | 0; + } + + function legalfunc$wasm2js_scratch_store_i64($0_1, $0$hi) { + $0_1 = $0_1 | 0; + $0$hi = $0$hi | 0; + var i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $2_1 = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $0$hi; + $2_1 = $0_1; + i64toi32_i32$2 = $0_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $8 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + legalimport$wasm2js_scratch_store_i64($2_1 | 0, $8 | 0); + } + + function _ZN17compiler_builtins3int4sdiv3Mod4mod_17h2cbb7bbf36e41d68E(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, i64toi32_i32$5 = 0, var$2$hi = 0, i64toi32_i32$6 = 0, var$2 = 0, $20 = 0, $21 = 0, $7$hi = 0, $9 = 0, $9$hi = 0, $14$hi = 0, $16$hi = 0, $17$hi = 0, $19$hi = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + $20 = i64toi32_i32$0 >> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >> i64toi32_i32$4 | 0; + $20 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$2 = $20; + var$2$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$0 = var$2; + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$2 | 0; + $7$hi = i64toi32_i32$2; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$1 = i64toi32_i32$0 ^ i64toi32_i32$3 | 0; + i64toi32_i32$0 = var$2$hi; + i64toi32_i32$3 = var$2; + i64toi32_i32$4 = i64toi32_i32$1 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$1 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$5 = i64toi32_i32$6 + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; + $9 = i64toi32_i32$4; + $9$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$1$hi; + i64toi32_i32$2 = var$1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$0 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$5 >> 31 | 0; + $21 = i64toi32_i32$5 >> i64toi32_i32$0 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$5 >> i64toi32_i32$0 | 0; + $21 = (((1 << i64toi32_i32$0 | 0) - 1 | 0) & i64toi32_i32$5 | 0) << (32 - i64toi32_i32$0 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$0 | 0) | 0; + } + var$0 = $21; + var$0$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$3 = var$1; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$2 | 0; + $14$hi = i64toi32_i32$2; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$2 = $14$hi; + i64toi32_i32$1 = i64toi32_i32$5 ^ i64toi32_i32$3 | 0; + i64toi32_i32$5 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$0 = i64toi32_i32$1 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$1 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$4 = i64toi32_i32$6 + i64toi32_i32$5 | 0; + i64toi32_i32$4 = i64toi32_i32$2 - i64toi32_i32$4 | 0; + $16$hi = i64toi32_i32$4; + i64toi32_i32$4 = $9$hi; + i64toi32_i32$1 = $16$hi; + i64toi32_i32$1 = __wasm_i64_urem($9 | 0, i64toi32_i32$4 | 0, i64toi32_i32$0 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$4 = i64toi32_i32$HIGH_BITS; + $17$hi = i64toi32_i32$4; + i64toi32_i32$4 = var$2$hi; + i64toi32_i32$4 = $17$hi; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$3 = var$2; + i64toi32_i32$1 = i64toi32_i32$4 ^ i64toi32_i32$1 | 0; + $19$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$1 = $19$hi; + i64toi32_i32$4 = i64toi32_i32$2 ^ i64toi32_i32$3 | 0; + i64toi32_i32$2 = var$2$hi; + i64toi32_i32$5 = i64toi32_i32$4 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$4 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$0 = i64toi32_i32$6 + i64toi32_i32$2 | 0; + i64toi32_i32$0 = i64toi32_i32$1 - i64toi32_i32$0 | 0; + i64toi32_i32$4 = i64toi32_i32$5; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$4 | 0; + } + + function _ZN17compiler_builtins3int4udiv10divmod_u6417h6026910b5ed08e40E(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$3 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$5 = 0, var$2 = 0, var$3 = 0, var$4 = 0, var$5 = 0, var$5$hi = 0, var$6 = 0, var$6$hi = 0, i64toi32_i32$6 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, var$8$hi = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, var$7$hi = 0, $49 = 0, $63$hi = 0, $65 = 0, $65$hi = 0, $120$hi = 0, $129$hi = 0, $134$hi = 0, var$8 = 0, $140 = 0, $140$hi = 0, $142$hi = 0, $144 = 0, $144$hi = 0, $151 = 0, $151$hi = 0, $154$hi = 0, var$7 = 0, $165$hi = 0; + label$1 : { + label$2 : { + label$3 : { + label$4 : { + label$5 : { + label$6 : { + label$7 : { + label$8 : { + label$9 : { + label$10 : { + label$11 : { + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $37 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $37 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$2 = $37; + if (var$2) { + block : { + i64toi32_i32$1 = var$1$hi; + var$3 = var$1; + if (!var$3) { + break label$11 + } + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$0 = var$1; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $38 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $38 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; + } + var$4 = $38; + if (!var$4) { + break label$9 + } + var$2 = Math_clz32(var$4) - Math_clz32(var$2) | 0; + if (var$2 >>> 0 <= 31 >>> 0) { + break label$8 + } + break label$2; + } + } + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$1 = var$1; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = 0; + if (i64toi32_i32$2 >>> 0 > i64toi32_i32$0 >>> 0 | ((i64toi32_i32$2 | 0) == (i64toi32_i32$0 | 0) & i64toi32_i32$1 >>> 0 >= i64toi32_i32$3 >>> 0 | 0) | 0) { + break label$2 + } + i64toi32_i32$1 = var$0$hi; + var$2 = var$0; + i64toi32_i32$1 = var$1$hi; + var$3 = var$1; + var$2 = (var$2 >>> 0) / (var$3 >>> 0) | 0; + i64toi32_i32$1 = 0; + legalfunc$wasm2js_scratch_store_i64(var$0 - Math_imul(var$2, var$3) | 0 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$2; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$2 | 0; + } + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$3 = var$1; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $39 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + $39 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$2 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$3 >>> i64toi32_i32$4 | 0) | 0; + } + var$3 = $39; + i64toi32_i32$1 = var$0$hi; + if (!var$0) { + break label$7 + } + if (!var$3) { + break label$6 + } + var$4 = var$3 + -1 | 0; + if (var$4 & var$3 | 0) { + break label$6 + } + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$4 & var$2 | 0; + i64toi32_i32$3 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$3 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $40 = 0; + } else { + i64toi32_i32$3 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; + $40 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $63$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$1 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = -1; + i64toi32_i32$2 = i64toi32_i32$3 & i64toi32_i32$2 | 0; + $65 = i64toi32_i32$1 & i64toi32_i32$0 | 0; + $65$hi = i64toi32_i32$2; + i64toi32_i32$2 = $63$hi; + i64toi32_i32$3 = $40; + i64toi32_i32$1 = $65$hi; + i64toi32_i32$0 = $65; + i64toi32_i32$1 = i64toi32_i32$2 | i64toi32_i32$1 | 0; + legalfunc$wasm2js_scratch_store_i64(i64toi32_i32$3 | i64toi32_i32$0 | 0 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$3 = var$2 >>> ((__wasm_ctz_i32(var$3 | 0) | 0) & 31 | 0) | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$3 | 0; + } + } + var$4 = var$3 + -1 | 0; + if (!(var$4 & var$3 | 0)) { + break label$5 + } + var$2 = (Math_clz32(var$3) + 33 | 0) - Math_clz32(var$2) | 0; + var$3 = 0 - var$2 | 0; + break label$3; + } + var$3 = 63 - var$2 | 0; + var$2 = var$2 + 1 | 0; + break label$3; + } + var$4 = (var$2 >>> 0) / (var$3 >>> 0) | 0; + i64toi32_i32$3 = 0; + i64toi32_i32$2 = var$2 - Math_imul(var$4, var$3) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $41 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $41 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + legalfunc$wasm2js_scratch_store_i64($41 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$4; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$2 | 0; + } + var$2 = Math_clz32(var$3) - Math_clz32(var$2) | 0; + if (var$2 >>> 0 < 31 >>> 0) { + break label$4 + } + break label$2; + } + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$2 = 0; + legalfunc$wasm2js_scratch_store_i64(var$4 & var$0 | 0 | 0, i64toi32_i32$2 | 0); + if ((var$3 | 0) == (1 | 0)) { + break label$1 + } + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$2 = 0; + $120$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$1 = $120$hi; + i64toi32_i32$0 = __wasm_ctz_i32(var$3 | 0) | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $42 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + $42 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$2 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$3 >>> i64toi32_i32$4 | 0) | 0; + } + i64toi32_i32$3 = $42; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$3 | 0; + } + var$3 = 63 - var$2 | 0; + var$2 = var$2 + 1 | 0; + } + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$3 = 0; + $129$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = $129$hi; + i64toi32_i32$0 = var$2 & 63 | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $43 = i64toi32_i32$3 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$3 >>> i64toi32_i32$4 | 0; + $43 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$3 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$5 = $43; + var$5$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$1 = 0; + $134$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$2 = $134$hi; + i64toi32_i32$0 = var$3 & 63 | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$3 << i64toi32_i32$4 | 0; + $44 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$3 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; + $44 = i64toi32_i32$3 << i64toi32_i32$4 | 0; + } + var$0 = $44; + var$0$hi = i64toi32_i32$2; + label$13 : { + if (var$2) { + block3 : { + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$1 = var$1; + i64toi32_i32$3 = -1; + i64toi32_i32$0 = -1; + i64toi32_i32$4 = i64toi32_i32$1 + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 + i64toi32_i32$3 | 0; + if (i64toi32_i32$4 >>> 0 < i64toi32_i32$0 >>> 0) { + i64toi32_i32$5 = i64toi32_i32$5 + 1 | 0 + } + var$8 = i64toi32_i32$4; + var$8$hi = i64toi32_i32$5; + label$15 : while (1) { + i64toi32_i32$5 = var$5$hi; + i64toi32_i32$2 = var$5; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$3 | 0; + $45 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$3 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$3 | 0) | 0) | 0 | (i64toi32_i32$5 << i64toi32_i32$3 | 0) | 0; + $45 = i64toi32_i32$2 << i64toi32_i32$3 | 0; + } + $140 = $45; + $140$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 63; + i64toi32_i32$3 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $46 = i64toi32_i32$1 >>> i64toi32_i32$3 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$3 | 0; + $46 = (((1 << i64toi32_i32$3 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$3 | 0) | 0 | (i64toi32_i32$5 >>> i64toi32_i32$3 | 0) | 0; + } + $142$hi = i64toi32_i32$2; + i64toi32_i32$2 = $140$hi; + i64toi32_i32$1 = $140; + i64toi32_i32$5 = $142$hi; + i64toi32_i32$0 = $46; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + var$5 = i64toi32_i32$1 | i64toi32_i32$0 | 0; + var$5$hi = i64toi32_i32$5; + $144 = var$5; + $144$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$8$hi; + i64toi32_i32$5 = var$5$hi; + i64toi32_i32$5 = var$8$hi; + i64toi32_i32$2 = var$8; + i64toi32_i32$1 = var$5$hi; + i64toi32_i32$0 = var$5; + i64toi32_i32$3 = i64toi32_i32$2 - i64toi32_i32$0 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$0 >>> 0; + i64toi32_i32$4 = i64toi32_i32$6 + i64toi32_i32$1 | 0; + i64toi32_i32$4 = i64toi32_i32$5 - i64toi32_i32$4 | 0; + i64toi32_i32$5 = i64toi32_i32$3; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 63; + i64toi32_i32$1 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$4 >> 31 | 0; + $47 = i64toi32_i32$4 >> i64toi32_i32$1 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$4 >> i64toi32_i32$1 | 0; + $47 = (((1 << i64toi32_i32$1 | 0) - 1 | 0) & i64toi32_i32$4 | 0) << (32 - i64toi32_i32$1 | 0) | 0 | (i64toi32_i32$5 >>> i64toi32_i32$1 | 0) | 0; + } + var$6 = $47; + var$6$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$2 = var$6$hi; + i64toi32_i32$4 = var$6; + i64toi32_i32$5 = var$1$hi; + i64toi32_i32$0 = var$1; + i64toi32_i32$5 = i64toi32_i32$2 & i64toi32_i32$5 | 0; + $151 = i64toi32_i32$4 & i64toi32_i32$0 | 0; + $151$hi = i64toi32_i32$5; + i64toi32_i32$5 = $144$hi; + i64toi32_i32$2 = $144; + i64toi32_i32$4 = $151$hi; + i64toi32_i32$0 = $151; + i64toi32_i32$1 = i64toi32_i32$2 - i64toi32_i32$0 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$0 >>> 0; + i64toi32_i32$3 = i64toi32_i32$6 + i64toi32_i32$4 | 0; + i64toi32_i32$3 = i64toi32_i32$5 - i64toi32_i32$3 | 0; + var$5 = i64toi32_i32$1; + var$5$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + $48 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$5 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $48 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + } + $154$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$7$hi; + i64toi32_i32$2 = $154$hi; + i64toi32_i32$3 = $48; + i64toi32_i32$5 = var$7$hi; + i64toi32_i32$0 = var$7; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + var$0 = i64toi32_i32$3 | i64toi32_i32$0 | 0; + var$0$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$6$hi; + i64toi32_i32$2 = var$6; + i64toi32_i32$3 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = i64toi32_i32$5 & i64toi32_i32$3 | 0; + var$6 = i64toi32_i32$2 & i64toi32_i32$0 | 0; + var$6$hi = i64toi32_i32$3; + var$7 = var$6; + var$7$hi = i64toi32_i32$3; + var$2 = var$2 + -1 | 0; + if (var$2) { + continue label$15 + } + break label$15; + }; + break label$13; + } + } + } + i64toi32_i32$3 = var$5$hi; + legalfunc$wasm2js_scratch_store_i64(var$5 | 0, i64toi32_i32$3 | 0); + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + $49 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$5 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $49 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + } + $165$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$6$hi; + i64toi32_i32$2 = $165$hi; + i64toi32_i32$3 = $49; + i64toi32_i32$5 = var$6$hi; + i64toi32_i32$0 = var$6; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + i64toi32_i32$3 = i64toi32_i32$3 | i64toi32_i32$0 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$5; + return i64toi32_i32$3 | 0; + } + i64toi32_i32$3 = var$0$hi; + legalfunc$wasm2js_scratch_store_i64(var$0 | 0, i64toi32_i32$3 | 0); + i64toi32_i32$3 = 0; + var$0 = 0; + var$0$hi = i64toi32_i32$3; + } + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$3; + return i64toi32_i32$5 | 0; + } + + function __wasm_i64_srem(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$0 = var$1$hi; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = _ZN17compiler_builtins3int4sdiv3Mod4mod_17h2cbb7bbf36e41d68E(var$0 | 0, i64toi32_i32$0 | 0, var$1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function __wasm_i64_urem(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$0 = var$1$hi; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = _ZN17compiler_builtins3int4udiv10divmod_u6417h6026910b5ed08e40E(var$0 | 0, i64toi32_i32$0 | 0, var$1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$0 = legalfunc$wasm2js_scratch_load_i64() | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$0 | 0; + } + + function __wasm_ctz_i32(var$0) { + var$0 = var$0 | 0; + if (var$0) { + return 31 - Math_clz32((var$0 + -1 | 0) ^ var$0 | 0) | 0 | 0 + } + return 32 | 0; + } + + var FUNCTION_TABLE = []; + return { + "i32_no_fold_rem_s_self": $0, + "i32_no_fold_rem_u_self": $1, + "i64_no_fold_rem_s_self": legalstub$2, + "i64_no_fold_rem_u_self": legalstub$3 + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0,getTempRet0},memasmFunc); +export var i32_no_fold_rem_s_self = retasmFunc.i32_no_fold_rem_s_self; +export var i32_no_fold_rem_u_self = retasmFunc.i32_no_fold_rem_u_self; +export var i64_no_fold_rem_s_self = retasmFunc.i64_no_fold_rem_s_self; +export var i64_no_fold_rem_u_self = retasmFunc.i64_no_fold_rem_u_self; +import { setTempRet0 } from 'env'; + + + var scratchBuffer = new ArrayBuffer(8); + var i32ScratchView = new Int32Array(scratchBuffer); + var f32ScratchView = new Float32Array(scratchBuffer); + var f64ScratchView = new Float64Array(scratchBuffer); + + function legalimport$wasm2js_scratch_store_i64(low, high) { + i32ScratchView[0] = low; + i32ScratchView[1] = high; + } + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + var setTempRet0 = env.setTempRet0; + var i64toi32_i32$HIGH_BITS = 0; + function $0(x) { + x = x | 0; return (Math_imul(x, 6) | 0) / (6 | 0) | 0 | 0; } @@ -4651,19 +6172,19 @@ function asmFunc(global, env, buffer) { var FUNCTION_TABLE = []; return { - "i32_div_s_3": $0, - "i32_div_u_3": $1, - "i64_div_s_3": legalstub$2, - "i64_div_u_3": legalstub$3 + "i32_div_s_0": $0, + "i32_div_u_0": $1, + "i64_div_s_0": legalstub$2, + "i64_div_u_0": legalstub$3 }; } var memasmFunc = new ArrayBuffer(65536); var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); -export var i32_div_s_3 = retasmFunc.i32_div_s_3; -export var i32_div_u_3 = retasmFunc.i32_div_u_3; -export var i64_div_s_3 = retasmFunc.i64_div_s_3; -export var i64_div_u_3 = retasmFunc.i64_div_u_3; +export var i32_div_s_0 = retasmFunc.i32_div_s_0; +export var i32_div_u_0 = retasmFunc.i32_div_u_0; +export var i64_div_s_0 = retasmFunc.i64_div_s_0; +export var i64_div_u_0 = retasmFunc.i64_div_u_0; import { setTempRet0 } from 'env'; @@ -9227,3 +10748,689 @@ export var i32_rem_s_7 = retasmFunc.i32_rem_s_7; export var i32_rem_u_7 = retasmFunc.i32_rem_u_7; export var i64_rem_s_7 = retasmFunc.i64_rem_s_7; export var i64_rem_u_7 = retasmFunc.i64_rem_u_7; +import { setTempRet0 } from 'env'; + + + var scratchBuffer = new ArrayBuffer(8); + var i32ScratchView = new Int32Array(scratchBuffer); + var f32ScratchView = new Float32Array(scratchBuffer); + var f64ScratchView = new Float64Array(scratchBuffer); + + function legalimport$wasm2js_scratch_store_i64(low, high) { + i32ScratchView[0] = low; + i32ScratchView[1] = high; + } + +function asmFunc(global, env, buffer) { + var HEAP8 = new global.Int8Array(buffer); + var HEAP16 = new global.Int16Array(buffer); + var HEAP32 = new global.Int32Array(buffer); + var HEAPU8 = new global.Uint8Array(buffer); + var HEAPU16 = new global.Uint16Array(buffer); + var HEAPU32 = new global.Uint32Array(buffer); + var HEAPF32 = new global.Float32Array(buffer); + var HEAPF64 = new global.Float64Array(buffer); + var Math_imul = global.Math.imul; + var Math_fround = global.Math.fround; + var Math_abs = global.Math.abs; + var Math_clz32 = global.Math.clz32; + var Math_min = global.Math.min; + var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; + var abort = env.abort; + var nan = global.NaN; + var infinity = global.Infinity; + var setTempRet0 = env.setTempRet0; + var i64toi32_i32$HIGH_BITS = 0; + function $0(x) { + x = x | 0; + return (x | 0) / (-1 | 0) | 0 | 0; + } + + function $1(x, x$hi) { + x = x | 0; + x$hi = x$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = x$hi; + i64toi32_i32$1 = -1; + i64toi32_i32$1 = __wasm_i64_sdiv(x | 0, i64toi32_i32$0 | 0, -1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function legalstub$1($0_1, $1_1) { + $0_1 = $0_1 | 0; + $1_1 = $1_1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2 = 0, $2$hi = 0; + i64toi32_i32$0 = 0; + $4 = $0_1; + $4$hi = i64toi32_i32$0; + i64toi32_i32$0 = 0; + i64toi32_i32$2 = $1_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $12 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; + $12 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $7$hi = i64toi32_i32$1; + i64toi32_i32$1 = $4$hi; + i64toi32_i32$0 = $4; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$3 = $12; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$2 = $1(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + $2 = i64toi32_i32$2; + $2$hi = i64toi32_i32$0; + i64toi32_i32$1 = i64toi32_i32$2; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $13 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $13 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$1 >>> i64toi32_i32$4 | 0) | 0; + } + setTempRet0($13 | 0); + i64toi32_i32$2 = $2$hi; + return $2 | 0; + } + + function legalfunc$wasm2js_scratch_store_i64($0_1, $0$hi) { + $0_1 = $0_1 | 0; + $0$hi = $0$hi | 0; + var i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $2 = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $0$hi; + $2 = $0_1; + i64toi32_i32$2 = $0_1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $8 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + legalimport$wasm2js_scratch_store_i64($2 | 0, $8 | 0); + } + + function _ZN17compiler_builtins3int4sdiv3Div3div17he78fc483e41d7ec7E(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$1 = 0, i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, i64toi32_i32$0 = 0, i64toi32_i32$5 = 0, var$2 = 0, var$2$hi = 0, i64toi32_i32$6 = 0, $21 = 0, $22 = 0, $23 = 0, $7$hi = 0, $9 = 0, $9$hi = 0, $14$hi = 0, $16$hi = 0, $17 = 0, $17$hi = 0, $23$hi = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$0 >> 31 | 0; + $21 = i64toi32_i32$0 >> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >> i64toi32_i32$4 | 0; + $21 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$2 = $21; + var$2$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$0 = var$2; + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$2 | 0; + $7$hi = i64toi32_i32$2; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$1 = i64toi32_i32$0 ^ i64toi32_i32$3 | 0; + i64toi32_i32$0 = var$2$hi; + i64toi32_i32$3 = var$2; + i64toi32_i32$4 = i64toi32_i32$1 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$1 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$5 = i64toi32_i32$6 + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$5 | 0; + $9 = i64toi32_i32$4; + $9$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$1$hi; + i64toi32_i32$2 = var$1; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$0 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$5 >> 31 | 0; + $22 = i64toi32_i32$5 >> i64toi32_i32$0 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$5 >> i64toi32_i32$0 | 0; + $22 = (((1 << i64toi32_i32$0 | 0) - 1 | 0) & i64toi32_i32$5 | 0) << (32 - i64toi32_i32$0 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$0 | 0) | 0; + } + var$2 = $22; + var$2$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = var$2$hi; + i64toi32_i32$5 = var$2; + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$3 = var$1; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$2 | 0; + $14$hi = i64toi32_i32$2; + i64toi32_i32$2 = i64toi32_i32$1; + i64toi32_i32$2 = $14$hi; + i64toi32_i32$1 = i64toi32_i32$5 ^ i64toi32_i32$3 | 0; + i64toi32_i32$5 = var$2$hi; + i64toi32_i32$3 = var$2; + i64toi32_i32$0 = i64toi32_i32$1 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$1 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$4 = i64toi32_i32$6 + i64toi32_i32$5 | 0; + i64toi32_i32$4 = i64toi32_i32$2 - i64toi32_i32$4 | 0; + $16$hi = i64toi32_i32$4; + i64toi32_i32$4 = $9$hi; + i64toi32_i32$1 = $16$hi; + i64toi32_i32$1 = __wasm_i64_udiv($9 | 0, i64toi32_i32$4 | 0, i64toi32_i32$0 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$4 = i64toi32_i32$HIGH_BITS; + $17 = i64toi32_i32$1; + $17$hi = i64toi32_i32$4; + i64toi32_i32$4 = var$1$hi; + i64toi32_i32$4 = var$0$hi; + i64toi32_i32$4 = var$1$hi; + i64toi32_i32$2 = var$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$1 = i64toi32_i32$4 ^ i64toi32_i32$1 | 0; + i64toi32_i32$4 = i64toi32_i32$2 ^ i64toi32_i32$3 | 0; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 63; + i64toi32_i32$5 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$1 >> 31 | 0; + $23 = i64toi32_i32$1 >> i64toi32_i32$5 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >> i64toi32_i32$5 | 0; + $23 = (((1 << i64toi32_i32$5 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$5 | 0) | 0 | (i64toi32_i32$4 >>> i64toi32_i32$5 | 0) | 0; + } + var$0 = $23; + var$0$hi = i64toi32_i32$2; + i64toi32_i32$2 = $17$hi; + i64toi32_i32$1 = $17; + i64toi32_i32$4 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$4 = i64toi32_i32$2 ^ i64toi32_i32$4 | 0; + $23$hi = i64toi32_i32$4; + i64toi32_i32$4 = var$0$hi; + i64toi32_i32$4 = $23$hi; + i64toi32_i32$2 = i64toi32_i32$1 ^ i64toi32_i32$3 | 0; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$5 = i64toi32_i32$2 - i64toi32_i32$3 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$3 >>> 0; + i64toi32_i32$0 = i64toi32_i32$6 + i64toi32_i32$1 | 0; + i64toi32_i32$0 = i64toi32_i32$4 - i64toi32_i32$0 | 0; + i64toi32_i32$2 = i64toi32_i32$5; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$2 | 0; + } + + function __wasm_i64_sdiv(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$0 = var$1$hi; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = _ZN17compiler_builtins3int4sdiv3Div3div17he78fc483e41d7ec7E(var$0 | 0, i64toi32_i32$0 | 0, var$1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function _ZN17compiler_builtins3int4udiv10divmod_u6417h6026910b5ed08e40E(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$3 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$5 = 0, var$2 = 0, var$3 = 0, var$4 = 0, var$5 = 0, var$5$hi = 0, var$6 = 0, var$6$hi = 0, i64toi32_i32$6 = 0, $37 = 0, $38 = 0, $39 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $44 = 0, var$8$hi = 0, $45 = 0, $46 = 0, $47 = 0, $48 = 0, var$7$hi = 0, $49 = 0, $63$hi = 0, $65 = 0, $65$hi = 0, $120$hi = 0, $129$hi = 0, $134$hi = 0, var$8 = 0, $140 = 0, $140$hi = 0, $142$hi = 0, $144 = 0, $144$hi = 0, $151 = 0, $151$hi = 0, $154$hi = 0, var$7 = 0, $165$hi = 0; + label$1 : { + label$2 : { + label$3 : { + label$4 : { + label$5 : { + label$6 : { + label$7 : { + label$8 : { + label$9 : { + label$10 : { + label$11 : { + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $37 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $37 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$2 = $37; + if (var$2) { + block : { + i64toi32_i32$1 = var$1$hi; + var$3 = var$1; + if (!var$3) { + break label$11 + } + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$0 = var$1; + i64toi32_i32$2 = 0; + i64toi32_i32$3 = 32; + i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $38 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $38 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; + } + var$4 = $38; + if (!var$4) { + break label$9 + } + var$2 = Math_clz32(var$4) - Math_clz32(var$2) | 0; + if (var$2 >>> 0 <= 31 >>> 0) { + break label$8 + } + break label$2; + } + } + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$1 = var$1; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = 0; + if (i64toi32_i32$2 >>> 0 > i64toi32_i32$0 >>> 0 | ((i64toi32_i32$2 | 0) == (i64toi32_i32$0 | 0) & i64toi32_i32$1 >>> 0 >= i64toi32_i32$3 >>> 0 | 0) | 0) { + break label$2 + } + i64toi32_i32$1 = var$0$hi; + var$2 = var$0; + i64toi32_i32$1 = var$1$hi; + var$3 = var$1; + var$2 = (var$2 >>> 0) / (var$3 >>> 0) | 0; + i64toi32_i32$1 = 0; + legalfunc$wasm2js_scratch_store_i64(var$0 - Math_imul(var$2, var$3) | 0 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$2; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$2 | 0; + } + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$3 = var$1; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $39 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + $39 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$2 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$3 >>> i64toi32_i32$4 | 0) | 0; + } + var$3 = $39; + i64toi32_i32$1 = var$0$hi; + if (!var$0) { + break label$7 + } + if (!var$3) { + break label$6 + } + var$4 = var$3 + -1 | 0; + if (var$4 & var$3 | 0) { + break label$6 + } + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$4 & var$2 | 0; + i64toi32_i32$3 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$3 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $40 = 0; + } else { + i64toi32_i32$3 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; + $40 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + $63$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$1 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = -1; + i64toi32_i32$2 = i64toi32_i32$3 & i64toi32_i32$2 | 0; + $65 = i64toi32_i32$1 & i64toi32_i32$0 | 0; + $65$hi = i64toi32_i32$2; + i64toi32_i32$2 = $63$hi; + i64toi32_i32$3 = $40; + i64toi32_i32$1 = $65$hi; + i64toi32_i32$0 = $65; + i64toi32_i32$1 = i64toi32_i32$2 | i64toi32_i32$1 | 0; + legalfunc$wasm2js_scratch_store_i64(i64toi32_i32$3 | i64toi32_i32$0 | 0 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$3 = var$2 >>> ((__wasm_ctz_i32(var$3 | 0) | 0) & 31 | 0) | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$3 | 0; + } + } + var$4 = var$3 + -1 | 0; + if (!(var$4 & var$3 | 0)) { + break label$5 + } + var$2 = (Math_clz32(var$3) + 33 | 0) - Math_clz32(var$2) | 0; + var$3 = 0 - var$2 | 0; + break label$3; + } + var$3 = 63 - var$2 | 0; + var$2 = var$2 + 1 | 0; + break label$3; + } + var$4 = (var$2 >>> 0) / (var$3 >>> 0) | 0; + i64toi32_i32$3 = 0; + i64toi32_i32$2 = var$2 - Math_imul(var$4, var$3) | 0; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 32; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $41 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $41 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + } + legalfunc$wasm2js_scratch_store_i64($41 | 0, i64toi32_i32$1 | 0); + i64toi32_i32$1 = 0; + i64toi32_i32$2 = var$4; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$2 | 0; + } + var$2 = Math_clz32(var$3) - Math_clz32(var$2) | 0; + if (var$2 >>> 0 < 31 >>> 0) { + break label$4 + } + break label$2; + } + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$2 = 0; + legalfunc$wasm2js_scratch_store_i64(var$4 & var$0 | 0 | 0, i64toi32_i32$2 | 0); + if ((var$3 | 0) == (1 | 0)) { + break label$1 + } + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$2 = 0; + $120$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$1 = $120$hi; + i64toi32_i32$0 = __wasm_ctz_i32(var$3 | 0) | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $42 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$2 >>> i64toi32_i32$4 | 0; + $42 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$2 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$3 >>> i64toi32_i32$4 | 0) | 0; + } + i64toi32_i32$3 = $42; + i64toi32_i32$HIGH_BITS = i64toi32_i32$1; + return i64toi32_i32$3 | 0; + } + var$3 = 63 - var$2 | 0; + var$2 = var$2 + 1 | 0; + } + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$3 = 0; + $129$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$2 = var$0; + i64toi32_i32$1 = $129$hi; + i64toi32_i32$0 = var$2 & 63 | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = 0; + $43 = i64toi32_i32$3 >>> i64toi32_i32$4 | 0; + } else { + i64toi32_i32$1 = i64toi32_i32$3 >>> i64toi32_i32$4 | 0; + $43 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$3 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } + var$5 = $43; + var$5$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$1 = 0; + $134$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$3 = var$0; + i64toi32_i32$2 = $134$hi; + i64toi32_i32$0 = var$3 & 63 | 0; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$3 << i64toi32_i32$4 | 0; + $44 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$3 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; + $44 = i64toi32_i32$3 << i64toi32_i32$4 | 0; + } + var$0 = $44; + var$0$hi = i64toi32_i32$2; + label$13 : { + if (var$2) { + block3 : { + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$1 = var$1; + i64toi32_i32$3 = -1; + i64toi32_i32$0 = -1; + i64toi32_i32$4 = i64toi32_i32$1 + i64toi32_i32$0 | 0; + i64toi32_i32$5 = i64toi32_i32$2 + i64toi32_i32$3 | 0; + if (i64toi32_i32$4 >>> 0 < i64toi32_i32$0 >>> 0) { + i64toi32_i32$5 = i64toi32_i32$5 + 1 | 0 + } + var$8 = i64toi32_i32$4; + var$8$hi = i64toi32_i32$5; + label$15 : while (1) { + i64toi32_i32$5 = var$5$hi; + i64toi32_i32$2 = var$5; + i64toi32_i32$1 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$3 | 0; + $45 = 0; + } else { + i64toi32_i32$1 = ((1 << i64toi32_i32$3 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$3 | 0) | 0) | 0 | (i64toi32_i32$5 << i64toi32_i32$3 | 0) | 0; + $45 = i64toi32_i32$2 << i64toi32_i32$3 | 0; + } + $140 = $45; + $140$hi = i64toi32_i32$1; + i64toi32_i32$1 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 63; + i64toi32_i32$3 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = 0; + $46 = i64toi32_i32$1 >>> i64toi32_i32$3 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$3 | 0; + $46 = (((1 << i64toi32_i32$3 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$3 | 0) | 0 | (i64toi32_i32$5 >>> i64toi32_i32$3 | 0) | 0; + } + $142$hi = i64toi32_i32$2; + i64toi32_i32$2 = $140$hi; + i64toi32_i32$1 = $140; + i64toi32_i32$5 = $142$hi; + i64toi32_i32$0 = $46; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + var$5 = i64toi32_i32$1 | i64toi32_i32$0 | 0; + var$5$hi = i64toi32_i32$5; + $144 = var$5; + $144$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$8$hi; + i64toi32_i32$5 = var$5$hi; + i64toi32_i32$5 = var$8$hi; + i64toi32_i32$2 = var$8; + i64toi32_i32$1 = var$5$hi; + i64toi32_i32$0 = var$5; + i64toi32_i32$3 = i64toi32_i32$2 - i64toi32_i32$0 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$0 >>> 0; + i64toi32_i32$4 = i64toi32_i32$6 + i64toi32_i32$1 | 0; + i64toi32_i32$4 = i64toi32_i32$5 - i64toi32_i32$4 | 0; + i64toi32_i32$5 = i64toi32_i32$3; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 63; + i64toi32_i32$1 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$4 >> 31 | 0; + $47 = i64toi32_i32$4 >> i64toi32_i32$1 | 0; + } else { + i64toi32_i32$2 = i64toi32_i32$4 >> i64toi32_i32$1 | 0; + $47 = (((1 << i64toi32_i32$1 | 0) - 1 | 0) & i64toi32_i32$4 | 0) << (32 - i64toi32_i32$1 | 0) | 0 | (i64toi32_i32$5 >>> i64toi32_i32$1 | 0) | 0; + } + var$6 = $47; + var$6$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$1$hi; + i64toi32_i32$2 = var$6$hi; + i64toi32_i32$4 = var$6; + i64toi32_i32$5 = var$1$hi; + i64toi32_i32$0 = var$1; + i64toi32_i32$5 = i64toi32_i32$2 & i64toi32_i32$5 | 0; + $151 = i64toi32_i32$4 & i64toi32_i32$0 | 0; + $151$hi = i64toi32_i32$5; + i64toi32_i32$5 = $144$hi; + i64toi32_i32$2 = $144; + i64toi32_i32$4 = $151$hi; + i64toi32_i32$0 = $151; + i64toi32_i32$1 = i64toi32_i32$2 - i64toi32_i32$0 | 0; + i64toi32_i32$6 = i64toi32_i32$2 >>> 0 < i64toi32_i32$0 >>> 0; + i64toi32_i32$3 = i64toi32_i32$6 + i64toi32_i32$4 | 0; + i64toi32_i32$3 = i64toi32_i32$5 - i64toi32_i32$3 | 0; + var$5 = i64toi32_i32$1; + var$5$hi = i64toi32_i32$3; + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + $48 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$5 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $48 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + } + $154$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$7$hi; + i64toi32_i32$2 = $154$hi; + i64toi32_i32$3 = $48; + i64toi32_i32$5 = var$7$hi; + i64toi32_i32$0 = var$7; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + var$0 = i64toi32_i32$3 | i64toi32_i32$0 | 0; + var$0$hi = i64toi32_i32$5; + i64toi32_i32$5 = var$6$hi; + i64toi32_i32$2 = var$6; + i64toi32_i32$3 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$3 = i64toi32_i32$5 & i64toi32_i32$3 | 0; + var$6 = i64toi32_i32$2 & i64toi32_i32$0 | 0; + var$6$hi = i64toi32_i32$3; + var$7 = var$6; + var$7$hi = i64toi32_i32$3; + var$2 = var$2 + -1 | 0; + if (var$2) { + continue label$15 + } + break label$15; + }; + break label$13; + } + } + } + i64toi32_i32$3 = var$5$hi; + legalfunc$wasm2js_scratch_store_i64(var$5 | 0, i64toi32_i32$3 | 0); + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$2 = 0; + i64toi32_i32$0 = 1; + i64toi32_i32$4 = i64toi32_i32$0 & 31 | 0; + if (32 >>> 0 <= (i64toi32_i32$0 & 63 | 0) >>> 0) { + i64toi32_i32$2 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + $49 = 0; + } else { + i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$5 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$3 << i64toi32_i32$4 | 0) | 0; + $49 = i64toi32_i32$5 << i64toi32_i32$4 | 0; + } + $165$hi = i64toi32_i32$2; + i64toi32_i32$2 = var$6$hi; + i64toi32_i32$2 = $165$hi; + i64toi32_i32$3 = $49; + i64toi32_i32$5 = var$6$hi; + i64toi32_i32$0 = var$6; + i64toi32_i32$5 = i64toi32_i32$2 | i64toi32_i32$5 | 0; + i64toi32_i32$3 = i64toi32_i32$3 | i64toi32_i32$0 | 0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$5; + return i64toi32_i32$3 | 0; + } + i64toi32_i32$3 = var$0$hi; + legalfunc$wasm2js_scratch_store_i64(var$0 | 0, i64toi32_i32$3 | 0); + i64toi32_i32$3 = 0; + var$0 = 0; + var$0$hi = i64toi32_i32$3; + } + i64toi32_i32$3 = var$0$hi; + i64toi32_i32$5 = var$0; + i64toi32_i32$HIGH_BITS = i64toi32_i32$3; + return i64toi32_i32$5 | 0; + } + + function __wasm_i64_udiv(var$0, var$0$hi, var$1, var$1$hi) { + var$0 = var$0 | 0; + var$0$hi = var$0$hi | 0; + var$1 = var$1 | 0; + var$1$hi = var$1$hi | 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$0 = var$1$hi; + i64toi32_i32$0 = var$0$hi; + i64toi32_i32$1 = var$1$hi; + i64toi32_i32$1 = _ZN17compiler_builtins3int4udiv10divmod_u6417h6026910b5ed08e40E(var$0 | 0, i64toi32_i32$0 | 0, var$1 | 0, i64toi32_i32$1 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return i64toi32_i32$1 | 0; + } + + function __wasm_ctz_i32(var$0) { + var$0 = var$0 | 0; + if (var$0) { + return 31 - Math_clz32((var$0 + -1 | 0) ^ var$0 | 0) | 0 | 0 + } + return 32 | 0; + } + + var FUNCTION_TABLE = []; + return { + "i32_no_fold_div_neg1": $0, + "i64_no_fold_div_neg1": legalstub$1 + }; +} + +var memasmFunc = new ArrayBuffer(65536); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +export var i32_no_fold_div_neg1 = retasmFunc.i32_no_fold_div_neg1; +export var i64_no_fold_div_neg1 = retasmFunc.i64_no_fold_div_neg1; diff --git a/test/wasm2js/labels.2asm.js b/test/wasm2js/labels.2asm.js index 0051a4113..34a88c63a 100644 --- a/test/wasm2js/labels.2asm.js +++ b/test/wasm2js/labels.2asm.js @@ -109,6 +109,18 @@ function asmFunc(global, env, buffer) { } function $6() { + var $2_1 = 0; + loop_in : while (1) { + if (0) { + continue loop_in + } + $2_1 = 3; + break loop_in; + }; + return $2_1 | 0; + } + + function $7() { var i = 0; i = 0; block_1 : { @@ -136,7 +148,7 @@ function asmFunc(global, env, buffer) { return i | 0; } - function $7() { + function $8() { var i = 0; i = 0; block_1 : { @@ -164,7 +176,7 @@ function asmFunc(global, env, buffer) { return i | 0; } - function $8($0_1) { + function $9($0_1) { $0_1 = $0_1 | 0; var $2_1 = 0, $3_1 = 0; ret : { @@ -190,7 +202,7 @@ function asmFunc(global, env, buffer) { return $3_1 | 0; } - function $9($0_1) { + function $10($0_1) { $0_1 = $0_1 | 0; $1_1 : { switch ($0_1 | 0) { @@ -203,7 +215,7 @@ function asmFunc(global, env, buffer) { return 2 | 0; } - function $10() { + function $11() { var i = 0, $10_1 = 0; i = 0; outer : { @@ -234,7 +246,7 @@ function asmFunc(global, env, buffer) { return $10_1 | 0; } - function $11() { + function $12() { var $2_1 = 0, $0_1 = 0; l0 : { l1 : { @@ -245,12 +257,12 @@ function asmFunc(global, env, buffer) { if (1) { break l0 } - $2_1 = 1; + $2_1 = 0; } return $2_1 | 0; } - function $12() { + function $13() { var $2_1 = 0, $0_1 = 0; l0 : { l1 : { @@ -258,12 +270,15 @@ function asmFunc(global, env, buffer) { break l1; } $2_1 = $0_1; - break l0; + if (1) { + break l0 + } + $2_1 = 0; } return $2_1 | 0; } - function $13() { + function $14() { var i1 = 0, $7_1 = 0, $3_1 = 0; l0 : { i1 = 1; @@ -278,7 +293,7 @@ function asmFunc(global, env, buffer) { return i1 | 0; } - function $14() { + function $15() { var $2_1 = 0, $0_1 = 0, $3_1 = 0; l0 : { l1 : { @@ -291,7 +306,7 @@ function asmFunc(global, env, buffer) { return $2_1 | 0; } - function $15() { + function $16() { var $0_1 = 0; l1 : { $0_1 = 1; @@ -300,7 +315,7 @@ function asmFunc(global, env, buffer) { return $0_1 | 0; } - function $16() { + function $17() { var $1_2 = 0, $2_1 = 0; l1 : { $1_2 = 2; @@ -320,17 +335,18 @@ function asmFunc(global, env, buffer) { "loop3": $3, "loop4": $4, "loop5": $5, - "if_": $6, - "if2": $7, - "switch_": $8, - "return_": $9, - "br_if0": $10, - "br_if1": $11, - "br_if2": $12, - "br_if3": $13, - "br": $14, - "shadowing": $15, - "redefinition": $16 + "loop6": $6, + "if_": $7, + "if2": $8, + "switch_": $9, + "return_": $10, + "br_if0": $11, + "br_if1": $12, + "br_if2": $13, + "br_if3": $14, + "br": $15, + "shadowing": $16, + "redefinition": $17 }; } @@ -342,6 +358,7 @@ export var loop2 = retasmFunc.loop2; export var loop3 = retasmFunc.loop3; export var loop4 = retasmFunc.loop4; export var loop5 = retasmFunc.loop5; +export var loop6 = retasmFunc.loop6; export var if_ = retasmFunc.if_; export var if2 = retasmFunc.if2; export var switch_ = retasmFunc.switch_; diff --git a/test/wasm2js/traps.2asm.js b/test/wasm2js/traps.2asm.js index 5ca7284d7..22740f79a 100644 --- a/test/wasm2js/traps.2asm.js +++ b/test/wasm2js/traps.2asm.js @@ -1,4 +1,3 @@ -import { setTempRet0 } from 'env'; var scratchBuffer = new ArrayBuffer(8); @@ -32,18 +31,17 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var setTempRet0 = env.setTempRet0; var i64toi32_i32$HIGH_BITS = 0; function $0(x, y) { x = x | 0; y = y | 0; - return (x | 0) / (y | 0) | 0 | 0; + (x | 0) / (y | 0) | 0; } function $1(x, y) { x = x | 0; y = y | 0; - return (x >>> 0) / (y >>> 0) | 0 | 0; + (x >>> 0) / (y >>> 0) | 0; } function $2(x, x$hi, y, y$hi) { @@ -51,15 +49,7 @@ function asmFunc(global, env, buffer) { x$hi = x$hi | 0; y = y | 0; y$hi = y$hi | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; - i64toi32_i32$0 = x$hi; - i64toi32_i32$0 = y$hi; - i64toi32_i32$0 = x$hi; - i64toi32_i32$1 = y$hi; - i64toi32_i32$1 = __wasm_i64_sdiv(x | 0, i64toi32_i32$0 | 0, y | 0, i64toi32_i32$1 | 0) | 0; - i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - i64toi32_i32$HIGH_BITS = i64toi32_i32$0; - return i64toi32_i32$1 | 0; + __wasm_i64_sdiv(x | 0, x$hi | 0, y | 0, y$hi | 0) | 0; } function $3(x, x$hi, y, y$hi) { @@ -67,15 +57,7 @@ function asmFunc(global, env, buffer) { x$hi = x$hi | 0; y = y | 0; y$hi = y$hi | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; - i64toi32_i32$0 = x$hi; - i64toi32_i32$0 = y$hi; - i64toi32_i32$0 = x$hi; - i64toi32_i32$1 = y$hi; - i64toi32_i32$1 = __wasm_i64_udiv(x | 0, i64toi32_i32$0 | 0, y | 0, i64toi32_i32$1 | 0) | 0; - i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - i64toi32_i32$HIGH_BITS = i64toi32_i32$0; - return i64toi32_i32$1 | 0; + __wasm_i64_udiv(x | 0, x$hi | 0, y | 0, y$hi | 0) | 0; } function legalstub$2($0_1, $1_1, $2_1, $3_1) { @@ -83,10 +65,10 @@ function asmFunc(global, env, buffer) { $1_1 = $1_1 | 0; $2_1 = $2_1 | 0; $3_1 = $3_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, $21 = 0, $22 = 0, $23 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $10 = 0, $10$hi = 0, $12 = 0, $12$hi = 0, $15$hi = 0, $16 = 0, $16$hi = 0, $4 = 0, $4$hi = 0; + var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $19 = 0, $20 = 0, $5 = 0, $5$hi = 0, $8$hi = 0, $9 = 0, $9$hi = 0, $11 = 0, $11$hi = 0, $14$hi = 0, $15 = 0, $15$hi = 0; i64toi32_i32$0 = 0; - $6 = $0_1; - $6$hi = i64toi32_i32$0; + $5 = $0_1; + $5$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; i64toi32_i32$2 = $1_1; i64toi32_i32$1 = 0; @@ -94,22 +76,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; - $21 = 0; + $19 = 0; } else { i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; - $21 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $19 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } - $9$hi = i64toi32_i32$1; - i64toi32_i32$1 = $6$hi; - i64toi32_i32$0 = $6; - i64toi32_i32$2 = $9$hi; - i64toi32_i32$3 = $21; + $8$hi = i64toi32_i32$1; + i64toi32_i32$1 = $5$hi; + i64toi32_i32$0 = $5; + i64toi32_i32$2 = $8$hi; + i64toi32_i32$3 = $19; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - $10 = i64toi32_i32$0 | i64toi32_i32$3 | 0; - $10$hi = i64toi32_i32$2; + $9 = i64toi32_i32$0 | i64toi32_i32$3 | 0; + $9$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; - $12 = $2_1; - $12$hi = i64toi32_i32$2; + $11 = $2_1; + $11$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; i64toi32_i32$1 = $3_1; i64toi32_i32$0 = 0; @@ -117,39 +99,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$0 = i64toi32_i32$1 << i64toi32_i32$4 | 0; - $22 = 0; + $20 = 0; } else { i64toi32_i32$0 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$1 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$2 << i64toi32_i32$4 | 0) | 0; - $22 = i64toi32_i32$1 << i64toi32_i32$4 | 0; + $20 = i64toi32_i32$1 << i64toi32_i32$4 | 0; } - $15$hi = i64toi32_i32$0; - i64toi32_i32$0 = $12$hi; - i64toi32_i32$2 = $12; - i64toi32_i32$1 = $15$hi; - i64toi32_i32$3 = $22; + $14$hi = i64toi32_i32$0; + i64toi32_i32$0 = $11$hi; + i64toi32_i32$2 = $11; + i64toi32_i32$1 = $14$hi; + i64toi32_i32$3 = $20; i64toi32_i32$1 = i64toi32_i32$0 | i64toi32_i32$1 | 0; - $16 = i64toi32_i32$2 | i64toi32_i32$3 | 0; - $16$hi = i64toi32_i32$1; - i64toi32_i32$1 = $10$hi; - i64toi32_i32$2 = $16$hi; - i64toi32_i32$2 = $2($10 | 0, i64toi32_i32$1 | 0, $16 | 0, i64toi32_i32$2 | 0) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $4 = i64toi32_i32$2; - $4$hi = i64toi32_i32$1; - i64toi32_i32$0 = i64toi32_i32$2; - i64toi32_i32$2 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$2 = 0; - $23 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $23 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($23 | 0); - i64toi32_i32$2 = $4$hi; - return $4 | 0; + $15 = i64toi32_i32$2 | i64toi32_i32$3 | 0; + $15$hi = i64toi32_i32$1; + i64toi32_i32$1 = $9$hi; + i64toi32_i32$2 = $15$hi; + $2($9 | 0, i64toi32_i32$1 | 0, $15 | 0, i64toi32_i32$2 | 0); } function legalstub$3($0_1, $1_1, $2_1, $3_1) { @@ -157,10 +122,10 @@ function asmFunc(global, env, buffer) { $1_1 = $1_1 | 0; $2_1 = $2_1 | 0; $3_1 = $3_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, $21 = 0, $22 = 0, $23 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $10 = 0, $10$hi = 0, $12 = 0, $12$hi = 0, $15$hi = 0, $16 = 0, $16$hi = 0, $4 = 0, $4$hi = 0; + var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $19 = 0, $20 = 0, $5 = 0, $5$hi = 0, $8$hi = 0, $9 = 0, $9$hi = 0, $11 = 0, $11$hi = 0, $14$hi = 0, $15 = 0, $15$hi = 0; i64toi32_i32$0 = 0; - $6 = $0_1; - $6$hi = i64toi32_i32$0; + $5 = $0_1; + $5$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; i64toi32_i32$2 = $1_1; i64toi32_i32$1 = 0; @@ -168,22 +133,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; - $21 = 0; + $19 = 0; } else { i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; - $21 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $19 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } - $9$hi = i64toi32_i32$1; - i64toi32_i32$1 = $6$hi; - i64toi32_i32$0 = $6; - i64toi32_i32$2 = $9$hi; - i64toi32_i32$3 = $21; + $8$hi = i64toi32_i32$1; + i64toi32_i32$1 = $5$hi; + i64toi32_i32$0 = $5; + i64toi32_i32$2 = $8$hi; + i64toi32_i32$3 = $19; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - $10 = i64toi32_i32$0 | i64toi32_i32$3 | 0; - $10$hi = i64toi32_i32$2; + $9 = i64toi32_i32$0 | i64toi32_i32$3 | 0; + $9$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; - $12 = $2_1; - $12$hi = i64toi32_i32$2; + $11 = $2_1; + $11$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; i64toi32_i32$1 = $3_1; i64toi32_i32$0 = 0; @@ -191,39 +156,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$0 = i64toi32_i32$1 << i64toi32_i32$4 | 0; - $22 = 0; + $20 = 0; } else { i64toi32_i32$0 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$1 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$2 << i64toi32_i32$4 | 0) | 0; - $22 = i64toi32_i32$1 << i64toi32_i32$4 | 0; + $20 = i64toi32_i32$1 << i64toi32_i32$4 | 0; } - $15$hi = i64toi32_i32$0; - i64toi32_i32$0 = $12$hi; - i64toi32_i32$2 = $12; - i64toi32_i32$1 = $15$hi; - i64toi32_i32$3 = $22; + $14$hi = i64toi32_i32$0; + i64toi32_i32$0 = $11$hi; + i64toi32_i32$2 = $11; + i64toi32_i32$1 = $14$hi; + i64toi32_i32$3 = $20; i64toi32_i32$1 = i64toi32_i32$0 | i64toi32_i32$1 | 0; - $16 = i64toi32_i32$2 | i64toi32_i32$3 | 0; - $16$hi = i64toi32_i32$1; - i64toi32_i32$1 = $10$hi; - i64toi32_i32$2 = $16$hi; - i64toi32_i32$2 = $3($10 | 0, i64toi32_i32$1 | 0, $16 | 0, i64toi32_i32$2 | 0) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $4 = i64toi32_i32$2; - $4$hi = i64toi32_i32$1; - i64toi32_i32$0 = i64toi32_i32$2; - i64toi32_i32$2 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$2 = 0; - $23 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $23 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($23 | 0); - i64toi32_i32$2 = $4$hi; - return $4 | 0; + $15 = i64toi32_i32$2 | i64toi32_i32$3 | 0; + $15$hi = i64toi32_i32$1; + i64toi32_i32$1 = $9$hi; + i64toi32_i32$2 = $15$hi; + $3($9 | 0, i64toi32_i32$1 | 0, $15 | 0, i64toi32_i32$2 | 0); } function legalfunc$wasm2js_scratch_store_i64($0_1, $0$hi) { @@ -813,12 +761,11 @@ function asmFunc(global, env, buffer) { } var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); export var no_dce_i32_div_s = retasmFunc.no_dce_i32_div_s; export var no_dce_i32_div_u = retasmFunc.no_dce_i32_div_u; export var no_dce_i64_div_s = retasmFunc.no_dce_i64_div_s; export var no_dce_i64_div_u = retasmFunc.no_dce_i64_div_u; -import { setTempRet0 } from 'env'; import { getTempRet0 } from 'env'; @@ -858,19 +805,18 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var setTempRet0 = env.setTempRet0; var getTempRet0 = env.getTempRet0; var i64toi32_i32$HIGH_BITS = 0; function $0(x, y) { x = x | 0; y = y | 0; - return (x | 0) % (y | 0) | 0 | 0; + (x | 0) % (y | 0) | 0; } function $1(x, y) { x = x | 0; y = y | 0; - return (x >>> 0) % (y >>> 0) | 0 | 0; + (x >>> 0) % (y >>> 0) | 0; } function $2(x, x$hi, y, y$hi) { @@ -878,15 +824,7 @@ function asmFunc(global, env, buffer) { x$hi = x$hi | 0; y = y | 0; y$hi = y$hi | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; - i64toi32_i32$0 = x$hi; - i64toi32_i32$0 = y$hi; - i64toi32_i32$0 = x$hi; - i64toi32_i32$1 = y$hi; - i64toi32_i32$1 = __wasm_i64_srem(x | 0, i64toi32_i32$0 | 0, y | 0, i64toi32_i32$1 | 0) | 0; - i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - i64toi32_i32$HIGH_BITS = i64toi32_i32$0; - return i64toi32_i32$1 | 0; + __wasm_i64_srem(x | 0, x$hi | 0, y | 0, y$hi | 0) | 0; } function $3(x, x$hi, y, y$hi) { @@ -894,15 +832,7 @@ function asmFunc(global, env, buffer) { x$hi = x$hi | 0; y = y | 0; y$hi = y$hi | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; - i64toi32_i32$0 = x$hi; - i64toi32_i32$0 = y$hi; - i64toi32_i32$0 = x$hi; - i64toi32_i32$1 = y$hi; - i64toi32_i32$1 = __wasm_i64_urem(x | 0, i64toi32_i32$0 | 0, y | 0, i64toi32_i32$1 | 0) | 0; - i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - i64toi32_i32$HIGH_BITS = i64toi32_i32$0; - return i64toi32_i32$1 | 0; + __wasm_i64_urem(x | 0, x$hi | 0, y | 0, y$hi | 0) | 0; } function legalstub$2($0_1, $1_1, $2_1, $3_1) { @@ -910,10 +840,10 @@ function asmFunc(global, env, buffer) { $1_1 = $1_1 | 0; $2_1 = $2_1 | 0; $3_1 = $3_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, $21 = 0, $22 = 0, $23 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $10 = 0, $10$hi = 0, $12 = 0, $12$hi = 0, $15$hi = 0, $16 = 0, $16$hi = 0, $4 = 0, $4$hi = 0; + var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $19 = 0, $20 = 0, $5 = 0, $5$hi = 0, $8$hi = 0, $9 = 0, $9$hi = 0, $11 = 0, $11$hi = 0, $14$hi = 0, $15 = 0, $15$hi = 0; i64toi32_i32$0 = 0; - $6 = $0_1; - $6$hi = i64toi32_i32$0; + $5 = $0_1; + $5$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; i64toi32_i32$2 = $1_1; i64toi32_i32$1 = 0; @@ -921,22 +851,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; - $21 = 0; + $19 = 0; } else { i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; - $21 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $19 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } - $9$hi = i64toi32_i32$1; - i64toi32_i32$1 = $6$hi; - i64toi32_i32$0 = $6; - i64toi32_i32$2 = $9$hi; - i64toi32_i32$3 = $21; + $8$hi = i64toi32_i32$1; + i64toi32_i32$1 = $5$hi; + i64toi32_i32$0 = $5; + i64toi32_i32$2 = $8$hi; + i64toi32_i32$3 = $19; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - $10 = i64toi32_i32$0 | i64toi32_i32$3 | 0; - $10$hi = i64toi32_i32$2; + $9 = i64toi32_i32$0 | i64toi32_i32$3 | 0; + $9$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; - $12 = $2_1; - $12$hi = i64toi32_i32$2; + $11 = $2_1; + $11$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; i64toi32_i32$1 = $3_1; i64toi32_i32$0 = 0; @@ -944,39 +874,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$0 = i64toi32_i32$1 << i64toi32_i32$4 | 0; - $22 = 0; + $20 = 0; } else { i64toi32_i32$0 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$1 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$2 << i64toi32_i32$4 | 0) | 0; - $22 = i64toi32_i32$1 << i64toi32_i32$4 | 0; + $20 = i64toi32_i32$1 << i64toi32_i32$4 | 0; } - $15$hi = i64toi32_i32$0; - i64toi32_i32$0 = $12$hi; - i64toi32_i32$2 = $12; - i64toi32_i32$1 = $15$hi; - i64toi32_i32$3 = $22; + $14$hi = i64toi32_i32$0; + i64toi32_i32$0 = $11$hi; + i64toi32_i32$2 = $11; + i64toi32_i32$1 = $14$hi; + i64toi32_i32$3 = $20; i64toi32_i32$1 = i64toi32_i32$0 | i64toi32_i32$1 | 0; - $16 = i64toi32_i32$2 | i64toi32_i32$3 | 0; - $16$hi = i64toi32_i32$1; - i64toi32_i32$1 = $10$hi; - i64toi32_i32$2 = $16$hi; - i64toi32_i32$2 = $2($10 | 0, i64toi32_i32$1 | 0, $16 | 0, i64toi32_i32$2 | 0) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $4 = i64toi32_i32$2; - $4$hi = i64toi32_i32$1; - i64toi32_i32$0 = i64toi32_i32$2; - i64toi32_i32$2 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$2 = 0; - $23 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $23 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($23 | 0); - i64toi32_i32$2 = $4$hi; - return $4 | 0; + $15 = i64toi32_i32$2 | i64toi32_i32$3 | 0; + $15$hi = i64toi32_i32$1; + i64toi32_i32$1 = $9$hi; + i64toi32_i32$2 = $15$hi; + $2($9 | 0, i64toi32_i32$1 | 0, $15 | 0, i64toi32_i32$2 | 0); } function legalstub$3($0_1, $1_1, $2_1, $3_1) { @@ -984,10 +897,10 @@ function asmFunc(global, env, buffer) { $1_1 = $1_1 | 0; $2_1 = $2_1 | 0; $3_1 = $3_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$3 = 0, $21 = 0, $22 = 0, $23 = 0, $6 = 0, $6$hi = 0, $9$hi = 0, $10 = 0, $10$hi = 0, $12 = 0, $12$hi = 0, $15$hi = 0, $16 = 0, $16$hi = 0, $4 = 0, $4$hi = 0; + var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $19 = 0, $20 = 0, $5 = 0, $5$hi = 0, $8$hi = 0, $9 = 0, $9$hi = 0, $11 = 0, $11$hi = 0, $14$hi = 0, $15 = 0, $15$hi = 0; i64toi32_i32$0 = 0; - $6 = $0_1; - $6$hi = i64toi32_i32$0; + $5 = $0_1; + $5$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; i64toi32_i32$2 = $1_1; i64toi32_i32$1 = 0; @@ -995,22 +908,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; - $21 = 0; + $19 = 0; } else { i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; - $21 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $19 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } - $9$hi = i64toi32_i32$1; - i64toi32_i32$1 = $6$hi; - i64toi32_i32$0 = $6; - i64toi32_i32$2 = $9$hi; - i64toi32_i32$3 = $21; + $8$hi = i64toi32_i32$1; + i64toi32_i32$1 = $5$hi; + i64toi32_i32$0 = $5; + i64toi32_i32$2 = $8$hi; + i64toi32_i32$3 = $19; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - $10 = i64toi32_i32$0 | i64toi32_i32$3 | 0; - $10$hi = i64toi32_i32$2; + $9 = i64toi32_i32$0 | i64toi32_i32$3 | 0; + $9$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; - $12 = $2_1; - $12$hi = i64toi32_i32$2; + $11 = $2_1; + $11$hi = i64toi32_i32$2; i64toi32_i32$2 = 0; i64toi32_i32$1 = $3_1; i64toi32_i32$0 = 0; @@ -1018,39 +931,22 @@ function asmFunc(global, env, buffer) { i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { i64toi32_i32$0 = i64toi32_i32$1 << i64toi32_i32$4 | 0; - $22 = 0; + $20 = 0; } else { i64toi32_i32$0 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$1 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$2 << i64toi32_i32$4 | 0) | 0; - $22 = i64toi32_i32$1 << i64toi32_i32$4 | 0; + $20 = i64toi32_i32$1 << i64toi32_i32$4 | 0; } - $15$hi = i64toi32_i32$0; - i64toi32_i32$0 = $12$hi; - i64toi32_i32$2 = $12; - i64toi32_i32$1 = $15$hi; - i64toi32_i32$3 = $22; + $14$hi = i64toi32_i32$0; + i64toi32_i32$0 = $11$hi; + i64toi32_i32$2 = $11; + i64toi32_i32$1 = $14$hi; + i64toi32_i32$3 = $20; i64toi32_i32$1 = i64toi32_i32$0 | i64toi32_i32$1 | 0; - $16 = i64toi32_i32$2 | i64toi32_i32$3 | 0; - $16$hi = i64toi32_i32$1; - i64toi32_i32$1 = $10$hi; - i64toi32_i32$2 = $16$hi; - i64toi32_i32$2 = $3($10 | 0, i64toi32_i32$1 | 0, $16 | 0, i64toi32_i32$2 | 0) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $4 = i64toi32_i32$2; - $4$hi = i64toi32_i32$1; - i64toi32_i32$0 = i64toi32_i32$2; - i64toi32_i32$2 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$2 = 0; - $23 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$2 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $23 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$0 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($23 | 0); - i64toi32_i32$2 = $4$hi; - return $4 | 0; + $15 = i64toi32_i32$2 | i64toi32_i32$3 | 0; + $15$hi = i64toi32_i32$1; + i64toi32_i32$1 = $9$hi; + i64toi32_i32$2 = $15$hi; + $3($9 | 0, i64toi32_i32$1 | 0, $15 | 0, i64toi32_i32$2 | 0); } function legalfunc$wasm2js_scratch_load_i64() { @@ -1650,12 +1546,11 @@ function asmFunc(global, env, buffer) { } var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0,getTempRet0},memasmFunc); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },getTempRet0},memasmFunc); export var no_dce_i32_rem_s = retasmFunc.no_dce_i32_rem_s; export var no_dce_i32_rem_u = retasmFunc.no_dce_i32_rem_u; export var no_dce_i64_rem_s = retasmFunc.no_dce_i64_rem_s; export var no_dce_i64_rem_u = retasmFunc.no_dce_i64_rem_u; -import { setTempRet0 } from 'env'; function asmFunc(global, env, buffer) { var HEAP8 = new global.Int8Array(buffer); @@ -1678,224 +1573,117 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var setTempRet0 = env.setTempRet0; - var i64toi32_i32$HIGH_BITS = 0; function $0(x) { x = Math_fround(x); - return ~~x | 0; + ~~x; } function $1(x) { x = Math_fround(x); - return ~~x >>> 0 | 0; + ~~x >>> 0; } function $2(x) { x = +x; - return ~~x | 0; + ~~x; } function $3(x) { x = +x; - return ~~x >>> 0 | 0; + ~~x >>> 0; } function $4(x) { x = Math_fround(x); - var i64toi32_i32$0 = Math_fround(0), $4_1 = 0, $5_1 = 0, i64toi32_i32$1 = 0, i64toi32_i32$2 = 0; + var i64toi32_i32$0 = Math_fround(0), $2_1 = 0, $3_1 = 0; i64toi32_i32$0 = x; if (Math_fround(Math_abs(i64toi32_i32$0)) >= Math_fround(1.0)) { if (i64toi32_i32$0 > Math_fround(0.0)) { - $4_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0 + $2_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0 } else { - $4_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0 + $2_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0 } - $5_1 = $4_1; + $3_1 = $2_1; } else { - $5_1 = 0 + $3_1 = 0 } - i64toi32_i32$1 = $5_1; - i64toi32_i32$2 = ~~i64toi32_i32$0 >>> 0; - i64toi32_i32$HIGH_BITS = i64toi32_i32$1; - return i64toi32_i32$2 | 0; + ~~i64toi32_i32$0 >>> 0; } function $5(x) { x = Math_fround(x); - var i64toi32_i32$0 = Math_fround(0), $4_1 = 0, $5_1 = 0, i64toi32_i32$1 = 0, i64toi32_i32$2 = 0; + var i64toi32_i32$0 = Math_fround(0), $2_1 = 0, $3_1 = 0; i64toi32_i32$0 = x; if (Math_fround(Math_abs(i64toi32_i32$0)) >= Math_fround(1.0)) { if (i64toi32_i32$0 > Math_fround(0.0)) { - $4_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0 + $2_1 = ~~Math_fround(Math_min(Math_fround(Math_floor(Math_fround(i64toi32_i32$0 / Math_fround(4294967296.0)))), Math_fround(Math_fround(4294967296.0) - Math_fround(1.0)))) >>> 0 } else { - $4_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0 + $2_1 = ~~Math_fround(Math_ceil(Math_fround(Math_fround(i64toi32_i32$0 - Math_fround(~~i64toi32_i32$0 >>> 0 >>> 0)) / Math_fround(4294967296.0)))) >>> 0 } - $5_1 = $4_1; + $3_1 = $2_1; } else { - $5_1 = 0 + $3_1 = 0 } - i64toi32_i32$1 = $5_1; - i64toi32_i32$2 = ~~i64toi32_i32$0 >>> 0; - i64toi32_i32$HIGH_BITS = i64toi32_i32$1; - return i64toi32_i32$2 | 0; + ~~i64toi32_i32$0 >>> 0; } function $6(x) { x = +x; - var i64toi32_i32$0 = 0.0, $4_1 = 0, $5_1 = 0, i64toi32_i32$1 = 0, i64toi32_i32$2 = 0; + var i64toi32_i32$0 = 0.0, $2_1 = 0, $3_1 = 0; i64toi32_i32$0 = x; if (Math_abs(i64toi32_i32$0) >= 1.0) { if (i64toi32_i32$0 > 0.0) { - $4_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0 + $2_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0 } else { - $4_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0 + $2_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0 } - $5_1 = $4_1; + $3_1 = $2_1; } else { - $5_1 = 0 + $3_1 = 0 } - i64toi32_i32$1 = $5_1; - i64toi32_i32$2 = ~~i64toi32_i32$0 >>> 0; - i64toi32_i32$HIGH_BITS = i64toi32_i32$1; - return i64toi32_i32$2 | 0; + ~~i64toi32_i32$0 >>> 0; } function $7(x) { x = +x; - var i64toi32_i32$0 = 0.0, $4_1 = 0, $5_1 = 0, i64toi32_i32$1 = 0, i64toi32_i32$2 = 0; + var i64toi32_i32$0 = 0.0, $2_1 = 0, $3_1 = 0; i64toi32_i32$0 = x; if (Math_abs(i64toi32_i32$0) >= 1.0) { if (i64toi32_i32$0 > 0.0) { - $4_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0 + $2_1 = ~~Math_min(Math_floor(i64toi32_i32$0 / 4294967296.0), 4294967296.0 - 1.0) >>> 0 } else { - $4_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0 + $2_1 = ~~Math_ceil((i64toi32_i32$0 - +(~~i64toi32_i32$0 >>> 0 >>> 0)) / 4294967296.0) >>> 0 } - $5_1 = $4_1; - } else { - $5_1 = 0 - } - i64toi32_i32$1 = $5_1; - i64toi32_i32$2 = ~~i64toi32_i32$0 >>> 0; - i64toi32_i32$HIGH_BITS = i64toi32_i32$1; - return i64toi32_i32$2 | 0; - } - - function legalstub$4($0_1) { - $0_1 = Math_fround($0_1); - var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $4(Math_fround($0_1)) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $1_1 = i64toi32_i32$0; - $1$hi = i64toi32_i32$1; - i64toi32_i32$2 = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$0 = 0; - $8 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($8 | 0); - i64toi32_i32$0 = $1$hi; - return $1_1 | 0; - } - - function legalstub$5($0_1) { - $0_1 = Math_fround($0_1); - var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $5(Math_fround($0_1)) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $1_1 = i64toi32_i32$0; - $1$hi = i64toi32_i32$1; - i64toi32_i32$2 = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$0 = 0; - $8 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $3_1 = $2_1; } else { - i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + $3_1 = 0 } - setTempRet0($8 | 0); - i64toi32_i32$0 = $1$hi; - return $1_1 | 0; - } - - function legalstub$6($0_1) { - $0_1 = +$0_1; - var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $6(+$0_1) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $1_1 = i64toi32_i32$0; - $1$hi = i64toi32_i32$1; - i64toi32_i32$2 = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$0 = 0; - $8 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($8 | 0); - i64toi32_i32$0 = $1$hi; - return $1_1 | 0; - } - - function legalstub$7($0_1) { - $0_1 = +$0_1; - var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $7(+$0_1) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $1_1 = i64toi32_i32$0; - $1$hi = i64toi32_i32$1; - i64toi32_i32$2 = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$0 = 0; - $8 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($8 | 0); - i64toi32_i32$0 = $1$hi; - return $1_1 | 0; + ~~i64toi32_i32$0 >>> 0; } var FUNCTION_TABLE = []; return { - "no_dce_i32_trunc_s_f32": $0, - "no_dce_i32_trunc_u_f32": $1, - "no_dce_i32_trunc_s_f64": $2, - "no_dce_i32_trunc_u_f64": $3, - "no_dce_i64_trunc_s_f32": legalstub$4, - "no_dce_i64_trunc_u_f32": legalstub$5, - "no_dce_i64_trunc_s_f64": legalstub$6, - "no_dce_i64_trunc_u_f64": legalstub$7 + "no_dce_i32_trunc_f32_s": $0, + "no_dce_i32_trunc_f32_u": $1, + "no_dce_i32_trunc_f64_s": $2, + "no_dce_i32_trunc_f64_u": $3, + "no_dce_i64_trunc_f32_s": $4, + "no_dce_i64_trunc_f32_u": $5, + "no_dce_i64_trunc_f64_s": $6, + "no_dce_i64_trunc_f64_u": $7 }; } var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); -export var no_dce_i32_trunc_s_f32 = retasmFunc.no_dce_i32_trunc_s_f32; -export var no_dce_i32_trunc_u_f32 = retasmFunc.no_dce_i32_trunc_u_f32; -export var no_dce_i32_trunc_s_f64 = retasmFunc.no_dce_i32_trunc_s_f64; -export var no_dce_i32_trunc_u_f64 = retasmFunc.no_dce_i32_trunc_u_f64; -export var no_dce_i64_trunc_s_f32 = retasmFunc.no_dce_i64_trunc_s_f32; -export var no_dce_i64_trunc_u_f32 = retasmFunc.no_dce_i64_trunc_u_f32; -export var no_dce_i64_trunc_s_f64 = retasmFunc.no_dce_i64_trunc_s_f64; -export var no_dce_i64_trunc_u_f64 = retasmFunc.no_dce_i64_trunc_u_f64; -import { setTempRet0 } from 'env'; +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +export var no_dce_i32_trunc_f32_s = retasmFunc.no_dce_i32_trunc_f32_s; +export var no_dce_i32_trunc_f32_u = retasmFunc.no_dce_i32_trunc_f32_u; +export var no_dce_i32_trunc_f64_s = retasmFunc.no_dce_i32_trunc_f64_s; +export var no_dce_i32_trunc_f64_u = retasmFunc.no_dce_i32_trunc_f64_u; +export var no_dce_i64_trunc_f32_s = retasmFunc.no_dce_i64_trunc_f32_s; +export var no_dce_i64_trunc_f32_u = retasmFunc.no_dce_i64_trunc_f32_u; +export var no_dce_i64_trunc_f64_s = retasmFunc.no_dce_i64_trunc_f64_s; +export var no_dce_i64_trunc_f64_u = retasmFunc.no_dce_i64_trunc_f64_u; function asmFunc(global, env, buffer) { var HEAP8 = new global.Int8Array(buffer); @@ -1918,54 +1706,80 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - var setTempRet0 = env.setTempRet0; - var i64toi32_i32$HIGH_BITS = 0; function $0(i) { i = i | 0; - return HEAP32[i >> 2] | 0 | 0; + HEAP32[i >> 2] | 0; } function $1(i) { i = i | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0; - i64toi32_i32$2 = i; - i64toi32_i32$0 = HEAP32[i64toi32_i32$2 >> 2] | 0; - i64toi32_i32$1 = HEAP32[(i64toi32_i32$2 + 4 | 0) >> 2] | 0; - i64toi32_i32$HIGH_BITS = i64toi32_i32$1; - return i64toi32_i32$0 | 0; + HEAP16[i >> 1] | 0; } function $2(i) { i = i | 0; - return Math_fround(Math_fround(HEAPF32[i >> 2])); + HEAPU16[i >> 1] | 0; } function $3(i) { i = i | 0; - return +(+HEAPF64[i >> 3]); + HEAP8[i >> 0] | 0; } - function legalstub$1($0_1) { - $0_1 = $0_1 | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $8 = 0, $1_1 = 0, $1$hi = 0, i64toi32_i32$2 = 0; - i64toi32_i32$0 = $1($0_1 | 0) | 0; - i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; - $1_1 = i64toi32_i32$0; - $1$hi = i64toi32_i32$1; - i64toi32_i32$2 = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { - i64toi32_i32$0 = 0; - $8 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - } else { - i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; - $8 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; - } - setTempRet0($8 | 0); - i64toi32_i32$0 = $1$hi; - return $1_1 | 0; + function $4(i) { + i = i | 0; + HEAPU8[i >> 0] | 0; + } + + function $5(i) { + i = i | 0; + var i64toi32_i32$2 = 0; + i64toi32_i32$2 = i; + HEAP32[(i64toi32_i32$2 + 4 | 0) >> 2] | 0; + HEAP32[i64toi32_i32$2 >> 2] | 0; + } + + function $6(i) { + i = i | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = HEAP32[i >> 2] | 0; + } + + function $7(i) { + i = i | 0; + HEAP32[i >> 2] | 0; + } + + function $8(i) { + i = i | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = HEAP16[i >> 1] | 0; + } + + function $9(i) { + i = i | 0; + HEAPU16[i >> 1] | 0; + } + + function $10(i) { + i = i | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = HEAP8[i >> 0] | 0; + } + + function $11(i) { + i = i | 0; + HEAPU8[i >> 0] | 0; + } + + function $12(i) { + i = i | 0; + Math_fround(HEAPF32[i >> 2]); + } + + function $13(i) { + i = i | 0; + +HEAPF64[i >> 3]; } var FUNCTION_TABLE = []; @@ -1997,15 +1811,35 @@ function asmFunc(global, env, buffer) { return { "no_dce_i32_load": $0, - "no_dce_i64_load": legalstub$1, - "no_dce_f32_load": $2, - "no_dce_f64_load": $3 + "no_dce_i32_load16_s": $1, + "no_dce_i32_load16_u": $2, + "no_dce_i32_load8_s": $3, + "no_dce_i32_load8_u": $4, + "no_dce_i64_load": $5, + "no_dce_i64_load32_s": $6, + "no_dce_i64_load32_u": $7, + "no_dce_i64_load16_s": $8, + "no_dce_i64_load16_u": $9, + "no_dce_i64_load8_s": $10, + "no_dce_i64_load8_u": $11, + "no_dce_f32_load": $12, + "no_dce_f64_load": $13 }; } var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); export var no_dce_i32_load = retasmFunc.no_dce_i32_load; +export var no_dce_i32_load16_s = retasmFunc.no_dce_i32_load16_s; +export var no_dce_i32_load16_u = retasmFunc.no_dce_i32_load16_u; +export var no_dce_i32_load8_s = retasmFunc.no_dce_i32_load8_s; +export var no_dce_i32_load8_u = retasmFunc.no_dce_i32_load8_u; export var no_dce_i64_load = retasmFunc.no_dce_i64_load; +export var no_dce_i64_load32_s = retasmFunc.no_dce_i64_load32_s; +export var no_dce_i64_load32_u = retasmFunc.no_dce_i64_load32_u; +export var no_dce_i64_load16_s = retasmFunc.no_dce_i64_load16_s; +export var no_dce_i64_load16_u = retasmFunc.no_dce_i64_load16_u; +export var no_dce_i64_load8_s = retasmFunc.no_dce_i64_load8_s; +export var no_dce_i64_load8_u = retasmFunc.no_dce_i64_load8_u; export var no_dce_f32_load = retasmFunc.no_dce_f32_load; export var no_dce_f64_load = retasmFunc.no_dce_f64_load; |