diff options
Diffstat (limited to 'test/lit/passes')
31 files changed, 98 insertions, 56 deletions
diff --git a/test/lit/passes/asyncify-wasm64.wast b/test/lit/passes/asyncify-wasm64.wast index 07d1942e4..94cdf0347 100644 --- a/test/lit/passes/asyncify-wasm64.wast +++ b/test/lit/passes/asyncify-wasm64.wast @@ -7,7 +7,6 @@ ;; CHECK: (type $f (func (param i32))) (type $f (func (param i32))) - (memory i64 1 2) ;; CHECK: (type $2 (func)) ;; CHECK: (type $3 (func (param i64))) @@ -18,6 +17,9 @@ (import "env" "import" (func $import)) ;; CHECK: (import "env" "import2" (func $import2 (param i32))) (import "env" "import2" (func $import2 (param i32))) + + (memory i64 1 2) + (table funcref (elem $liveness2 $liveness2)) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast b/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast index 1a8f6dfef..45af7b839 100644 --- a/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast +++ b/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast @@ -3,7 +3,6 @@ ;; RUN: wasm-opt --enable-memory64 --enable-multimemory --asyncify --pass-arg=asyncify-in-secondary-memory %s -S -o - | filecheck %s (module - (memory i64 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -14,6 +13,9 @@ ;; CHECK: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory i64 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify.wast b/test/lit/passes/asyncify.wast index 968cc5716..71043f2e8 100644 --- a/test/lit/passes/asyncify.wast +++ b/test/lit/passes/asyncify.wast @@ -6,7 +6,6 @@ (module ;; CHECK: (type $f (func (param i32))) (type $f (func (param i32))) - (memory 1 2) ;; CHECK: (type $1 (func (param i32 i32))) ;; CHECK: (type $2 (func)) @@ -17,15 +16,16 @@ (import "env" "import" (func $import)) ;; CHECK: (import "env" "import2" (func $import2 (param i32))) (import "env" "import2" (func $import2 (param i32))) - (table funcref (elem $liveness2 $liveness2)) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) - ;; CHECK: (memory $0 1 2) - - ;; CHECK: (table $0 2 2 funcref) + ;; CHECK: (memory $m 1 2) + (memory $m 1 2) + ;; CHECK: (table $t 2 2 funcref) + (table $t funcref (elem $liveness2 $liveness2)) ;; CHECK: (elem $0 (i32.const 0) $liveness2 $liveness2) ;; CHECK: (export "asyncify_start_unwind" (func $asyncify_start_unwind)) diff --git a/test/lit/passes/asyncify_enable-multivalue.wast b/test/lit/passes/asyncify_enable-multivalue.wast index e5834b114..f29edd4a5 100644 --- a/test/lit/passes/asyncify_enable-multivalue.wast +++ b/test/lit/passes/asyncify_enable-multivalue.wast @@ -5,11 +5,12 @@ ;; Pre-existing imports that the pass turns into the implementations. (module - (memory 1 2) (import "asyncify" "start_unwind" (func $asyncify_start_unwind (param i32))) (import "asyncify" "stop_unwind" (func $asyncify_stop_unwind)) (import "asyncify" "start_rewind" (func $asyncify_start_rewind (param i32))) (import "asyncify" "stop_rewind" (func $asyncify_stop_rewind)) + + (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -404,7 +405,6 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -423,6 +423,8 @@ (import "env" "import3" (func $import3 (param i32))) ;; CHECK: (import "env" "import-mv" (func $import-mv (result i32 i64))) (import "env" "import-mv" (func $import-mv (result i32 i64))) + + (memory 1 2) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast index dcb4ead34..fda095ad5 100644 --- a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast +++ b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --mod-asyncify-always-and-only-unwind -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (result i32))) @@ -17,6 +16,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast index 7d53b6cbb..99ac2c05f 100644 --- a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast +++ b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --mod-asyncify-always-and-only-unwind -O -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -15,6 +14,10 @@ (import "env" "import" (func $import)) (import "env" "import2" (func $import2 (result i32))) (import "env" "import3" (func $import3 (param i32))) + + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast b/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast index 1ac962eb9..e03a0ad7c 100644 --- a/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast +++ b/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --mod-asyncify-never-unwind -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (result i32))) @@ -17,6 +16,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast b/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast index 112d750ba..38a54ea80 100644 --- a/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast +++ b/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --mod-asyncify-never-unwind -O -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -15,6 +14,9 @@ (import "env" "import" (func $import)) (import "env" "import2" (func $import2 (result i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_optimize-level=1.wast b/test/lit/passes/asyncify_optimize-level=1.wast index 0eefc7ffa..d7627f407 100644 --- a/test/lit/passes/asyncify_optimize-level=1.wast +++ b/test/lit/passes/asyncify_optimize-level=1.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --optimize-level=1 -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -19,6 +18,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast index 6a0026459..92dbe2bb2 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-addlist@foo -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -13,6 +12,9 @@ ;; CHECK: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast index 217feb358..81107cb16 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast @@ -6,15 +6,17 @@ (module ;; CHECK: (type $t (func)) (type $t (func)) - (memory 1 2) - (table 1 funcref) - (elem (i32.const 0)) ;; CHECK: (type $1 (func (param i32))) ;; CHECK: (type $2 (func (result i32))) ;; CHECK: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory 1 2) + (table 1 funcref) + (elem (i32.const 0)) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast b/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast index e86fe988e..8415dfdb7 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast @@ -9,7 +9,6 @@ ;; state. (module - (memory 1 2) ;; CHECK: (type $f (func)) (type $f (func)) ;; CHECK: (type $1 (func (param i32))) @@ -22,6 +21,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + (table funcref (elem $calls-import2-drop $calls-import2-drop)) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast b/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast index d89ff3a1a..87e62f4fb 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast @@ -5,7 +5,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-blacklist@@%S/asyncify-foo,bar-nl.txt -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -14,6 +13,8 @@ ;; CHECK: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory 1 2) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast index dc99a09d0..88371e31a 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-ignore-imports -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $f (func)) (type $f (func)) ;; CHECK: (type $1 (func (param i32))) @@ -17,6 +16,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + (table funcref (elem $calls-import2-drop $calls-import2-drop)) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast index 519c6ea2f..af043224a 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-ignore-indirect -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $f (func)) (type $f (func)) ;; CHECK: (type $1 (func (param i32))) @@ -17,6 +16,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + (table funcref (elem $calls-import2-drop $calls-import2-drop)) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast b/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast index ba781e12a..801ab5eb9 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast @@ -5,10 +5,12 @@ ;; Pre-existing imports that the pass turns into the implementations. (module - (memory 1 2) (import "asyncify" "start_unwind" (func $asyncify_start_unwind (param i32))) (import "asyncify" "start_rewind" (func $asyncify_start_rewind (param i32))) (import "asyncify" "stop_rewind" (func $asyncify_stop_rewind)) + + (memory 1 2) + ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -400,7 +402,6 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -415,6 +416,9 @@ (import "env" "import2" (func $import2 (result i32))) ;; CHECK: (import "env" "import3" (func $import3 (param i32))) (import "env" "import3" (func $import3 (param i32))) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast b/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast index d5dd3775a..00d257005 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast @@ -5,7 +5,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-onlylist@@%S/asyncify-foo,bar-nl.txt -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -14,6 +13,8 @@ ;; CHECK: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory 1 2) ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast b/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast index 035c46059..2b463426a 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --asyncify --pass-arg=asyncify-verbose -S -o - | filecheck %s (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -13,6 +12,9 @@ ;; CHECK: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast b/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast index 7772d68f5..64489fb3b 100644 --- a/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast +++ b/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast @@ -4,7 +4,6 @@ ;; RUN: wasm-opt --enable-multimemory --asyncify --pass-arg=asyncify-in-secondary-memory --pass-arg=asyncify-secondary-memory-size@3 %s -S -o - | filecheck %s --check-prefix SIZE (module - (memory 1 2) ;; CHECK: (type $0 (func)) ;; CHECK: (type $1 (func (param i32))) @@ -24,6 +23,9 @@ ;; SIZE: (import "env" "import" (func $import)) (import "env" "import" (func $import)) + + (memory 1 2) + ;; CHECK: (global $__asyncify_state (mut i32) (i32.const 0)) ;; CHECK: (global $__asyncify_data (mut i32) (i32.const 0)) diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast index 7fb2a7f13..c84eea900 100644 --- a/test/lit/passes/cfp.wast +++ b/test/lit/passes/cfp.wast @@ -1461,7 +1461,6 @@ (struct.set $struct2 0 (local.get $struct2) (i32.const 9999) ;; use a different value here - (f64.const 0) ) (drop (struct.new $struct3 diff --git a/test/lit/passes/coalesce-locals-learning.wast b/test/lit/passes/coalesce-locals-learning.wast index 5451c68cd..689f7441b 100644 --- a/test/lit/passes/coalesce-locals-learning.wast +++ b/test/lit/passes/coalesce-locals-learning.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --coalesce-locals-learning -S -o - | filecheck %s (module - (memory 10) ;; CHECK: (type $2 (func)) ;; CHECK: (type $FUNCSIG$iii (func (param i32 i32) (result i32))) @@ -18,8 +17,12 @@ (type $3 (func (param i32 f32))) ;; CHECK: (type $4 (func (param i32))) (type $4 (func (param 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))) + + (memory 10) + ;; 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 38fefc17a..f195c3681 100644 --- a/test/lit/passes/coalesce-locals.wast +++ b/test/lit/passes/coalesce-locals.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt --coalesce-locals -S -o - | filecheck %s (module - (memory 10) ;; CHECK: (type $2 (func)) ;; CHECK: (type $1 (func (result i32))) @@ -35,6 +34,9 @@ (import "env" "get" (func $get (result i32))) ;; CHECK: (import "env" "set" (func $set (param i32))) (import "env" "set" (func $set (param i32))) + + (memory 10) + ;; CHECK: (memory $0 10) ;; CHECK: (func $nothing-to-do diff --git a/test/lit/passes/directize_all-features.wast b/test/lit/passes/directize_all-features.wast index 1e46e42c1..c1308faad 100644 --- a/test/lit/passes/directize_all-features.wast +++ b/test/lit/passes/directize_all-features.wast @@ -372,6 +372,8 @@ ;; CHECK: (type $ii (func (param i32 i32))) ;; IMMUT: (type $ii (func (param i32 i32))) (type $ii (func (param i32 i32))) + (global $g (import "env" "g") i32) + ;; CHECK: (import "env" "g" (global $g i32)) ;; CHECK: (table $0 5 5 funcref) @@ -379,7 +381,7 @@ ;; IMMUT: (table $0 5 5 funcref) (table $0 5 5 funcref) - (global $g (import "env" "g") i32) + (elem (global.get $g) $foo) ;; CHECK: (elem $0 (global.get $g) $foo) @@ -421,6 +423,8 @@ ;; CHECK: (type $ii (func (param i32 i32))) ;; IMMUT: (type $ii (func (param i32 i32))) (type $ii (func (param i32 i32))) + (global $g (import "env" "g") i32) + ;; CHECK: (import "env" "g" (global $g i32)) ;; CHECK: (table $0 5 5 funcref) @@ -431,7 +435,7 @@ ;; CHECK: (table $1 5 5 funcref) ;; IMMUT: (table $1 5 5 funcref) (table $1 5 5 funcref) - (global $g (import "env" "g") i32) + (elem (table $1) (global.get $g) func $foo) ;; CHECK: (elem $0 (table $1) (global.get $g) func $foo) diff --git a/test/lit/passes/flatten_i64-to-i32-lowering.wast b/test/lit/passes/flatten_i64-to-i32-lowering.wast index d2fc16a58..5a185cc0a 100644 --- a/test/lit/passes/flatten_i64-to-i32-lowering.wast +++ b/test/lit/passes/flatten_i64-to-i32-lowering.wast @@ -4,7 +4,6 @@ ;; RUN: foreach %s %t wasm-opt -all --flatten --i64-to-i32-lowering -S -o - | filecheck %s (module - (memory 1 1) ;; CHECK: (type $0 (func (result i32))) ;; CHECK: (type $1 (func (result i64))) @@ -13,6 +12,8 @@ ;; CHECK: (import "env" "func" (func $import (type $1) (result i64))) (import "env" "func" (func $import (result i64))) + + (memory 1 1) ;; CHECK: (global $i64toi32_i32$HIGH_BITS (mut i32) (i32.const 0)) ;; CHECK: (memory $0 1 1) diff --git a/test/lit/passes/global-effects.wast b/test/lit/passes/global-effects.wast index 00c9a77ff..d0d3228df 100644 --- a/test/lit/passes/global-effects.wast +++ b/test/lit/passes/global-effects.wast @@ -16,8 +16,6 @@ ;; WITHOUT: (type $2 (func (param i32))) ;; WITHOUT: (import "a" "b" (func $import (type $0))) - - ;; WITHOUT: (tag $tag) ;; INCLUDE: (type $0 (func)) ;; INCLUDE: (type $1 (func (result i32))) @@ -25,8 +23,6 @@ ;; INCLUDE: (type $2 (func (param i32))) ;; INCLUDE: (import "a" "b" (func $import (type $0))) - - ;; INCLUDE: (tag $tag) ;; DISCARD: (type $0 (func)) ;; DISCARD: (type $1 (func (result i32))) @@ -34,12 +30,13 @@ ;; DISCARD: (type $2 (func (param i32))) ;; DISCARD: (import "a" "b" (func $import (type $0))) + (import "a" "b" (func $import)) + ;; WITHOUT: (tag $tag) + ;; INCLUDE: (tag $tag) ;; DISCARD: (tag $tag) (tag $tag) - (import "a" "b" (func $import)) - ;; WITHOUT: (func $main (type $0) ;; WITHOUT-NEXT: (call $nop) ;; WITHOUT-NEXT: (call $unreachable) diff --git a/test/lit/passes/gto-removals.wast b/test/lit/passes/gto-removals.wast index bcc3f0463..558b0c85f 100644 --- a/test/lit/passes/gto-removals.wast +++ b/test/lit/passes/gto-removals.wast @@ -850,7 +850,7 @@ (func $unreachable-set-2 (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; As above, but the side effects now are a br. Again, the br must happen ;; before the trap (in fact, the br will skip the trap here). - (block + (block $block (struct.set $"{mut:i8}" 0 (local.get $"{mut:i8}") (br $block) diff --git a/test/lit/passes/memory-packing_all-features.wast b/test/lit/passes/memory-packing_all-features.wast index 42e21e32c..8d5089e6f 100644 --- a/test/lit/passes/memory-packing_all-features.wast +++ b/test/lit/passes/memory-packing_all-features.wast @@ -5,19 +5,17 @@ (module ;; CHECK: (import "env" "memoryBase" (global $memoryBase i32)) - + (import "env" "memoryBase" (global $memoryBase i32)) ;; CHECK: (memory $0 2048 2048) (memory $0 2048 2048) - (import "env" "memoryBase" (global $memoryBase i32)) ;; nothing ) (module ;; CHECK: (import "env" "memoryBase" (global $memoryBase i32)) - + (import "env" "memoryBase" (global $memoryBase i32)) ;; CHECK: (memory $0 2048 2048) (memory $0 2048 2048) - (import "env" "memoryBase" (global $memoryBase i32)) (data (i32.const 4066) "") ;; empty; leave it as is ;; (remove-unused-module-elements handles such ;; things, taking into account possible traps etc.) @@ -26,10 +24,10 @@ ;; CHECK: (data $0 (i32.const 4066) "") (module ;; CHECK: (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memoryBase" (global $memoryBase i32)) ;; CHECK: (memory $0 2048 2048) (memory $0 2048 2048) - (import "env" "memoryBase" (global $memoryBase i32)) (data (global.get $memoryBase) "waka this cannot be optimized\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00we don't know where it will go") ) @@ -681,6 +679,7 @@ ;; CHECK: (type $0 (func)) ;; CHECK: (import "env" "param" (global $param i32)) + (import "env" "param" (global $param i32)) ;; CHECK: (global $__mem_segment_drop_state (mut i32) (i32.const 0)) @@ -700,7 +699,6 @@ ;; CHECK: (memory $0 2048 2048) (memory $0 2048 2048) - (import "env" "param" (global $param i32)) (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00even\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00more\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00zeroes\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") ;; 0 @@ -2232,10 +2230,11 @@ ;; CHECK: (data $2 (i32.const 4096) "\00") (module ;; CHECK: (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memoryBase" (global $memoryBase i32)) ;; CHECK: (memory $0 1 1) (memory $0 1 1) - (import "env" "memoryBase" (global $memoryBase i32)) + (data (i32.const 1024) "x") (data (global.get $memoryBase) "\00") ;; this could trample, or not ) @@ -2244,10 +2243,11 @@ ;; CHECK: (data $1 (global.get $memoryBase) "\00") (module ;; CHECK: (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memoryBase" (global $memoryBase i32)) ;; CHECK: (memory $0 1 1) (memory $0 1 1) - (import "env" "memoryBase" (global $memoryBase i32)) + (data (i32.const 1024) "\00") ;; this could trample, or not (data (global.get $memoryBase) "x") ) diff --git a/test/lit/passes/monomorphize.wast b/test/lit/passes/monomorphize.wast index 0974978b9..43208a97d 100644 --- a/test/lit/passes/monomorphize.wast +++ b/test/lit/passes/monomorphize.wast @@ -342,8 +342,6 @@ ;; ALWAYS: (type $4 (func (param (ref $A)))) ;; ALWAYS: (import "a" "b" (func $import (type $2) (param (ref $B)))) - - ;; ALWAYS: (global $global (mut i32) (i32.const 1)) ;; CAREFUL: (type $2 (func (param (ref $B)))) ;; CAREFUL: (type $3 (func)) @@ -351,12 +349,12 @@ ;; CAREFUL: (type $4 (func (param (ref $A)))) ;; CAREFUL: (import "a" "b" (func $import (type $2) (param (ref $B)))) + (import "a" "b" (func $import (param (ref $B)))) + ;; ALWAYS: (global $global (mut i32) (i32.const 1)) ;; CAREFUL: (global $global (mut i32) (i32.const 1)) (global $global (mut i32) (i32.const 1)) - (import "a" "b" (func $import (param (ref $B)))) - ;; ALWAYS: (func $calls (type $3) ;; ALWAYS-NEXT: (call $refinable ;; ALWAYS-NEXT: (struct.new_default $A) diff --git a/test/lit/passes/optimize-instructions-ignore-traps.wast b/test/lit/passes/optimize-instructions-ignore-traps.wast index e594b791c..96ea16449 100644 --- a/test/lit/passes/optimize-instructions-ignore-traps.wast +++ b/test/lit/passes/optimize-instructions-ignore-traps.wast @@ -6,12 +6,11 @@ ;; CHECK: (type $0 (func (param i32 i32) (result i32))) (type $0 (func (param i32 i32) (result i32))) ;; CHECK: (import "a" "b" (func $get-i32 (type $2) (result i32))) + (import "a" "b" (func $get-i32 (result i32))) ;; CHECK: (memory $0 0) (memory $0 0) - (import "a" "b" (func $get-i32 (result i32))) - ;; CHECK: (func $conditionals (type $0) (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (local $2 i32) ;; CHECK-NEXT: (local $3 i32) diff --git a/test/lit/passes/optimize-instructions-mvp.wast b/test/lit/passes/optimize-instructions-mvp.wast index 9ac34145c..1575e8d6b 100644 --- a/test/lit/passes/optimize-instructions-mvp.wast +++ b/test/lit/passes/optimize-instructions-mvp.wast @@ -2,7 +2,6 @@ ;; RUN: wasm-opt %s --optimize-instructions --mvp-features -S -o - | filecheck %s (module - (memory 0) ;; CHECK: (type $0 (func (result i32))) (type $0 (func (param i32 i64))) @@ -11,6 +10,8 @@ ;; CHECK: (import "a" "b" (func $get-f64 (result f64))) (import "a" "b" (func $get-f64 (result f64))) + (memory 0) + ;; CHECK: (func $and-and (param $i1 i32) (result i32) ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $i1) diff --git a/test/lit/passes/remove-unused-module-elements-eh-old.wast b/test/lit/passes/remove-unused-module-elements-eh-old.wast index da6d6ff8a..cd052dbfb 100644 --- a/test/lit/passes/remove-unused-module-elements-eh-old.wast +++ b/test/lit/passes/remove-unused-module-elements-eh-old.wast @@ -4,6 +4,8 @@ (module (type $0 (func (param i32))) + (import "env" "e" (tag $e-import (param i32))) + ;; CHECK-NOT: (tag $e-remove ;; CHECK: (tag $e-export ;; CHECK: (tag $e-throw @@ -14,7 +16,6 @@ (tag $e-catch (type $0)) ;; cannot be removed (used in catch) (export "e-export" (tag $e-export)) - (import "env" "e" (tag $e-import (param i32))) (start $start) (func $start |