diff --git a/README.md b/README.md index b0525aa1..ce197b75 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,11 @@ * This error message is for the WAT format, WASM format cannot detect this error by the bytecode. * `core/comments/comments.wast` line 81: remove the WAT tests. * The tests are for comment tests in WAT and cannot be parsed by wabt, therefore remove them. +* `threads/atomic/atomic.wast`: divergence behavior + * Please check [this issue](https://github.com/WebAssembly/threads/issues/195). + * Modified the `wast` file for fitting the `compare_exchange_strong` behavior in C++. +* `threads/atomic_wait_notify/atomic_wait_notify.wast`: line 73: remove the thread tests. + * The S-Expression of threads cannot be parsed by wabt, therefore remove them. ## Branches And Tags diff --git a/threads/atomic/atomic.0.wasm b/threads/atomic/atomic.0.wasm new file mode 100644 index 00000000..5ce3e49d Binary files /dev/null and b/threads/atomic/atomic.0.wasm differ diff --git a/threads/atomic/atomic.1.wasm b/threads/atomic/atomic.1.wasm new file mode 100644 index 00000000..35330163 Binary files /dev/null and b/threads/atomic/atomic.1.wasm differ diff --git a/threads/atomic/atomic.10.wasm b/threads/atomic/atomic.10.wasm new file mode 100644 index 00000000..4a24ec96 Binary files /dev/null and b/threads/atomic/atomic.10.wasm differ diff --git a/threads/atomic/atomic.11.wasm b/threads/atomic/atomic.11.wasm new file mode 100644 index 00000000..87499e47 Binary files /dev/null and b/threads/atomic/atomic.11.wasm differ diff --git a/threads/atomic/atomic.12.wasm b/threads/atomic/atomic.12.wasm new file mode 100644 index 00000000..59de30c1 Binary files /dev/null and b/threads/atomic/atomic.12.wasm differ diff --git a/threads/atomic/atomic.13.wasm b/threads/atomic/atomic.13.wasm new file mode 100644 index 00000000..ca6148fe Binary files /dev/null and b/threads/atomic/atomic.13.wasm differ diff --git a/threads/atomic/atomic.14.wasm b/threads/atomic/atomic.14.wasm new file mode 100644 index 00000000..698d39a2 Binary files /dev/null and b/threads/atomic/atomic.14.wasm differ diff --git a/threads/atomic/atomic.15.wasm b/threads/atomic/atomic.15.wasm new file mode 100644 index 00000000..4485889b Binary files /dev/null and b/threads/atomic/atomic.15.wasm differ diff --git a/threads/atomic/atomic.16.wasm b/threads/atomic/atomic.16.wasm new file mode 100644 index 00000000..956d9d5a Binary files /dev/null and b/threads/atomic/atomic.16.wasm differ diff --git a/threads/atomic/atomic.17.wasm b/threads/atomic/atomic.17.wasm new file mode 100644 index 00000000..3437ea6d Binary files /dev/null and b/threads/atomic/atomic.17.wasm differ diff --git a/threads/atomic/atomic.18.wasm b/threads/atomic/atomic.18.wasm new file mode 100644 index 00000000..7f22b0e8 Binary files /dev/null and b/threads/atomic/atomic.18.wasm differ diff --git a/threads/atomic/atomic.19.wasm b/threads/atomic/atomic.19.wasm new file mode 100644 index 00000000..2aa20559 Binary files /dev/null and b/threads/atomic/atomic.19.wasm differ diff --git a/threads/atomic/atomic.2.wasm b/threads/atomic/atomic.2.wasm new file mode 100644 index 00000000..8171c3dd Binary files /dev/null and b/threads/atomic/atomic.2.wasm differ diff --git a/threads/atomic/atomic.20.wasm b/threads/atomic/atomic.20.wasm new file mode 100644 index 00000000..677e5b8e Binary files /dev/null and b/threads/atomic/atomic.20.wasm differ diff --git a/threads/atomic/atomic.21.wasm b/threads/atomic/atomic.21.wasm new file mode 100644 index 00000000..c66d1456 Binary files /dev/null and b/threads/atomic/atomic.21.wasm differ diff --git a/threads/atomic/atomic.22.wasm b/threads/atomic/atomic.22.wasm new file mode 100644 index 00000000..b41de263 Binary files /dev/null and b/threads/atomic/atomic.22.wasm differ diff --git a/threads/atomic/atomic.23.wasm b/threads/atomic/atomic.23.wasm new file mode 100644 index 00000000..b9a01a2c Binary files /dev/null and b/threads/atomic/atomic.23.wasm differ diff --git a/threads/atomic/atomic.24.wasm b/threads/atomic/atomic.24.wasm new file mode 100644 index 00000000..7d5142a8 Binary files /dev/null and b/threads/atomic/atomic.24.wasm differ diff --git a/threads/atomic/atomic.25.wasm b/threads/atomic/atomic.25.wasm new file mode 100644 index 00000000..56056fb5 Binary files /dev/null and b/threads/atomic/atomic.25.wasm differ diff --git a/threads/atomic/atomic.26.wasm b/threads/atomic/atomic.26.wasm new file mode 100644 index 00000000..6b6a5974 Binary files /dev/null and b/threads/atomic/atomic.26.wasm differ diff --git a/threads/atomic/atomic.27.wasm b/threads/atomic/atomic.27.wasm new file mode 100644 index 00000000..a70eaf3d Binary files /dev/null and b/threads/atomic/atomic.27.wasm differ diff --git a/threads/atomic/atomic.28.wasm b/threads/atomic/atomic.28.wasm new file mode 100644 index 00000000..25dfe1d2 Binary files /dev/null and b/threads/atomic/atomic.28.wasm differ diff --git a/threads/atomic/atomic.29.wasm b/threads/atomic/atomic.29.wasm new file mode 100644 index 00000000..a6f65189 Binary files /dev/null and b/threads/atomic/atomic.29.wasm differ diff --git a/threads/atomic/atomic.3.wasm b/threads/atomic/atomic.3.wasm new file mode 100644 index 00000000..1716480c Binary files /dev/null and b/threads/atomic/atomic.3.wasm differ diff --git a/threads/atomic/atomic.30.wasm b/threads/atomic/atomic.30.wasm new file mode 100644 index 00000000..bdb4f6c1 Binary files /dev/null and b/threads/atomic/atomic.30.wasm differ diff --git a/threads/atomic/atomic.31.wasm b/threads/atomic/atomic.31.wasm new file mode 100644 index 00000000..a122cf63 Binary files /dev/null and b/threads/atomic/atomic.31.wasm differ diff --git a/threads/atomic/atomic.32.wasm b/threads/atomic/atomic.32.wasm new file mode 100644 index 00000000..482cd3c9 Binary files /dev/null and b/threads/atomic/atomic.32.wasm differ diff --git a/threads/atomic/atomic.33.wasm b/threads/atomic/atomic.33.wasm new file mode 100644 index 00000000..fd26168c Binary files /dev/null and b/threads/atomic/atomic.33.wasm differ diff --git a/threads/atomic/atomic.34.wasm b/threads/atomic/atomic.34.wasm new file mode 100644 index 00000000..20c4e59a Binary files /dev/null and b/threads/atomic/atomic.34.wasm differ diff --git a/threads/atomic/atomic.35.wasm b/threads/atomic/atomic.35.wasm new file mode 100644 index 00000000..ff570562 Binary files /dev/null and b/threads/atomic/atomic.35.wasm differ diff --git a/threads/atomic/atomic.36.wasm b/threads/atomic/atomic.36.wasm new file mode 100644 index 00000000..895e3348 Binary files /dev/null and b/threads/atomic/atomic.36.wasm differ diff --git a/threads/atomic/atomic.37.wasm b/threads/atomic/atomic.37.wasm new file mode 100644 index 00000000..3b68434c Binary files /dev/null and b/threads/atomic/atomic.37.wasm differ diff --git a/threads/atomic/atomic.38.wasm b/threads/atomic/atomic.38.wasm new file mode 100644 index 00000000..01f1f08c Binary files /dev/null and b/threads/atomic/atomic.38.wasm differ diff --git a/threads/atomic/atomic.39.wasm b/threads/atomic/atomic.39.wasm new file mode 100644 index 00000000..8b1f7802 Binary files /dev/null and b/threads/atomic/atomic.39.wasm differ diff --git a/threads/atomic/atomic.4.wasm b/threads/atomic/atomic.4.wasm new file mode 100644 index 00000000..b907fe3e Binary files /dev/null and b/threads/atomic/atomic.4.wasm differ diff --git a/threads/atomic/atomic.40.wasm b/threads/atomic/atomic.40.wasm new file mode 100644 index 00000000..7404cd81 Binary files /dev/null and b/threads/atomic/atomic.40.wasm differ diff --git a/threads/atomic/atomic.41.wasm b/threads/atomic/atomic.41.wasm new file mode 100644 index 00000000..4ad34b5b Binary files /dev/null and b/threads/atomic/atomic.41.wasm differ diff --git a/threads/atomic/atomic.42.wasm b/threads/atomic/atomic.42.wasm new file mode 100644 index 00000000..f93da496 Binary files /dev/null and b/threads/atomic/atomic.42.wasm differ diff --git a/threads/atomic/atomic.43.wasm b/threads/atomic/atomic.43.wasm new file mode 100644 index 00000000..56844545 Binary files /dev/null and b/threads/atomic/atomic.43.wasm differ diff --git a/threads/atomic/atomic.44.wasm b/threads/atomic/atomic.44.wasm new file mode 100644 index 00000000..bda4f517 Binary files /dev/null and b/threads/atomic/atomic.44.wasm differ diff --git a/threads/atomic/atomic.45.wasm b/threads/atomic/atomic.45.wasm new file mode 100644 index 00000000..a6351d65 Binary files /dev/null and b/threads/atomic/atomic.45.wasm differ diff --git a/threads/atomic/atomic.46.wasm b/threads/atomic/atomic.46.wasm new file mode 100644 index 00000000..e1488a99 Binary files /dev/null and b/threads/atomic/atomic.46.wasm differ diff --git a/threads/atomic/atomic.47.wasm b/threads/atomic/atomic.47.wasm new file mode 100644 index 00000000..b1d57a0f Binary files /dev/null and b/threads/atomic/atomic.47.wasm differ diff --git a/threads/atomic/atomic.48.wasm b/threads/atomic/atomic.48.wasm new file mode 100644 index 00000000..dc8d8d32 Binary files /dev/null and b/threads/atomic/atomic.48.wasm differ diff --git a/threads/atomic/atomic.49.wasm b/threads/atomic/atomic.49.wasm new file mode 100644 index 00000000..5fc7fef0 Binary files /dev/null and b/threads/atomic/atomic.49.wasm differ diff --git a/threads/atomic/atomic.5.wasm b/threads/atomic/atomic.5.wasm new file mode 100644 index 00000000..cb94a263 Binary files /dev/null and b/threads/atomic/atomic.5.wasm differ diff --git a/threads/atomic/atomic.50.wasm b/threads/atomic/atomic.50.wasm new file mode 100644 index 00000000..c701cd64 Binary files /dev/null and b/threads/atomic/atomic.50.wasm differ diff --git a/threads/atomic/atomic.6.wasm b/threads/atomic/atomic.6.wasm new file mode 100644 index 00000000..07573337 Binary files /dev/null and b/threads/atomic/atomic.6.wasm differ diff --git a/threads/atomic/atomic.7.wasm b/threads/atomic/atomic.7.wasm new file mode 100644 index 00000000..d9e6c375 Binary files /dev/null and b/threads/atomic/atomic.7.wasm differ diff --git a/threads/atomic/atomic.8.wasm b/threads/atomic/atomic.8.wasm new file mode 100644 index 00000000..8c122dd0 Binary files /dev/null and b/threads/atomic/atomic.8.wasm differ diff --git a/threads/atomic/atomic.9.wasm b/threads/atomic/atomic.9.wasm new file mode 100644 index 00000000..7081ba0a Binary files /dev/null and b/threads/atomic/atomic.9.wasm differ diff --git a/threads/atomic/atomic.json b/threads/atomic/atomic.json new file mode 100644 index 00000000..fa5705f0 --- /dev/null +++ b/threads/atomic/atomic.json @@ -0,0 +1,311 @@ +{"source_filename": "atomic.wast", + "commands": [ + {"type": "module", "line": 3, "filename": "atomic.0.wasm"}, + {"type": "action", "line": 84, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "506097522914230528"}]}, "expected": []}, + {"type": "assert_return", "line": 86, "action": {"type": "invoke", "field": "i32.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "50462976"}]}, + {"type": "assert_return", "line": 87, "action": {"type": "invoke", "field": "i32.atomic.load", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i32", "value": "117835012"}]}, + {"type": "assert_return", "line": 89, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "506097522914230528"}]}, + {"type": "assert_return", "line": 91, "action": {"type": "invoke", "field": "i32.atomic.load8_u", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 92, "action": {"type": "invoke", "field": "i32.atomic.load8_u", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "i32", "value": "5"}]}, + {"type": "assert_return", "line": 94, "action": {"type": "invoke", "field": "i32.atomic.load16_u", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "256"}]}, + {"type": "assert_return", "line": 95, "action": {"type": "invoke", "field": "i32.atomic.load16_u", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "1798"}]}, + {"type": "assert_return", "line": 97, "action": {"type": "invoke", "field": "i64.atomic.load8_u", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "0"}]}, + {"type": "assert_return", "line": 98, "action": {"type": "invoke", "field": "i64.atomic.load8_u", "args": [{"type": "i32", "value": "5"}]}, "expected": [{"type": "i64", "value": "5"}]}, + {"type": "assert_return", "line": 100, "action": {"type": "invoke", "field": "i64.atomic.load16_u", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "256"}]}, + {"type": "assert_return", "line": 101, "action": {"type": "invoke", "field": "i64.atomic.load16_u", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i64", "value": "1798"}]}, + {"type": "assert_return", "line": 103, "action": {"type": "invoke", "field": "i64.atomic.load32_u", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "50462976"}]}, + {"type": "assert_return", "line": 104, "action": {"type": "invoke", "field": "i64.atomic.load32_u", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i64", "value": "117835012"}]}, + {"type": "action", "line": 108, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "0"}]}, "expected": []}, + {"type": "assert_return", "line": 110, "action": {"type": "invoke", "field": "i32.atomic.store", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "4293844428"}]}, "expected": []}, + {"type": "assert_return", "line": 111, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "4293844428"}]}, + {"type": "assert_return", "line": 113, "action": {"type": "invoke", "field": "i64.atomic.store", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "81985529216486895"}]}, "expected": []}, + {"type": "assert_return", "line": 114, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "81985529216486895"}]}, + {"type": "assert_return", "line": 116, "action": {"type": "invoke", "field": "i32.atomic.store8", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "66"}]}, "expected": []}, + {"type": "assert_return", "line": 117, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "81985529216451311"}]}, + {"type": "assert_return", "line": 119, "action": {"type": "invoke", "field": "i32.atomic.store16", "args": [{"type": "i32", "value": "4"}, {"type": "i32", "value": "34884"}]}, "expected": []}, + {"type": "assert_return", "line": 120, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "82059046171656943"}]}, + {"type": "assert_return", "line": 122, "action": {"type": "invoke", "field": "i64.atomic.store8", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "153"}]}, "expected": []}, + {"type": "assert_return", "line": 123, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "82059046171679215"}]}, + {"type": "assert_return", "line": 125, "action": {"type": "invoke", "field": "i64.atomic.store16", "args": [{"type": "i32", "value": "4"}, {"type": "i64", "value": "51966"}]}, "expected": []}, + {"type": "assert_return", "line": 126, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "82132412803029487"}]}, + {"type": "assert_return", "line": 128, "action": {"type": "invoke", "field": "i64.atomic.store32", "args": [{"type": "i32", "value": "4"}, {"type": "i64", "value": "3735928559"}]}, "expected": []}, + {"type": "assert_return", "line": 129, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "16045690983407131119"}]}, + {"type": "action", "line": 133, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 134, "action": {"type": "invoke", "field": "i32.atomic.rmw.add", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 135, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938552723337"}]}, + {"type": "action", "line": 137, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 138, "action": {"type": "invoke", "field": "i64.atomic.rmw.add", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 139, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1302123111102223123"}]}, + {"type": "action", "line": 141, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 142, "action": {"type": "invoke", "field": "i32.atomic.rmw8.add_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 143, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303646"}]}, + {"type": "action", "line": 145, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 146, "action": {"type": "invoke", "field": "i32.atomic.rmw16.add_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 147, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247355407"}]}, + {"type": "action", "line": 149, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 150, "action": {"type": "invoke", "field": "i64.atomic.rmw8.add_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 151, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303507"}]}, + {"type": "action", "line": 153, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 154, "action": {"type": "invoke", "field": "i64.atomic.rmw16.add_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 155, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247352320"}]}, + {"type": "action", "line": 157, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 158, "action": {"type": "invoke", "field": "i64.atomic.rmw32.add_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 159, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782941648599030"}]}, + {"type": "action", "line": 163, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 164, "action": {"type": "invoke", "field": "i32.atomic.rmw.sub", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 165, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782942236850841"}]}, + {"type": "action", "line": 167, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 168, "action": {"type": "invoke", "field": "i64.atomic.rmw.sub", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 169, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1157442765392383759"}]}, + {"type": "action", "line": 171, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 172, "action": {"type": "invoke", "field": "i32.atomic.rmw8.sub_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 173, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303492"}]}, + {"type": "action", "line": 175, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 176, "action": {"type": "invoke", "field": "i32.atomic.rmw16.sub_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 177, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247317011"}]}, + {"type": "action", "line": 179, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 180, "action": {"type": "invoke", "field": "i64.atomic.rmw8.sub_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 181, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303631"}]}, + {"type": "action", "line": 183, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 184, "action": {"type": "invoke", "field": "i64.atomic.rmw16.sub_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 185, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247320098"}]}, + {"type": "action", "line": 187, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 188, "action": {"type": "invoke", "field": "i64.atomic.rmw32.sub_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 189, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782939140975148"}]}, + {"type": "action", "line": 193, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 194, "action": {"type": "invoke", "field": "i32.atomic.rmw.and", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 195, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938230460432"}]}, + {"type": "action", "line": 197, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 198, "action": {"type": "invoke", "field": "i64.atomic.rmw.and", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 199, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "72340172821233664"}]}, + {"type": "action", "line": 201, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 202, "action": {"type": "invoke", "field": "i32.atomic.rmw8.and_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 203, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303425"}]}, + {"type": "action", "line": 205, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 206, "action": {"type": "invoke", "field": "i32.atomic.rmw16.and_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 207, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247299088"}]}, + {"type": "action", "line": 209, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 210, "action": {"type": "invoke", "field": "i64.atomic.rmw8.and_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 211, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303424"}]}, + {"type": "action", "line": 213, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 214, "action": {"type": "invoke", "field": "i64.atomic.rmw16.and_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 215, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303169"}]}, + {"type": "action", "line": 217, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 218, "action": {"type": "invoke", "field": "i64.atomic.rmw32.and_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 219, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782937962086401"}]}, + {"type": "action", "line": 223, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 224, "action": {"type": "invoke", "field": "i32.atomic.rmw.or", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 225, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938283235193"}]}, + {"type": "action", "line": 227, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 228, "action": {"type": "invoke", "field": "i64.atomic.rmw.or", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 229, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938280989459"}]}, + {"type": "action", "line": 231, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 232, "action": {"type": "invoke", "field": "i32.atomic.rmw8.or_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 233, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303645"}]}, + {"type": "action", "line": 235, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 236, "action": {"type": "invoke", "field": "i32.atomic.rmw16.or_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 237, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247355391"}]}, + {"type": "action", "line": 239, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 240, "action": {"type": "invoke", "field": "i64.atomic.rmw8.or_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 241, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303507"}]}, + {"type": "action", "line": 243, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 244, "action": {"type": "invoke", "field": "i64.atomic.rmw16.or_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 245, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247348223"}]}, + {"type": "action", "line": 247, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 248, "action": {"type": "invoke", "field": "i64.atomic.rmw32.or_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 249, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782941647484917"}]}, + {"type": "action", "line": 253, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 254, "action": {"type": "invoke", "field": "i32.atomic.rmw.xor", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 255, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938013747049"}]}, + {"type": "action", "line": 257, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 258, "action": {"type": "invoke", "field": "i64.atomic.rmw.xor", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 259, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1157442765459755795"}]}, + {"type": "action", "line": 261, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 262, "action": {"type": "invoke", "field": "i32.atomic.rmw8.xor_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 263, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303644"}]}, + {"type": "action", "line": 265, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 266, "action": {"type": "invoke", "field": "i32.atomic.rmw16.xor_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 267, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247355375"}]}, + {"type": "action", "line": 269, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 270, "action": {"type": "invoke", "field": "i64.atomic.rmw8.xor_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 271, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303507"}]}, + {"type": "action", "line": 273, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 274, "action": {"type": "invoke", "field": "i64.atomic.rmw16.xor_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 275, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247344126"}]}, + {"type": "action", "line": 277, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 278, "action": {"type": "invoke", "field": "i64.atomic.rmw32.xor_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 279, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782941646370804"}]}, + {"type": "action", "line": 283, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 284, "action": {"type": "invoke", "field": "i32.atomic.rmw.xchg", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 285, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938266392184"}]}, + {"type": "action", "line": 287, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 288, "action": {"type": "invoke", "field": "i64.atomic.rmw.xchg", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 289, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "72340172854919682"}]}, + {"type": "action", "line": 291, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 292, "action": {"type": "invoke", "field": "i32.atomic.rmw8.xchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 293, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303629"}]}, + {"type": "action", "line": 295, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 296, "action": {"type": "invoke", "field": "i32.atomic.rmw16.xchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 297, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247351038"}]}, + {"type": "action", "line": 299, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 300, "action": {"type": "invoke", "field": "i64.atomic.rmw8.xchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 301, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303490"}]}, + {"type": "action", "line": 303, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 304, "action": {"type": "invoke", "field": "i64.atomic.rmw16.xchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 305, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247347951"}]}, + {"type": "action", "line": 307, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 308, "action": {"type": "invoke", "field": "i64.atomic.rmw32.xchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 309, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782941362267877"}]}, + {"type": "action", "line": 313, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 314, "action": {"type": "invoke", "field": "i32.atomic.rmw.cmpxchg", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 315, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 317, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 318, "action": {"type": "invoke", "field": "i64.atomic.rmw.cmpxchg", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 319, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 321, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 322, "action": {"type": "invoke", "field": "i32.atomic.rmw8.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 323, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 325, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 326, "action": {"type": "invoke", "field": "i32.atomic.rmw8.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "286331153"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 327, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303629"}]}, + {"type": "action", "line": 329, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 330, "action": {"type": "invoke", "field": "i32.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 331, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 333, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 334, "action": {"type": "invoke", "field": "i32.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "286331153"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 335, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247351038"}]}, + {"type": "action", "line": 337, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 338, "action": {"type": "invoke", "field": "i64.atomic.rmw8.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 339, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 341, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 342, "action": {"type": "invoke", "field": "i64.atomic.rmw8.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "1229782938247303441"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 343, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303490"}]}, + {"type": "action", "line": 345, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 346, "action": {"type": "invoke", "field": "i64.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 347, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 349, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 350, "action": {"type": "invoke", "field": "i64.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "1229782938247303441"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 351, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247347951"}]}, + {"type": "action", "line": 353, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 354, "action": {"type": "invoke", "field": "i64.atomic.rmw32.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 355, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "action", "line": 357, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 358, "action": {"type": "invoke", "field": "i64.atomic.rmw32.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "1229782938247303441"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 359, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782941362267877"}]}, + {"type": "action", "line": 363, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 364, "action": {"type": "invoke", "field": "i32.atomic.rmw.cmpxchg", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "286331153"}, {"type": "i32", "value": "305419896"}]}, "expected": [{"type": "i32", "value": "286331153"}]}, + {"type": "assert_return", "line": 365, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938266392184"}]}, + {"type": "action", "line": 367, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 368, "action": {"type": "invoke", "field": "i64.atomic.rmw.cmpxchg", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "1229782938247303441"}, {"type": "i64", "value": "72340172854919682"}]}, "expected": [{"type": "i64", "value": "1229782938247303441"}]}, + {"type": "assert_return", "line": 369, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "72340172854919682"}]}, + {"type": "action", "line": 371, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 372, "action": {"type": "invoke", "field": "i32.atomic.rmw8.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "17"}, {"type": "i32", "value": "3452816845"}]}, "expected": [{"type": "i32", "value": "17"}]}, + {"type": "assert_return", "line": 373, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303629"}]}, + {"type": "action", "line": 375, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 376, "action": {"type": "invoke", "field": "i32.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "4369"}, {"type": "i32", "value": "3405695742"}]}, "expected": [{"type": "i32", "value": "4369"}]}, + {"type": "assert_return", "line": 377, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247351038"}]}, + {"type": "action", "line": 379, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 380, "action": {"type": "invoke", "field": "i64.atomic.rmw8.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "17"}, {"type": "i64", "value": "4774451407313060418"}]}, "expected": [{"type": "i64", "value": "17"}]}, + {"type": "assert_return", "line": 381, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247303490"}]}, + {"type": "action", "line": 383, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 384, "action": {"type": "invoke", "field": "i64.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "4369"}, {"type": "i64", "value": "13758425323549998831"}]}, "expected": [{"type": "i64", "value": "4369"}]}, + {"type": "assert_return", "line": 385, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782938247347951"}]}, + {"type": "action", "line": 387, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "1229782938247303441"}]}, "expected": []}, + {"type": "assert_return", "line": 388, "action": {"type": "invoke", "field": "i64.atomic.rmw32.cmpxchg_u", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "286331153"}, {"type": "i64", "value": "14608453322185352933"}]}, "expected": [{"type": "i64", "value": "286331153"}]}, + {"type": "assert_return", "line": 389, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i64", "value": "1229782941362267877"}]}, + {"type": "assert_trap", "line": 394, "action": {"type": "invoke", "field": "i32.atomic.load", "args": [{"type": "i32", "value": "1"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 395, "action": {"type": "invoke", "field": "i64.atomic.load", "args": [{"type": "i32", "value": "1"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 396, "action": {"type": "invoke", "field": "i32.atomic.load16_u", "args": [{"type": "i32", "value": "1"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 397, "action": {"type": "invoke", "field": "i64.atomic.load16_u", "args": [{"type": "i32", "value": "1"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 398, "action": {"type": "invoke", "field": "i64.atomic.load32_u", "args": [{"type": "i32", "value": "1"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 399, "action": {"type": "invoke", "field": "i32.atomic.store", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": []}, + {"type": "assert_trap", "line": 400, "action": {"type": "invoke", "field": "i64.atomic.store", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": []}, + {"type": "assert_trap", "line": 401, "action": {"type": "invoke", "field": "i32.atomic.store16", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": []}, + {"type": "assert_trap", "line": 402, "action": {"type": "invoke", "field": "i64.atomic.store16", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": []}, + {"type": "assert_trap", "line": 403, "action": {"type": "invoke", "field": "i64.atomic.store32", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": []}, + {"type": "assert_trap", "line": 404, "action": {"type": "invoke", "field": "i32.atomic.rmw.add", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 405, "action": {"type": "invoke", "field": "i64.atomic.rmw.add", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 406, "action": {"type": "invoke", "field": "i32.atomic.rmw16.add_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 407, "action": {"type": "invoke", "field": "i64.atomic.rmw16.add_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 408, "action": {"type": "invoke", "field": "i64.atomic.rmw32.add_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 409, "action": {"type": "invoke", "field": "i32.atomic.rmw.sub", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 410, "action": {"type": "invoke", "field": "i64.atomic.rmw.sub", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 411, "action": {"type": "invoke", "field": "i32.atomic.rmw16.sub_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 412, "action": {"type": "invoke", "field": "i64.atomic.rmw16.sub_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 413, "action": {"type": "invoke", "field": "i64.atomic.rmw32.sub_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 414, "action": {"type": "invoke", "field": "i32.atomic.rmw.and", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 415, "action": {"type": "invoke", "field": "i64.atomic.rmw.and", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 416, "action": {"type": "invoke", "field": "i32.atomic.rmw16.and_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 417, "action": {"type": "invoke", "field": "i64.atomic.rmw16.and_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 418, "action": {"type": "invoke", "field": "i64.atomic.rmw32.and_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 419, "action": {"type": "invoke", "field": "i32.atomic.rmw.or", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 420, "action": {"type": "invoke", "field": "i64.atomic.rmw.or", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 421, "action": {"type": "invoke", "field": "i32.atomic.rmw16.or_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 422, "action": {"type": "invoke", "field": "i64.atomic.rmw16.or_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 423, "action": {"type": "invoke", "field": "i64.atomic.rmw32.or_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 424, "action": {"type": "invoke", "field": "i32.atomic.rmw.xor", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 425, "action": {"type": "invoke", "field": "i64.atomic.rmw.xor", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 426, "action": {"type": "invoke", "field": "i32.atomic.rmw16.xor_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 427, "action": {"type": "invoke", "field": "i64.atomic.rmw16.xor_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 428, "action": {"type": "invoke", "field": "i64.atomic.rmw32.xor_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 429, "action": {"type": "invoke", "field": "i32.atomic.rmw.xchg", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 430, "action": {"type": "invoke", "field": "i64.atomic.rmw.xchg", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 431, "action": {"type": "invoke", "field": "i32.atomic.rmw16.xchg_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 432, "action": {"type": "invoke", "field": "i64.atomic.rmw16.xchg_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 433, "action": {"type": "invoke", "field": "i64.atomic.rmw32.xchg_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 434, "action": {"type": "invoke", "field": "i32.atomic.rmw.cmpxchg", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 435, "action": {"type": "invoke", "field": "i64.atomic.rmw.cmpxchg", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 436, "action": {"type": "invoke", "field": "i32.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "1"}, {"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 437, "action": {"type": "invoke", "field": "i64.atomic.rmw16.cmpxchg_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "assert_trap", "line": 438, "action": {"type": "invoke", "field": "i64.atomic.rmw32.cmpxchg_u", "args": [{"type": "i32", "value": "1"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i64"}]}, + {"type": "module", "line": 441, "filename": "atomic.1.wasm"}, + {"type": "module", "line": 494, "filename": "atomic.2.wasm"}, + {"type": "assert_return", "line": 498, "action": {"type": "invoke", "field": "fence", "args": []}, "expected": []}, + {"type": "assert_invalid", "line": 501, "filename": "atomic.3.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 502, "filename": "atomic.4.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 503, "filename": "atomic.5.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 504, "filename": "atomic.6.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 505, "filename": "atomic.7.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 506, "filename": "atomic.8.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 507, "filename": "atomic.9.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 508, "filename": "atomic.10.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 509, "filename": "atomic.11.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 510, "filename": "atomic.12.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 511, "filename": "atomic.13.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 512, "filename": "atomic.14.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 513, "filename": "atomic.15.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 514, "filename": "atomic.16.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 515, "filename": "atomic.17.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 516, "filename": "atomic.18.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 517, "filename": "atomic.19.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 518, "filename": "atomic.20.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 519, "filename": "atomic.21.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 520, "filename": "atomic.22.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 521, "filename": "atomic.23.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 522, "filename": "atomic.24.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 523, "filename": "atomic.25.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 524, "filename": "atomic.26.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 525, "filename": "atomic.27.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 526, "filename": "atomic.28.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 527, "filename": "atomic.29.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 528, "filename": "atomic.30.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 529, "filename": "atomic.31.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 530, "filename": "atomic.32.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 531, "filename": "atomic.33.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 532, "filename": "atomic.34.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 533, "filename": "atomic.35.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 534, "filename": "atomic.36.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 535, "filename": "atomic.37.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 536, "filename": "atomic.38.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 537, "filename": "atomic.39.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 538, "filename": "atomic.40.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 539, "filename": "atomic.41.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 540, "filename": "atomic.42.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 541, "filename": "atomic.43.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 542, "filename": "atomic.44.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 543, "filename": "atomic.45.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 544, "filename": "atomic.46.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 545, "filename": "atomic.47.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 546, "filename": "atomic.48.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 547, "filename": "atomic.49.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 548, "filename": "atomic.50.wasm", "text": "unknown memory", "module_type": "binary"}]} diff --git a/threads/atomic/atomic.wast b/threads/atomic/atomic.wast new file mode 100644 index 00000000..4691eb25 --- /dev/null +++ b/threads/atomic/atomic.wast @@ -0,0 +1,548 @@ +;; atomic operations + +(module + (memory 1 1 shared) + + (func (export "init") (param $value i64) (i64.store (i32.const 0) (local.get $value))) + + (func (export "i32.atomic.load") (param $addr i32) (result i32) (i32.atomic.load (local.get $addr))) + (func (export "i64.atomic.load") (param $addr i32) (result i64) (i64.atomic.load (local.get $addr))) + (func (export "i32.atomic.load8_u") (param $addr i32) (result i32) (i32.atomic.load8_u (local.get $addr))) + (func (export "i32.atomic.load16_u") (param $addr i32) (result i32) (i32.atomic.load16_u (local.get $addr))) + (func (export "i64.atomic.load8_u") (param $addr i32) (result i64) (i64.atomic.load8_u (local.get $addr))) + (func (export "i64.atomic.load16_u") (param $addr i32) (result i64) (i64.atomic.load16_u (local.get $addr))) + (func (export "i64.atomic.load32_u") (param $addr i32) (result i64) (i64.atomic.load32_u (local.get $addr))) + + (func (export "i32.atomic.store") (param $addr i32) (param $value i32) (i32.atomic.store (local.get $addr) (local.get $value))) + (func (export "i64.atomic.store") (param $addr i32) (param $value i64) (i64.atomic.store (local.get $addr) (local.get $value))) + (func (export "i32.atomic.store8") (param $addr i32) (param $value i32) (i32.atomic.store8 (local.get $addr) (local.get $value))) + (func (export "i32.atomic.store16") (param $addr i32) (param $value i32) (i32.atomic.store16 (local.get $addr) (local.get $value))) + (func (export "i64.atomic.store8") (param $addr i32) (param $value i64) (i64.atomic.store8 (local.get $addr) (local.get $value))) + (func (export "i64.atomic.store16") (param $addr i32) (param $value i64) (i64.atomic.store16 (local.get $addr) (local.get $value))) + (func (export "i64.atomic.store32") (param $addr i32) (param $value i64) (i64.atomic.store32 (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.add") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.add (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw.add") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.add (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw8.add_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.add_u (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw16.add_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.add_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw8.add_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.add_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw16.add_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.add_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw32.add_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.add_u (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.sub") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.sub (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw.sub") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.sub (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw8.sub_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.sub_u (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw16.sub_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.sub_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw8.sub_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.sub_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw16.sub_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.sub_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw32.sub_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.sub_u (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.and") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.and (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw.and") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.and (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw8.and_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.and_u (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw16.and_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.and_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw8.and_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.and_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw16.and_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.and_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw32.and_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.and_u (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.or") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.or (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw.or") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.or (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw8.or_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.or_u (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw16.or_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.or_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw8.or_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.or_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw16.or_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.or_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw32.or_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.or_u (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.xor") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.xor (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw.xor") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.xor (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw8.xor_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.xor_u (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw16.xor_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.xor_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw8.xor_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.xor_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw16.xor_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.xor_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw32.xor_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.xor_u (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.xchg") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.xchg (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw.xchg") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.xchg (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw8.xchg_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.xchg_u (local.get $addr) (local.get $value))) + (func (export "i32.atomic.rmw16.xchg_u") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.xchg_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw8.xchg_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.xchg_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw16.xchg_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.xchg_u (local.get $addr) (local.get $value))) + (func (export "i64.atomic.rmw32.xchg_u") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.xchg_u (local.get $addr) (local.get $value))) + + (func (export "i32.atomic.rmw.cmpxchg") (param $addr i32) (param $expected i32) (param $value i32) (result i32) (i32.atomic.rmw.cmpxchg (local.get $addr) (local.get $expected) (local.get $value))) + (func (export "i64.atomic.rmw.cmpxchg") (param $addr i32) (param $expected i64) (param $value i64) (result i64) (i64.atomic.rmw.cmpxchg (local.get $addr) (local.get $expected) (local.get $value))) + (func (export "i32.atomic.rmw8.cmpxchg_u") (param $addr i32) (param $expected i32) (param $value i32) (result i32) (i32.atomic.rmw8.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value))) + (func (export "i32.atomic.rmw16.cmpxchg_u") (param $addr i32) (param $expected i32) (param $value i32) (result i32) (i32.atomic.rmw16.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value))) + (func (export "i64.atomic.rmw8.cmpxchg_u") (param $addr i32) (param $expected i64) (param $value i64) (result i64) (i64.atomic.rmw8.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value))) + (func (export "i64.atomic.rmw16.cmpxchg_u") (param $addr i32) (param $expected i64) (param $value i64) (result i64) (i64.atomic.rmw16.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value))) + (func (export "i64.atomic.rmw32.cmpxchg_u") (param $addr i32) (param $expected i64) (param $value i64) (result i64) (i64.atomic.rmw32.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value))) + +) + +;; *.atomic.load* + +(invoke "init" (i64.const 0x0706050403020100)) + +(assert_return (invoke "i32.atomic.load" (i32.const 0)) (i32.const 0x03020100)) +(assert_return (invoke "i32.atomic.load" (i32.const 4)) (i32.const 0x07060504)) + +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0706050403020100)) + +(assert_return (invoke "i32.atomic.load8_u" (i32.const 0)) (i32.const 0x00)) +(assert_return (invoke "i32.atomic.load8_u" (i32.const 5)) (i32.const 0x05)) + +(assert_return (invoke "i32.atomic.load16_u" (i32.const 0)) (i32.const 0x0100)) +(assert_return (invoke "i32.atomic.load16_u" (i32.const 6)) (i32.const 0x0706)) + +(assert_return (invoke "i64.atomic.load8_u" (i32.const 0)) (i64.const 0x00)) +(assert_return (invoke "i64.atomic.load8_u" (i32.const 5)) (i64.const 0x05)) + +(assert_return (invoke "i64.atomic.load16_u" (i32.const 0)) (i64.const 0x0100)) +(assert_return (invoke "i64.atomic.load16_u" (i32.const 6)) (i64.const 0x0706)) + +(assert_return (invoke "i64.atomic.load32_u" (i32.const 0)) (i64.const 0x03020100)) +(assert_return (invoke "i64.atomic.load32_u" (i32.const 4)) (i64.const 0x07060504)) + +;; *.atomic.store* + +(invoke "init" (i64.const 0x0000000000000000)) + +(assert_return (invoke "i32.atomic.store" (i32.const 0) (i32.const 0xffeeddcc))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x00000000ffeeddcc)) + +(assert_return (invoke "i64.atomic.store" (i32.const 0) (i64.const 0x0123456789abcdef))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0123456789abcdef)) + +(assert_return (invoke "i32.atomic.store8" (i32.const 1) (i32.const 0x42))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0123456789ab42ef)) + +(assert_return (invoke "i32.atomic.store16" (i32.const 4) (i32.const 0x8844))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0123884489ab42ef)) + +(assert_return (invoke "i64.atomic.store8" (i32.const 1) (i64.const 0x99))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0123884489ab99ef)) + +(assert_return (invoke "i64.atomic.store16" (i32.const 4) (i64.const 0xcafe))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0123cafe89ab99ef)) + +(assert_return (invoke "i64.atomic.store32" (i32.const 4) (i64.const 0xdeadbeef))) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0xdeadbeef89ab99ef)) + +;; *.atomic.rmw*.add + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.add" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111123456789)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.add" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1212121213131313)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.add_u" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111de)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.add_u" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111dc0f)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.add_u" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111153)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.add_u" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111d000)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.add_u" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111dbccb7f6)) + +;; *.atomic.rmw*.sub + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.sub" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111fedcba99)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.sub" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x101010100f0f0f0f)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.sub_u" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111144)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.sub_u" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111114613)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.sub_u" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111cf)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.sub_u" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111115222)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.sub_u" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111146556a2c)) + +;; *.atomic.rmw*.and + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.and" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111110101010)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.and" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0101010100000000)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.and_u" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111101)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.and_u" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111110010)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.and_u" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111100)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.and_u" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111001)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.and_u" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111100110001)) + +;; *.atomic.rmw*.or + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.or" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111113355779)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.or" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111113131313)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.or_u" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111dd)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.or_u" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111dbff)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.or_u" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111153)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.or_u" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111bfff)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.or_u" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111dbbbb7f5)) + +;; *.atomic.rmw*.xor + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.xor" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111103254769)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.xor" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1010101013131313)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.xor_u" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111dc)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.xor_u" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111dbef)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.xor_u" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111153)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.xor_u" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111affe)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.xor_u" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111dbaab7f4)) + +;; *.atomic.rmw*.xchg + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.xchg" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111112345678)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.xchg" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0101010102020202)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.xchg_u" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111cd)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.xchg_u" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111cafe)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.xchg_u" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111142)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.xchg_u" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111beef)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.xchg_u" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111cabba6e5)) + +;; *.atomic.rmw*.cmpxchg (compare false) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.cmpxchg" (i32.const 0) (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.cmpxchg" (i32.const 0) (i64.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.cmpxchg_u" (i32.const 0) (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.cmpxchg_u" (i32.const 0) (i32.const 0x11111111) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111cd)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.cmpxchg_u" (i32.const 0) (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.cmpxchg_u" (i32.const 0) (i32.const 0x11111111) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111cafe)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.cmpxchg_u" (i32.const 0) (i64.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.cmpxchg_u" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111142)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.cmpxchg_u" (i32.const 0) (i64.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.cmpxchg_u" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111beef)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.cmpxchg_u" (i32.const 0) (i64.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111111)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.cmpxchg_u" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111cabba6e5)) + +;; *.atomic.rmw*.cmpxchg (compare true) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw.cmpxchg" (i32.const 0) (i32.const 0x11111111) (i32.const 0x12345678)) (i32.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111112345678)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw.cmpxchg" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x0101010102020202)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw8.cmpxchg_u" (i32.const 0) (i32.const 0x11) (i32.const 0xcdcdcdcd)) (i32.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111111111cd)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i32.atomic.rmw16.cmpxchg_u" (i32.const 0) (i32.const 0x1111) (i32.const 0xcafecafe)) (i32.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111cafe)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw8.cmpxchg_u" (i32.const 0) (i64.const 0x11) (i64.const 0x4242424242424242)) (i64.const 0x11)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x1111111111111142)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw16.cmpxchg_u" (i32.const 0) (i64.const 0x1111) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x111111111111beef)) + +(invoke "init" (i64.const 0x1111111111111111)) +(assert_return (invoke "i64.atomic.rmw32.cmpxchg_u" (i32.const 0) (i64.const 0x11111111) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111)) +(assert_return (invoke "i64.atomic.load" (i32.const 0)) (i64.const 0x11111111cabba6e5)) + + +;; unaligned accesses + +(assert_trap (invoke "i32.atomic.load" (i32.const 1)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.load" (i32.const 1)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.load16_u" (i32.const 1)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.load16_u" (i32.const 1)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.load32_u" (i32.const 1)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.store" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.store" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.store16" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.store16" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.store32" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.add" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.add" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.add_u" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.add_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.add_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.sub" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.sub" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.sub_u" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.sub_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.sub_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.and" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.and" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.and_u" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.and_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.and_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.or" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.or" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.or_u" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.or_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.or_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.xor" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.xor" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.xor_u" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.xor_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.xor_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.xchg" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.xchg" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.xchg_u" (i32.const 1) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.xchg_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.xchg_u" (i32.const 1) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw.cmpxchg" (i32.const 1) (i32.const 0) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw.cmpxchg" (i32.const 1) (i64.const 0) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i32.atomic.rmw16.cmpxchg_u" (i32.const 1) (i32.const 0) (i32.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw16.cmpxchg_u" (i32.const 1) (i64.const 0) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "i64.atomic.rmw32.cmpxchg_u" (i32.const 1) (i64.const 0) (i64.const 0)) "unaligned atomic") + +;; unshared memory is OK +(module + (memory 1 1) + (func (drop (memory.atomic.notify (i32.const 0) (i32.const 0)))) + (func (drop (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 0)))) + (func (drop (memory.atomic.wait64 (i32.const 0) (i64.const 0) (i64.const 0)))) + (func (drop (i32.atomic.load (i32.const 0)))) + (func (drop (i64.atomic.load (i32.const 0)))) + (func (drop (i32.atomic.load16_u (i32.const 0)))) + (func (drop (i64.atomic.load16_u (i32.const 0)))) + (func (drop (i64.atomic.load32_u (i32.const 0)))) + (func (i32.atomic.store (i32.const 0) (i32.const 0))) + (func (i64.atomic.store (i32.const 0) (i64.const 0))) + (func (i32.atomic.store16 (i32.const 0) (i32.const 0))) + (func (i64.atomic.store16 (i32.const 0) (i64.const 0))) + (func (i64.atomic.store32 (i32.const 0) (i64.const 0))) + (func (drop (i32.atomic.rmw.add (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.add (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.add_u (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.add_u (i32.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.add_u (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw.sub (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.sub (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.sub_u (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.sub_u (i32.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.sub_u (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw.and (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.and (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.and_u (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.and_u (i32.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.and_u (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw.or (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.or (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.or_u (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.or_u (i32.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.or_u (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw.xor (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.xor (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.xor_u (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.xor_u (i32.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.xor_u (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw.xchg (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.xchg (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.xchg_u (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.xchg_u (i32.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.xchg_u (i32.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw.cmpxchg (i32.const 0) (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw.cmpxchg (i32.const 0) (i64.const 0) (i64.const 0)))) + (func (drop (i32.atomic.rmw16.cmpxchg_u (i32.const 0) (i32.const 0) (i32.const 0)))) + (func (drop (i64.atomic.rmw16.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0)))) + (func (drop (i64.atomic.rmw32.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0)))) +) + +;; atomic.fence: no memory is ok +(module + (func (export "fence") (atomic.fence)) +) + +(assert_return (invoke "fence")) + +;; Fails with no memory +(assert_invalid (module (func (drop (memory.atomic.notify (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (memory.atomic.wait64 (i32.const 0) (i64.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.load (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.load (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.load16_u (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.load16_u (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.load32_u (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (i32.atomic.store (i32.const 0) (i32.const 0)))) "unknown memory") +(assert_invalid (module (func (i64.atomic.store (i32.const 0) (i64.const 0)))) "unknown memory") +(assert_invalid (module (func (i32.atomic.store16 (i32.const 0) (i32.const 0)))) "unknown memory") +(assert_invalid (module (func (i64.atomic.store16 (i32.const 0) (i64.const 0)))) "unknown memory") +(assert_invalid (module (func (i64.atomic.store32 (i32.const 0) (i64.const 0)))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.add (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.add (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.add_u (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.add_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.add_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.sub (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.sub (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.sub_u (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.sub_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.sub_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.and (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.and (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.and_u (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.and_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.and_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.or (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.or (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.or_u (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.or_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.or_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.xor (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.xor (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.xor_u (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.xor_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.xor_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.xchg (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.xchg (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.xchg_u (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.xchg_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.xchg_u (i32.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw.cmpxchg (i32.const 0) (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw.cmpxchg (i32.const 0) (i64.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i32.atomic.rmw16.cmpxchg_u (i32.const 0) (i32.const 0) (i32.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw16.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0))))) "unknown memory") +(assert_invalid (module (func (drop (i64.atomic.rmw32.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0))))) "unknown memory") diff --git a/threads/atomic_wait_notify/atomic_wait_notify.0.wasm b/threads/atomic_wait_notify/atomic_wait_notify.0.wasm new file mode 100644 index 00000000..4c6ed8f9 Binary files /dev/null and b/threads/atomic_wait_notify/atomic_wait_notify.0.wasm differ diff --git a/threads/atomic_wait_notify/atomic_wait_notify.1.wasm b/threads/atomic_wait_notify/atomic_wait_notify.1.wasm new file mode 100644 index 00000000..d1b9f64b Binary files /dev/null and b/threads/atomic_wait_notify/atomic_wait_notify.1.wasm differ diff --git a/threads/atomic_wait_notify/atomic_wait_notify.2.wasm b/threads/atomic_wait_notify/atomic_wait_notify.2.wasm new file mode 100644 index 00000000..fb23a671 Binary files /dev/null and b/threads/atomic_wait_notify/atomic_wait_notify.2.wasm differ diff --git a/threads/atomic_wait_notify/atomic_wait_notify.json b/threads/atomic_wait_notify/atomic_wait_notify.json new file mode 100644 index 00000000..1edd4fd7 --- /dev/null +++ b/threads/atomic_wait_notify/atomic_wait_notify.json @@ -0,0 +1,24 @@ +{"source_filename": "atomic_wait_notify.wast", + "commands": [ + {"type": "module", "line": 2, "filename": "atomic_wait_notify.0.wasm"}, + {"type": "action", "line": 15, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "281474976710655"}]}, "expected": []}, + {"type": "assert_return", "line": 18, "action": {"type": "invoke", "field": "memory.atomic.wait32", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 19, "action": {"type": "invoke", "field": "memory.atomic.wait64", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 22, "action": {"type": "invoke", "field": "memory.atomic.wait32", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "4294967295"}, {"type": "i64", "value": "10"}]}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "assert_return", "line": 23, "action": {"type": "invoke", "field": "memory.atomic.wait64", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "281474976710655"}, {"type": "i64", "value": "10"}]}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "assert_return", "line": 26, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 27, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_trap", "line": 30, "action": {"type": "invoke", "field": "memory.atomic.wait32", "args": [{"type": "i32", "value": "65536"}, {"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 31, "action": {"type": "invoke", "field": "memory.atomic.wait64", "args": [{"type": "i32", "value": "65536"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 34, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "65536"}, {"type": "i32", "value": "0"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 37, "action": {"type": "invoke", "field": "memory.atomic.wait32", "args": [{"type": "i32", "value": "65531"}, {"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 38, "action": {"type": "invoke", "field": "memory.atomic.wait64", "args": [{"type": "i32", "value": "65524"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 40, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "65531"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "module", "line": 43, "filename": "atomic_wait_notify.1.wasm"}, + {"type": "action", "line": 56, "action": {"type": "invoke", "field": "init", "args": [{"type": "i64", "value": "281474976710655"}]}, "expected": []}, + {"type": "assert_trap", "line": 58, "action": {"type": "invoke", "field": "memory.atomic.wait32", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "expected shared memory", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 59, "action": {"type": "invoke", "field": "memory.atomic.wait64", "args": [{"type": "i32", "value": "0"}, {"type": "i64", "value": "0"}, {"type": "i64", "value": "0"}]}, "text": "expected shared memory", "expected": [{"type": "i32"}]}, + {"type": "assert_return", "line": 62, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_trap", "line": 65, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "65536"}, {"type": "i32", "value": "0"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 66, "action": {"type": "invoke", "field": "memory.atomic.notify", "args": [{"type": "i32", "value": "65531"}, {"type": "i32", "value": "0"}]}, "text": "unaligned atomic", "expected": [{"type": "i32"}]}, + {"type": "module", "line": 69, "name": "$Mem", "filename": "atomic_wait_notify.2.wasm"}]} diff --git a/threads/atomic_wait_notify/atomic_wait_notify.wast b/threads/atomic_wait_notify/atomic_wait_notify.wast new file mode 100644 index 00000000..2e312c37 --- /dev/null +++ b/threads/atomic_wait_notify/atomic_wait_notify.wast @@ -0,0 +1,108 @@ +;; wait/notify +(module + (memory 1 1 shared) + + (func (export "init") (param $value i64) (i64.store (i32.const 0) (local.get $value))) + + (func (export "memory.atomic.notify") (param $addr i32) (param $count i32) (result i32) + (memory.atomic.notify (local.get 0) (local.get 1))) + (func (export "memory.atomic.wait32") (param $addr i32) (param $expected i32) (param $timeout i64) (result i32) + (memory.atomic.wait32 (local.get 0) (local.get 1) (local.get 2))) + (func (export "memory.atomic.wait64") (param $addr i32) (param $expected i64) (param $timeout i64) (result i32) + (memory.atomic.wait64 (local.get 0) (local.get 1) (local.get 2))) +) + +(invoke "init" (i64.const 0xffffffffffff)) + +;; wait returns immediately if values do not match +(assert_return (invoke "memory.atomic.wait32" (i32.const 0) (i32.const 0) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "memory.atomic.wait64" (i32.const 0) (i64.const 0) (i64.const 0)) (i32.const 1)) + +;; wait times out if values do match and timeout is small +(assert_return (invoke "memory.atomic.wait32" (i32.const 0) (i32.const 0xffffffff) (i64.const 10)) (i32.const 2)) +(assert_return (invoke "memory.atomic.wait64" (i32.const 0) (i64.const 0xffffffffffff) (i64.const 10)) (i32.const 2)) + +;; notify always returns +(assert_return (invoke "memory.atomic.notify" (i32.const 0) (i32.const 0)) (i32.const 0)) +(assert_return (invoke "memory.atomic.notify" (i32.const 0) (i32.const 10)) (i32.const 0)) + +;; OOB wait and notify always trap +(assert_trap (invoke "memory.atomic.wait32" (i32.const 65536) (i32.const 0) (i64.const 0)) "out of bounds memory access") +(assert_trap (invoke "memory.atomic.wait64" (i32.const 65536) (i64.const 0) (i64.const 0)) "out of bounds memory access") + +;; in particular, notify always traps even if waking 0 threads +(assert_trap (invoke "memory.atomic.notify" (i32.const 65536) (i32.const 0)) "out of bounds memory access") + +;; similarly, unaligned wait and notify always trap +(assert_trap (invoke "memory.atomic.wait32" (i32.const 65531) (i32.const 0) (i64.const 0)) "unaligned atomic") +(assert_trap (invoke "memory.atomic.wait64" (i32.const 65524) (i64.const 0) (i64.const 0)) "unaligned atomic") + +(assert_trap (invoke "memory.atomic.notify" (i32.const 65531) (i32.const 0)) "unaligned atomic") + +;; atomic.wait traps on unshared memory even if it wouldn't block +(module + (memory 1 1) + + (func (export "init") (param $value i64) (i64.store (i32.const 0) (local.get $value))) + + (func (export "memory.atomic.notify") (param $addr i32) (param $count i32) (result i32) + (memory.atomic.notify (local.get 0) (local.get 1))) + (func (export "memory.atomic.wait32") (param $addr i32) (param $expected i32) (param $timeout i64) (result i32) + (memory.atomic.wait32 (local.get 0) (local.get 1) (local.get 2))) + (func (export "memory.atomic.wait64") (param $addr i32) (param $expected i64) (param $timeout i64) (result i32) + (memory.atomic.wait64 (local.get 0) (local.get 1) (local.get 2))) +) + +(invoke "init" (i64.const 0xffffffffffff)) + +(assert_trap (invoke "memory.atomic.wait32" (i32.const 0) (i32.const 0) (i64.const 0)) "expected shared memory") +(assert_trap (invoke "memory.atomic.wait64" (i32.const 0) (i64.const 0) (i64.const 0)) "expected shared memory") + +;; notify still works +(assert_return (invoke "memory.atomic.notify" (i32.const 0) (i32.const 0)) (i32.const 0)) + +;; OOB and unaligned notify still trap +(assert_trap (invoke "memory.atomic.notify" (i32.const 65536) (i32.const 0)) "out of bounds memory access") +(assert_trap (invoke "memory.atomic.notify" (i32.const 65531) (i32.const 0)) "unaligned atomic") + +;; test that looping notify eventually unblocks a parallel waiting thread +(module $Mem + (memory (export "shared") 1 1 shared) +) + +(thread $T1 (shared (module $Mem)) + (register "mem" $Mem) + (module + (memory (import "mem" "shared") 1 10 shared) + (func (export "run") (result i32) + (memory.atomic.wait32 (i32.const 0) (i32.const 0) (i64.const -1)) + ) + ) + ;; test that this thread eventually gets unblocked + (assert_return (invoke "run") (i32.const 0)) +) + +(thread $T2 (shared (module $Mem)) + (register "mem" $Mem) + (module + (memory (import "mem" "shared") 1 1 shared) + (func (export "notify-0") (result i32) + (memory.atomic.notify (i32.const 0) (i32.const 0)) + ) + (func (export "notify-1-while") + (loop + (i32.const 1) + (memory.atomic.notify (i32.const 0) (i32.const 1)) + (i32.ne) + (br_if 0) + ) + ) + ) + ;; notifying with a count of 0 will not unblock + (assert_return (invoke "notify-0") (i32.const 0)) + ;; loop until something is notified + (assert_return (invoke "notify-1-while")) +) + +(wait $T1) +(wait $T2) diff --git a/threads/exports/exports.0.wasm b/threads/exports/exports.0.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.0.wasm differ diff --git a/threads/exports/exports.1.wasm b/threads/exports/exports.1.wasm new file mode 100644 index 00000000..505f4fe7 Binary files /dev/null and b/threads/exports/exports.1.wasm differ diff --git a/threads/exports/exports.10.wasm b/threads/exports/exports.10.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.10.wasm differ diff --git a/threads/exports/exports.11.wasm b/threads/exports/exports.11.wasm new file mode 100644 index 00000000..615bb04c Binary files /dev/null and b/threads/exports/exports.11.wasm differ diff --git a/threads/exports/exports.12.wasm b/threads/exports/exports.12.wasm new file mode 100644 index 00000000..d8fc92d0 Binary files /dev/null and b/threads/exports/exports.12.wasm differ diff --git a/threads/exports/exports.13.wasm b/threads/exports/exports.13.wasm new file mode 100644 index 00000000..d8fc92d0 Binary files /dev/null and b/threads/exports/exports.13.wasm differ diff --git a/threads/exports/exports.14.wasm b/threads/exports/exports.14.wasm new file mode 100644 index 00000000..f7ea7e89 Binary files /dev/null and b/threads/exports/exports.14.wasm differ diff --git a/threads/exports/exports.15.wasm b/threads/exports/exports.15.wasm new file mode 100644 index 00000000..1ea99a77 Binary files /dev/null and b/threads/exports/exports.15.wasm differ diff --git a/threads/exports/exports.16.wasm b/threads/exports/exports.16.wasm new file mode 100644 index 00000000..bdbe2fe5 Binary files /dev/null and b/threads/exports/exports.16.wasm differ diff --git a/threads/exports/exports.17.wasm b/threads/exports/exports.17.wasm new file mode 100644 index 00000000..4670c7c1 Binary files /dev/null and b/threads/exports/exports.17.wasm differ diff --git a/threads/exports/exports.18.wasm b/threads/exports/exports.18.wasm new file mode 100644 index 00000000..5ff35c41 Binary files /dev/null and b/threads/exports/exports.18.wasm differ diff --git a/threads/exports/exports.19.wasm b/threads/exports/exports.19.wasm new file mode 100644 index 00000000..526226b5 Binary files /dev/null and b/threads/exports/exports.19.wasm differ diff --git a/threads/exports/exports.2.wasm b/threads/exports/exports.2.wasm new file mode 100644 index 00000000..0ec4916e Binary files /dev/null and b/threads/exports/exports.2.wasm differ diff --git a/threads/exports/exports.20.wasm b/threads/exports/exports.20.wasm new file mode 100644 index 00000000..fd54b55a Binary files /dev/null and b/threads/exports/exports.20.wasm differ diff --git a/threads/exports/exports.21.wasm b/threads/exports/exports.21.wasm new file mode 100644 index 00000000..4abb7ed1 Binary files /dev/null and b/threads/exports/exports.21.wasm differ diff --git a/threads/exports/exports.22.wasm b/threads/exports/exports.22.wasm new file mode 100644 index 00000000..775694a6 Binary files /dev/null and b/threads/exports/exports.22.wasm differ diff --git a/threads/exports/exports.23.wasm b/threads/exports/exports.23.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.23.wasm differ diff --git a/threads/exports/exports.24.wasm b/threads/exports/exports.24.wasm new file mode 100644 index 00000000..f1bae6aa Binary files /dev/null and b/threads/exports/exports.24.wasm differ diff --git a/threads/exports/exports.25.wasm b/threads/exports/exports.25.wasm new file mode 100644 index 00000000..3c2410be Binary files /dev/null and b/threads/exports/exports.25.wasm differ diff --git a/threads/exports/exports.26.wasm b/threads/exports/exports.26.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.26.wasm differ diff --git a/threads/exports/exports.27.wasm b/threads/exports/exports.27.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.27.wasm differ diff --git a/threads/exports/exports.28.wasm b/threads/exports/exports.28.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.28.wasm differ diff --git a/threads/exports/exports.29.wasm b/threads/exports/exports.29.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.29.wasm differ diff --git a/threads/exports/exports.3.wasm b/threads/exports/exports.3.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.3.wasm differ diff --git a/threads/exports/exports.30.wasm b/threads/exports/exports.30.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.30.wasm differ diff --git a/threads/exports/exports.31.wasm b/threads/exports/exports.31.wasm new file mode 100644 index 00000000..a2f90fe1 Binary files /dev/null and b/threads/exports/exports.31.wasm differ diff --git a/threads/exports/exports.32.wasm b/threads/exports/exports.32.wasm new file mode 100644 index 00000000..a9893a2a Binary files /dev/null and b/threads/exports/exports.32.wasm differ diff --git a/threads/exports/exports.33.wasm b/threads/exports/exports.33.wasm new file mode 100644 index 00000000..d8fc92d0 Binary files /dev/null and b/threads/exports/exports.33.wasm differ diff --git a/threads/exports/exports.34.wasm b/threads/exports/exports.34.wasm new file mode 100644 index 00000000..d8fc92d0 Binary files /dev/null and b/threads/exports/exports.34.wasm differ diff --git a/threads/exports/exports.35.wasm b/threads/exports/exports.35.wasm new file mode 100644 index 00000000..e429246d Binary files /dev/null and b/threads/exports/exports.35.wasm differ diff --git a/threads/exports/exports.36.wasm b/threads/exports/exports.36.wasm new file mode 100644 index 00000000..38002d4a Binary files /dev/null and b/threads/exports/exports.36.wasm differ diff --git a/threads/exports/exports.37.wasm b/threads/exports/exports.37.wasm new file mode 100644 index 00000000..728410f5 Binary files /dev/null and b/threads/exports/exports.37.wasm differ diff --git a/threads/exports/exports.38.wasm b/threads/exports/exports.38.wasm new file mode 100644 index 00000000..545e7b7d Binary files /dev/null and b/threads/exports/exports.38.wasm differ diff --git a/threads/exports/exports.39.wasm b/threads/exports/exports.39.wasm new file mode 100644 index 00000000..834177e7 Binary files /dev/null and b/threads/exports/exports.39.wasm differ diff --git a/threads/exports/exports.4.wasm b/threads/exports/exports.4.wasm new file mode 100644 index 00000000..153cdd1e Binary files /dev/null and b/threads/exports/exports.4.wasm differ diff --git a/threads/exports/exports.40.wasm b/threads/exports/exports.40.wasm new file mode 100644 index 00000000..ca38a77c Binary files /dev/null and b/threads/exports/exports.40.wasm differ diff --git a/threads/exports/exports.41.wasm b/threads/exports/exports.41.wasm new file mode 100644 index 00000000..8cbe00e5 Binary files /dev/null and b/threads/exports/exports.41.wasm differ diff --git a/threads/exports/exports.42.wasm b/threads/exports/exports.42.wasm new file mode 100644 index 00000000..af239591 Binary files /dev/null and b/threads/exports/exports.42.wasm differ diff --git a/threads/exports/exports.43.wasm b/threads/exports/exports.43.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.43.wasm differ diff --git a/threads/exports/exports.44.wasm b/threads/exports/exports.44.wasm new file mode 100644 index 00000000..1f2cfccf Binary files /dev/null and b/threads/exports/exports.44.wasm differ diff --git a/threads/exports/exports.45.wasm b/threads/exports/exports.45.wasm new file mode 100644 index 00000000..44ace6ec Binary files /dev/null and b/threads/exports/exports.45.wasm differ diff --git a/threads/exports/exports.46.wasm b/threads/exports/exports.46.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.46.wasm differ diff --git a/threads/exports/exports.47.wasm b/threads/exports/exports.47.wasm new file mode 100644 index 00000000..48fb7293 Binary files /dev/null and b/threads/exports/exports.47.wasm differ diff --git a/threads/exports/exports.48.wasm b/threads/exports/exports.48.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.48.wasm differ diff --git a/threads/exports/exports.49.wasm b/threads/exports/exports.49.wasm new file mode 100644 index 00000000..48fb7293 Binary files /dev/null and b/threads/exports/exports.49.wasm differ diff --git a/threads/exports/exports.5.wasm b/threads/exports/exports.5.wasm new file mode 100644 index 00000000..d1ae1c3f Binary files /dev/null and b/threads/exports/exports.5.wasm differ diff --git a/threads/exports/exports.50.wasm b/threads/exports/exports.50.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.50.wasm differ diff --git a/threads/exports/exports.51.wasm b/threads/exports/exports.51.wasm new file mode 100644 index 00000000..48fb7293 Binary files /dev/null and b/threads/exports/exports.51.wasm differ diff --git a/threads/exports/exports.52.wasm b/threads/exports/exports.52.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.52.wasm differ diff --git a/threads/exports/exports.53.wasm b/threads/exports/exports.53.wasm new file mode 100644 index 00000000..48fb7293 Binary files /dev/null and b/threads/exports/exports.53.wasm differ diff --git a/threads/exports/exports.54.wasm b/threads/exports/exports.54.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.54.wasm differ diff --git a/threads/exports/exports.55.wasm b/threads/exports/exports.55.wasm new file mode 100644 index 00000000..48fb7293 Binary files /dev/null and b/threads/exports/exports.55.wasm differ diff --git a/threads/exports/exports.56.wasm b/threads/exports/exports.56.wasm new file mode 100644 index 00000000..539a89bf Binary files /dev/null and b/threads/exports/exports.56.wasm differ diff --git a/threads/exports/exports.57.wasm b/threads/exports/exports.57.wasm new file mode 100644 index 00000000..48fb7293 Binary files /dev/null and b/threads/exports/exports.57.wasm differ diff --git a/threads/exports/exports.58.wasm b/threads/exports/exports.58.wasm new file mode 100644 index 00000000..4ab93b29 Binary files /dev/null and b/threads/exports/exports.58.wasm differ diff --git a/threads/exports/exports.59.wasm b/threads/exports/exports.59.wasm new file mode 100644 index 00000000..9dec9ee5 Binary files /dev/null and b/threads/exports/exports.59.wasm differ diff --git a/threads/exports/exports.6.wasm b/threads/exports/exports.6.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.6.wasm differ diff --git a/threads/exports/exports.60.wasm b/threads/exports/exports.60.wasm new file mode 100644 index 00000000..f45b5aa6 Binary files /dev/null and b/threads/exports/exports.60.wasm differ diff --git a/threads/exports/exports.61.wasm b/threads/exports/exports.61.wasm new file mode 100644 index 00000000..7b16c9dd Binary files /dev/null and b/threads/exports/exports.61.wasm differ diff --git a/threads/exports/exports.62.wasm b/threads/exports/exports.62.wasm new file mode 100644 index 00000000..d6b99b95 Binary files /dev/null and b/threads/exports/exports.62.wasm differ diff --git a/threads/exports/exports.63.wasm b/threads/exports/exports.63.wasm new file mode 100644 index 00000000..94a8e1b7 Binary files /dev/null and b/threads/exports/exports.63.wasm differ diff --git a/threads/exports/exports.64.wasm b/threads/exports/exports.64.wasm new file mode 100644 index 00000000..9733b5e7 Binary files /dev/null and b/threads/exports/exports.64.wasm differ diff --git a/threads/exports/exports.65.wasm b/threads/exports/exports.65.wasm new file mode 100644 index 00000000..f28390c7 Binary files /dev/null and b/threads/exports/exports.65.wasm differ diff --git a/threads/exports/exports.66.wasm b/threads/exports/exports.66.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.66.wasm differ diff --git a/threads/exports/exports.67.wasm b/threads/exports/exports.67.wasm new file mode 100644 index 00000000..6696dc1f Binary files /dev/null and b/threads/exports/exports.67.wasm differ diff --git a/threads/exports/exports.68.wasm b/threads/exports/exports.68.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.68.wasm differ diff --git a/threads/exports/exports.69.wasm b/threads/exports/exports.69.wasm new file mode 100644 index 00000000..f6bda9d1 Binary files /dev/null and b/threads/exports/exports.69.wasm differ diff --git a/threads/exports/exports.7.wasm b/threads/exports/exports.7.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.7.wasm differ diff --git a/threads/exports/exports.70.wasm b/threads/exports/exports.70.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.70.wasm differ diff --git a/threads/exports/exports.71.wasm b/threads/exports/exports.71.wasm new file mode 100644 index 00000000..f6bda9d1 Binary files /dev/null and b/threads/exports/exports.71.wasm differ diff --git a/threads/exports/exports.72.wasm b/threads/exports/exports.72.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.72.wasm differ diff --git a/threads/exports/exports.73.wasm b/threads/exports/exports.73.wasm new file mode 100644 index 00000000..f6bda9d1 Binary files /dev/null and b/threads/exports/exports.73.wasm differ diff --git a/threads/exports/exports.74.wasm b/threads/exports/exports.74.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.74.wasm differ diff --git a/threads/exports/exports.75.wasm b/threads/exports/exports.75.wasm new file mode 100644 index 00000000..f6bda9d1 Binary files /dev/null and b/threads/exports/exports.75.wasm differ diff --git a/threads/exports/exports.76.wasm b/threads/exports/exports.76.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.76.wasm differ diff --git a/threads/exports/exports.77.wasm b/threads/exports/exports.77.wasm new file mode 100644 index 00000000..f6bda9d1 Binary files /dev/null and b/threads/exports/exports.77.wasm differ diff --git a/threads/exports/exports.78.wasm b/threads/exports/exports.78.wasm new file mode 100644 index 00000000..2981c246 Binary files /dev/null and b/threads/exports/exports.78.wasm differ diff --git a/threads/exports/exports.79.wasm b/threads/exports/exports.79.wasm new file mode 100644 index 00000000..f6bda9d1 Binary files /dev/null and b/threads/exports/exports.79.wasm differ diff --git a/threads/exports/exports.8.wasm b/threads/exports/exports.8.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.8.wasm differ diff --git a/threads/exports/exports.80.wasm b/threads/exports/exports.80.wasm new file mode 100644 index 00000000..638954c4 Binary files /dev/null and b/threads/exports/exports.80.wasm differ diff --git a/threads/exports/exports.81.wasm b/threads/exports/exports.81.wasm new file mode 100644 index 00000000..638954c4 Binary files /dev/null and b/threads/exports/exports.81.wasm differ diff --git a/threads/exports/exports.82.wasm b/threads/exports/exports.82.wasm new file mode 100644 index 00000000..638954c4 Binary files /dev/null and b/threads/exports/exports.82.wasm differ diff --git a/threads/exports/exports.83.wasm b/threads/exports/exports.83.wasm new file mode 100644 index 00000000..638954c4 Binary files /dev/null and b/threads/exports/exports.83.wasm differ diff --git a/threads/exports/exports.84.wasm b/threads/exports/exports.84.wasm new file mode 100644 index 00000000..638954c4 Binary files /dev/null and b/threads/exports/exports.84.wasm differ diff --git a/threads/exports/exports.85.wasm b/threads/exports/exports.85.wasm new file mode 100644 index 00000000..638954c4 Binary files /dev/null and b/threads/exports/exports.85.wasm differ diff --git a/threads/exports/exports.86.wasm b/threads/exports/exports.86.wasm new file mode 100644 index 00000000..04759b47 Binary files /dev/null and b/threads/exports/exports.86.wasm differ diff --git a/threads/exports/exports.87.wasm b/threads/exports/exports.87.wasm new file mode 100644 index 00000000..699526de Binary files /dev/null and b/threads/exports/exports.87.wasm differ diff --git a/threads/exports/exports.88.wasm b/threads/exports/exports.88.wasm new file mode 100644 index 00000000..9692101e Binary files /dev/null and b/threads/exports/exports.88.wasm differ diff --git a/threads/exports/exports.89.wasm b/threads/exports/exports.89.wasm new file mode 100644 index 00000000..0e6c0299 Binary files /dev/null and b/threads/exports/exports.89.wasm differ diff --git a/threads/exports/exports.9.wasm b/threads/exports/exports.9.wasm new file mode 100644 index 00000000..fff82363 Binary files /dev/null and b/threads/exports/exports.9.wasm differ diff --git a/threads/exports/exports.90.wasm b/threads/exports/exports.90.wasm new file mode 100644 index 00000000..fbded776 Binary files /dev/null and b/threads/exports/exports.90.wasm differ diff --git a/threads/exports/exports.91.wasm b/threads/exports/exports.91.wasm new file mode 100644 index 00000000..0520a4ad Binary files /dev/null and b/threads/exports/exports.91.wasm differ diff --git a/threads/exports/exports.92.wasm b/threads/exports/exports.92.wasm new file mode 100644 index 00000000..1e327f93 Binary files /dev/null and b/threads/exports/exports.92.wasm differ diff --git a/threads/exports/exports.json b/threads/exports/exports.json new file mode 100644 index 00000000..025479e1 --- /dev/null +++ b/threads/exports/exports.json @@ -0,0 +1,104 @@ +{"source_filename": "exports.wast", + "commands": [ + {"type": "module", "line": 3, "filename": "exports.0.wasm"}, + {"type": "module", "line": 4, "filename": "exports.1.wasm"}, + {"type": "module", "line": 5, "filename": "exports.2.wasm"}, + {"type": "module", "line": 7, "filename": "exports.3.wasm"}, + {"type": "module", "line": 8, "filename": "exports.4.wasm"}, + {"type": "module", "line": 9, "filename": "exports.5.wasm"}, + {"type": "module", "line": 10, "filename": "exports.6.wasm"}, + {"type": "module", "line": 11, "filename": "exports.7.wasm"}, + {"type": "module", "line": 12, "filename": "exports.8.wasm"}, + {"type": "module", "line": 13, "filename": "exports.9.wasm"}, + {"type": "module", "line": 14, "filename": "exports.10.wasm"}, + {"type": "module", "line": 16, "name": "$Func", "filename": "exports.11.wasm"}, + {"type": "assert_return", "line": 22, "action": {"type": "invoke", "field": "e", "args": [{"type": "i32", "value": "42"}]}, "expected": [{"type": "i32", "value": "43"}]}, + {"type": "assert_return", "line": 23, "action": {"type": "invoke", "module": "$Func", "field": "e", "args": [{"type": "i32", "value": "42"}]}, "expected": [{"type": "i32", "value": "43"}]}, + {"type": "module", "line": 24, "filename": "exports.12.wasm"}, + {"type": "module", "line": 25, "name": "$Other1", "filename": "exports.13.wasm"}, + {"type": "assert_return", "line": 26, "action": {"type": "invoke", "module": "$Func", "field": "e", "args": [{"type": "i32", "value": "42"}]}, "expected": [{"type": "i32", "value": "43"}]}, + {"type": "module", "line": 28, "filename": "exports.14.wasm"}, + {"type": "assert_return", "line": 34, "action": {"type": "invoke", "field": "a", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "assert_return", "line": 35, "action": {"type": "invoke", "field": "b", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "assert_return", "line": 36, "action": {"type": "invoke", "field": "c", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "assert_invalid", "line": 39, "filename": "exports.15.wasm", "text": "unknown function", "module_type": "binary"}, + {"type": "assert_invalid", "line": 43, "filename": "exports.16.wasm", "text": "unknown function", "module_type": "binary"}, + {"type": "assert_invalid", "line": 47, "filename": "exports.17.wasm", "text": "unknown function", "module_type": "binary"}, + {"type": "assert_invalid", "line": 51, "filename": "exports.18.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 55, "filename": "exports.19.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 59, "filename": "exports.20.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 63, "filename": "exports.21.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 67, "filename": "exports.22.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "module", "line": 74, "filename": "exports.23.wasm"}, + {"type": "module", "line": 75, "filename": "exports.24.wasm"}, + {"type": "module", "line": 76, "filename": "exports.25.wasm"}, + {"type": "module", "line": 78, "filename": "exports.26.wasm"}, + {"type": "module", "line": 79, "filename": "exports.27.wasm"}, + {"type": "module", "line": 80, "filename": "exports.28.wasm"}, + {"type": "module", "line": 81, "filename": "exports.29.wasm"}, + {"type": "module", "line": 82, "filename": "exports.30.wasm"}, + {"type": "module", "line": 83, "filename": "exports.31.wasm"}, + {"type": "module", "line": 85, "name": "$Global", "filename": "exports.32.wasm"}, + {"type": "assert_return", "line": 89, "action": {"type": "get", "field": "e"}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "assert_return", "line": 90, "action": {"type": "get", "module": "$Global", "field": "e"}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "module", "line": 91, "filename": "exports.33.wasm"}, + {"type": "module", "line": 92, "name": "$Other2", "filename": "exports.34.wasm"}, + {"type": "assert_return", "line": 93, "action": {"type": "get", "module": "$Global", "field": "e"}, "expected": [{"type": "i32", "value": "42"}]}, + {"type": "assert_invalid", "line": 96, "filename": "exports.35.wasm", "text": "unknown global", "module_type": "binary"}, + {"type": "assert_invalid", "line": 100, "filename": "exports.36.wasm", "text": "unknown global", "module_type": "binary"}, + {"type": "assert_invalid", "line": 104, "filename": "exports.37.wasm", "text": "unknown global", "module_type": "binary"}, + {"type": "assert_invalid", "line": 108, "filename": "exports.38.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 112, "filename": "exports.39.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 116, "filename": "exports.40.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 120, "filename": "exports.41.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 124, "filename": "exports.42.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "module", "line": 131, "filename": "exports.43.wasm"}, + {"type": "module", "line": 132, "filename": "exports.44.wasm"}, + {"type": "module", "line": 133, "filename": "exports.45.wasm"}, + {"type": "module", "line": 135, "filename": "exports.46.wasm"}, + {"type": "module", "line": 136, "filename": "exports.47.wasm"}, + {"type": "module", "line": 137, "filename": "exports.48.wasm"}, + {"type": "module", "line": 138, "filename": "exports.49.wasm"}, + {"type": "module", "line": 139, "filename": "exports.50.wasm"}, + {"type": "module", "line": 140, "filename": "exports.51.wasm"}, + {"type": "module", "line": 141, "filename": "exports.52.wasm"}, + {"type": "module", "line": 142, "filename": "exports.53.wasm"}, + {"type": "module", "line": 143, "filename": "exports.54.wasm"}, + {"type": "module", "line": 144, "filename": "exports.55.wasm"}, + {"type": "module", "line": 145, "filename": "exports.56.wasm"}, + {"type": "module", "line": 146, "filename": "exports.57.wasm"}, + {"type": "assert_invalid", "line": 151, "filename": "exports.58.wasm", "text": "unknown table", "module_type": "binary"}, + {"type": "assert_invalid", "line": 155, "filename": "exports.59.wasm", "text": "unknown table", "module_type": "binary"}, + {"type": "assert_invalid", "line": 159, "filename": "exports.60.wasm", "text": "unknown table", "module_type": "binary"}, + {"type": "assert_invalid", "line": 163, "filename": "exports.61.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 167, "filename": "exports.62.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 171, "filename": "exports.63.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 175, "filename": "exports.64.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 179, "filename": "exports.65.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "module", "line": 186, "filename": "exports.66.wasm"}, + {"type": "module", "line": 187, "filename": "exports.67.wasm"}, + {"type": "module", "line": 191, "filename": "exports.68.wasm"}, + {"type": "module", "line": 192, "filename": "exports.69.wasm"}, + {"type": "module", "line": 193, "filename": "exports.70.wasm"}, + {"type": "module", "line": 194, "filename": "exports.71.wasm"}, + {"type": "module", "line": 195, "filename": "exports.72.wasm"}, + {"type": "module", "line": 196, "filename": "exports.73.wasm"}, + {"type": "module", "line": 197, "filename": "exports.74.wasm"}, + {"type": "module", "line": 198, "filename": "exports.75.wasm"}, + {"type": "module", "line": 199, "filename": "exports.76.wasm"}, + {"type": "module", "line": 200, "filename": "exports.77.wasm"}, + {"type": "module", "line": 201, "filename": "exports.78.wasm"}, + {"type": "module", "line": 202, "filename": "exports.79.wasm"}, + {"type": "module", "line": 204, "filename": "exports.80.wasm"}, + {"type": "module", "line": 205, "filename": "exports.81.wasm"}, + {"type": "module", "line": 206, "filename": "exports.82.wasm"}, + {"type": "module", "line": 207, "filename": "exports.83.wasm"}, + {"type": "module", "line": 208, "filename": "exports.84.wasm"}, + {"type": "module", "line": 209, "filename": "exports.85.wasm"}, + {"type": "assert_invalid", "line": 214, "filename": "exports.86.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 218, "filename": "exports.87.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 222, "filename": "exports.88.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 226, "filename": "exports.89.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 235, "filename": "exports.90.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 239, "filename": "exports.91.wasm", "text": "duplicate export name", "module_type": "binary"}, + {"type": "assert_invalid", "line": 243, "filename": "exports.92.wasm", "text": "duplicate export name", "module_type": "binary"}]} diff --git a/threads/exports/exports.wast b/threads/exports/exports.wast new file mode 100644 index 00000000..e1844b11 --- /dev/null +++ b/threads/exports/exports.wast @@ -0,0 +1,245 @@ +;; 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 (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)) + (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)) + +(module + (type (;0;) (func (result i32))) + (func (;0;) (type 0) (result i32) i32.const 42) + (export "a" (func 0)) + (export "b" (func 0)) + (export "c" (func 0))) +(assert_return (invoke "a") (i32.const 42)) +(assert_return (invoke "b") (i32.const 42)) +(assert_return (invoke "c") (i32.const 42)) + +(assert_invalid + (module (export "a" (func 0))) + "unknown function" +) +(assert_invalid + (module (func) (export "a" (func 1))) + "unknown function" +) +(assert_invalid + (module (import "spectest" "print_i32" (func (param i32))) (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 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)) + (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 (export "a" (global 0))) + "unknown global" +) +(assert_invalid + (module (global i32 (i32.const 0)) (export "a" (global 1))) + "unknown global" +) +(assert_invalid + (module (import "spectest" "global_i32" (global i32)) (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))) +(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 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 ;) + +(assert_invalid + (module (export "a" (table 0))) + "unknown table" +) +(assert_invalid + (module (table 0 funcref) (export "a" (table 1))) + "unknown table" +) +(assert_invalid + (module (import "spectest" "table" (table 10 20 funcref)) (export "a" (table 1))) + "unknown table" +) +(assert_invalid + (module (table 0 funcref) (export "a" (table 0)) (export "a" (table 0))) + "duplicate export name" +) +(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 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)) + +(module (memory (export "a") 0 1 shared)) +(module (memory 0 1 shared) (export "a" (memory 0))) +(module (memory $a (export "a") 0 1 shared)) +(module (memory $a 0 1 shared) (export "a" (memory $a))) +(module (export "a" (memory 0)) (memory 0 1 shared)) +(module (export "a" (memory $a)) (memory $a 0 1 shared)) + +(; TODO: access memory ;) + +(assert_invalid + (module (export "a" (memory 0))) + "unknown memory" +) +(assert_invalid + (module (memory 0) (export "a" (memory 1))) + "unknown memory" +) +(assert_invalid + (module (import "spectest" "memory" (memory 1 2)) (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/threads/imports/imports.0.wasm b/threads/imports/imports.0.wasm new file mode 100644 index 00000000..314beaf0 Binary files /dev/null and b/threads/imports/imports.0.wasm differ diff --git a/threads/imports/imports.1.wasm b/threads/imports/imports.1.wasm new file mode 100644 index 00000000..652d87b4 Binary files /dev/null and b/threads/imports/imports.1.wasm differ diff --git a/threads/imports/imports.10.wasm b/threads/imports/imports.10.wasm new file mode 100644 index 00000000..0cca0603 Binary files /dev/null and b/threads/imports/imports.10.wasm differ diff --git a/threads/imports/imports.100.wasm b/threads/imports/imports.100.wasm new file mode 100644 index 00000000..01e7c8de Binary files /dev/null and b/threads/imports/imports.100.wasm differ diff --git a/threads/imports/imports.101.wasm b/threads/imports/imports.101.wasm new file mode 100644 index 00000000..a1146c50 Binary files /dev/null and b/threads/imports/imports.101.wasm differ diff --git a/threads/imports/imports.102.wasm b/threads/imports/imports.102.wasm new file mode 100644 index 00000000..b966a190 Binary files /dev/null and b/threads/imports/imports.102.wasm differ diff --git a/threads/imports/imports.103.wasm b/threads/imports/imports.103.wasm new file mode 100644 index 00000000..a7db9709 Binary files /dev/null and b/threads/imports/imports.103.wasm differ diff --git a/threads/imports/imports.104.wasm b/threads/imports/imports.104.wasm new file mode 100644 index 00000000..19592e8b Binary files /dev/null and b/threads/imports/imports.104.wasm differ diff --git a/threads/imports/imports.105.wasm b/threads/imports/imports.105.wasm new file mode 100644 index 00000000..9c81a865 Binary files /dev/null and b/threads/imports/imports.105.wasm differ diff --git a/threads/imports/imports.106.wasm b/threads/imports/imports.106.wasm new file mode 100644 index 00000000..4d0cb1a9 Binary files /dev/null and b/threads/imports/imports.106.wasm differ diff --git a/threads/imports/imports.107.wasm b/threads/imports/imports.107.wasm new file mode 100644 index 00000000..0fd00827 Binary files /dev/null and b/threads/imports/imports.107.wasm differ diff --git a/threads/imports/imports.108.wasm b/threads/imports/imports.108.wasm new file mode 100644 index 00000000..1d55b9bc Binary files /dev/null and b/threads/imports/imports.108.wasm differ diff --git a/threads/imports/imports.109.wasm b/threads/imports/imports.109.wasm new file mode 100644 index 00000000..6f794ae3 Binary files /dev/null and b/threads/imports/imports.109.wasm differ diff --git a/threads/imports/imports.11.wasm b/threads/imports/imports.11.wasm new file mode 100644 index 00000000..843504ae Binary files /dev/null and b/threads/imports/imports.11.wasm differ diff --git a/threads/imports/imports.110.wasm b/threads/imports/imports.110.wasm new file mode 100644 index 00000000..20ed7a19 Binary files /dev/null and b/threads/imports/imports.110.wasm differ diff --git a/threads/imports/imports.111.wasm b/threads/imports/imports.111.wasm new file mode 100644 index 00000000..969740f2 Binary files /dev/null and b/threads/imports/imports.111.wasm differ diff --git a/threads/imports/imports.112.wasm b/threads/imports/imports.112.wasm new file mode 100644 index 00000000..bd3ae5ba Binary files /dev/null and b/threads/imports/imports.112.wasm differ diff --git a/threads/imports/imports.113.wasm b/threads/imports/imports.113.wasm new file mode 100644 index 00000000..877a2e56 Binary files /dev/null and b/threads/imports/imports.113.wasm differ diff --git a/threads/imports/imports.114.wasm b/threads/imports/imports.114.wasm new file mode 100644 index 00000000..1acf047d Binary files /dev/null and b/threads/imports/imports.114.wasm differ diff --git a/threads/imports/imports.115.wasm b/threads/imports/imports.115.wasm new file mode 100644 index 00000000..3c7cc625 Binary files /dev/null and b/threads/imports/imports.115.wasm differ diff --git a/threads/imports/imports.116.wasm b/threads/imports/imports.116.wasm new file mode 100644 index 00000000..788006a4 Binary files /dev/null and b/threads/imports/imports.116.wasm differ diff --git a/threads/imports/imports.117.wasm b/threads/imports/imports.117.wasm new file mode 100644 index 00000000..de0a76f9 Binary files /dev/null and b/threads/imports/imports.117.wasm differ diff --git a/threads/imports/imports.118.wasm b/threads/imports/imports.118.wasm new file mode 100644 index 00000000..ed4b95d4 Binary files /dev/null and b/threads/imports/imports.118.wasm differ diff --git a/threads/imports/imports.119.wasm b/threads/imports/imports.119.wasm new file mode 100644 index 00000000..48f7e7bc Binary files /dev/null and b/threads/imports/imports.119.wasm differ diff --git a/threads/imports/imports.12.wasm b/threads/imports/imports.12.wasm new file mode 100644 index 00000000..2a48ca29 Binary files /dev/null and b/threads/imports/imports.12.wasm differ diff --git a/threads/imports/imports.120.wasm b/threads/imports/imports.120.wasm new file mode 100644 index 00000000..7cc4a3cb Binary files /dev/null and b/threads/imports/imports.120.wasm differ diff --git a/threads/imports/imports.121.wasm b/threads/imports/imports.121.wasm new file mode 100644 index 00000000..877a2e56 Binary files /dev/null and b/threads/imports/imports.121.wasm differ diff --git a/threads/imports/imports.122.wasm b/threads/imports/imports.122.wasm new file mode 100644 index 00000000..1acf047d Binary files /dev/null and b/threads/imports/imports.122.wasm differ diff --git a/threads/imports/imports.123.wasm b/threads/imports/imports.123.wasm new file mode 100644 index 00000000..2b92957d Binary files /dev/null and b/threads/imports/imports.123.wasm differ diff --git a/threads/imports/imports.124.wasm b/threads/imports/imports.124.wasm new file mode 100644 index 00000000..d5ef36b2 Binary files /dev/null and b/threads/imports/imports.124.wasm differ diff --git a/threads/imports/imports.125.wasm b/threads/imports/imports.125.wasm new file mode 100644 index 00000000..8a5cd5f4 Binary files /dev/null and b/threads/imports/imports.125.wasm differ diff --git a/threads/imports/imports.126.wasm b/threads/imports/imports.126.wasm new file mode 100644 index 00000000..aa46c032 Binary files /dev/null and b/threads/imports/imports.126.wasm differ diff --git a/threads/imports/imports.127.wasm b/threads/imports/imports.127.wasm new file mode 100644 index 00000000..3de69b00 Binary files /dev/null and b/threads/imports/imports.127.wasm differ diff --git a/threads/imports/imports.128.wasm b/threads/imports/imports.128.wasm new file mode 100644 index 00000000..b45c295f Binary files /dev/null and b/threads/imports/imports.128.wasm differ diff --git a/threads/imports/imports.129.wasm b/threads/imports/imports.129.wasm new file mode 100644 index 00000000..2e7f177f Binary files /dev/null and b/threads/imports/imports.129.wasm differ diff --git a/threads/imports/imports.13.wasm b/threads/imports/imports.13.wasm new file mode 100644 index 00000000..2f5d2a6a Binary files /dev/null and b/threads/imports/imports.13.wasm differ diff --git a/threads/imports/imports.130.wat b/threads/imports/imports.130.wat new file mode 100644 index 00000000..43ebf80b --- /dev/null +++ b/threads/imports/imports.130.wat @@ -0,0 +1 @@ +(func) (import "" "" (func)) \ No newline at end of file diff --git a/threads/imports/imports.131.wat b/threads/imports/imports.131.wat new file mode 100644 index 00000000..5e764821 --- /dev/null +++ b/threads/imports/imports.131.wat @@ -0,0 +1 @@ +(func) (import "" "" (global i64)) \ No newline at end of file diff --git a/threads/imports/imports.132.wat b/threads/imports/imports.132.wat new file mode 100644 index 00000000..9a7000b2 --- /dev/null +++ b/threads/imports/imports.132.wat @@ -0,0 +1 @@ +(func) (import "" "" (table 0 funcref)) \ No newline at end of file diff --git a/threads/imports/imports.133.wat b/threads/imports/imports.133.wat new file mode 100644 index 00000000..98a5e57f --- /dev/null +++ b/threads/imports/imports.133.wat @@ -0,0 +1 @@ +(func) (import "" "" (memory 0)) \ No newline at end of file diff --git a/threads/imports/imports.134.wat b/threads/imports/imports.134.wat new file mode 100644 index 00000000..e2e49bd9 --- /dev/null +++ b/threads/imports/imports.134.wat @@ -0,0 +1 @@ +(global i64 (i64.const 0)) (import "" "" (func)) \ No newline at end of file diff --git a/threads/imports/imports.135.wat b/threads/imports/imports.135.wat new file mode 100644 index 00000000..4d3a65ed --- /dev/null +++ b/threads/imports/imports.135.wat @@ -0,0 +1 @@ +(global i64 (i64.const 0)) (import "" "" (global f32)) \ No newline at end of file diff --git a/threads/imports/imports.136.wat b/threads/imports/imports.136.wat new file mode 100644 index 00000000..e47459cd --- /dev/null +++ b/threads/imports/imports.136.wat @@ -0,0 +1 @@ +(global i64 (i64.const 0)) (import "" "" (table 0 funcref)) \ No newline at end of file diff --git a/threads/imports/imports.137.wat b/threads/imports/imports.137.wat new file mode 100644 index 00000000..1420aecb --- /dev/null +++ b/threads/imports/imports.137.wat @@ -0,0 +1 @@ +(global i64 (i64.const 0)) (import "" "" (memory 0)) \ No newline at end of file diff --git a/threads/imports/imports.138.wat b/threads/imports/imports.138.wat new file mode 100644 index 00000000..9d02ae0f --- /dev/null +++ b/threads/imports/imports.138.wat @@ -0,0 +1 @@ +(table 0 funcref) (import "" "" (func)) \ No newline at end of file diff --git a/threads/imports/imports.139.wat b/threads/imports/imports.139.wat new file mode 100644 index 00000000..4005146b --- /dev/null +++ b/threads/imports/imports.139.wat @@ -0,0 +1 @@ +(table 0 funcref) (import "" "" (global i32)) \ No newline at end of file diff --git a/threads/imports/imports.14.wasm b/threads/imports/imports.14.wasm new file mode 100644 index 00000000..fd7a0a79 Binary files /dev/null and b/threads/imports/imports.14.wasm differ diff --git a/threads/imports/imports.140.wat b/threads/imports/imports.140.wat new file mode 100644 index 00000000..9dbf7fe2 --- /dev/null +++ b/threads/imports/imports.140.wat @@ -0,0 +1 @@ +(table 0 funcref) (import "" "" (table 0 funcref)) \ No newline at end of file diff --git a/threads/imports/imports.141.wat b/threads/imports/imports.141.wat new file mode 100644 index 00000000..ee4b9083 --- /dev/null +++ b/threads/imports/imports.141.wat @@ -0,0 +1 @@ +(table 0 funcref) (import "" "" (memory 0)) \ No newline at end of file diff --git a/threads/imports/imports.142.wat b/threads/imports/imports.142.wat new file mode 100644 index 00000000..deb39802 --- /dev/null +++ b/threads/imports/imports.142.wat @@ -0,0 +1 @@ +(memory 0) (import "" "" (func)) \ No newline at end of file diff --git a/threads/imports/imports.143.wat b/threads/imports/imports.143.wat new file mode 100644 index 00000000..70ac60fc --- /dev/null +++ b/threads/imports/imports.143.wat @@ -0,0 +1 @@ +(memory 0) (import "" "" (global i32)) \ No newline at end of file diff --git a/threads/imports/imports.144.wat b/threads/imports/imports.144.wat new file mode 100644 index 00000000..3aecd543 --- /dev/null +++ b/threads/imports/imports.144.wat @@ -0,0 +1 @@ +(memory 0) (import "" "" (table 1 3 funcref)) \ No newline at end of file diff --git a/threads/imports/imports.145.wat b/threads/imports/imports.145.wat new file mode 100644 index 00000000..975ca634 --- /dev/null +++ b/threads/imports/imports.145.wat @@ -0,0 +1 @@ +(memory 0) (import "" "" (memory 1 2)) \ No newline at end of file diff --git a/threads/imports/imports.146.wasm b/threads/imports/imports.146.wasm new file mode 100644 index 00000000..d8fc92d0 Binary files /dev/null and b/threads/imports/imports.146.wasm differ diff --git a/threads/imports/imports.147.wasm b/threads/imports/imports.147.wasm new file mode 100644 index 00000000..c7cebb7a Binary files /dev/null and b/threads/imports/imports.147.wasm differ diff --git a/threads/imports/imports.15.wasm b/threads/imports/imports.15.wasm new file mode 100644 index 00000000..a67a230a Binary files /dev/null and b/threads/imports/imports.15.wasm differ diff --git a/threads/imports/imports.16.wasm b/threads/imports/imports.16.wasm new file mode 100644 index 00000000..fc033342 Binary files /dev/null and b/threads/imports/imports.16.wasm differ diff --git a/threads/imports/imports.17.wasm b/threads/imports/imports.17.wasm new file mode 100644 index 00000000..1b10aa71 Binary files /dev/null and b/threads/imports/imports.17.wasm differ diff --git a/threads/imports/imports.18.wasm b/threads/imports/imports.18.wasm new file mode 100644 index 00000000..1d576d9b Binary files /dev/null and b/threads/imports/imports.18.wasm differ diff --git a/threads/imports/imports.19.wasm b/threads/imports/imports.19.wasm new file mode 100644 index 00000000..01e697f2 Binary files /dev/null and b/threads/imports/imports.19.wasm differ diff --git a/threads/imports/imports.2.wasm b/threads/imports/imports.2.wasm new file mode 100644 index 00000000..991362ee Binary files /dev/null and b/threads/imports/imports.2.wasm differ diff --git a/threads/imports/imports.20.wasm b/threads/imports/imports.20.wasm new file mode 100644 index 00000000..885d5bd9 Binary files /dev/null and b/threads/imports/imports.20.wasm differ diff --git a/threads/imports/imports.21.wasm b/threads/imports/imports.21.wasm new file mode 100644 index 00000000..d6647f6b Binary files /dev/null and b/threads/imports/imports.21.wasm differ diff --git a/threads/imports/imports.22.wasm b/threads/imports/imports.22.wasm new file mode 100644 index 00000000..55f8407e Binary files /dev/null and b/threads/imports/imports.22.wasm differ diff --git a/threads/imports/imports.23.wasm b/threads/imports/imports.23.wasm new file mode 100644 index 00000000..83d154c9 Binary files /dev/null and b/threads/imports/imports.23.wasm differ diff --git a/threads/imports/imports.24.wasm b/threads/imports/imports.24.wasm new file mode 100644 index 00000000..6072362c Binary files /dev/null and b/threads/imports/imports.24.wasm differ diff --git a/threads/imports/imports.25.wasm b/threads/imports/imports.25.wasm new file mode 100644 index 00000000..dd6531f1 Binary files /dev/null and b/threads/imports/imports.25.wasm differ diff --git a/threads/imports/imports.26.wasm b/threads/imports/imports.26.wasm new file mode 100644 index 00000000..1104039d Binary files /dev/null and b/threads/imports/imports.26.wasm differ diff --git a/threads/imports/imports.27.wasm b/threads/imports/imports.27.wasm new file mode 100644 index 00000000..211ade86 Binary files /dev/null and b/threads/imports/imports.27.wasm differ diff --git a/threads/imports/imports.28.wasm b/threads/imports/imports.28.wasm new file mode 100644 index 00000000..76bf13a6 Binary files /dev/null and b/threads/imports/imports.28.wasm differ diff --git a/threads/imports/imports.29.wasm b/threads/imports/imports.29.wasm new file mode 100644 index 00000000..dd4e01d4 Binary files /dev/null and b/threads/imports/imports.29.wasm differ diff --git a/threads/imports/imports.3.wasm b/threads/imports/imports.3.wasm new file mode 100644 index 00000000..bc5ef772 Binary files /dev/null and b/threads/imports/imports.3.wasm differ diff --git a/threads/imports/imports.30.wasm b/threads/imports/imports.30.wasm new file mode 100644 index 00000000..23488f40 Binary files /dev/null and b/threads/imports/imports.30.wasm differ diff --git a/threads/imports/imports.31.wasm b/threads/imports/imports.31.wasm new file mode 100644 index 00000000..7b046aaa Binary files /dev/null and b/threads/imports/imports.31.wasm differ diff --git a/threads/imports/imports.32.wasm b/threads/imports/imports.32.wasm new file mode 100644 index 00000000..552abb20 Binary files /dev/null and b/threads/imports/imports.32.wasm differ diff --git a/threads/imports/imports.33.wasm b/threads/imports/imports.33.wasm new file mode 100644 index 00000000..cb3ee7eb Binary files /dev/null and b/threads/imports/imports.33.wasm differ diff --git a/threads/imports/imports.34.wasm b/threads/imports/imports.34.wasm new file mode 100644 index 00000000..638e1684 Binary files /dev/null and b/threads/imports/imports.34.wasm differ diff --git a/threads/imports/imports.35.wasm b/threads/imports/imports.35.wasm new file mode 100644 index 00000000..89bfb0a9 Binary files /dev/null and b/threads/imports/imports.35.wasm differ diff --git a/threads/imports/imports.36.wasm b/threads/imports/imports.36.wasm new file mode 100644 index 00000000..02d027c1 Binary files /dev/null and b/threads/imports/imports.36.wasm differ diff --git a/threads/imports/imports.37.wasm b/threads/imports/imports.37.wasm new file mode 100644 index 00000000..e382fa9b Binary files /dev/null and b/threads/imports/imports.37.wasm differ diff --git a/threads/imports/imports.38.wasm b/threads/imports/imports.38.wasm new file mode 100644 index 00000000..bf0e2b15 Binary files /dev/null and b/threads/imports/imports.38.wasm differ diff --git a/threads/imports/imports.39.wasm b/threads/imports/imports.39.wasm new file mode 100644 index 00000000..83e63a56 Binary files /dev/null and b/threads/imports/imports.39.wasm differ diff --git a/threads/imports/imports.4.wasm b/threads/imports/imports.4.wasm new file mode 100644 index 00000000..c197bb62 Binary files /dev/null and b/threads/imports/imports.4.wasm differ diff --git a/threads/imports/imports.40.wasm b/threads/imports/imports.40.wasm new file mode 100644 index 00000000..0bd2ff71 Binary files /dev/null and b/threads/imports/imports.40.wasm differ diff --git a/threads/imports/imports.41.wasm b/threads/imports/imports.41.wasm new file mode 100644 index 00000000..82f7f25d Binary files /dev/null and b/threads/imports/imports.41.wasm differ diff --git a/threads/imports/imports.42.wasm b/threads/imports/imports.42.wasm new file mode 100644 index 00000000..c8719735 Binary files /dev/null and b/threads/imports/imports.42.wasm differ diff --git a/threads/imports/imports.43.wasm b/threads/imports/imports.43.wasm new file mode 100644 index 00000000..ba13df73 Binary files /dev/null and b/threads/imports/imports.43.wasm differ diff --git a/threads/imports/imports.44.wasm b/threads/imports/imports.44.wasm new file mode 100644 index 00000000..8400d5aa Binary files /dev/null and b/threads/imports/imports.44.wasm differ diff --git a/threads/imports/imports.45.wasm b/threads/imports/imports.45.wasm new file mode 100644 index 00000000..fddf15b8 Binary files /dev/null and b/threads/imports/imports.45.wasm differ diff --git a/threads/imports/imports.46.wasm b/threads/imports/imports.46.wasm new file mode 100644 index 00000000..777d18ee Binary files /dev/null and b/threads/imports/imports.46.wasm differ diff --git a/threads/imports/imports.47.wasm b/threads/imports/imports.47.wasm new file mode 100644 index 00000000..2cf69d34 Binary files /dev/null and b/threads/imports/imports.47.wasm differ diff --git a/threads/imports/imports.48.wasm b/threads/imports/imports.48.wasm new file mode 100644 index 00000000..a453b7a3 Binary files /dev/null and b/threads/imports/imports.48.wasm differ diff --git a/threads/imports/imports.49.wasm b/threads/imports/imports.49.wasm new file mode 100644 index 00000000..18de398b Binary files /dev/null and b/threads/imports/imports.49.wasm differ diff --git a/threads/imports/imports.5.wasm b/threads/imports/imports.5.wasm new file mode 100644 index 00000000..767dd4ca Binary files /dev/null and b/threads/imports/imports.5.wasm differ diff --git a/threads/imports/imports.50.wasm b/threads/imports/imports.50.wasm new file mode 100644 index 00000000..43e6b9a6 Binary files /dev/null and b/threads/imports/imports.50.wasm differ diff --git a/threads/imports/imports.51.wasm b/threads/imports/imports.51.wasm new file mode 100644 index 00000000..1328ee25 Binary files /dev/null and b/threads/imports/imports.51.wasm differ diff --git a/threads/imports/imports.52.wasm b/threads/imports/imports.52.wasm new file mode 100644 index 00000000..d735f6ba Binary files /dev/null and b/threads/imports/imports.52.wasm differ diff --git a/threads/imports/imports.53.wasm b/threads/imports/imports.53.wasm new file mode 100644 index 00000000..07b7a8db Binary files /dev/null and b/threads/imports/imports.53.wasm differ diff --git a/threads/imports/imports.54.wasm b/threads/imports/imports.54.wasm new file mode 100644 index 00000000..cd5a9c95 Binary files /dev/null and b/threads/imports/imports.54.wasm differ diff --git a/threads/imports/imports.55.wasm b/threads/imports/imports.55.wasm new file mode 100644 index 00000000..47603583 Binary files /dev/null and b/threads/imports/imports.55.wasm differ diff --git a/threads/imports/imports.56.wasm b/threads/imports/imports.56.wasm new file mode 100644 index 00000000..826872e8 Binary files /dev/null and b/threads/imports/imports.56.wasm differ diff --git a/threads/imports/imports.57.wasm b/threads/imports/imports.57.wasm new file mode 100644 index 00000000..d65b0406 Binary files /dev/null and b/threads/imports/imports.57.wasm differ diff --git a/threads/imports/imports.58.wasm b/threads/imports/imports.58.wasm new file mode 100644 index 00000000..29af0f90 Binary files /dev/null and b/threads/imports/imports.58.wasm differ diff --git a/threads/imports/imports.59.wasm b/threads/imports/imports.59.wasm new file mode 100644 index 00000000..ee499e92 Binary files /dev/null and b/threads/imports/imports.59.wasm differ diff --git a/threads/imports/imports.6.wasm b/threads/imports/imports.6.wasm new file mode 100644 index 00000000..8d7f4e4a Binary files /dev/null and b/threads/imports/imports.6.wasm differ diff --git a/threads/imports/imports.60.wasm b/threads/imports/imports.60.wasm new file mode 100644 index 00000000..27aa8136 Binary files /dev/null and b/threads/imports/imports.60.wasm differ diff --git a/threads/imports/imports.61.wasm b/threads/imports/imports.61.wasm new file mode 100644 index 00000000..27aa8136 Binary files /dev/null and b/threads/imports/imports.61.wasm differ diff --git a/threads/imports/imports.62.wasm b/threads/imports/imports.62.wasm new file mode 100644 index 00000000..4626678f Binary files /dev/null and b/threads/imports/imports.62.wasm differ diff --git a/threads/imports/imports.63.wasm b/threads/imports/imports.63.wasm new file mode 100644 index 00000000..3cf00836 Binary files /dev/null and b/threads/imports/imports.63.wasm differ diff --git a/threads/imports/imports.64.wasm b/threads/imports/imports.64.wasm new file mode 100644 index 00000000..d4cfcd9b Binary files /dev/null and b/threads/imports/imports.64.wasm differ diff --git a/threads/imports/imports.65.wasm b/threads/imports/imports.65.wasm new file mode 100644 index 00000000..e0ce1dec Binary files /dev/null and b/threads/imports/imports.65.wasm differ diff --git a/threads/imports/imports.66.wasm b/threads/imports/imports.66.wasm new file mode 100644 index 00000000..c8609224 Binary files /dev/null and b/threads/imports/imports.66.wasm differ diff --git a/threads/imports/imports.67.wasm b/threads/imports/imports.67.wasm new file mode 100644 index 00000000..cad10bbf Binary files /dev/null and b/threads/imports/imports.67.wasm differ diff --git a/threads/imports/imports.68.wasm b/threads/imports/imports.68.wasm new file mode 100644 index 00000000..cea5ea55 Binary files /dev/null and b/threads/imports/imports.68.wasm differ diff --git a/threads/imports/imports.69.wasm b/threads/imports/imports.69.wasm new file mode 100644 index 00000000..6cda9616 Binary files /dev/null and b/threads/imports/imports.69.wasm differ diff --git a/threads/imports/imports.7.wasm b/threads/imports/imports.7.wasm new file mode 100644 index 00000000..5c1ae26e Binary files /dev/null and b/threads/imports/imports.7.wasm differ diff --git a/threads/imports/imports.70.wasm b/threads/imports/imports.70.wasm new file mode 100644 index 00000000..89422121 Binary files /dev/null and b/threads/imports/imports.70.wasm differ diff --git a/threads/imports/imports.71.wasm b/threads/imports/imports.71.wasm new file mode 100644 index 00000000..cca7f50f Binary files /dev/null and b/threads/imports/imports.71.wasm differ diff --git a/threads/imports/imports.72.wasm b/threads/imports/imports.72.wasm new file mode 100644 index 00000000..6bb3f2c0 Binary files /dev/null and b/threads/imports/imports.72.wasm differ diff --git a/threads/imports/imports.73.wasm b/threads/imports/imports.73.wasm new file mode 100644 index 00000000..46efaea3 Binary files /dev/null and b/threads/imports/imports.73.wasm differ diff --git a/threads/imports/imports.74.wasm b/threads/imports/imports.74.wasm new file mode 100644 index 00000000..2e5daf02 Binary files /dev/null and b/threads/imports/imports.74.wasm differ diff --git a/threads/imports/imports.75.wasm b/threads/imports/imports.75.wasm new file mode 100644 index 00000000..27d3f4d9 Binary files /dev/null and b/threads/imports/imports.75.wasm differ diff --git a/threads/imports/imports.76.wasm b/threads/imports/imports.76.wasm new file mode 100644 index 00000000..431bc7e6 Binary files /dev/null and b/threads/imports/imports.76.wasm differ diff --git a/threads/imports/imports.77.wasm b/threads/imports/imports.77.wasm new file mode 100644 index 00000000..1e25eb25 Binary files /dev/null and b/threads/imports/imports.77.wasm differ diff --git a/threads/imports/imports.78.wasm b/threads/imports/imports.78.wasm new file mode 100644 index 00000000..8c61b5bd Binary files /dev/null and b/threads/imports/imports.78.wasm differ diff --git a/threads/imports/imports.79.wasm b/threads/imports/imports.79.wasm new file mode 100644 index 00000000..2a6b158a Binary files /dev/null and b/threads/imports/imports.79.wasm differ diff --git a/threads/imports/imports.8.wasm b/threads/imports/imports.8.wasm new file mode 100644 index 00000000..07b93fb1 Binary files /dev/null and b/threads/imports/imports.8.wasm differ diff --git a/threads/imports/imports.80.wasm b/threads/imports/imports.80.wasm new file mode 100644 index 00000000..a098343f Binary files /dev/null and b/threads/imports/imports.80.wasm differ diff --git a/threads/imports/imports.81.wasm b/threads/imports/imports.81.wasm new file mode 100644 index 00000000..bf2cd933 Binary files /dev/null and b/threads/imports/imports.81.wasm differ diff --git a/threads/imports/imports.82.wasm b/threads/imports/imports.82.wasm new file mode 100644 index 00000000..60cf1991 Binary files /dev/null and b/threads/imports/imports.82.wasm differ diff --git a/threads/imports/imports.83.wasm b/threads/imports/imports.83.wasm new file mode 100644 index 00000000..0d52289f Binary files /dev/null and b/threads/imports/imports.83.wasm differ diff --git a/threads/imports/imports.84.wasm b/threads/imports/imports.84.wasm new file mode 100644 index 00000000..c3e0390f Binary files /dev/null and b/threads/imports/imports.84.wasm differ diff --git a/threads/imports/imports.85.wasm b/threads/imports/imports.85.wasm new file mode 100644 index 00000000..9f17b38f Binary files /dev/null and b/threads/imports/imports.85.wasm differ diff --git a/threads/imports/imports.86.wasm b/threads/imports/imports.86.wasm new file mode 100644 index 00000000..62d775f6 Binary files /dev/null and b/threads/imports/imports.86.wasm differ diff --git a/threads/imports/imports.87.wasm b/threads/imports/imports.87.wasm new file mode 100644 index 00000000..975db667 Binary files /dev/null and b/threads/imports/imports.87.wasm differ diff --git a/threads/imports/imports.88.wasm b/threads/imports/imports.88.wasm new file mode 100644 index 00000000..f570ec28 Binary files /dev/null and b/threads/imports/imports.88.wasm differ diff --git a/threads/imports/imports.89.wasm b/threads/imports/imports.89.wasm new file mode 100644 index 00000000..8130164e Binary files /dev/null and b/threads/imports/imports.89.wasm differ diff --git a/threads/imports/imports.9.wasm b/threads/imports/imports.9.wasm new file mode 100644 index 00000000..10e75e56 Binary files /dev/null and b/threads/imports/imports.9.wasm differ diff --git a/threads/imports/imports.90.wasm b/threads/imports/imports.90.wasm new file mode 100644 index 00000000..68ee3ca2 Binary files /dev/null and b/threads/imports/imports.90.wasm differ diff --git a/threads/imports/imports.91.wasm b/threads/imports/imports.91.wasm new file mode 100644 index 00000000..ac4bc9f2 Binary files /dev/null and b/threads/imports/imports.91.wasm differ diff --git a/threads/imports/imports.92.wasm b/threads/imports/imports.92.wasm new file mode 100644 index 00000000..86d66cff Binary files /dev/null and b/threads/imports/imports.92.wasm differ diff --git a/threads/imports/imports.93.wasm b/threads/imports/imports.93.wasm new file mode 100644 index 00000000..5101c52d Binary files /dev/null and b/threads/imports/imports.93.wasm differ diff --git a/threads/imports/imports.94.wasm b/threads/imports/imports.94.wasm new file mode 100644 index 00000000..cec7f0e1 Binary files /dev/null and b/threads/imports/imports.94.wasm differ diff --git a/threads/imports/imports.95.wasm b/threads/imports/imports.95.wasm new file mode 100644 index 00000000..551315ad Binary files /dev/null and b/threads/imports/imports.95.wasm differ diff --git a/threads/imports/imports.96.wasm b/threads/imports/imports.96.wasm new file mode 100644 index 00000000..551315ad Binary files /dev/null and b/threads/imports/imports.96.wasm differ diff --git a/threads/imports/imports.97.wasm b/threads/imports/imports.97.wasm new file mode 100644 index 00000000..43e850c6 Binary files /dev/null and b/threads/imports/imports.97.wasm differ diff --git a/threads/imports/imports.98.wasm b/threads/imports/imports.98.wasm new file mode 100644 index 00000000..8b333823 Binary files /dev/null and b/threads/imports/imports.98.wasm differ diff --git a/threads/imports/imports.99.wasm b/threads/imports/imports.99.wasm new file mode 100644 index 00000000..97c84e5f Binary files /dev/null and b/threads/imports/imports.99.wasm differ diff --git a/threads/imports/imports.json b/threads/imports/imports.json new file mode 100644 index 00000000..055608b8 --- /dev/null +++ b/threads/imports/imports.json @@ -0,0 +1,188 @@ +{"source_filename": "imports.wast", + "commands": [ + {"type": "module", "line": 3, "filename": "imports.0.wasm"}, + {"type": "register", "line": 21, "as": "test"}, + {"type": "module", "line": 26, "filename": "imports.1.wasm"}, + {"type": "assert_return", "line": 85, "action": {"type": "invoke", "field": "print32", "args": [{"type": "i32", "value": "13"}]}, "expected": []}, + {"type": "assert_return", "line": 86, "action": {"type": "invoke", "field": "print64", "args": [{"type": "i64", "value": "24"}]}, "expected": []}, + {"type": "assert_invalid", "line": 89, "filename": "imports.2.wasm", "text": "unknown type", "module_type": "binary"}, + {"type": "module", "line": 97, "filename": "imports.3.wasm"}, + {"type": "assert_return", "line": 104, "action": {"type": "invoke", "field": "print_i32", "args": [{"type": "i32", "value": "13"}]}, "expected": []}, + {"type": "module", "line": 107, "filename": "imports.4.wasm"}, + {"type": "assert_return", "line": 114, "action": {"type": "invoke", "field": "print_i32", "args": [{"type": "i32", "value": "5"}, {"type": "i32", "value": "11"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "module", "line": 116, "filename": "imports.5.wasm"}, + {"type": "module", "line": 117, "filename": "imports.6.wasm"}, + {"type": "module", "line": 118, "filename": "imports.7.wasm"}, + {"type": "module", "line": 119, "filename": "imports.8.wasm"}, + {"type": "module", "line": 120, "filename": "imports.9.wasm"}, + {"type": "module", "line": 121, "filename": "imports.10.wasm"}, + {"type": "module", "line": 122, "filename": "imports.11.wasm"}, + {"type": "assert_unlinkable", "line": 125, "filename": "imports.12.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 129, "filename": "imports.13.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 134, "filename": "imports.14.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 138, "filename": "imports.15.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 142, "filename": "imports.16.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 146, "filename": "imports.17.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 150, "filename": "imports.18.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 154, "filename": "imports.19.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 158, "filename": "imports.20.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 162, "filename": "imports.21.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 166, "filename": "imports.22.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 170, "filename": "imports.23.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 174, "filename": "imports.24.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 178, "filename": "imports.25.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 182, "filename": "imports.26.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 186, "filename": "imports.27.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 190, "filename": "imports.28.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 194, "filename": "imports.29.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 199, "filename": "imports.30.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 203, "filename": "imports.31.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 207, "filename": "imports.32.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 211, "filename": "imports.33.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 215, "filename": "imports.34.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 219, "filename": "imports.35.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "module", "line": 226, "filename": "imports.36.wasm"}, + {"type": "assert_return", "line": 243, "action": {"type": "invoke", "field": "get-0", "args": []}, "expected": [{"type": "i32", "value": "666"}]}, + {"type": "assert_return", "line": 244, "action": {"type": "invoke", "field": "get-1", "args": []}, "expected": [{"type": "i32", "value": "666"}]}, + {"type": "assert_return", "line": 245, "action": {"type": "invoke", "field": "get-x", "args": []}, "expected": [{"type": "i32", "value": "666"}]}, + {"type": "assert_return", "line": 246, "action": {"type": "invoke", "field": "get-y", "args": []}, "expected": [{"type": "i32", "value": "666"}]}, + {"type": "module", "line": 248, "filename": "imports.37.wasm"}, + {"type": "module", "line": 249, "filename": "imports.38.wasm"}, + {"type": "module", "line": 250, "filename": "imports.39.wasm"}, + {"type": "assert_unlinkable", "line": 253, "filename": "imports.40.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 257, "filename": "imports.41.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 262, "filename": "imports.42.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 266, "filename": "imports.43.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 270, "filename": "imports.44.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 274, "filename": "imports.45.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 278, "filename": "imports.46.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 282, "filename": "imports.47.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 286, "filename": "imports.48.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 290, "filename": "imports.49.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 294, "filename": "imports.50.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 298, "filename": "imports.51.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 302, "filename": "imports.52.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 306, "filename": "imports.53.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 311, "filename": "imports.54.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 315, "filename": "imports.55.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 319, "filename": "imports.56.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 323, "filename": "imports.57.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 327, "filename": "imports.58.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 331, "filename": "imports.59.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "module", "line": 338, "filename": "imports.60.wasm"}, + {"type": "assert_trap", "line": 350, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, + {"type": "assert_return", "line": 351, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "11"}]}, + {"type": "assert_return", "line": 352, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_trap", "line": 353, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "3"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 354, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "100"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, + {"type": "module", "line": 357, "filename": "imports.61.wasm"}, + {"type": "assert_trap", "line": 369, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, + {"type": "assert_return", "line": 370, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "11"}]}, + {"type": "assert_return", "line": 371, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "22"}]}, + {"type": "assert_trap", "line": 372, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "3"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, + {"type": "assert_trap", "line": 373, "action": {"type": "invoke", "field": "call", "args": [{"type": "i32", "value": "100"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, + {"type": "module", "line": 376, "filename": "imports.62.wasm"}, + {"type": "module", "line": 383, "filename": "imports.63.wasm"}, + {"type": "module", "line": 384, "filename": "imports.64.wasm"}, + {"type": "module", "line": 385, "filename": "imports.65.wasm"}, + {"type": "module", "line": 386, "filename": "imports.66.wasm"}, + {"type": "module", "line": 387, "filename": "imports.67.wasm"}, + {"type": "module", "line": 388, "filename": "imports.68.wasm"}, + {"type": "module", "line": 389, "filename": "imports.69.wasm"}, + {"type": "module", "line": 390, "filename": "imports.70.wasm"}, + {"type": "module", "line": 391, "filename": "imports.71.wasm"}, + {"type": "module", "line": 392, "filename": "imports.72.wasm"}, + {"type": "module", "line": 393, "filename": "imports.73.wasm"}, + {"type": "module", "line": 394, "filename": "imports.74.wasm"}, + {"type": "module", "line": 395, "filename": "imports.75.wasm"}, + {"type": "module", "line": 396, "filename": "imports.76.wasm"}, + {"type": "module", "line": 397, "filename": "imports.77.wasm"}, + {"type": "module", "line": 398, "filename": "imports.78.wasm"}, + {"type": "module", "line": 399, "filename": "imports.79.wasm"}, + {"type": "module", "line": 400, "filename": "imports.80.wasm"}, + {"type": "module", "line": 401, "filename": "imports.81.wasm"}, + {"type": "module", "line": 402, "filename": "imports.82.wasm"}, + {"type": "assert_unlinkable", "line": 405, "filename": "imports.83.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 409, "filename": "imports.84.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 414, "filename": "imports.85.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 418, "filename": "imports.86.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 422, "filename": "imports.87.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 426, "filename": "imports.88.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 430, "filename": "imports.89.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 434, "filename": "imports.90.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 439, "filename": "imports.91.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 443, "filename": "imports.92.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 447, "filename": "imports.93.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 451, "filename": "imports.94.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "module", "line": 459, "filename": "imports.95.wasm"}, + {"type": "assert_return", "line": 466, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 467, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "assert_return", "line": 468, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "i32", "value": "1048576"}]}, + {"type": "assert_trap", "line": 469, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "1000000"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, + {"type": "module", "line": 471, "filename": "imports.96.wasm"}, + {"type": "assert_return", "line": 477, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "assert_return", "line": 478, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "10"}]}, "expected": [{"type": "i32", "value": "16"}]}, + {"type": "assert_return", "line": 479, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "8"}]}, "expected": [{"type": "i32", "value": "1048576"}]}, + {"type": "assert_trap", "line": 480, "action": {"type": "invoke", "field": "load", "args": [{"type": "i32", "value": "1000000"}]}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, + {"type": "assert_invalid", "line": 483, "filename": "imports.97.wasm", "text": "multiple memories", "module_type": "binary"}, + {"type": "assert_invalid", "line": 487, "filename": "imports.98.wasm", "text": "multiple memories", "module_type": "binary"}, + {"type": "assert_invalid", "line": 491, "filename": "imports.99.wasm", "text": "multiple memories", "module_type": "binary"}, + {"type": "module", "line": 495, "filename": "imports.100.wasm"}, + {"type": "module", "line": 496, "filename": "imports.101.wasm"}, + {"type": "module", "line": 497, "filename": "imports.102.wasm"}, + {"type": "module", "line": 498, "filename": "imports.103.wasm"}, + {"type": "module", "line": 499, "filename": "imports.104.wasm"}, + {"type": "module", "line": 500, "filename": "imports.105.wasm"}, + {"type": "module", "line": 501, "filename": "imports.106.wasm"}, + {"type": "module", "line": 502, "filename": "imports.107.wasm"}, + {"type": "module", "line": 503, "filename": "imports.108.wasm"}, + {"type": "assert_unlinkable", "line": 506, "filename": "imports.109.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 510, "filename": "imports.110.wasm", "text": "unknown import", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 515, "filename": "imports.111.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 519, "filename": "imports.112.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 523, "filename": "imports.113.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 527, "filename": "imports.114.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 532, "filename": "imports.115.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 536, "filename": "imports.116.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 540, "filename": "imports.117.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 544, "filename": "imports.118.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 548, "filename": "imports.119.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 552, "filename": "imports.120.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 557, "filename": "imports.121.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 561, "filename": "imports.122.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "module", "line": 565, "filename": "imports.123.wasm"}, + {"type": "assert_return", "line": 569, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 570, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 571, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "assert_return", "line": 572, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, + {"type": "assert_return", "line": 573, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "module", "line": 575, "name": "$Mgm", "filename": "imports.124.wasm"}, + {"type": "register", "line": 579, "name": "$Mgm", "as": "grown-memory"}, + {"type": "assert_return", "line": 580, "action": {"type": "invoke", "module": "$Mgm", "field": "grow", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "module", "line": 581, "name": "$Mgim1", "filename": "imports.125.wasm"}, + {"type": "register", "line": 586, "name": "$Mgim1", "as": "grown-imported-memory"}, + {"type": "assert_return", "line": 587, "action": {"type": "invoke", "module": "$Mgim1", "field": "grow", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, + {"type": "module", "line": 588, "name": "$Mgim2", "filename": "imports.126.wasm"}, + {"type": "assert_return", "line": 593, "action": {"type": "invoke", "module": "$Mgim2", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, + {"type": "module", "line": 598, "filename": "imports.127.wasm"}, + {"type": "assert_unlinkable", "line": 601, "filename": "imports.128.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_unlinkable", "line": 605, "filename": "imports.129.wasm", "text": "incompatible import type", "module_type": "binary"}, + {"type": "assert_malformed", "line": 612, "filename": "imports.130.wat", "text": "import after function", "module_type": "text"}, + {"type": "assert_malformed", "line": 616, "filename": "imports.131.wat", "text": "import after function", "module_type": "text"}, + {"type": "assert_malformed", "line": 620, "filename": "imports.132.wat", "text": "import after function", "module_type": "text"}, + {"type": "assert_malformed", "line": 624, "filename": "imports.133.wat", "text": "import after function", "module_type": "text"}, + {"type": "assert_malformed", "line": 629, "filename": "imports.134.wat", "text": "import after global", "module_type": "text"}, + {"type": "assert_malformed", "line": 633, "filename": "imports.135.wat", "text": "import after global", "module_type": "text"}, + {"type": "assert_malformed", "line": 637, "filename": "imports.136.wat", "text": "import after global", "module_type": "text"}, + {"type": "assert_malformed", "line": 641, "filename": "imports.137.wat", "text": "import after global", "module_type": "text"}, + {"type": "assert_malformed", "line": 646, "filename": "imports.138.wat", "text": "import after table", "module_type": "text"}, + {"type": "assert_malformed", "line": 650, "filename": "imports.139.wat", "text": "import after table", "module_type": "text"}, + {"type": "assert_malformed", "line": 654, "filename": "imports.140.wat", "text": "import after table", "module_type": "text"}, + {"type": "assert_malformed", "line": 658, "filename": "imports.141.wat", "text": "import after table", "module_type": "text"}, + {"type": "assert_malformed", "line": 663, "filename": "imports.142.wat", "text": "import after memory", "module_type": "text"}, + {"type": "assert_malformed", "line": 667, "filename": "imports.143.wat", "text": "import after memory", "module_type": "text"}, + {"type": "assert_malformed", "line": 671, "filename": "imports.144.wat", "text": "import after memory", "module_type": "text"}, + {"type": "assert_malformed", "line": 675, "filename": "imports.145.wat", "text": "import after memory", "module_type": "text"}, + {"type": "module", "line": 682, "filename": "imports.146.wasm"}, + {"type": "register", "line": 683, "as": "not wasm"}, + {"type": "assert_unlinkable", "line": 685, "filename": "imports.147.wasm", "text": "unknown import", "module_type": "binary"}]} diff --git a/threads/imports/imports.wast b/threads/imports/imports.wast new file mode 100644 index 00000000..b02e12e1 --- /dev/null +++ b/threads/imports/imports.wast @@ -0,0 +1,704 @@ +;; Auxiliary module to import from + +(module + (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)) + (global (export "global-mut-i64") (mut i64) (i64.const 66)) + (table (export "table-10-inf") 10 funcref) + (table (export "table-10-20") 10 20 funcref) + (memory (export "memory-2-inf") 2) + ;; Multiple memories are not yet supported + ;; (memory (export "memory-2-4") 2 4) +) + +(register "test") + + +;; 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))) + (func (import "spectest" "print_i64") (param i64)) + (import "spectest" "print_i32" (func $print_i32 (param i32))) + (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)) + (f32.const 42) + ) + (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) + (local $x f64) + (local.set $x (f64.convert_i64_s (call $i64->i64 (local.get $i)))) + (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_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" +) + +;; Export sharing name with import +(module + (import "spectest" "print_i32" (func $imported_print (param i32))) + (func (export "print_i32") (param $i i32) + (call $imported_print (local.get $i)) + ) +) + +(assert_return (invoke "print_i32" (i32.const 13))) + +;; Export sharing name with import +(module + (import "spectest" "print_i32" (func $imported_print (param i32))) + (func (export "print_i32") (param $i i32) (param $j i32) (result i32) + (i32.add (local.get $i) (local.get $j)) + ) +) + +(assert_return (invoke "print_i32" (i32.const 5) (i32.const 11)) (i32.const 16)) + +(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 "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 "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_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_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)) +) + +(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)) + +(module (import "test" "global-i32" (global i32))) +(module (import "test" "global-f32" (global f32))) +(module (import "test" "global-mut-i64" (global (mut i64)))) + +(assert_unlinkable + (module (import "test" "unknown" (global i32))) + "unknown import" +) +(assert_unlinkable + (module (import "spectest" "unknown" (global i32))) + "unknown import" +) + +(assert_unlinkable + (module (import "test" "global-i32" (global i64))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-i32" (global f32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-i32" (global f64))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-i32" (global (mut i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-f32" (global i32))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-f32" (global i64))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-f32" (global f64))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-f32" (global (mut f32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-mut-i64" (global (mut i32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-mut-i64" (global (mut f32)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-mut-i64" (global (mut f64)))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "global-mut-i64" (global i64))) + "incompatible import type" +) + +(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 + +(module + (type (func (result i32))) + (import "spectest" "table" (table $tab 10 20 funcref)) + (elem (table $tab) (i32.const 1) func $f $g) + + (func (export "call") (param i32) (result i32) + (call_indirect $tab (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 $tab (import "spectest" "table") 10 20 funcref) + (elem (table $tab) (i32.const 1) func $f $g) + + (func (export "call") (param i32) (result i32) + (call_indirect $tab (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 + (import "spectest" "table" (table 0 funcref)) + (import "spectest" "table" (table 0 funcref)) + (table 10 funcref) + (table 10 funcref) +) + +(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 "test" "table-10-20" (table 10 funcref))) +(module (import "test" "table-10-20" (table 5 funcref))) +(module (import "test" "table-10-20" (table 0 funcref))) +(module (import "test" "table-10-20" (table 10 20 funcref))) +(module (import "test" "table-10-20" (table 5 20 funcref))) +(module (import "test" "table-10-20" (table 0 20 funcref))) +(module (import "test" "table-10-20" (table 10 25 funcref))) +(module (import "test" "table-10-20" (table 5 25 funcref))) +(module (import "test" "table-10-20" (table 0 25 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 "test" "table-10-inf" (table 10 20 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "table-10-20" (table 12 20 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "test" "table-10-20" (table 10 18 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "table" (table 12 funcref))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "table" (table 10 15 funcref))) + "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 + (import "spectest" "memory" (memory 1 2)) + (data (memory 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 (memory 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" +) + +(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_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))) + "incompatible import type" +) +(assert_unlinkable + (module (import "spectest" "memory" (memory 1 1))) + "incompatible import type" +) + +(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)) + +(module $Mgm + (memory (export "memory") 1) ;; initial size is 1 + (func (export "grow") (result i32) (memory.grow (i32.const 1))) +) +(register "grown-memory" $Mgm) +(assert_return (invoke $Mgm "grow") (i32.const 1)) ;; now size is 2 +(module $Mgim1 + ;; imported memory limits should match, because external memory size is 2 now + (memory (export "memory") (import "grown-memory" "memory") 2) + (func (export "grow") (result i32) (memory.grow (i32.const 1))) +) +(register "grown-imported-memory" $Mgim1) +(assert_return (invoke $Mgim1 "grow") (i32.const 2)) ;; now size is 3 +(module $Mgim2 + ;; imported memory limits should match, because external memory size is 3 now + (import "grown-imported-memory" "memory" (memory 3)) + (func (export "size") (result i32) (memory.size)) +) +(assert_return (invoke $Mgim2 "size") (i32.const 3)) + + +;; Shared Memory + +(module (import "spectest" "shared_memory" (memory 1 2 shared))) + +(assert_unlinkable + (module (import "spectest" "shared_memory" (memory 1 2))) + "incompatible import type") + +(assert_unlinkable + (module (import "spectest" "memory" (memory 1 2 shared))) + "incompatible import type") + + +;; 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/threads/memory/memory.0.wasm b/threads/memory/memory.0.wasm new file mode 100644 index 00000000..b55aac61 Binary files /dev/null and b/threads/memory/memory.0.wasm differ diff --git a/threads/memory/memory.1.wasm b/threads/memory/memory.1.wasm new file mode 100644 index 00000000..67d6849c Binary files /dev/null and b/threads/memory/memory.1.wasm differ diff --git a/threads/memory/memory.10.wasm b/threads/memory/memory.10.wasm new file mode 100644 index 00000000..0f5e6c6d Binary files /dev/null and b/threads/memory/memory.10.wasm differ diff --git a/threads/memory/memory.11.wasm b/threads/memory/memory.11.wasm new file mode 100644 index 00000000..8f394682 Binary files /dev/null and b/threads/memory/memory.11.wasm differ diff --git a/threads/memory/memory.12.wasm b/threads/memory/memory.12.wasm new file mode 100644 index 00000000..8f394682 Binary files /dev/null and b/threads/memory/memory.12.wasm differ diff --git a/threads/memory/memory.13.wasm b/threads/memory/memory.13.wasm new file mode 100644 index 00000000..6591570f Binary files /dev/null and b/threads/memory/memory.13.wasm differ diff --git a/threads/memory/memory.14.wasm b/threads/memory/memory.14.wasm new file mode 100644 index 00000000..e00ce9ca Binary files /dev/null and b/threads/memory/memory.14.wasm differ diff --git a/threads/memory/memory.15.wasm b/threads/memory/memory.15.wasm new file mode 100644 index 00000000..e00ce9ca Binary files /dev/null and b/threads/memory/memory.15.wasm differ diff --git a/threads/memory/memory.16.wasm b/threads/memory/memory.16.wasm new file mode 100644 index 00000000..82074b41 Binary files /dev/null and b/threads/memory/memory.16.wasm differ diff --git a/threads/memory/memory.17.wasm b/threads/memory/memory.17.wasm new file mode 100644 index 00000000..8b15c41b Binary files /dev/null and b/threads/memory/memory.17.wasm differ diff --git a/threads/memory/memory.18.wasm b/threads/memory/memory.18.wasm new file mode 100644 index 00000000..6dc549a0 Binary files /dev/null and b/threads/memory/memory.18.wasm differ diff --git a/threads/memory/memory.19.wasm b/threads/memory/memory.19.wasm new file mode 100644 index 00000000..dfcc8d4c Binary files /dev/null and b/threads/memory/memory.19.wasm differ diff --git a/threads/memory/memory.2.wasm b/threads/memory/memory.2.wasm new file mode 100644 index 00000000..93b6da76 Binary files /dev/null and b/threads/memory/memory.2.wasm differ diff --git a/threads/memory/memory.20.wasm b/threads/memory/memory.20.wasm new file mode 100644 index 00000000..360a7387 Binary files /dev/null and b/threads/memory/memory.20.wasm differ diff --git a/threads/memory/memory.21.wasm b/threads/memory/memory.21.wasm new file mode 100644 index 00000000..4bfd2bff Binary files /dev/null and b/threads/memory/memory.21.wasm differ diff --git a/threads/memory/memory.22.wasm b/threads/memory/memory.22.wasm new file mode 100644 index 00000000..a3e62a98 Binary files /dev/null and b/threads/memory/memory.22.wasm differ diff --git a/threads/memory/memory.23.wasm b/threads/memory/memory.23.wasm new file mode 100644 index 00000000..d09cfb18 Binary files /dev/null and b/threads/memory/memory.23.wasm differ diff --git a/threads/memory/memory.24.wasm b/threads/memory/memory.24.wasm new file mode 100644 index 00000000..6f2d7eb1 Binary files /dev/null and b/threads/memory/memory.24.wasm differ diff --git a/threads/memory/memory.25.wasm b/threads/memory/memory.25.wasm new file mode 100644 index 00000000..51b9e2c8 Binary files /dev/null and b/threads/memory/memory.25.wasm differ diff --git a/threads/memory/memory.26.wasm b/threads/memory/memory.26.wasm new file mode 100644 index 00000000..eadfa7fa Binary files /dev/null and b/threads/memory/memory.26.wasm differ diff --git a/threads/memory/memory.27.wasm b/threads/memory/memory.27.wasm new file mode 100644 index 00000000..5a2f5725 Binary files /dev/null and b/threads/memory/memory.27.wasm differ diff --git a/threads/memory/memory.28.wasm b/threads/memory/memory.28.wasm new file mode 100644 index 00000000..841e90a1 Binary files /dev/null and b/threads/memory/memory.28.wasm differ diff --git a/threads/memory/memory.29.wasm b/threads/memory/memory.29.wasm new file mode 100644 index 00000000..579064c1 Binary files /dev/null and b/threads/memory/memory.29.wasm differ diff --git a/threads/memory/memory.3.wasm b/threads/memory/memory.3.wasm new file mode 100644 index 00000000..e47e0cf8 Binary files /dev/null and b/threads/memory/memory.3.wasm differ diff --git a/threads/memory/memory.30.wat b/threads/memory/memory.30.wat new file mode 100644 index 00000000..3413f644 --- /dev/null +++ b/threads/memory/memory.30.wat @@ -0,0 +1 @@ +(memory 0x1_0000_0000) \ No newline at end of file diff --git a/threads/memory/memory.31.wat b/threads/memory/memory.31.wat new file mode 100644 index 00000000..0e381d3c --- /dev/null +++ b/threads/memory/memory.31.wat @@ -0,0 +1 @@ +(memory 0x1_0000_0000 0x1_0000_0000) \ No newline at end of file diff --git a/threads/memory/memory.32.wat b/threads/memory/memory.32.wat new file mode 100644 index 00000000..e87cc60a --- /dev/null +++ b/threads/memory/memory.32.wat @@ -0,0 +1 @@ +(memory 0 0x1_0000_0000) \ No newline at end of file diff --git a/threads/memory/memory.33.wasm b/threads/memory/memory.33.wasm new file mode 100644 index 00000000..67bd234b Binary files /dev/null and b/threads/memory/memory.33.wasm differ diff --git a/threads/memory/memory.34.wat b/threads/memory/memory.34.wat new file mode 100644 index 00000000..98bceea6 --- /dev/null +++ b/threads/memory/memory.34.wat @@ -0,0 +1 @@ +(memory $foo 1)(memory $foo 1) \ No newline at end of file diff --git a/threads/memory/memory.35.wat b/threads/memory/memory.35.wat new file mode 100644 index 00000000..bce7a81e --- /dev/null +++ b/threads/memory/memory.35.wat @@ -0,0 +1 @@ +(import "" "" (memory $foo 1))(memory $foo 1) \ No newline at end of file diff --git a/threads/memory/memory.36.wat b/threads/memory/memory.36.wat new file mode 100644 index 00000000..54dc409e --- /dev/null +++ b/threads/memory/memory.36.wat @@ -0,0 +1 @@ +(import "" "" (memory $foo 1))(import "" "" (memory $foo 1)) \ No newline at end of file diff --git a/threads/memory/memory.4.wasm b/threads/memory/memory.4.wasm new file mode 100644 index 00000000..64ffe038 Binary files /dev/null and b/threads/memory/memory.4.wasm differ diff --git a/threads/memory/memory.5.wasm b/threads/memory/memory.5.wasm new file mode 100644 index 00000000..d3e64161 Binary files /dev/null and b/threads/memory/memory.5.wasm differ diff --git a/threads/memory/memory.6.wasm b/threads/memory/memory.6.wasm new file mode 100644 index 00000000..7a0233b2 Binary files /dev/null and b/threads/memory/memory.6.wasm differ diff --git a/threads/memory/memory.7.wasm b/threads/memory/memory.7.wasm new file mode 100644 index 00000000..63ff5d1d Binary files /dev/null and b/threads/memory/memory.7.wasm differ diff --git a/threads/memory/memory.8.wasm b/threads/memory/memory.8.wasm new file mode 100644 index 00000000..924dc2c7 Binary files /dev/null and b/threads/memory/memory.8.wasm differ diff --git a/threads/memory/memory.9.wasm b/threads/memory/memory.9.wasm new file mode 100644 index 00000000..97c84e5f Binary files /dev/null and b/threads/memory/memory.9.wasm differ diff --git a/threads/memory/memory.json b/threads/memory/memory.json new file mode 100644 index 00000000..ecd91c4b --- /dev/null +++ b/threads/memory/memory.json @@ -0,0 +1,84 @@ +{"source_filename": "memory.wast", + "commands": [ + {"type": "module", "line": 3, "filename": "memory.0.wasm"}, + {"type": "module", "line": 4, "filename": "memory.1.wasm"}, + {"type": "module", "line": 5, "filename": "memory.2.wasm"}, + {"type": "module", "line": 6, "filename": "memory.3.wasm"}, + {"type": "module", "line": 7, "filename": "memory.4.wasm"}, + {"type": "module", "line": 8, "filename": "memory.5.wasm"}, + {"type": "module", "line": 9, "filename": "memory.6.wasm"}, + {"type": "module", "line": 10, "filename": "memory.7.wasm"}, + {"type": "assert_invalid", "line": 12, "filename": "memory.8.wasm", "text": "shared memory must have maximum", "module_type": "binary"}, + {"type": "assert_invalid", "line": 14, "filename": "memory.9.wasm", "text": "multiple memories", "module_type": "binary"}, + {"type": "assert_invalid", "line": 15, "filename": "memory.10.wasm", "text": "multiple memories", "module_type": "binary"}, + {"type": "module", "line": 17, "filename": "memory.11.wasm"}, + {"type": "assert_return", "line": 18, "action": {"type": "invoke", "field": "memsize", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "module", "line": 19, "filename": "memory.12.wasm"}, + {"type": "assert_return", "line": 20, "action": {"type": "invoke", "field": "memsize", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, + {"type": "module", "line": 21, "filename": "memory.13.wasm"}, + {"type": "assert_return", "line": 22, "action": {"type": "invoke", "field": "memsize", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_invalid", "line": 24, "filename": "memory.14.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 25, "filename": "memory.15.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 26, "filename": "memory.16.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 29, "filename": "memory.17.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 33, "filename": "memory.18.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 37, "filename": "memory.19.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 41, "filename": "memory.20.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 45, "filename": "memory.21.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 49, "filename": "memory.22.wasm", "text": "unknown memory", "module_type": "binary"}, + {"type": "assert_invalid", "line": 55, "filename": "memory.23.wasm", "text": "size minimum must not be greater than maximum", "module_type": "binary"}, + {"type": "assert_invalid", "line": 59, "filename": "memory.24.wasm", "text": "memory size must be at most 65536 pages (4GiB)", "module_type": "binary"}, + {"type": "assert_invalid", "line": 63, "filename": "memory.25.wasm", "text": "memory size must be at most 65536 pages (4GiB)", "module_type": "binary"}, + {"type": "assert_invalid", "line": 67, "filename": "memory.26.wasm", "text": "memory size must be at most 65536 pages (4GiB)", "module_type": "binary"}, + {"type": "assert_invalid", "line": 71, "filename": "memory.27.wasm", "text": "memory size must be at most 65536 pages (4GiB)", "module_type": "binary"}, + {"type": "assert_invalid", "line": 75, "filename": "memory.28.wasm", "text": "memory size must be at most 65536 pages (4GiB)", "module_type": "binary"}, + {"type": "assert_invalid", "line": 79, "filename": "memory.29.wasm", "text": "memory size must be at most 65536 pages (4GiB)", "module_type": "binary"}, + {"type": "assert_malformed", "line": 84, "filename": "memory.30.wat", "text": "i32 constant out of range", "module_type": "text"}, + {"type": "assert_malformed", "line": 88, "filename": "memory.31.wat", "text": "i32 constant out of range", "module_type": "text"}, + {"type": "assert_malformed", "line": 92, "filename": "memory.32.wat", "text": "i32 constant out of range", "module_type": "text"}, + {"type": "module", "line": 96, "filename": "memory.33.wasm"}, + {"type": "assert_return", "line": 184, "action": {"type": "invoke", "field": "data", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, + {"type": "assert_return", "line": 185, "action": {"type": "invoke", "field": "cast", "args": []}, "expected": [{"type": "f64", "value": "4631107791820423168"}]}, + {"type": "assert_return", "line": 187, "action": {"type": "invoke", "field": "i32_load8_s", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, + {"type": "assert_return", "line": 188, "action": {"type": "invoke", "field": "i32_load8_u", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "255"}]}, + {"type": "assert_return", "line": 189, "action": {"type": "invoke", "field": "i32_load16_s", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, + {"type": "assert_return", "line": 190, "action": {"type": "invoke", "field": "i32_load16_u", "args": [{"type": "i32", "value": "4294967295"}]}, "expected": [{"type": "i32", "value": "65535"}]}, + {"type": "assert_return", "line": 192, "action": {"type": "invoke", "field": "i32_load8_s", "args": [{"type": "i32", "value": "100"}]}, "expected": [{"type": "i32", "value": "100"}]}, + {"type": "assert_return", "line": 193, "action": {"type": "invoke", "field": "i32_load8_u", "args": [{"type": "i32", "value": "200"}]}, "expected": [{"type": "i32", "value": "200"}]}, + {"type": "assert_return", "line": 194, "action": {"type": "invoke", "field": "i32_load16_s", "args": [{"type": "i32", "value": "20000"}]}, "expected": [{"type": "i32", "value": "20000"}]}, + {"type": "assert_return", "line": 195, "action": {"type": "invoke", "field": "i32_load16_u", "args": [{"type": "i32", "value": "40000"}]}, "expected": [{"type": "i32", "value": "40000"}]}, + {"type": "assert_return", "line": 197, "action": {"type": "invoke", "field": "i32_load8_s", "args": [{"type": "i32", "value": "4275856707"}]}, "expected": [{"type": "i32", "value": "67"}]}, + {"type": "assert_return", "line": 198, "action": {"type": "invoke", "field": "i32_load8_s", "args": [{"type": "i32", "value": "878104047"}]}, "expected": [{"type": "i32", "value": "4294967279"}]}, + {"type": "assert_return", "line": 199, "action": {"type": "invoke", "field": "i32_load8_u", "args": [{"type": "i32", "value": "4275856707"}]}, "expected": [{"type": "i32", "value": "67"}]}, + {"type": "assert_return", "line": 200, "action": {"type": "invoke", "field": "i32_load8_u", "args": [{"type": "i32", "value": "878104047"}]}, "expected": [{"type": "i32", "value": "239"}]}, + {"type": "assert_return", "line": 201, "action": {"type": "invoke", "field": "i32_load16_s", "args": [{"type": "i32", "value": "4275856707"}]}, "expected": [{"type": "i32", "value": "25923"}]}, + {"type": "assert_return", "line": 202, "action": {"type": "invoke", "field": "i32_load16_s", "args": [{"type": "i32", "value": "878104047"}]}, "expected": [{"type": "i32", "value": "4294954479"}]}, + {"type": "assert_return", "line": 203, "action": {"type": "invoke", "field": "i32_load16_u", "args": [{"type": "i32", "value": "4275856707"}]}, "expected": [{"type": "i32", "value": "25923"}]}, + {"type": "assert_return", "line": 204, "action": {"type": "invoke", "field": "i32_load16_u", "args": [{"type": "i32", "value": "878104047"}]}, "expected": [{"type": "i32", "value": "52719"}]}, + {"type": "assert_return", "line": 206, "action": {"type": "invoke", "field": "i64_load8_s", "args": [{"type": "i64", "value": "18446744073709551615"}]}, "expected": [{"type": "i64", "value": "18446744073709551615"}]}, + {"type": "assert_return", "line": 207, "action": {"type": "invoke", "field": "i64_load8_u", "args": [{"type": "i64", "value": "18446744073709551615"}]}, "expected": [{"type": "i64", "value": "255"}]}, + {"type": "assert_return", "line": 208, "action": {"type": "invoke", "field": "i64_load16_s", "args": [{"type": "i64", "value": "18446744073709551615"}]}, "expected": [{"type": "i64", "value": "18446744073709551615"}]}, + {"type": "assert_return", "line": 209, "action": {"type": "invoke", "field": "i64_load16_u", "args": [{"type": "i64", "value": "18446744073709551615"}]}, "expected": [{"type": "i64", "value": "65535"}]}, + {"type": "assert_return", "line": 210, "action": {"type": "invoke", "field": "i64_load32_s", "args": [{"type": "i64", "value": "18446744073709551615"}]}, "expected": [{"type": "i64", "value": "18446744073709551615"}]}, + {"type": "assert_return", "line": 211, "action": {"type": "invoke", "field": "i64_load32_u", "args": [{"type": "i64", "value": "18446744073709551615"}]}, "expected": [{"type": "i64", "value": "4294967295"}]}, + {"type": "assert_return", "line": 213, "action": {"type": "invoke", "field": "i64_load8_s", "args": [{"type": "i64", "value": "100"}]}, "expected": [{"type": "i64", "value": "100"}]}, + {"type": "assert_return", "line": 214, "action": {"type": "invoke", "field": "i64_load8_u", "args": [{"type": "i64", "value": "200"}]}, "expected": [{"type": "i64", "value": "200"}]}, + {"type": "assert_return", "line": 215, "action": {"type": "invoke", "field": "i64_load16_s", "args": [{"type": "i64", "value": "20000"}]}, "expected": [{"type": "i64", "value": "20000"}]}, + {"type": "assert_return", "line": 216, "action": {"type": "invoke", "field": "i64_load16_u", "args": [{"type": "i64", "value": "40000"}]}, "expected": [{"type": "i64", "value": "40000"}]}, + {"type": "assert_return", "line": 217, "action": {"type": "invoke", "field": "i64_load32_s", "args": [{"type": "i64", "value": "20000"}]}, "expected": [{"type": "i64", "value": "20000"}]}, + {"type": "assert_return", "line": 218, "action": {"type": "invoke", "field": "i64_load32_u", "args": [{"type": "i64", "value": "40000"}]}, "expected": [{"type": "i64", "value": "40000"}]}, + {"type": "assert_return", "line": 220, "action": {"type": "invoke", "field": "i64_load8_s", "args": [{"type": "i64", "value": "18364758543954109763"}]}, "expected": [{"type": "i64", "value": "67"}]}, + {"type": "assert_return", "line": 221, "action": {"type": "invoke", "field": "i64_load8_s", "args": [{"type": "i64", "value": "3771275841602506223"}]}, "expected": [{"type": "i64", "value": "18446744073709551599"}]}, + {"type": "assert_return", "line": 222, "action": {"type": "invoke", "field": "i64_load8_u", "args": [{"type": "i64", "value": "18364758543954109763"}]}, "expected": [{"type": "i64", "value": "67"}]}, + {"type": "assert_return", "line": 223, "action": {"type": "invoke", "field": "i64_load8_u", "args": [{"type": "i64", "value": "3771275841602506223"}]}, "expected": [{"type": "i64", "value": "239"}]}, + {"type": "assert_return", "line": 224, "action": {"type": "invoke", "field": "i64_load16_s", "args": [{"type": "i64", "value": "18364758543954109763"}]}, "expected": [{"type": "i64", "value": "25923"}]}, + {"type": "assert_return", "line": 225, "action": {"type": "invoke", "field": "i64_load16_s", "args": [{"type": "i64", "value": "3771275841602506223"}]}, "expected": [{"type": "i64", "value": "18446744073709538799"}]}, + {"type": "assert_return", "line": 226, "action": {"type": "invoke", "field": "i64_load16_u", "args": [{"type": "i64", "value": "18364758543954109763"}]}, "expected": [{"type": "i64", "value": "25923"}]}, + {"type": "assert_return", "line": 227, "action": {"type": "invoke", "field": "i64_load16_u", "args": [{"type": "i64", "value": "3771275841602506223"}]}, "expected": [{"type": "i64", "value": "52719"}]}, + {"type": "assert_return", "line": 228, "action": {"type": "invoke", "field": "i64_load32_s", "args": [{"type": "i64", "value": "18364758543954109763"}]}, "expected": [{"type": "i64", "value": "1446274371"}]}, + {"type": "assert_return", "line": 229, "action": {"type": "invoke", "field": "i64_load32_s", "args": [{"type": "i64", "value": "3771275841602506223"}]}, "expected": [{"type": "i64", "value": "18446744071976963567"}]}, + {"type": "assert_return", "line": 230, "action": {"type": "invoke", "field": "i64_load32_u", "args": [{"type": "i64", "value": "18364758543954109763"}]}, "expected": [{"type": "i64", "value": "1446274371"}]}, + {"type": "assert_return", "line": 231, "action": {"type": "invoke", "field": "i64_load32_u", "args": [{"type": "i64", "value": "3771275841602506223"}]}, "expected": [{"type": "i64", "value": "2562379247"}]}, + {"type": "assert_malformed", "line": 235, "filename": "memory.34.wat", "text": "duplicate memory", "module_type": "text"}, + {"type": "assert_malformed", "line": 239, "filename": "memory.35.wat", "text": "duplicate memory", "module_type": "text"}, + {"type": "assert_malformed", "line": 243, "filename": "memory.36.wat", "text": "duplicate memory", "module_type": "text"}]} diff --git a/threads/memory/memory.wast b/threads/memory/memory.wast new file mode 100644 index 00000000..e10c3497 --- /dev/null +++ b/threads/memory/memory.wast @@ -0,0 +1,246 @@ +;; Test memory section structure + +(module (memory 0)) +(module (memory 1)) +(module (memory 0 0)) +(module (memory 0 1)) +(module (memory 1 256)) +(module (memory 0 65536)) +(module (memory 0 0 shared)) +(module (memory 1 2 shared)) + +(assert_invalid (module (memory 1 shared)) "shared memory must have maximum") + +(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") + +(assert_invalid + (module (func (drop (f32.load (i32.const 0))))) + "unknown memory" +) +(assert_invalid + (module (func (f32.store (i32.const 0) (f32.const 0)))) + "unknown memory" +) +(assert_invalid + (module (func (drop (i32.load8_s (i32.const 0))))) + "unknown memory" +) +(assert_invalid + (module (func (i32.store8 (i32.const 0) (i32.const 0)))) + "unknown memory" +) +(assert_invalid + (module (func (drop (memory.size)))) + "unknown memory" +) +(assert_invalid + (module (func (drop (memory.grow (i32.const 0))))) + "unknown memory" +) + + +(assert_invalid + (module (memory 1 0)) + "size minimum must not be greater than maximum" +) +(assert_invalid + (module (memory 65537)) + "memory size must be at most 65536 pages (4GiB)" +) +(assert_invalid + (module (memory 2147483648)) + "memory size must be at most 65536 pages (4GiB)" +) +(assert_invalid + (module (memory 4294967295)) + "memory size must be at most 65536 pages (4GiB)" +) +(assert_invalid + (module (memory 0 65537)) + "memory size must be at most 65536 pages (4GiB)" +) +(assert_invalid + (module (memory 0 2147483648)) + "memory size must be at most 65536 pages (4GiB)" +) +(assert_invalid + (module (memory 0 4294967295)) + "memory size must be at most 65536 pages (4GiB)" +) + +(assert_malformed + (module quote "(memory 0x1_0000_0000)") + "i32 constant out of range" +) +(assert_malformed + (module quote "(memory 0x1_0000_0000 0x1_0000_0000)") + "i32 constant out of range" +) +(assert_malformed + (module quote "(memory 0 0x1_0000_0000)") + "i32 constant out of range" +) + +(module + (memory 1) + (data (i32.const 0) "ABC\a7D") (data (i32.const 20) "WASM") + + ;; Data section + (func (export "data") (result i32) + (i32.and + (i32.and + (i32.and + (i32.eq (i32.load8_u (i32.const 0)) (i32.const 65)) + (i32.eq (i32.load8_u (i32.const 3)) (i32.const 167)) + ) + (i32.and + (i32.eq (i32.load8_u (i32.const 6)) (i32.const 0)) + (i32.eq (i32.load8_u (i32.const 19)) (i32.const 0)) + ) + ) + (i32.and + (i32.and + (i32.eq (i32.load8_u (i32.const 20)) (i32.const 87)) + (i32.eq (i32.load8_u (i32.const 23)) (i32.const 77)) + ) + (i32.and + (i32.eq (i32.load8_u (i32.const 24)) (i32.const 0)) + (i32.eq (i32.load8_u (i32.const 1023)) (i32.const 0)) + ) + ) + ) + ) + + ;; Memory cast + (func (export "cast") (result f64) + (i64.store (i32.const 8) (i64.const -12345)) + (if + (f64.eq + (f64.load (i32.const 8)) + (f64.reinterpret_i64 (i64.const -12345)) + ) + (then (return (f64.const 0))) + ) + (i64.store align=1 (i32.const 9) (i64.const 0)) + (i32.store16 align=1 (i32.const 15) (i32.const 16453)) + (f64.load align=1 (i32.const 9)) + ) + + ;; Sign and zero extending memory loads + (func (export "i32_load8_s") (param $i i32) (result i32) + (i32.store8 (i32.const 8) (local.get $i)) + (i32.load8_s (i32.const 8)) + ) + (func (export "i32_load8_u") (param $i i32) (result i32) + (i32.store8 (i32.const 8) (local.get $i)) + (i32.load8_u (i32.const 8)) + ) + (func (export "i32_load16_s") (param $i i32) (result i32) + (i32.store16 (i32.const 8) (local.get $i)) + (i32.load16_s (i32.const 8)) + ) + (func (export "i32_load16_u") (param $i i32) (result i32) + (i32.store16 (i32.const 8) (local.get $i)) + (i32.load16_u (i32.const 8)) + ) + (func (export "i64_load8_s") (param $i i64) (result i64) + (i64.store8 (i32.const 8) (local.get $i)) + (i64.load8_s (i32.const 8)) + ) + (func (export "i64_load8_u") (param $i i64) (result i64) + (i64.store8 (i32.const 8) (local.get $i)) + (i64.load8_u (i32.const 8)) + ) + (func (export "i64_load16_s") (param $i i64) (result i64) + (i64.store16 (i32.const 8) (local.get $i)) + (i64.load16_s (i32.const 8)) + ) + (func (export "i64_load16_u") (param $i i64) (result i64) + (i64.store16 (i32.const 8) (local.get $i)) + (i64.load16_u (i32.const 8)) + ) + (func (export "i64_load32_s") (param $i i64) (result i64) + (i64.store32 (i32.const 8) (local.get $i)) + (i64.load32_s (i32.const 8)) + ) + (func (export "i64_load32_u") (param $i i64) (result i64) + (i64.store32 (i32.const 8) (local.get $i)) + (i64.load32_u (i32.const 8)) + ) +) + +(assert_return (invoke "data") (i32.const 1)) +(assert_return (invoke "cast") (f64.const 42.0)) + +(assert_return (invoke "i32_load8_s" (i32.const -1)) (i32.const -1)) +(assert_return (invoke "i32_load8_u" (i32.const -1)) (i32.const 255)) +(assert_return (invoke "i32_load16_s" (i32.const -1)) (i32.const -1)) +(assert_return (invoke "i32_load16_u" (i32.const -1)) (i32.const 65535)) + +(assert_return (invoke "i32_load8_s" (i32.const 100)) (i32.const 100)) +(assert_return (invoke "i32_load8_u" (i32.const 200)) (i32.const 200)) +(assert_return (invoke "i32_load16_s" (i32.const 20000)) (i32.const 20000)) +(assert_return (invoke "i32_load16_u" (i32.const 40000)) (i32.const 40000)) + +(assert_return (invoke "i32_load8_s" (i32.const 0xfedc6543)) (i32.const 0x43)) +(assert_return (invoke "i32_load8_s" (i32.const 0x3456cdef)) (i32.const 0xffffffef)) +(assert_return (invoke "i32_load8_u" (i32.const 0xfedc6543)) (i32.const 0x43)) +(assert_return (invoke "i32_load8_u" (i32.const 0x3456cdef)) (i32.const 0xef)) +(assert_return (invoke "i32_load16_s" (i32.const 0xfedc6543)) (i32.const 0x6543)) +(assert_return (invoke "i32_load16_s" (i32.const 0x3456cdef)) (i32.const 0xffffcdef)) +(assert_return (invoke "i32_load16_u" (i32.const 0xfedc6543)) (i32.const 0x6543)) +(assert_return (invoke "i32_load16_u" (i32.const 0x3456cdef)) (i32.const 0xcdef)) + +(assert_return (invoke "i64_load8_s" (i64.const -1)) (i64.const -1)) +(assert_return (invoke "i64_load8_u" (i64.const -1)) (i64.const 255)) +(assert_return (invoke "i64_load16_s" (i64.const -1)) (i64.const -1)) +(assert_return (invoke "i64_load16_u" (i64.const -1)) (i64.const 65535)) +(assert_return (invoke "i64_load32_s" (i64.const -1)) (i64.const -1)) +(assert_return (invoke "i64_load32_u" (i64.const -1)) (i64.const 4294967295)) + +(assert_return (invoke "i64_load8_s" (i64.const 100)) (i64.const 100)) +(assert_return (invoke "i64_load8_u" (i64.const 200)) (i64.const 200)) +(assert_return (invoke "i64_load16_s" (i64.const 20000)) (i64.const 20000)) +(assert_return (invoke "i64_load16_u" (i64.const 40000)) (i64.const 40000)) +(assert_return (invoke "i64_load32_s" (i64.const 20000)) (i64.const 20000)) +(assert_return (invoke "i64_load32_u" (i64.const 40000)) (i64.const 40000)) + +(assert_return (invoke "i64_load8_s" (i64.const 0xfedcba9856346543)) (i64.const 0x43)) +(assert_return (invoke "i64_load8_s" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffffffffffef)) +(assert_return (invoke "i64_load8_u" (i64.const 0xfedcba9856346543)) (i64.const 0x43)) +(assert_return (invoke "i64_load8_u" (i64.const 0x3456436598bacdef)) (i64.const 0xef)) +(assert_return (invoke "i64_load16_s" (i64.const 0xfedcba9856346543)) (i64.const 0x6543)) +(assert_return (invoke "i64_load16_s" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffffffffcdef)) +(assert_return (invoke "i64_load16_u" (i64.const 0xfedcba9856346543)) (i64.const 0x6543)) +(assert_return (invoke "i64_load16_u" (i64.const 0x3456436598bacdef)) (i64.const 0xcdef)) +(assert_return (invoke "i64_load32_s" (i64.const 0xfedcba9856346543)) (i64.const 0x56346543)) +(assert_return (invoke "i64_load32_s" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffff98bacdef)) +(assert_return (invoke "i64_load32_u" (i64.const 0xfedcba9856346543)) (i64.const 0x56346543)) +(assert_return (invoke "i64_load32_u" (i64.const 0x3456436598bacdef)) (i64.const 0x98bacdef)) + +;; Duplicate identifier errors + +(assert_malformed (module quote + "(memory $foo 1)" + "(memory $foo 1)") + "duplicate memory") +(assert_malformed (module quote + "(import \"\" \"\" (memory $foo 1))" + "(memory $foo 1)") + "duplicate memory") +(assert_malformed (module quote + "(import \"\" \"\" (memory $foo 1))" + "(import \"\" \"\" (memory $foo 1))") + "duplicate memory")