diff options
author | Thomas Lively <tlively@google.com> | 2024-01-08 11:46:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 11:46:30 -0800 |
commit | cc0fab918aed3643abdc3566ade3f70f06d1d954 (patch) | |
tree | 923fe1e125e7b4f95c2dfa20e4525f1c10a190f2 | |
parent | 82057de7666b84424f8d2bd90e941762e4e14f0e (diff) | |
download | binaryen-cc0fab918aed3643abdc3566ade3f70f06d1d954.tar.gz binaryen-cc0fab918aed3643abdc3566ade3f70f06d1d954.tar.bz2 binaryen-cc0fab918aed3643abdc3566ade3f70f06d1d954.zip |
Fix incorrect wat in tests (#6207)
The new wat parser is much more strict than the legacy wat parser; the latter
accepts all sorts of things that the spec does not allow. To ease an eventual
transition to using the new wat parser by default, update the tests to use the
standard text format in many places where they previously did not. We do not yet
have a way to prevent new errors from being introduced into the test suite, but
at least there will now be many fewer errors when it comes time to make the
switch.
62 files changed, 274 insertions, 302 deletions
diff --git a/test/ctor-eval/bad-indirect-call.wast b/test/ctor-eval/bad-indirect-call.wast index 29a09fe2e..9ef091ad3 100644 --- a/test/ctor-eval/bad-indirect-call.wast +++ b/test/ctor-eval/bad-indirect-call.wast @@ -4,7 +4,7 @@ (data (i32.const 10) "waka waka waka waka waka") (table 1 1 funcref) (elem (i32.const 0) $call-indirect) - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (call_indirect (type $v) (i32.const 1)) ;; unsafe to call, out of range (i32.store8 (i32.const 20) (i32.const 120)) diff --git a/test/ctor-eval/bad-indirect-call2.wast b/test/ctor-eval/bad-indirect-call2.wast index 8999af145..60d73b7fc 100644 --- a/test/ctor-eval/bad-indirect-call2.wast +++ b/test/ctor-eval/bad-indirect-call2.wast @@ -5,7 +5,7 @@ (import "env" "_abort" (func $_abort)) (table 2 2 funcref) (elem (i32.const 0) $_abort $call-indirect) - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (call_indirect (type $v) (i32.const 0)) ;; unsafe to call, imported (i32.store8 (i32.const 20) (i32.const 120)) diff --git a/test/ctor-eval/basics-flatten.wast b/test/ctor-eval/basics-flatten.wast index 3584bc9fa..f53b772f0 100644 --- a/test/ctor-eval/basics-flatten.wast +++ b/test/ctor-eval/basics-flatten.wast @@ -7,9 +7,9 @@ (data (i32.const 20) "waka waka waka") (table 1 1 funcref) (elem (i32.const 0) $call-indirect) - (export "test1" $test1) - (export "test2" $test2) - (export "test3" $test3) + (export "test1" (func $test1)) + (export "test2" (func $test2)) + (export "test3" (func $test3)) (func $test1 (drop (i32.const 0)) ;; no work at all, really (call $safe-to-call) ;; safe to call diff --git a/test/ctor-eval/basics.wast b/test/ctor-eval/basics.wast index 5f9add08f..ff138de24 100644 --- a/test/ctor-eval/basics.wast +++ b/test/ctor-eval/basics.wast @@ -4,9 +4,9 @@ (data (i32.const 10) "waka waka waka waka waka") (table 1 1 funcref) (elem (i32.const 0) $call-indirect) - (export "test1" $test1) - (export "test2" $test2) - (export "test3" $test3) + (export "test1" (func $test1)) + (export "test2" (func $test2)) + (export "test3" (func $test3)) (func $test1 (drop (i32.const 0)) ;; no work at all, really (call $safe-to-call) ;; safe to call diff --git a/test/ctor-eval/imported-global.wast b/test/ctor-eval/imported-global.wast index 20e56d2d1..1c14a3114 100644 --- a/test/ctor-eval/imported-global.wast +++ b/test/ctor-eval/imported-global.wast @@ -3,7 +3,7 @@ (data (i32.const 10) "waka waka waka waka waka") ;; imports must not be used (import "env" "tempDoublePtr" (global $tempDoublePtr i32)) - (export "test1" $test1) + (export "test1" (func $test1)) (global $mine (mut i32) (global.get $tempDoublePtr)) ;; BAD, if used (func $test1 (i32.store8 (i32.const 13) (i32.const 115)) ;; we never get here. diff --git a/test/ctor-eval/indirect-call3.wast b/test/ctor-eval/indirect-call3.wast index 9c88e0f78..0c18c01d5 100644 --- a/test/ctor-eval/indirect-call3.wast +++ b/test/ctor-eval/indirect-call3.wast @@ -5,7 +5,7 @@ (import "env" "_abort" (func $_abort)) (table 2 2 funcref) (elem (i32.const 0) $_abort $call-indirect) - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (call_indirect (type $v) (i32.const 1)) ;; safe to call (i32.store8 (i32.const 20) (i32.const 120)) diff --git a/test/ctor-eval/just_some.wast b/test/ctor-eval/just_some.wast index 64aa18d27..661688eff 100644 --- a/test/ctor-eval/just_some.wast +++ b/test/ctor-eval/just_some.wast @@ -1,9 +1,9 @@ (module (memory 256 256) (data (i32.const 10) "waka waka waka waka waka") - (export "test1" $test1) - (export "test2" $test2) - (export "test3" $test3) + (export "test1" (func $test1)) + (export "test2" (func $test2)) + (export "test3" (func $test3)) (func $test1 (i32.store8 (i32.const 12) (i32.const 115)) ;; a safe store, should alter memory ) diff --git a/test/ctor-eval/partial-locals-tee.wast b/test/ctor-eval/partial-locals-tee.wast index 37dac176a..651234790 100644 --- a/test/ctor-eval/partial-locals-tee.wast +++ b/test/ctor-eval/partial-locals-tee.wast @@ -4,7 +4,7 @@ (memory 256 256) (data (i32.const 10) "_________________") - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (local $temp i32) diff --git a/test/ctor-eval/partial-locals.wast b/test/ctor-eval/partial-locals.wast index b0304c2ea..4a58274c8 100644 --- a/test/ctor-eval/partial-locals.wast +++ b/test/ctor-eval/partial-locals.wast @@ -4,7 +4,7 @@ (memory 256 256) (data (i32.const 10) "_________________") - (export "test1" $test1) + (export "test1" (func $test1)) (global $sp (mut i32) (i32.const 100)) diff --git a/test/ctor-eval/partial-return.wast b/test/ctor-eval/partial-return.wast index e74c59cb8..95529ea17 100644 --- a/test/ctor-eval/partial-return.wast +++ b/test/ctor-eval/partial-return.wast @@ -4,7 +4,7 @@ (memory 256 256) (data (i32.const 10) "_________________") - (export "test1" $test1) + (export "test1" (func $test1)) (export "memory" (memory $0)) (func $test1 diff --git a/test/ctor-eval/partial.wast b/test/ctor-eval/partial.wast index bbff880e7..e1d033bda 100644 --- a/test/ctor-eval/partial.wast +++ b/test/ctor-eval/partial.wast @@ -4,12 +4,12 @@ (memory 256 256) (data (i32.const 10) "_________________") - (export "test1" $test1) + (export "test1" (func $test1)) ;; Use the function in an additional export. We should still get the same ;; results if we call this one, so it should point to identical contents as ;; earlier - (export "keepalive" $test1) + (export "keepalive" (func $test1)) (func $test1 ;; A safe store, should alter memory diff --git a/test/ctor-eval/unsafe_call.wast b/test/ctor-eval/unsafe_call.wast index a3dff7c19..86543cbf4 100644 --- a/test/ctor-eval/unsafe_call.wast +++ b/test/ctor-eval/unsafe_call.wast @@ -1,7 +1,7 @@ (module (memory 256 256) (data (i32.const 10) "waka waka waka waka waka") - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (call $unsafe-to-call) ;; unsafe to call (i32.store (i32.const 12) (i32.const 115)) ;; a safe store, should alter memory diff --git a/test/ctor-eval/unsafe_store.wast b/test/ctor-eval/unsafe_store.wast index 296363b35..9b0111806 100644 --- a/test/ctor-eval/unsafe_store.wast +++ b/test/ctor-eval/unsafe_store.wast @@ -1,7 +1,7 @@ (module (memory 256 256) (data (i32.const 10) "waka waka waka waka waka") - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (i32.store8 (i32.const 9) (i32.const 109)) ;; before first segment ) diff --git a/test/ctor-eval/unsafe_store2.wast b/test/ctor-eval/unsafe_store2.wast index 5272c8333..7c25eee67 100644 --- a/test/ctor-eval/unsafe_store2.wast +++ b/test/ctor-eval/unsafe_store2.wast @@ -1,7 +1,7 @@ (module (memory 256 256) (data (i32.const 10) "waka waka waka waka waka") - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (i32.store8 (i32.const 34) (i32.const 109)) ;; after last segment ) diff --git a/test/ctor-eval/unsafe_store3.wast b/test/ctor-eval/unsafe_store3.wast index b8e7c662a..64e7a28c4 100644 --- a/test/ctor-eval/unsafe_store3.wast +++ b/test/ctor-eval/unsafe_store3.wast @@ -1,7 +1,7 @@ (module (memory 256 256) (data (i32.const 10) "waka waka waka waka waka") - (export "test1" $test1) + (export "test1" (func $test1)) (func $test1 (i32.store16 (i32.const 33) (i32.const 109)) ;; after last segment due to size of type ) diff --git a/test/lit/basic/atomics.wast b/test/lit/basic/atomics.wast index e73d6b611..44786b31d 100644 --- a/test/lit/basic/atomics.wast +++ b/test/lit/basic/atomics.wast @@ -546,7 +546,7 @@ ) ) (drop - (memory.atomic.wait64 align=8 offset=16 + (memory.atomic.wait64 offset=16 align=8 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/lit/basic/atomics64.wast b/test/lit/basic/atomics64.wast index 255ecc033..016515a91 100644 --- a/test/lit/basic/atomics64.wast +++ b/test/lit/basic/atomics64.wast @@ -558,7 +558,7 @@ ) ) (drop - (memory.atomic.wait64 align=8 offset=16 + (memory.atomic.wait64 offset=16 align=8 (local.get $0) (local.get $1) (local.get $1) diff --git a/test/lit/basic/multi-table.wast b/test/lit/basic/multi-table.wast index b856f8494..3a464dca1 100644 --- a/test/lit/basic/multi-table.wast +++ b/test/lit/basic/multi-table.wast @@ -83,7 +83,7 @@ ;; table. ;; CHECK-TEXT: (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) (ref.func $f) (ref.func $h)) ;; CHECK-BIN: (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) (ref.func $f) (ref.func $h)) - (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) $f $h) + (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) (ref.func $f) (ref.func $h)) ;; CHECK-TEXT: (func $f (type $none_=>_none) ;; CHECK-TEXT-NEXT: (drop diff --git a/test/lit/basic/reference-types.wast b/test/lit/basic/reference-types.wast index 94d4f3525..75d5f313f 100644 --- a/test/lit/basic/reference-types.wast +++ b/test/lit/basic/reference-types.wast @@ -174,7 +174,7 @@ (import "env" "import_func" (func $import_func (param eqref) (result funcref))) (import "env" "import_global" (global $import_global eqref)) - (export "export_func" (func $import_func (param eqref) (result funcref))) + (export "export_func" (func $import_func)) (export "export_global" (global $import_global)) ;; Test global initializer expressions diff --git a/test/lit/basic/simd.wast b/test/lit/basic/simd.wast index 483caefca..af771e659 100644 --- a/test/lit/basic/simd.wast +++ b/test/lit/basic/simd.wast @@ -1738,7 +1738,7 @@ ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $v128.load64_lane_align_offset (param $0 i32) (param $1 v128) (result v128) - (v128.load64_lane align=1 offset=32 0 + (v128.load64_lane offset=32 align=1 0 (local.get $0) (local.get $1) ) @@ -1871,7 +1871,7 @@ ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $v128.store64_lane_align_offset (param $0 i32) (param $1 v128) - (v128.store64_lane align=1 offset=32 0 + (v128.store64_lane offset=32 align=1 0 (local.get $0) (local.get $1) ) diff --git a/test/lit/if-then-else.wast b/test/lit/if-then-else.wast index 9d13cea92..7fa59fad0 100644 --- a/test/lit/if-then-else.wast +++ b/test/lit/if-then-else.wast @@ -30,14 +30,14 @@ ;; CHECK-NEXT: ) (func $test (param i32) (result i32) (if - (local.get $0) + (local.get 0) (then) (else (return (i32.const 0)) ) ) (if - (local.get $0) + (local.get 0) (then (return (i32.const 1) diff --git a/test/lit/merge/renamings.wat b/test/lit/merge/renamings.wat index bb49b7ab7..6d4de5c65 100644 --- a/test/lit/merge/renamings.wat +++ b/test/lit/merge/renamings.wat @@ -72,12 +72,12 @@ ;; CHECK: (table $other 70 80 funcref) ;; CHECK: (elem $foo func $foo $bar) - (elem $foo (ref null func) $foo $bar) + (elem $foo func $foo $bar) ;; This elem has a conflict in second.wat, and so second.wat's $bar ;; will be renamed. ;; CHECK: (elem $bar func $bar $foo) - (elem $bar (ref null func) $bar $foo) + (elem $bar func $bar $foo) ;; CHECK: (elem $other func $foo_3 $other) diff --git a/test/lit/merge/renamings.wat.second b/test/lit/merge/renamings.wat.second index 5c3c5d299..f3489e620 100644 --- a/test/lit/merge/renamings.wat.second +++ b/test/lit/merge/renamings.wat.second @@ -20,9 +20,9 @@ (table $other 70 80 funcref) - (elem $other (ref null func) $foo $other) + (elem $other func $foo $other) - (elem $bar (ref null func) $other $foo) + (elem $bar func $other $foo) (global $other i32 (i32.const 3)) diff --git a/test/lit/passes/Oz.wast b/test/lit/passes/Oz.wast index 42295ec23..8c1db3083 100644 --- a/test/lit/passes/Oz.wast +++ b/test/lit/passes/Oz.wast @@ -48,7 +48,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $basics (export "localcse") (param $x i32) ($param $y i32) (result i32) ;; -O3 does localcse + (func $basics (export "localcse") (param $x i32) (param $y i32) (result i32) ;; -O3 does localcse (local $x2 i32) (local $y2 i32) (local.set $x2 diff --git a/test/lit/passes/alignment-lowering.wast b/test/lit/passes/alignment-lowering.wast index 0bcbbf3df..164229e07 100644 --- a/test/lit/passes/alignment-lowering.wast +++ b/test/lit/passes/alignment-lowering.wast @@ -982,7 +982,7 @@ (drop (i64.load align=1 (i32.const 12))) (drop (i64.load align=2 (i32.const 16))) (drop (i64.load align=4 (i32.const 20))) - (drop (i64.load align=1 offset=3 (i32.const 20))) + (drop (i64.load offset=3 align=1 (i32.const 20))) (drop (i64.load16_s align=1 (i32.const 28))) (drop (i64.load32_s align=1 (i32.const 32))) (drop (i64.load16_u align=1 (i32.const 40))) @@ -1088,7 +1088,7 @@ (func $f32-load (drop (f32.load align=1 (i32.const 12))) (drop (f32.load align=2 (i32.const 16))) - (drop (f32.load align=1 offset=3 (i32.const 20))) + (drop (f32.load offset=3 align=1 (i32.const 20))) ) ;; CHECK: (func $f64-load ;; CHECK-NEXT: (local $0 i32) @@ -1344,7 +1344,7 @@ (drop (f64.load align=1 (i32.const 12))) (drop (f64.load align=2 (i32.const 16))) (drop (f64.load align=4 (i32.const 20))) - (drop (f64.load align=1 offset=3 (i32.const 20))) + (drop (f64.load offset=3 align=1 (i32.const 20))) ) ;; CHECK: (func $i64-store ;; CHECK-NEXT: (local $0 i32) @@ -1670,7 +1670,7 @@ (i64.store align=1 (i32.const 12) (i64.const 100)) (i64.store align=2 (i32.const 16) (i64.const 200)) (i64.store align=4 (i32.const 20) (i64.const 300)) - (i64.store align=1 offset=3 (i32.const 24) (i64.const 400)) + (i64.store offset=3 align=1 (i32.const 24) (i64.const 400)) (i64.store16 align=1 (i32.const 20) (i64.const 600)) (i64.store32 align=1 (i32.const 20) (i64.const 700)) ) @@ -1776,7 +1776,7 @@ (func $f32-store (f32.store align=1 (i32.const 12) (f32.const 100)) (f32.store align=2 (i32.const 16) (f32.const 200)) - (f32.store align=1 offset=3 (i32.const 24) (f32.const 400)) + (f32.store offset=3 align=1 (i32.const 24) (f32.const 400)) ) ;; CHECK: (func $f64-store ;; CHECK-NEXT: (local $0 i32) @@ -2050,6 +2050,6 @@ (f64.store align=1 (i32.const 12) (f64.const 100)) (f64.store align=2 (i32.const 16) (f64.const 200)) (f64.store align=4 (i32.const 20) (f64.const 300)) - (f64.store align=1 offset=3 (i32.const 24) (f64.const 400)) + (f64.store offset=3 align=1 (i32.const 24) (f64.const 400)) ) ) diff --git a/test/lit/passes/alignment-lowering64.wast b/test/lit/passes/alignment-lowering64.wast index de4926911..1a4f05571 100644 --- a/test/lit/passes/alignment-lowering64.wast +++ b/test/lit/passes/alignment-lowering64.wast @@ -982,7 +982,7 @@ (drop (i64.load align=1 (i64.const 12))) (drop (i64.load align=2 (i64.const 16))) (drop (i64.load align=4 (i64.const 20))) - (drop (i64.load align=1 offset=3 (i64.const 20))) + (drop (i64.load offset=3 align=1 (i64.const 20))) (drop (i64.load16_s align=1 (i64.const 28))) (drop (i64.load32_s align=1 (i64.const 32))) (drop (i64.load16_u align=1 (i64.const 40))) @@ -1088,7 +1088,7 @@ (func $f32-load (drop (f32.load align=1 (i64.const 12))) (drop (f32.load align=2 (i64.const 16))) - (drop (f32.load align=1 offset=3 (i64.const 20))) + (drop (f32.load offset=3 align=1 (i64.const 20))) ) ;; CHECK: (func $f64-load ;; CHECK-NEXT: (local $0 i64) @@ -1344,7 +1344,7 @@ (drop (f64.load align=1 (i64.const 12))) (drop (f64.load align=2 (i64.const 16))) (drop (f64.load align=4 (i64.const 20))) - (drop (f64.load align=1 offset=3 (i64.const 20))) + (drop (f64.load offset=3 align=1 (i64.const 20))) ) ;; CHECK: (func $i64-store ;; CHECK-NEXT: (local $0 i64) @@ -1670,7 +1670,7 @@ (i64.store align=1 (i64.const 12) (i64.const 100)) (i64.store align=2 (i64.const 16) (i64.const 200)) (i64.store align=4 (i64.const 20) (i64.const 300)) - (i64.store align=1 offset=3 (i64.const 24) (i64.const 400)) + (i64.store offset=3 align=1 (i64.const 24) (i64.const 400)) (i64.store16 align=1 (i64.const 20) (i64.const 600)) (i64.store32 align=1 (i64.const 20) (i64.const 700)) ) @@ -1776,7 +1776,7 @@ (func $f32-store (f32.store align=1 (i64.const 12) (f32.const 100)) (f32.store align=2 (i64.const 16) (f32.const 200)) - (f32.store align=1 offset=3 (i64.const 24) (f32.const 400)) + (f32.store offset=3 align=1 (i64.const 24) (f32.const 400)) ) ;; CHECK: (func $f64-store ;; CHECK-NEXT: (local $0 i64) @@ -2050,6 +2050,6 @@ (f64.store align=1 (i64.const 12) (f64.const 100)) (f64.store align=2 (i64.const 16) (f64.const 200)) (f64.store align=4 (i64.const 20) (f64.const 300)) - (f64.store align=1 offset=3 (i64.const 24) (f64.const 400)) + (f64.store offset=3 align=1 (i64.const 24) (f64.const 400)) ) ) diff --git a/test/lit/passes/coalesce-locals-learning.wast b/test/lit/passes/coalesce-locals-learning.wast index aa20e87c5..5451c68cd 100644 --- a/test/lit/passes/coalesce-locals-learning.wast +++ b/test/lit/passes/coalesce-locals-learning.wast @@ -18,9 +18,8 @@ (type $3 (func (param i32 f32))) ;; CHECK: (type $4 (func (param i32))) (type $4 (func (param i32))) - (import $_emscripten_autodebug_i32 "env" "_emscripten_autodebug_i32" (param i32 i32) (result i32)) ;; CHECK: (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) - + (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) ;; CHECK: (memory $0 10) ;; CHECK: (func $nothing-to-do diff --git a/test/lit/passes/coalesce-locals.wast b/test/lit/passes/coalesce-locals.wast index 9666c02fa..38fefc17a 100644 --- a/test/lit/passes/coalesce-locals.wast +++ b/test/lit/passes/coalesce-locals.wast @@ -23,9 +23,6 @@ (type $2 (func)) (type $3 (func (param i32 f32))) (type $4 (func (param i32))) - (import $_emscripten_autodebug_i32 "env" "_emscripten_autodebug_i32" (param i32 i32) (result i32)) - (import $get "env" "get" (result i32)) - (import $set "env" "set" (param i32)) ;; CHECK: (type $7 (func (param i32) (result i32))) ;; CHECK: (type $8 (func (param i32 i32))) @@ -33,11 +30,11 @@ ;; CHECK: (type $9 (func (result f64))) ;; CHECK: (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) - + (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) ;; CHECK: (import "env" "get" (func $get (result i32))) - + (import "env" "get" (func $get (result i32))) ;; CHECK: (import "env" "set" (func $set (param i32))) - + (import "env" "set" (func $set (param i32))) ;; CHECK: (memory $0 10) ;; CHECK: (func $nothing-to-do diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast index 11638b62f..f478c2ff3 100644 --- a/test/lit/passes/dae-gc-refine-return.wast +++ b/test/lit/passes/dae-gc-refine-return.wast @@ -541,7 +541,7 @@ (if (local.get $y) (then - (return (struct.new ${i32_f32})) + (return (struct.new_default ${i32_f32})) ) (else (return (ref.null any)) @@ -549,7 +549,7 @@ ) ) (else - (return (struct.new ${i32_i64})) + (return (struct.new_default ${i32_i64})) ) ) ) @@ -570,12 +570,12 @@ ;; Call $update-null so it gets optimized. (Call it with various values so ;; that other opts do not inline the constants.) (drop - ($call $update-null + (call $update-null (i32.const 0) (i32.const 1) ) ) - ($call $update-null + (call $update-null (i32.const 1) (i32.const 0) ) diff --git a/test/lit/passes/directize_all-features.wast b/test/lit/passes/directize_all-features.wast index c560baf0e..706a86c46 100644 --- a/test/lit/passes/directize_all-features.wast +++ b/test/lit/passes/directize_all-features.wast @@ -1325,11 +1325,11 @@ ;; CHECK: (elem $0 (table $has-set) (i32.const 1) func $foo) ;; IMMUT: (elem $0 (table $has-set) (i32.const 1) func $foo) - (elem $0 (table $has-set) (i32.const 1) $foo) + (elem $0 (table $has-set) (i32.const 1) func $foo) ;; CHECK: (elem $1 (table $no-set) (i32.const 1) func $foo) ;; IMMUT: (elem $1 (table $no-set) (i32.const 1) func $foo) - (elem $1 (table $no-set) (i32.const 1) $foo) + (elem $1 (table $no-set) (i32.const 1) func $foo) ;; CHECK: (func $foo (type $v) ;; CHECK-NEXT: (table.set $has-set diff --git a/test/lit/passes/flatten_all-features.wast b/test/lit/passes/flatten_all-features.wast index fd7332609..aa3dc7578 100644 --- a/test/lit/passes/flatten_all-features.wast +++ b/test/lit/passes/flatten_all-features.wast @@ -661,8 +661,8 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $a13 (result i32) - (block $x i32 - (if i32 + (block $x (result i32) + (if (result i32) (br_table $x (i32.const 2) (i32.const 0)) (then (i32.const 0) @@ -702,7 +702,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $a14 (result i32) - (block i32 + (block (result i32) (select (i32.const 0) (i32.const 1) (br_table 0 (i32.const 7) (i32.const 1)) ) diff --git a/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast b/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast index 4f1aa8ec3..142fabeea 100644 --- a/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast +++ b/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast @@ -84,7 +84,6 @@ ) (i32.const 15) ) - (i64.const 1) ) ) (else @@ -182,4 +181,3 @@ (i32.const -2766) ) ) - diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast index 6d997dfa5..6bf32e95b 100644 --- a/test/lit/passes/gufa-refs.wast +++ b/test/lit/passes/gufa-refs.wast @@ -4361,7 +4361,6 @@ (i32.const 22) (f64.const 3.14159) ) - (i32.const 11) ) ;; This write might alias both types now. (struct.set $struct 0 @@ -4433,7 +4432,6 @@ (i32.const 10) (f64.const 3.14159) ) - (i32.const 10) ) (struct.set $struct 0 (global.get $something) diff --git a/test/lit/passes/instrument-memory.wast b/test/lit/passes/instrument-memory.wast index 86053c51c..74b1e75d4 100644 --- a/test/lit/passes/instrument-memory.wast +++ b/test/lit/passes/instrument-memory.wast @@ -421,20 +421,20 @@ (drop (f32.load (i32.const 0))) (drop (f64.load (i32.const 0))) - (drop (i32.load8_s align=1 offset=1 (i32.const 0))) - (drop (i32.load8_u align=1 offset=2 (i32.const 0))) - (drop (i32.load16_s align=1 offset=3 (i32.const 0))) - (drop (i32.load16_u align=1 offset=4 (i32.const 0))) - (drop (i32.load align=2 offset=5 (i32.const 0))) - (drop (i64.load8_s align=1 offset=6 (i32.const 0))) - (drop (i64.load8_u align=1 offset=7 (i32.const 0))) - (drop (i64.load16_s align=1 offset=8 (i32.const 0))) - (drop (i64.load16_u align=1 offset=9 (i32.const 0))) - (drop (i64.load32_s align=2 offset=10 (i32.const 0))) - (drop (i64.load32_u align=2 offset=11 (i32.const 0))) - (drop (i64.load align=2 offset=12 (i32.const 0))) - (drop (f32.load align=2 offset=13 (i32.const 0))) - (drop (f64.load align=2 offset=14 (i32.const 0))) + (drop (i32.load8_s offset=1 align=1 (i32.const 0))) + (drop (i32.load8_u offset=2 align=1 (i32.const 0))) + (drop (i32.load16_s offset=3 align=1 (i32.const 0))) + (drop (i32.load16_u offset=4 align=1 (i32.const 0))) + (drop (i32.load offset=5 align=2 (i32.const 0))) + (drop (i64.load8_s offset=6 align=1 (i32.const 0))) + (drop (i64.load8_u offset=7 align=1 (i32.const 0))) + (drop (i64.load16_s offset=8 align=1 (i32.const 0))) + (drop (i64.load16_u offset=9 align=1 (i32.const 0))) + (drop (i64.load32_s offset=10 align=2 (i32.const 0))) + (drop (i64.load32_u offset=11 align=2 (i32.const 0))) + (drop (i64.load offset=12 align=2 (i32.const 0))) + (drop (f32.load offset=13 align=2 (i32.const 0))) + (drop (f64.load offset=14 align=2 (i32.const 0))) ) ;; CHECK: (func $B @@ -666,14 +666,14 @@ (f32.store (i32.const 0) (f32.const 8)) (f64.store (i32.const 0) (f64.const 9)) - (i32.store8 align=1 offset=1 (i32.const 0) (i32.const 1)) - (i32.store16 align=1 offset=2 (i32.const 0) (i32.const 2)) - (i32.store align=2 offset=3 (i32.const 0) (i32.const 3)) - (i64.store8 align=1 offset=4 (i32.const 0) (i64.const 4)) - (i64.store16 align=2 offset=5 (i32.const 0) (i64.const 5)) - (i64.store32 align=2 offset=6 (i32.const 0) (i64.const 6)) - (i64.store align=2 offset=7 (i32.const 0) (i64.const 7)) - (f32.store align=2 offset=8 (i32.const 0) (f32.const 8)) - (f64.store align=2 offset=9 (i32.const 0) (f64.const 9)) + (i32.store8 offset=1 align=1 (i32.const 0) (i32.const 1)) + (i32.store16 offset=2 align=1 (i32.const 0) (i32.const 2)) + (i32.store offset=3 align=2 (i32.const 0) (i32.const 3)) + (i64.store8 offset=4 align=1 (i32.const 0) (i64.const 4)) + (i64.store16 offset=5 align=2 (i32.const 0) (i64.const 5)) + (i64.store32 offset=6 align=2 (i32.const 0) (i64.const 6)) + (i64.store offset=7 align=2 (i32.const 0) (i64.const 7)) + (f32.store offset=8 align=2 (i32.const 0) (f32.const 8)) + (f64.store offset=9 align=2 (i32.const 0) (f64.const 9)) ) ) diff --git a/test/lit/passes/instrument-memory64.wast b/test/lit/passes/instrument-memory64.wast index 832777a45..1f3be75d5 100644 --- a/test/lit/passes/instrument-memory64.wast +++ b/test/lit/passes/instrument-memory64.wast @@ -421,20 +421,20 @@ (drop (f32.load (i64.const 0))) (drop (f64.load (i64.const 0))) - (drop (i32.load8_s align=1 offset=1 (i64.const 0))) - (drop (i32.load8_u align=1 offset=2 (i64.const 0))) - (drop (i32.load16_s align=1 offset=3 (i64.const 0))) - (drop (i32.load16_u align=1 offset=4 (i64.const 0))) - (drop (i32.load align=2 offset=5 (i64.const 0))) - (drop (i64.load8_s align=1 offset=6 (i64.const 0))) - (drop (i64.load8_u align=1 offset=7 (i64.const 0))) - (drop (i64.load16_s align=1 offset=8 (i64.const 0))) - (drop (i64.load16_u align=1 offset=9 (i64.const 0))) - (drop (i64.load32_s align=2 offset=10 (i64.const 0))) - (drop (i64.load32_u align=2 offset=11 (i64.const 0))) - (drop (i64.load align=2 offset=12 (i64.const 0))) - (drop (f32.load align=2 offset=13 (i64.const 0))) - (drop (f64.load align=2 offset=14 (i64.const 0))) + (drop (i32.load8_s offset=1 align=1 (i64.const 0))) + (drop (i32.load8_u offset=2 align=1 (i64.const 0))) + (drop (i32.load16_s offset=3 align=1 (i64.const 0))) + (drop (i32.load16_u offset=4 align=1 (i64.const 0))) + (drop (i32.load offset=5 align=2 (i64.const 0))) + (drop (i64.load8_s offset=6 align=1 (i64.const 0))) + (drop (i64.load8_u offset=7 align=1 (i64.const 0))) + (drop (i64.load16_s offset=8 align=1 (i64.const 0))) + (drop (i64.load16_u offset=9 align=1 (i64.const 0))) + (drop (i64.load32_s offset=10 align=2 (i64.const 0))) + (drop (i64.load32_u offset=11 align=2 (i64.const 0))) + (drop (i64.load offset=12 align=2 (i64.const 0))) + (drop (f32.load offset=13 align=2 (i64.const 0))) + (drop (f64.load offset=14 align=2 (i64.const 0))) ) ;; CHECK: (func $B @@ -666,14 +666,14 @@ (f32.store (i64.const 0) (f32.const 8)) (f64.store (i64.const 0) (f64.const 9)) - (i32.store8 align=1 offset=1 (i64.const 0) (i32.const 1)) - (i32.store16 align=1 offset=2 (i64.const 0) (i32.const 2)) - (i32.store align=2 offset=3 (i64.const 0) (i32.const 3)) - (i64.store8 align=1 offset=4 (i64.const 0) (i64.const 4)) - (i64.store16 align=2 offset=5 (i64.const 0) (i64.const 5)) - (i64.store32 align=2 offset=6 (i64.const 0) (i64.const 6)) - (i64.store align=2 offset=7 (i64.const 0) (i64.const 7)) - (f32.store align=2 offset=8 (i64.const 0) (f32.const 8)) - (f64.store align=2 offset=9 (i64.const 0) (f64.const 9)) + (i32.store8 offset=1 align=1 (i64.const 0) (i32.const 1)) + (i32.store16 offset=2 align=1 (i64.const 0) (i32.const 2)) + (i32.store offset=3 align=2 (i64.const 0) (i32.const 3)) + (i64.store8 offset=4 align=1 (i64.const 0) (i64.const 4)) + (i64.store16 offset=5 align=2 (i64.const 0) (i64.const 5)) + (i64.store32 offset=6 align=2 (i64.const 0) (i64.const 6)) + (i64.store offset=7 align=2 (i64.const 0) (i64.const 7)) + (f32.store offset=8 align=2 (i64.const 0) (f32.const 8)) + (f64.store offset=9 align=2 (i64.const 0) (f64.const 9)) ) ) diff --git a/test/lit/passes/multi-memory-lowering.wast b/test/lit/passes/multi-memory-lowering.wast index 7508a5627..9b7f53635 100644 --- a/test/lit/passes/multi-memory-lowering.wast +++ b/test/lit/passes/multi-memory-lowering.wast @@ -373,7 +373,7 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) (func $v128.load16_lane (param $0 i32) (param $1 v128) (result v128) - (v128.load16_lane $memory2 align=1 offset=32 0 + (v128.load16_lane $memory2 offset=32 align=1 0 (local.get $0) (local.get $1) ) @@ -417,7 +417,7 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) (func $v128.load32_zero (param $0 i32) (result v128) - (v128.load32_zero $memory3 align=1 offset=16 + (v128.load32_zero $memory3 offset=16 align=1 (local.get $0) ) ) diff --git a/test/lit/passes/outlining.wast b/test/lit/passes/outlining.wast index ee6dd5d90..6e298b5fd 100644 --- a/test/lit/passes/outlining.wast +++ b/test/lit/passes/outlining.wast @@ -731,12 +731,12 @@ ;; Test outlining works with call_indirect ;; 0 results, 2 params, 3 operands (module - (table funcref) + (table 1 1 funcref) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32 i32))) - ;; CHECK: (table $0 0 funcref) + ;; CHECK: (table $0 1 1 funcref) ;; CHECK: (func $outline$ (type $0) ;; CHECK-NEXT: (call_indirect $0 (type $1) @@ -769,10 +769,10 @@ ;; Test outlining works with call_indirect ;; 0 results, 0 params, 1 operand (module - (table funcref) + (table 1 1 funcref) ;; CHECK: (type $0 (func)) - ;; CHECK: (table $0 0 funcref) + ;; CHECK: (table $0 1 1 funcref) ;; CHECK: (func $outline$ (type $0) ;; CHECK-NEXT: (call_indirect $0 (type $0) @@ -797,12 +797,12 @@ ;; Test outlining works with call_indirect ;; 1 result, 0 params, 1 operand (module - (table funcref) + (table 1 1 funcref) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (result i32))) - ;; CHECK: (table $0 0 funcref) + ;; CHECK: (table $0 1 1 funcref) ;; CHECK: (func $outline$ (type $0) ;; CHECK-NEXT: (drop @@ -835,12 +835,12 @@ ;; Test outlining works with call_indirect ;; 2 results, 0 params, 1 operand (module - (table funcref) + (table 1 1 funcref) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (result i32 i32))) - ;; CHECK: (table $0 0 funcref) + ;; CHECK: (table $0 1 1 funcref) ;; CHECK: (func $outline$ (type $0) ;; CHECK-NEXT: (tuple.drop 2 diff --git a/test/lit/passes/poppify.wast b/test/lit/passes/poppify.wast index 93a0353e3..b8323b717 100644 --- a/test/lit/passes/poppify.wast +++ b/test/lit/passes/poppify.wast @@ -64,7 +64,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $block (result i32) - (block i32 + (block (result i32) (nop) (i32.const 0) ) @@ -80,9 +80,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $nested (result i32) - (block $block i32 - (block $block0 i32 - (block $block1 i32 + (block $block (result i32) + (block $block0 (result i32) + (block $block1 (result i32) (i32.const 0) ) ) @@ -93,9 +93,9 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) (func $nested-nonames (result i32) - (block i32 - (block i32 - (block i32 + (block (result i32) + (block (result i32) + (block (result i32) (i32.const 0) ) ) @@ -160,7 +160,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $block-br (result i32) - (block $l i32 + (block $l (result i32) (nop) (br $l (i32.const 0) @@ -211,7 +211,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else (result i32) - (if i32 + (if (result i32) (i32.const 0) (then (i32.const 1) @@ -238,7 +238,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $try-catch (result i32) - (try i32 + (try (result i32) (do (throw $e (i32.const 0) @@ -272,7 +272,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $try-delegate (result i32) - (try $l0 i32 + (try $l0 (result i32) (do (try (do diff --git a/test/lit/passes/remove-unused-module-elements_all-features.wast b/test/lit/passes/remove-unused-module-elements_all-features.wast index c964d8c28..23f018787 100644 --- a/test/lit/passes/remove-unused-module-elements_all-features.wast +++ b/test/lit/passes/remove-unused-module-elements_all-features.wast @@ -35,9 +35,9 @@ (type $2-dupe (func (param i32) (result i32))) (type $2-thrupe (func (param i32) (result i32))) (export "memory" (memory $0)) - (export "exported" $exported) - (export "other1" $other1) - (export "other2" $other2) + (export "exported" (func $exported)) + (export "other1" (func $other1)) + (export "other2" (func $other2)) (table 1 1 funcref) (elem (i32.const 0) $called_indirect) ;; CHECK: (func $start (type $0) @@ -237,11 +237,10 @@ ;; CHECK: (import "env" "memory" (memory $0 256)) (import "env" "memory" (memory $0 256)) (import "env" "table" (table 0 funcref)) - (export "user" $user) ;; CHECK: (import "env" "table" (table $timport$0 0 funcref)) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.load @@ -262,9 +261,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 0) @@ -280,9 +278,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (i32.atomic.rmw.add ;; CHECK-NEXT: (i32.const 0) @@ -298,9 +295,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (i32.atomic.rmw8.cmpxchg_u ;; CHECK-NEXT: (i32.const 0) @@ -317,9 +313,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i64) @@ -348,9 +343,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (memory.atomic.notify ;; CHECK-NEXT: (i32.const 0) @@ -364,13 +358,12 @@ (module ;; atomic.fence and data.drop do not use a memory, so should not keep the memory alive. (memory $0 1 1 shared) (data "") - (export "fake-user" $user) ;; CHECK: (type $0 (func)) ;; CHECK: (data $0 "") ;; CHECK: (export "fake-user" (func $user)) - + (export "fake-user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (atomic.fence) ;; CHECK-NEXT: (data.drop $0) @@ -389,9 +382,8 @@ (memory $1 23 256) (memory $unused 1 1) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (memory.grow $0 @@ -414,9 +406,8 @@ ;; CHECK: (memory $0 23 256) (memory $0 23 256) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (memory.size) ;; CHECK-NEXT: ) @@ -432,9 +423,8 @@ ;; CHECK: (memory $1 1 1) (memory $1 1 1) (memory $unused 1 1) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (memory.copy $0 $1 ;; CHECK-NEXT: (i32.const 0) @@ -620,17 +610,17 @@ (table $defined-used 6 6 funcref) ;; CHECK: (elem $active1 (table $written) (i32.const 0) func $0) - (elem $active1 (table $written) (i32.const 0) $0) + (elem $active1 (table $written) (i32.const 0) func $0) ;; This empty active segment doesn't keep the unwritten table alive. - (elem $active2 (table $unwritten) (i32.const 0)) + (elem $active2 (table $unwritten) (i32.const 0) func) - (elem $active3 (table $defined-unused) (i32.const 0) $0) + (elem $active3 (table $defined-unused) (i32.const 0) func $0) ;; CHECK: (elem $active4 (table $defined-used) (i32.const 0) func $0) - (elem $active4 (table $defined-used) (i32.const 0) $0) + (elem $active4 (table $defined-used) (i32.const 0) func $0) - (elem $active5 (table $defined-used) (i32.const 0)) + (elem $active5 (table $defined-used) (i32.const 0) func) ;; CHECK: (func $0 (type $0) (param $var$0 f64) (result f64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (table.get $defined-used @@ -748,7 +738,6 @@ (array.new_elem $array 1 (i32.const 0) (i32.const 0) - (i32.const 0) ) ) ) diff --git a/test/lit/passes/stack-check-memory64.wast b/test/lit/passes/stack-check-memory64.wast index 137b156de..807e733e7 100644 --- a/test/lit/passes/stack-check-memory64.wast +++ b/test/lit/passes/stack-check-memory64.wast @@ -4,7 +4,7 @@ ;; RUN: foreach %s %t wasm-opt --stack-check --enable-memory64 -S -o - | filecheck %s (module - (memory i64 (data)) + (memory i64 0 0) ;; CHECK: (type $0 (func (result i64))) ;; CHECK: (type $1 (func (param i64 i64))) @@ -15,9 +15,7 @@ ;; CHECK: (global $__stack_limit (mut i64) (i64.const 0)) - ;; CHECK: (memory $0 i64 0 65536) - - ;; CHECK: (data $0 (i64.const 0) "") + ;; CHECK: (memory $0 i64 0 0) ;; CHECK: (export "use_stack" (func $use_stack)) @@ -64,7 +62,7 @@ ;; CHECK-NEXT: ) (module ;; if the global names are taken we should not crash - (memory i64 (data)) + (memory i64 0 0) ;; CHECK: (type $0 (func (result i64))) ;; CHECK: (type $1 (func (param i64 i64))) @@ -79,9 +77,7 @@ ;; CHECK: (global $__stack_limit_3 (mut i64) (i64.const 0)) - ;; CHECK: (memory $0 i64 0 65536) - - ;; CHECK: (data $0 (i64.const 0) "") + ;; CHECK: (memory $0 i64 0 0) ;; CHECK: (export "use_stack" (func $0)) (export "use_stack" (func $0)) diff --git a/test/lit/passes/stack-ir-non-nullable.wast b/test/lit/passes/stack-ir-non-nullable.wast index 62d75d61f..99bad9423 100644 --- a/test/lit/passes/stack-ir-non-nullable.wast +++ b/test/lit/passes/stack-ir-non-nullable.wast @@ -535,7 +535,6 @@ (if (i32.eqz (local.get $temp) - (i32.const 0) ) (then (local.set $temp diff --git a/test/lit/passes/unsubtyping-casts.wast b/test/lit/passes/unsubtyping-casts.wast index 8019efcd8..c1993e8b4 100644 --- a/test/lit/passes/unsubtyping-casts.wast +++ b/test/lit/passes/unsubtyping-casts.wast @@ -424,21 +424,21 @@ (local $l (ref null $topA)) (local.set $l ;; Require $botA <: $topA. - (struct.new $botA) + (struct.new_default $botA) ) (drop ;; Now the cast requires $midA <: $topA so that a $botA value appearing in ;; the $topA location would still pass the cast to $midA. This will ;; transitively require $botB <: $topB. (ref.cast (ref $midA) - (struct.new $topA) + (struct.new_default $topA) ) ) (drop ;; Same as before, but now for the B types. This requires $botC <: $topC, but ;; only after the previous cast has already been analyzed. (ref.cast (ref $midB) - (struct.new $topB) + (struct.new_default $topB) ) ) (drop diff --git a/test/lit/passes/unsubtyping.wast b/test/lit/passes/unsubtyping.wast index 38549504e..ad74ab736 100644 --- a/test/lit/passes/unsubtyping.wast +++ b/test/lit/passes/unsubtyping.wast @@ -468,8 +468,8 @@ ;; CHECK: (type $2 (func (param (ref $super)))) - ;; CHECK: (table $t 0 funcref) - (table $t funcref) + ;; CHECK: (table $t 1 1 funcref) + (table $t 1 1 funcref) ;; CHECK: (func $call-indirect (type $2) (param $0 (ref $super)) ;; CHECK-NEXT: (call_indirect $t (type $2) @@ -497,8 +497,8 @@ ;; CHECK: (type $3 (func (result (ref $super)))) - ;; CHECK: (table $t 0 funcref) - (table $t funcref) + ;; CHECK: (table $t 1 1 funcref) + (table $t 1 1 funcref) ;; CHECK: (func $return-call-indirect (type $3) (result (ref $super)) ;; CHECK-NEXT: (return_call_indirect $t (type $2) @@ -521,8 +521,8 @@ (type $super (sub (func))) (type $sub (sub $super (func))) - ;; CHECK: (table $t 0 (ref null $super)) - (table $t (ref null $super) 1 1) + ;; CHECK: (table $t 1 1 (ref null $super)) + (table $t 1 1 (ref null $super)) ;; CHECK: (func $call-indirect-table (type $sub) ;; CHECK-NEXT: (call_indirect $t (type $sub) @@ -739,8 +739,8 @@ ;; CHECK: (type $2 (func)) - ;; CHECK: (table $t 0 (ref null $super)) - (table $t (ref null $super) 1 1) + ;; CHECK: (table $t 1 1 (ref null $super)) + (table $t 1 1 (ref null $super)) ;; CHECK: (func $table-set (type $2) ;; CHECK-NEXT: (table.set $t @@ -766,8 +766,8 @@ ;; CHECK: (type $2 (func)) - ;; CHECK: (table $t 0 (ref null $super)) - (table $t (ref null $super) 1 1) + ;; CHECK: (table $t 1 1 (ref null $super)) + (table $t 1 1 (ref null $super)) ;; CHECK: (func $table-fill (type $2) ;; CHECK-NEXT: (table.fill $t @@ -795,11 +795,11 @@ ;; CHECK: (type $sub (sub $super (struct ))) (type $sub (sub $super (struct))) - ;; CHECK: (table $super 0 (ref null $super)) - (table $super (ref null $super) 1 1) + ;; CHECK: (table $super 1 1 (ref null $super)) + (table $super 1 1 (ref null $super)) - ;; CHECK: (table $sub 0 (ref null $sub)) - (table $sub (ref null $sub) 1 1) + ;; CHECK: (table $sub 1 1 (ref null $sub)) + (table $sub 1 1 (ref null $sub)) ;; CHECK: (func $table-copy (type $0) ;; CHECK-NEXT: (table.copy $super $sub diff --git a/test/lit/passes/vacuum_all-features.wast b/test/lit/passes/vacuum_all-features.wast index e4b183663..5dbbb9386 100644 --- a/test/lit/passes/vacuum_all-features.wast +++ b/test/lit/passes/vacuum_all-features.wast @@ -16,13 +16,12 @@ (type $3 (func (result i32))) ;; CHECK: (type $4 (func (param i32 f64 i32 i32))) (type $4 (func (param i32 f64 i32 i32))) - (import $int "env" "int" (result i32)) ;; CHECK: (type $5 (func (param i32) (result i32))) ;; CHECK: (type $6 (func (result f64))) ;; CHECK: (import "env" "int" (func $int (type $3) (result i32))) - + (import "env" "int" (func $int (result i32))) ;; CHECK: (global $Int i32 (i32.const 0)) (global $Int i32 (i32.const 0)) ;; CHECK: (memory $0 256 256) @@ -1148,7 +1147,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $_deflate (param i32) (result i32) - (call $_deflate (local.get $0)) + (call $_deflate (local.get 0)) ) ;; CHECK: (func $_deflateInit2_ (type $0) (param $0 i32) (result i32) ;; CHECK-NEXT: (call $_deflateInit2_ @@ -1156,7 +1155,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $_deflateInit2_ (param i32) (result i32) - (call $_deflateInit2_ (local.get $0)) + (call $_deflateInit2_ (local.get 0)) ) ;; CHECK: (func $_deflateEnd (type $0) (param $0 i32) (result i32) ;; CHECK-NEXT: (call $_deflateEnd @@ -1164,7 +1163,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $_deflateEnd (param i32) (result i32) - (call $_deflateEnd (local.get $0)) + (call $_deflateEnd (local.get 0)) ) ;; CHECK: (func $compress (type $1) (param $0 i32) (param $1 i32) (param $2 i32) ;; CHECK-NEXT: (local $3 i32) diff --git a/test/metadce/segments.wast b/test/metadce/segments.wast index 96e0088e8..261c4e164 100644 --- a/test/metadce/segments.wast +++ b/test/metadce/segments.wast @@ -2,7 +2,7 @@ (import "env" "g1" (global $g1 i32)) (import "env" "g2" (global $g2 i32)) - (table $tbl funcref) + (table $tbl 1 funcref) (elem (offset (global.get $g1)) funcref (ref.func $f)) (memory 3) diff --git a/test/metadce/segments.wast.dced b/test/metadce/segments.wast.dced index 2989ad60a..a5694e863 100644 --- a/test/metadce/segments.wast.dced +++ b/test/metadce/segments.wast.dced @@ -4,7 +4,7 @@ (import "env" "g2" (global $g2 i32)) (memory $0 3) (data $0 (global.get $g2) "xxx") - (table $tbl 0 funcref) + (table $tbl 1 funcref) (elem $0 (global.get $g1) $f) (export "f" (func $f)) (func $f (type $0) (param $0 i32) diff --git a/test/metadce/table.wast b/test/metadce/table.wast index d1ee93ae4..5b226b60f 100644 --- a/test/metadce/table.wast +++ b/test/metadce/table.wast @@ -6,7 +6,7 @@ (table $table-unused 10 funcref) ;; An active element segment, which is always used. - (elem $elem (table $table-used) (i32.const 0) $func) + (elem $elem (table $table-used) (i32.const 0) func $func) (elem $passive-elem-used $func) @@ -27,4 +27,3 @@ ) ) ) - diff --git a/test/passes/Oz_fuzz-exec_all-features.wast b/test/passes/Oz_fuzz-exec_all-features.wast index 1d2b106b7..3893ddccd 100644 --- a/test/passes/Oz_fuzz-exec_all-features.wast +++ b/test/passes/Oz_fuzz-exec_all-features.wast @@ -79,7 +79,7 @@ (struct.new_default $struct) ) (drop - (block $block (result ($ref $struct)) + (block $block (result (ref $struct)) (drop (block $extendedblock (result (ref $extendedstruct)) (drop @@ -348,7 +348,7 @@ (struct.new_default $struct) ) (drop - (block $block (result ($ref $struct)) + (block $block (result (ref $struct)) (drop (block $extendedblock (result (ref $extendedstruct)) (drop diff --git a/test/passes/duplicate-function-elimination_optimize-level=1.wast b/test/passes/duplicate-function-elimination_optimize-level=1.wast index 5b42a6ba5..1097f6715 100644 --- a/test/passes/duplicate-function-elimination_optimize-level=1.wast +++ b/test/passes/duplicate-function-elimination_optimize-level=1.wast @@ -52,8 +52,8 @@ (memory 0) (start $other) (type $0 (func)) - (export "keep2" $keep2) - (export "other" $other) + (export "keep2" (func $keep2)) + (export "other" (func $other)) (table 3 3 funcref) (elem (i32.const 0) $keep2 $other $caller) (func $keep2 (type $0) @@ -437,8 +437,8 @@ (module (memory 0) (type $FUNCSIG$v (func)) - (import $i "env" "i") - (import $j "env" "j") + (import "env" "i" (func $i)) + (import "env" "j" (func $j)) (func $erase (type $FUNCSIG$v) (call $i) ) @@ -449,8 +449,8 @@ (module (memory 0) (type $FUNCSIG$v (func)) - (import $i "env" "i") - (import $j "env" "j") + (import "env" "i" (func $i)) + (import "env" "j" (func $j)) (func $keep2 (type $FUNCSIG$v) (call $i) ) diff --git a/test/passes/duplicate-function-elimination_optimize-level=2.wast b/test/passes/duplicate-function-elimination_optimize-level=2.wast index 5b42a6ba5..1097f6715 100644 --- a/test/passes/duplicate-function-elimination_optimize-level=2.wast +++ b/test/passes/duplicate-function-elimination_optimize-level=2.wast @@ -52,8 +52,8 @@ (memory 0) (start $other) (type $0 (func)) - (export "keep2" $keep2) - (export "other" $other) + (export "keep2" (func $keep2)) + (export "other" (func $other)) (table 3 3 funcref) (elem (i32.const 0) $keep2 $other $caller) (func $keep2 (type $0) @@ -437,8 +437,8 @@ (module (memory 0) (type $FUNCSIG$v (func)) - (import $i "env" "i") - (import $j "env" "j") + (import "env" "i" (func $i)) + (import "env" "j" (func $j)) (func $erase (type $FUNCSIG$v) (call $i) ) @@ -449,8 +449,8 @@ (module (memory 0) (type $FUNCSIG$v (func)) - (import $i "env" "i") - (import $j "env" "j") + (import "env" "i" (func $i)) + (import "env" "j" (func $j)) (func $keep2 (type $FUNCSIG$v) (call $i) ) diff --git a/test/passes/fuzz-exec_all-features.wast b/test/passes/fuzz-exec_all-features.wast index bab6afb79..9250ad3ec 100644 --- a/test/passes/fuzz-exec_all-features.wast +++ b/test/passes/fuzz-exec_all-features.wast @@ -36,13 +36,11 @@ (func $unaligned_load (export "unaligned_load") (result i32) (i32.atomic.load (i32.const 1) ;; unaligned ptr - (i32.const 1) ) ) (func $unaligned_load_offset (export "unaligned_load_offset") (result i32) (i32.atomic.load offset=1 ;; unaligned with offset (i32.const 0) - (i32.const 1) ) ) (func $aligned_for_size (export "aligned_for_size") (result i32) diff --git a/test/passes/merge-locals_all-features.wast b/test/passes/merge-locals_all-features.wast index b1d3aa9b7..0eff2bcb7 100644 --- a/test/passes/merge-locals_all-features.wast +++ b/test/passes/merge-locals_all-features.wast @@ -1,6 +1,6 @@ (module (global $global$0 (mut i32) (i32.const 10)) - (func $test (param $x $i32) (param $y i32) (result i32) + (func $test (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -16,7 +16,7 @@ ) (local.get $y) ;; turn this into $x ) - (func $test2 (param $x $i32) (param $y i32) (result i32) + (func $test2 (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -32,7 +32,7 @@ ) (local.get $x) ) - (func $test-multiple (param $x $i32) (param $y i32) (result i32) + (func $test-multiple (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -49,7 +49,7 @@ (drop (local.get $y)) ;; turn this into $x (local.get $y) ;; turn this into $x ) - (func $test-just-some (param $x $i32) (param $y i32) (result i32) + (func $test-just-some (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -67,7 +67,7 @@ (local.set $y (i32.const 200)) (local.get $y) ;; but not this one! ) - (func $test-just-some2 (param $x $i32) (param $y i32) (result i32) + (func $test-just-some2 (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -92,7 +92,7 @@ ) (i32.const 500) ) - (func $test-just-some3 (param $x $i32) (param $y i32) (result i32) + (func $test-just-some3 (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -117,7 +117,7 @@ ) (local.get $y) ;; but not this one! ) - (func $silly-self (param $x $i32) (param $y i32) (result i32) + (func $silly-self (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -133,7 +133,7 @@ ) (local.get $y) ;; turn this into $x ) - (func $silly-multi (param $x $i32) (param $y i32) (result i32) + (func $silly-multi (param $x i32) (param $y i32) (result i32) (drop (if (result i32) (local.tee $x @@ -179,7 +179,7 @@ (local.get $var$1) ;; can't be changed to $var$2, as it changes ) ) - (func $reverse (param $x $i32) (param $y i32) + (func $reverse (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -201,7 +201,7 @@ ) (drop (local.get $y)) ;; cannot this into $x, since this $y has multiple sources ) - (func $reverse-end (param $x $i32) (param $y i32) + (func $reverse-end (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -216,7 +216,7 @@ ) ) ) - (func $reverse-lone-end-2 (param $x $i32) (param $y i32) + (func $reverse-lone-end-2 (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -233,7 +233,7 @@ (local.set $y (i32.const 200)) (drop (local.get $y)) ;; cannot this into $x, since this $y has multiple sources ) - (func $reverse-undo (param $x $i32) (param $y i32) + (func $reverse-undo (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -256,7 +256,7 @@ ) (drop (local.get $y)) ;; cannot this into $x, since this $y has multiple sources ) - (func $reverse-undo2 (param $x $i32) (param $y i32) + (func $reverse-undo2 (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -279,7 +279,7 @@ ) (drop (local.get $y)) ;; cannot this into $x, since this $y has multiple sources ) - (func $reverse-undo3-conditional (param $x $i32) (param $y i32) + (func $reverse-undo3-conditional (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -306,7 +306,7 @@ ) (drop (local.get $y)) ;; cannot this into $x, since this $y has multiple sources ) - (func $reverse-undo3-conditional-b (param $x $i32) (param $y i32) + (func $reverse-undo3-conditional-b (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x @@ -333,7 +333,7 @@ ) (drop (local.get $y)) ;; cannot this into $x, since this $y has multiple sources ) - (func $reverse-undo3-conditional-c (param $x $i32) (param $y i32) + (func $reverse-undo3-conditional-c (param $x i32) (param $y i32) (drop (if (result i32) (local.tee $x diff --git a/test/passes/optimize-instructions_fuzz-exec.wast b/test/passes/optimize-instructions_fuzz-exec.wast index f047e3ac2..927ca5c06 100644 --- a/test/passes/optimize-instructions_fuzz-exec.wast +++ b/test/passes/optimize-instructions_fuzz-exec.wast @@ -4,57 +4,57 @@ (func $test32 (export "test32") (call $logf32 (f32.add - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.sub - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.mul - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.div - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.copysign - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.min - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.max - (f32.const -nan:0xffff82) + (f32.const -nan:0x7fff82) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) @@ -122,13 +122,13 @@ (f32.add (f32.const 0) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.add - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) (f32.neg (f32.const 0) ) @@ -138,13 +138,13 @@ (f32.add (f32.const -0) (f32.neg - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) ) ) ) (call $logf32 (f32.add - (f32.const -nan:0xfff622) + (f32.const -nan:0x7ff622) (f32.neg (f32.const -0) ) @@ -154,13 +154,13 @@ (f32.add (f32.const 0) (f32.neg - (f32.const nan:0xfff622) + (f32.const nan:0x7ff622) ) ) ) (call $logf32 (f32.add - (f32.const nan:0xfff622) + (f32.const nan:0x7ff622) (f32.neg (f32.const 0) ) diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt index 3f5908ef0..8021136f2 100644 --- a/test/passes/precompute_all-features.txt +++ b/test/passes/precompute_all-features.txt @@ -8,7 +8,7 @@ (type $6 (func (result externref))) (global $global i32 (i32.const 1)) (global $global-mut (mut i32) (i32.const 2)) - (memory $0 6 65536) + (memory $m 512 512) (data $0 (i32.const 0) "hello!") (elem declare func $dummy) (func $x (type $0) (param $x i32) diff --git a/test/passes/precompute_all-features.wast b/test/passes/precompute_all-features.wast index 633787fad..f6ad267f2 100644 --- a/test/passes/precompute_all-features.wast +++ b/test/passes/precompute_all-features.wast @@ -1,5 +1,6 @@ (module - (memory (data "hello!") 512 512) + (memory $m 512 512) + (data (memory $m) (i32.const 0) "hello!") (type $0 (func (param i32))) (global $global i32 (i32.const 1)) (global $global-mut (mut i32) (i32.const 2)) diff --git a/test/passes/remove-imports.wast b/test/passes/remove-imports.wast index a96a438f5..77c16e991 100644 --- a/test/passes/remove-imports.wast +++ b/test/passes/remove-imports.wast @@ -3,10 +3,10 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$d (func (result f64))) - (import $waka "somewhere" "waka") - (import $waka-ret "somewhere" "waka-ret" (result i32)) - (import $waka-ret-d "somewhere" "waka-ret-d" (result f64)) - (import $waka-sneaky "somewhere" "waka-sneaky") + (import "somewhere" "waka" (func $waka)) + (import "somewhere" "waka-ret" (func $waka-ret (result i32))) + (import "somewhere" "waka-ret-d" (func $waka-ret-d (result f64))) + (import "somewhere" "waka-sneaky" (func $waka-sneaky)) (import "env" "memBase" (global i32)) (import "env" "table" (table $table 1 1 funcref)) (elem (i32.const 0) $waka-sneaky) diff --git a/test/passes/remove-unused-names_code-folding.wast b/test/passes/remove-unused-names_code-folding.wast index 642bbdf7c..6fba5ddde 100644 --- a/test/passes/remove-unused-names_code-folding.wast +++ b/test/passes/remove-unused-names_code-folding.wast @@ -429,13 +429,13 @@ (if (local.get $x) (then (block - (br_if $out (local.get $y i32)) + (br_if $out (local.get $y)) (nop) ) ) (else (block - (br_if $out (local.get $y i32)) + (br_if $out (local.get $y)) (nop) ) ) @@ -443,13 +443,13 @@ (if (local.get $x) (then (block - (br_if $out (local.get $y i32)) + (br_if $out (local.get $y)) (nop) ) ) (else (block - (br_if $out2 (local.get $y i32)) + (br_if $out2 (local.get $y)) (nop) ) ) @@ -460,14 +460,14 @@ (then (block (nop) - (br_if $out (local.get $y i32)) + (br_if $out (local.get $y)) (nop) ) ) (else (block (nop) - (br_if $out2 (local.get $y i32)) + (br_if $out2 (local.get $y)) (nop) ) ) @@ -477,13 +477,13 @@ (if (local.get $x) (then (block $left - (br_if $left (local.get $y i32)) + (br_if $left (local.get $y)) (nop) ) ) (else (block - (br_if $out (local.get $y i32)) + (br_if $out (local.get $y)) (nop) ) ) @@ -491,13 +491,13 @@ (if (local.get $x) (then (block - (br_if $out (local.get $y i32)) + (br_if $out (local.get $y)) (nop) ) ) (else (block $right - (br_if $right (local.get $y i32)) + (br_if $right (local.get $y)) (nop) ) ) diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast index 5ed444ca2..2917b23a0 100644 --- a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast +++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast @@ -9,9 +9,9 @@ (type $2-dupe (func (param i32) (result i32))) (type $2-thrupe (func (param i32) (result i32))) (export "memory" (memory $0)) - (export "exported" $exported) - (export "other1" $other1) - (export "other2" $other2) + (export "exported" (func $exported)) + (export "other1" (func $other1)) + (export "other2" (func $other2)) (table 1 1 funcref) (elem (i32.const 0) $called_indirect) (func $start (type $0) @@ -94,7 +94,7 @@ (type $0 (func)) (import "env" "memory" (memory $0 256)) (import "env" "table" (table 0 funcref)) - (export "user" $user) + (export "user" (func $user)) (func $user (drop (i32.load (i32.const 0))) (call_indirect (type $0) (i32.const 0)) @@ -102,28 +102,28 @@ ) (module ;; more use checks (memory $0 23 256 shared) - (export "user" $user) + (export "user" (func $user)) (func $user (i32.store (i32.const 0) (i32.const 0)) ) ) (module ;; more use checks (memory $0 23 256 shared) - (export "user" $user) + (export "user" (func $user)) (func $user (result i32) (i32.atomic.rmw.add (i32.const 0) (i32.const 0)) ) ) (module ;; more use checks (memory $0 23 256 shared) - (export "user" $user) + (export "user" (func $user)) (func $user (result i32) (i32.atomic.rmw8.cmpxchg_u (i32.const 0) (i32.const 0) (i32.const 0)) ) ) (module ;; more use checks (memory $0 23 256 shared) - (export "user" $user) + (export "user" (func $user)) (func $user (local $0 i32) (local $1 i64) @@ -138,28 +138,28 @@ ) (module ;; more use checks (memory $0 23 256 shared) - (export "user" $user) + (export "user" (func $user)) (func $user (result i32) (memory.atomic.notify (i32.const 0) (i32.const 0)) ) ) (module ;; more use checks (memory $0 23 256) - (export "user" $user) + (export "user" (func $user)) (func $user (result i32) (memory.grow (i32.const 0)) ) ) (module ;; more use checks (import "env" "memory" (memory $0 256)) - (export "user" $user) + (export "user" (func $user)) (func $user (result i32) (memory.grow (i32.const 0)) ) ) (module ;; more use checks (memory $0 23 256) - (export "user" $user) + (export "user" (func $user)) (func $user (result i32) (memory.size) ) diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast index b302a317d..e51abda5c 100644 --- a/test/passes/simplify-locals_all-features.wast +++ b/test/passes/simplify-locals_all-features.wast @@ -7,11 +7,11 @@ (type $4 (func (param i32))) (type $5 (func (param i32) (result i32))) (type $6 (func (param i32 i32 i32 i32 i32 i32))) - (import $waka "env" "waka") - (import $waka_int "env" "waka_int" (result i32)) - (import $_i64Subtract "env" "i64sub" (param i32 i32 i32 i32) (result i32)) - (import $___udivmoddi4 "env" "moddi" (param i32 i32 i32 i32 i32) (result i32)) - (import $lp "env" "lp" (param i32 i32) (result i32)) + (import "env" "waka" (func $waka)) + (import "env" "waka_int" (func $waka_int (result i32))) + (import "env" "i64sub" (func $_i64Subtract (param i32 i32 i32 i32) (result i32))) + (import "env" "moddi" (func $___udivmoddi4 (param i32 i32 i32 i32 i32) (result i32))) + (import "env" "lp" (func $lp (param i32 i32) (result i32))) (import "fuzzing-support" "log-f32" (func $fimport$0 (param f32))) (global $global$0 (mut i32) (i32.const 10)) (func $contrast ;; check for tee and structure sinking @@ -1710,7 +1710,7 @@ (func $memory-init-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1733,7 +1733,7 @@ (func $memory-copy-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1756,7 +1756,7 @@ (func $memory-fill-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1779,7 +1779,7 @@ (func $data-drop-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1792,7 +1792,7 @@ (func $data-drop-memory-init (local $x i32) (local.set $x - (block i32 + (block (result i32) (memory.init 0 (i32.const 0) (i32.const 0) (i32.const 5)) (i32.const 0) ) diff --git a/test/passes/simplify-locals_all-features_disable-exception-handling.wast b/test/passes/simplify-locals_all-features_disable-exception-handling.wast index 9cb4bf748..9fa89ea20 100644 --- a/test/passes/simplify-locals_all-features_disable-exception-handling.wast +++ b/test/passes/simplify-locals_all-features_disable-exception-handling.wast @@ -7,11 +7,11 @@ (type $4 (func (param i32))) (type $5 (func (param i32) (result i32))) (type $6 (func (param i32 i32 i32 i32 i32 i32))) - (import $waka "env" "waka") - (import $waka_int "env" "waka_int" (result i32)) - (import $_i64Subtract "env" "i64sub" (param i32 i32 i32 i32) (result i32)) - (import $___udivmoddi4 "env" "moddi" (param i32 i32 i32 i32 i32) (result i32)) - (import $lp "env" "lp" (param i32 i32) (result i32)) + (import "env" "waka" (func $waka)) + (import "env" "waka_int" (func $waka_int (result i32))) + (import "env" "i64sub" (func $_i64Subtract (param i32 i32 i32 i32) (result i32))) + (import "env" "moddi" (func $___udivmoddi4 (param i32 i32 i32 i32 i32) (result i32))) + (import "env" "lp" (func $lp (param i32 i32) (result i32))) (import "fuzzing-support" "log-f32" (func $fimport$0 (param f32))) (global $global$0 (mut i32) (i32.const 10)) (func $contrast ;; check for tee and structure sinking @@ -1710,7 +1710,7 @@ (func $memory-init-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1733,7 +1733,7 @@ (func $memory-copy-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1756,7 +1756,7 @@ (func $memory-fill-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1779,7 +1779,7 @@ (func $data-drop-store (local $x i32) (local.set $x - (block i32 + (block (result i32) (i32.store (i32.const 0) (i32.const 42)) (i32.const 0) ) @@ -1792,7 +1792,7 @@ (func $data-drop-memory-init (local $x i32) (local.set $x - (block i32 + (block (result i32) (memory.init 0 (i32.const 0) (i32.const 0) (i32.const 5)) (i32.const 0) ) diff --git a/test/passes/ssa-nomerge_enable-simd.wast b/test/passes/ssa-nomerge_enable-simd.wast index f99febe3e..da44b57ae 100644 --- a/test/passes/ssa-nomerge_enable-simd.wast +++ b/test/passes/ssa-nomerge_enable-simd.wast @@ -23,7 +23,7 @@ (local $x i32) (local $y i32) (drop - (if i32 + (if (result i32) (i32.const 1) (then (local.get $x) diff --git a/test/passes/ssa_enable-threads.wast b/test/passes/ssa_enable-threads.wast index a368f3c34..d2614b791 100644 --- a/test/passes/ssa_enable-threads.wast +++ b/test/passes/ssa_enable-threads.wast @@ -22,7 +22,7 @@ (local $x i32) (local $y i32) (drop - (if i32 + (if (result i32) (i32.const 1) (then (local.get $x) @@ -446,4 +446,3 @@ (i32.const -54) ) ) - |