summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/Print.cpp4
-rw-r--r--test/binaryen.js/debug-names.js.txt6
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt10
-rw-r--r--test/ctor-eval/imported2.wast.out2
-rw-r--r--test/example/c-api-kitchen-sink.txt6
-rw-r--r--test/example/module-splitting.txt8
-rw-r--r--test/lit/wasm-split/instrument-funcs.wast6
-rw-r--r--test/lld/basic_safe_stack.wat.out2
-rw-r--r--test/lld/duplicate_imports.wat.out6
-rw-r--r--test/lld/em_asm.wat.mem.out4
-rw-r--r--test/lld/em_asm.wat.out6
-rw-r--r--test/lld/em_asm64.wat.out6
-rw-r--r--test/lld/em_asm_O0.wat.out4
-rw-r--r--test/lld/em_asm_main_thread.wat.out6
-rw-r--r--test/lld/em_asm_pthread.wasm.out4
-rw-r--r--test/lld/em_asm_table.wat.out4
-rw-r--r--test/lld/hello_world.passive.wat.out6
-rw-r--r--test/lld/hello_world.wat.mem.out2
-rw-r--r--test/lld/hello_world.wat.out2
-rw-r--r--test/lld/init.wat.out2
-rw-r--r--test/lld/longjmp.wat.out2
-rw-r--r--test/lld/recursive.wat.out2
-rw-r--r--test/lld/recursive_safe_stack.wat.out6
-rw-r--r--test/lld/reserved_func_ptr.wat.out2
-rw-r--r--test/lld/safe_stack_standalone-wasm.wat.out6
-rw-r--r--test/lld/standalone-wasm-with-start.wat.out6
-rw-r--r--test/lld/standalone-wasm.wat.out6
-rw-r--r--test/lld/standalone-wasm2.wat.out2
-rw-r--r--test/lld/standalone-wasm3.wat.out2
-rw-r--r--test/passes/O3_inlining.txt2
-rw-r--r--test/passes/O4_disable-bulk-memory.txt4
-rw-r--r--test/passes/asyncify.txt4
-rw-r--r--test/passes/asyncify_enable-multivalue.txt6
-rw-r--r--test/passes/asyncify_mod-asyncify-always-and-only-unwind.txt2
-rw-r--r--test/passes/asyncify_mod-asyncify-always-and-only-unwind_O.txt2
-rw-r--r--test/passes/asyncify_mod-asyncify-never-unwind.txt2
-rw-r--r--test/passes/asyncify_mod-asyncify-never-unwind_O.txt2
-rw-r--r--test/passes/asyncify_optimize-level=1.txt2
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-addlist@foo.txt2
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt4
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt4
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt2
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt4
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt4
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt4
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.txt2
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-verbose.txt2
-rw-r--r--test/passes/dce_all-features.txt2
-rw-r--r--test/passes/directize_all-features.txt4
-rw-r--r--test/passes/duplicate-function-elimination_all-features.txt2
-rw-r--r--test/passes/dwarf-local-order.bin.txt16
-rw-r--r--test/passes/dwarf_with_exceptions.bin.txt4
-rw-r--r--test/passes/flatten_all-features.txt2
-rw-r--r--test/passes/flatten_i64-to-i32-lowering.txt4
-rw-r--r--test/passes/flatten_local-cse_all-features.txt2
-rw-r--r--test/passes/flatten_rereloop.txt2
-rw-r--r--test/passes/fpcast-emu.txt2
-rw-r--r--test/passes/func-metrics.txt2
-rw-r--r--test/passes/inlined_to_start_dwarf.bin.txt2
-rw-r--r--test/passes/inlining_enable-tail-call.txt4
-rw-r--r--test/passes/licm.txt2
-rw-r--r--test/passes/memory-packing_all-features.txt32
-rw-r--r--test/passes/metrics_all-features.txt2
-rw-r--r--test/passes/precompute_all-features.txt4
-rw-r--r--test/passes/remove-non-js-ops.txt2
-rw-r--r--test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt2
-rw-r--r--test/passes/roundtrip_signed.bin.txt2
-rw-r--r--test/passes/simplify-globals_all-features_fuzz-exec.txt2
-rw-r--r--test/passes/simplify-locals_all-features.txt4
-rw-r--r--test/passes/simplify-locals_all-features_disable-exception-handling.txt4
-rw-r--r--test/passes/ssa-nomerge_enable-simd.txt2
-rw-r--r--test/passes/vacuum_all-features.txt4
-rw-r--r--test/reference-types.wast.from-wast6
-rw-r--r--test/reference-types.wast.fromBinary6
-rw-r--r--test/reference-types.wast.fromBinary.noDebugInfo6
75 files changed, 156 insertions, 156 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index b4b4ef70f..e3ea04b53 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2892,6 +2892,8 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
*curr, [&](Function* func) { visitFunction(func); });
ModuleUtils::iterImportedEvents(*curr,
[&](Event* event) { visitEvent(event); });
+ ModuleUtils::iterDefinedGlobals(
+ *curr, [&](Global* global) { visitGlobal(global); });
ModuleUtils::iterDefinedMemories(
*curr, [&](Memory* memory) { visitMemory(memory); });
ModuleUtils::iterDefinedTables(*curr,
@@ -2909,8 +2911,6 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
}
o << ')' << maybeNewLine;
}
- ModuleUtils::iterDefinedGlobals(
- *curr, [&](Global* global) { visitGlobal(global); });
ModuleUtils::iterDefinedEvents(*curr,
[&](Event* event) { visitEvent(event); });
for (auto& child : curr->exports) {
diff --git a/test/binaryen.js/debug-names.js.txt b/test/binaryen.js/debug-names.js.txt
index 40e94c248..605bec650 100644
--- a/test/binaryen.js/debug-names.js.txt
+++ b/test/binaryen.js/debug-names.js.txt
@@ -11,9 +11,9 @@
=== parsed wast ===
(module $hel
(type $i32_=>_none (func (param i32)))
+ (global $ld i32 (i32.const 0))
(memory $lo 0 0)
(table $wor 0 0 funcref)
- (global $ld i32 (i32.const 0))
(func $of (param $wasm i32)
(local $!#$%&'*+-./:<=>?@\^_`|~ f64)
(nop)
@@ -23,9 +23,9 @@
=== roundtripped ===
(module $hel
(type $i32_=>_none (func (param i32)))
+ (global $ld i32 (i32.const 0))
(memory $lo 0 0)
(table $wor 0 0 funcref)
- (global $ld i32 (i32.const 0))
(func $of (param $js i32)
(local $!#$%&'*+-./:<=>?@\5c^_`|~ f64)
(nop)
@@ -35,9 +35,9 @@
=== roundtripped again ===
(module $hel
(type $i32_=>_none (func (param i32)))
+ (global $ld i32 (i32.const 0))
(memory $lo 0 0)
(table $wor 0 0 funcref)
- (global $ld i32 (i32.const 0))
(func $of (param $js i32)
(local $!#$%&'*+-./:<=>?@\5c^_`|~ f64)
(nop)
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 69ff4860b..a8ea4eccf 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -128,12 +128,12 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(import "module" "base" (global $a-mut-global-imp (mut i32)))
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
(import "module" "base" (event $a-event-imp (attr 0) (param i32)))
+ (global $a-global i32 (i32.const 1))
(memory $0 (shared 1 256))
(data (i32.const 10) "hello, world")
(data "I am passive")
(table $t0 1 funcref)
(elem $e0 (i32.const 0) "$kitchen()sinker")
- (global $a-global i32 (i32.const 1))
(event $a-event (attr 0) (param i32))
(export "kitchen_sinker" (func "$kitchen()sinker"))
(export "a-global-exp" (global $a-global))
@@ -1990,12 +1990,12 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(import "module" "base" (global $a-mut-global-imp (mut i32)))
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
(import "module" "base" (event $a-event-imp (attr 0) (param i32)))
+ (global $a-global i32 (i32.const 1))
(memory $0 (shared 1 256))
(data (i32.const 10) "hello, world")
(data "I am passive")
(table $t0 1 funcref)
(elem $e0 (i32.const 0) "$kitchen()sinker")
- (global $a-global i32 (i32.const 1))
(event $a-event (attr 0) (param i32))
(export "kitchen_sinker" (func "$kitchen()sinker"))
(export "a-global-exp" (global $a-global))
@@ -4386,14 +4386,14 @@ module loaded from text form:
sizeof Literal: 24
(module
(type $none_=>_none (func))
+ (global $a-global i32 (i32.const 125))
+ (global $a-global2 i32 (i32.const 2))
+ (global $a-global3 i32 (i32.const 3))
(memory $0 1 256)
(data (i32.const 10) "hello, world")
(data (global.get $a-global) "segment data 2")
(table $t0 1 funcref)
(elem $e0 (i32.const 0) $fn0 $fn1 $fn2)
- (global $a-global i32 (i32.const 125))
- (global $a-global2 i32 (i32.const 2))
- (global $a-global3 i32 (i32.const 3))
(export "export0" (func $fn0))
(export "export1" (func $fn1))
(export "export2" (func $fn2))
diff --git a/test/ctor-eval/imported2.wast.out b/test/ctor-eval/imported2.wast.out
index bcd2b4918..6fabeadd6 100644
--- a/test/ctor-eval/imported2.wast.out
+++ b/test/ctor-eval/imported2.wast.out
@@ -1,8 +1,8 @@
(module
(type $none_=>_none (func))
+ (global $mine (mut i32) (i32.const 1))
(memory $0 256 256)
(data (i32.const 10) "wasa waka waka waka waka")
- (global $mine (mut i32) (i32.const 1))
(export "test2" (func $test2))
(export "test3" (func $test3))
(func $test2
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index a0f28699b..4cad3e659 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -36,6 +36,8 @@ BinaryenFeatureAll: 8191
(type $i32_=>_none (func (param i32)))
(type $i32_f64_=>_f32 (func (param i32 f64) (result f32)))
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
+ (global $a-global i32 (i32.const 7))
+ (global $a-mutable-global (mut f32) (f32.const 7.5))
(memory $0 (shared 1 256))
(data (i32.const 10) "hello, world")
(data "I am passive")
@@ -43,8 +45,6 @@ BinaryenFeatureAll: 8191
(table $0 1 1 funcref)
(elem $0 (table $0) (i32.const 0) func "$kitchen()sinker")
(elem $passive func "$kitchen()sinker")
- (global $a-global i32 (i32.const 7))
- (global $a-mutable-global (mut f32) (f32.const 7.5))
(event $a-event (attr 0) (param i32))
(export "kitchen_sinker" (func "$kitchen()sinker"))
(export "mem" (memory $0))
@@ -2459,12 +2459,12 @@ module s-expr printed (in memory, caller-owned):
validation: 0
(module
(type $none_=>_none (func))
+ (global $a-global i32 (i32.const 125))
(memory $0 1 256)
(data (i32.const 10) "hello, world")
(data (global.get $a-global) "segment data 2")
(table $0 1 1 funcref)
(elem $0 (i32.const 0) $fn0 $fn1 $fn2)
- (global $a-global i32 (i32.const 125))
(export "export0" (func $fn0))
(export "export1" (func $fn1))
(export "export2" (func $fn2))
diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt
index 93a766652..f9e0b313f 100644
--- a/test/example/module-splitting.txt
+++ b/test/example/module-splitting.txt
@@ -13,18 +13,18 @@ Secondary:
Before:
(module
(type $i32_=>_none (func (param i32)))
+ (global $glob (mut i32) (i32.const 7))
(memory $mem (shared 3 42))
(table $tab 3 42 funcref)
- (global $glob (mut i32) (i32.const 7))
(event $e (attr 0) (param i32))
)
Keeping: <none>
After:
(module
(type $i32_=>_none (func (param i32)))
+ (global $glob (mut i32) (i32.const 7))
(memory $mem (shared 3 42))
(table $tab 3 42 funcref)
- (global $glob (mut i32) (i32.const 7))
(event $e (attr 0) (param i32))
(export "%memory" (memory $mem))
(export "%table" (table $tab))
@@ -75,9 +75,9 @@ Secondary:
Before:
(module
(type $i32_=>_none (func (param i32)))
+ (global $glob (mut i32) (i32.const 7))
(memory $mem (shared 3 42))
(table $tab 3 42 funcref)
- (global $glob (mut i32) (i32.const 7))
(event $e (attr 0) (param i32))
(export "mem" (memory $mem))
(export "tab" (table $tab))
@@ -88,9 +88,9 @@ Keeping: <none>
After:
(module
(type $i32_=>_none (func (param i32)))
+ (global $glob (mut i32) (i32.const 7))
(memory $mem (shared 3 42))
(table $tab 3 42 funcref)
- (global $glob (mut i32) (i32.const 7))
(event $e (attr 0) (param i32))
(export "mem" (memory $mem))
(export "tab" (table $tab))
diff --git a/test/lit/wasm-split/instrument-funcs.wast b/test/lit/wasm-split/instrument-funcs.wast
index 4b729aed2..1da68150d 100644
--- a/test/lit/wasm-split/instrument-funcs.wast
+++ b/test/lit/wasm-split/instrument-funcs.wast
@@ -15,14 +15,14 @@
)
)
-;; Check that a memory has been added
-;; CHECK: (memory $0 1 1)
-
;; Check that the counter and timestamps have been added
;; CHECK: (global $monotonic_counter (mut i32) (i32.const 0))
;; CHECK: (global $bar_timestamp (mut i32) (i32.const 0))
;; CHECK: (global $baz_timestamp (mut i32) (i32.const 0))
+;; Check that a memory has been added
+;; CHECK: (memory $0 1 1)
+
;; And the profiling function exported
;; CHECK: (export "__write_profile" (func $__write_profile))
diff --git a/test/lld/basic_safe_stack.wat.out b/test/lld/basic_safe_stack.wat.out
index 09c440ece..9500aea41 100644
--- a/test/lld/basic_safe_stack.wat.out
+++ b/test/lld/basic_safe_stack.wat.out
@@ -4,10 +4,10 @@
(type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_=>_i32 (func (param i32) (result i32)))
(import "env" "__handle_stack_overflow" (func $__handle_stack_overflow))
- (memory $0 2)
(global $__stack_pointer (mut i32) (i32.const 66112))
(global $__stack_base (mut i32) (i32.const 0))
(global $__stack_limit (mut i32) (i32.const 0))
+ (memory $0 2)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "stackRestore" (func $stackRestore))
diff --git a/test/lld/duplicate_imports.wat.out b/test/lld/duplicate_imports.wat.out
index 5a5fa94e3..50f73f88d 100644
--- a/test/lld/duplicate_imports.wat.out
+++ b/test/lld/duplicate_imports.wat.out
@@ -13,12 +13,12 @@
(import "env" "invoke_ffd" (func $invoke_ffd (param i32 f32 f64) (result f32)))
(import "env" "invoke_ffd" (func $invoke_ffd2 (param i32 f64 f64) (result f32)))
(import "env" "puts" (func $legalimport$puts2 (param i32 i32) (result i32)))
- (memory $0 2)
- (data (i32.const 568) "Hello, world\00")
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 66128))
(global $global$1 i32 (i32.const 66128))
(global $global$2 i32 (i32.const 581))
+ (memory $0 2)
+ (data (i32.const 568) "Hello, world\00")
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/em_asm.wat.mem.out b/test/lld/em_asm.wat.mem.out
index 22d0fdc5c..2f11aeb55 100644
--- a/test/lld/em_asm.wat.mem.out
+++ b/test/lld/em_asm.wat.mem.out
@@ -4,11 +4,11 @@
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32)))
- (memory $0 2)
- (table $0 1 1 funcref)
(global $__stack_pointer (mut i32) (i32.const 66208))
(global $global$1 i32 (i32.const 574))
(global $global$2 i32 (i32.const 658))
+ (memory $0 2)
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/em_asm.wat.out b/test/lld/em_asm.wat.out
index 167baddde..c0261d891 100644
--- a/test/lld/em_asm.wat.out
+++ b/test/lld/em_asm.wat.out
@@ -4,13 +4,13 @@
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32)))
+ (global $__stack_pointer (mut i32) (i32.const 66208))
+ (global $global$1 i32 (i32.const 574))
+ (global $global$2 i32 (i32.const 658))
(memory $0 2)
(data $.rodata (i32.const 568) "\00ii\00i\00")
(data $em_asm (i32.const 574) "")
(table $0 1 1 funcref)
- (global $__stack_pointer (mut i32) (i32.const 66208))
- (global $global$1 i32 (i32.const 574))
- (global $global$2 i32 (i32.const 658))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/em_asm64.wat.out b/test/lld/em_asm64.wat.out
index 1678b83f2..d4a8b6ded 100644
--- a/test/lld/em_asm64.wat.out
+++ b/test/lld/em_asm64.wat.out
@@ -4,13 +4,13 @@
(type $i32_i64_=>_i32 (func (param i32 i64) (result i32)))
(type $i64_i64_i64_=>_i32 (func (param i64 i64 i64) (result i32)))
(import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i64 i64 i64) (result i32)))
+ (global $__stack_pointer (mut i64) (i64.const 66208))
+ (global $global$1 i32 (i32.const 574))
+ (global $global$2 i32 (i32.const 658))
(memory $0 i64 2)
(data $.rodata (i64.const 568) "\00ii\00i\00")
(data $em_asm (i64.const 574) "")
(table $0 1 1 funcref)
- (global $__stack_pointer (mut i64) (i64.const 66208))
- (global $global$1 i32 (i32.const 574))
- (global $global$2 i32 (i32.const 658))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/em_asm_O0.wat.out b/test/lld/em_asm_O0.wat.out
index b1765812c..74e545ad5 100644
--- a/test/lld/em_asm_O0.wat.out
+++ b/test/lld/em_asm_O0.wat.out
@@ -3,11 +3,11 @@
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32)))
- (memory $0 2)
- (data $em_asm (i32.const 568) "")
(global $__stack_pointer (mut i32) (i32.const 66192))
(global $global$1 i32 (i32.const 568))
(global $global$2 i32 (i32.const 652))
+ (memory $0 2)
+ (data $em_asm (i32.const 568) "")
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/em_asm_main_thread.wat.out b/test/lld/em_asm_main_thread.wat.out
index 91a022dbc..31ee579c0 100644
--- a/test/lld/em_asm_main_thread.wat.out
+++ b/test/lld/em_asm_main_thread.wat.out
@@ -7,14 +7,14 @@
(type $6 (func (param i32 i32) (result i32)))
(type $0 (func (param i32 i32 i32) (result i32)))
(import "env" "emscripten_asm_const_int_sync_on_main_thread" (func $emscripten_asm_const_int_sync_on_main_thread (param i32 i32 i32) (result i32)))
- (memory $0 2)
- (data (i32.const 568) "")
- (table $0 1 1 funcref)
(global $0 i32 (i32.const 568))
(global $1 i32 (i32.const 652))
(global $global$0 (mut i32) (i32.const 66192))
(global $global$1 i32 (i32.const 66192))
(global $global$2 i32 (i32.const 652))
+ (memory $0 2)
+ (data (i32.const 568) "")
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/em_asm_pthread.wasm.out b/test/lld/em_asm_pthread.wasm.out
index a89db9b24..43eb27176 100644
--- a/test/lld/em_asm_pthread.wasm.out
+++ b/test/lld/em_asm_pthread.wasm.out
@@ -63,8 +63,6 @@
(import "wasi_snapshot_preview1" "fd_write" (func $fimport$16 (param i32 i32 i32 i32) (result i32)))
(import "env" "initPthreadsJS" (func $fimport$17))
(import "env" "setTempRet0" (func $setTempRet0 (param i32)))
- (table $0 5 5 funcref)
- (elem (i32.const 1) $6 $73 $72 $74)
(global $global$0 (mut i32) (i32.const 5246928))
(global $global$1 i32 (i32.const 0))
(global $global$2 i32 (i32.const 0))
@@ -77,6 +75,8 @@
(global $global$11 i32 (i32.const 1836))
(global $global$12 i32 (i32.const 1658))
(global $global$13 i32 (i32.const 1782))
+ (table $0 5 5 funcref)
+ (elem (i32.const 1) $6 $73 $72 $74)
(export "__wasm_call_ctors" (func $0))
(export "main" (func $4))
(export "__indirect_function_table" (table $0))
diff --git a/test/lld/em_asm_table.wat.out b/test/lld/em_asm_table.wat.out
index 99baf943b..9a6af1d7a 100644
--- a/test/lld/em_asm_table.wat.out
+++ b/test/lld/em_asm_table.wat.out
@@ -6,10 +6,10 @@
(import "env" "memory" (memory $2 8192))
(import "env" "emscripten_log" (func $fimport$0 (param i32 i32)))
(import "env" "emscripten_asm_const_int" (func $fimport$1 (param i32 i32 i32) (result i32)))
- (table $0 159609 funcref)
- (elem (i32.const 1) $fimport$0 $fimport$1)
(global $global$0 (mut i32) (i32.const 1024))
(global $global$1 i32 (i32.const 1048))
+ (table $0 159609 funcref)
+ (elem (i32.const 1) $fimport$0 $fimport$1)
(export "__data_end" (global $global$1))
(export "dynCall_vii" (func $dynCall_vii))
(export "dynCall_iiii" (func $dynCall_iiii))
diff --git a/test/lld/hello_world.passive.wat.out b/test/lld/hello_world.passive.wat.out
index 5d4a2ed10..a4c1a9c1b 100644
--- a/test/lld/hello_world.passive.wat.out
+++ b/test/lld/hello_world.passive.wat.out
@@ -4,12 +4,12 @@
(type $0 (func (param i32) (result i32)))
(type $3 (func (param i32 i32) (result i32)))
(import "env" "puts" (func $puts (param i32) (result i32)))
- (memory $0 2)
- (data "Hello, world\00")
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 66128))
(global $global$1 i32 (i32.const 66128))
(global $global$2 i32 (i32.const 581))
+ (memory $0 2)
+ (data "Hello, world\00")
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/hello_world.wat.mem.out b/test/lld/hello_world.wat.mem.out
index 6a002d7b2..9e8e50c7a 100644
--- a/test/lld/hello_world.wat.mem.out
+++ b/test/lld/hello_world.wat.mem.out
@@ -4,9 +4,9 @@
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(import "env" "puts" (func $puts (param i32) (result i32)))
+ (global $__stack_pointer (mut i32) (i32.const 66128))
(memory $0 2)
(table $0 1 1 funcref)
- (global $__stack_pointer (mut i32) (i32.const 66128))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/hello_world.wat.out b/test/lld/hello_world.wat.out
index 8783b5662..5f69eb918 100644
--- a/test/lld/hello_world.wat.out
+++ b/test/lld/hello_world.wat.out
@@ -4,10 +4,10 @@
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(import "env" "puts" (func $puts (param i32) (result i32)))
+ (global $__stack_pointer (mut i32) (i32.const 66128))
(memory $0 2)
(data $.rodata (i32.const 568) "Hello, world\00")
(table $0 1 1 funcref)
- (global $__stack_pointer (mut i32) (i32.const 66128))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/init.wat.out b/test/lld/init.wat.out
index 4ec84de43..06ea07837 100644
--- a/test/lld/init.wat.out
+++ b/test/lld/init.wat.out
@@ -2,9 +2,9 @@
(type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+ (global $__stack_pointer (mut i32) (i32.const 66112))
(memory $0 2)
(table $0 1 1 funcref)
- (global $__stack_pointer (mut i32) (i32.const 66112))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/longjmp.wat.out b/test/lld/longjmp.wat.out
index 9be7a12c7..3cc23cbbd 100644
--- a/test/lld/longjmp.wat.out
+++ b/test/lld/longjmp.wat.out
@@ -16,10 +16,10 @@
(import "env" "testSetjmp" (func $fimport$5 (param i32 i32 i32) (result i32)))
(import "env" "setTempRet0" (func $fimport$6 (param i32)))
(import "env" "free" (func $fimport$7 (param i32)))
+ (global $global$0 (mut i32) (i32.const 66112))
(memory $0 2)
(table $0 2 2 funcref)
(elem (i32.const 1) $fimport$3)
- (global $global$0 (mut i32) (i32.const 66112))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $0))
(export "main" (func $2))
diff --git a/test/lld/recursive.wat.out b/test/lld/recursive.wat.out
index f47981a47..029397fe7 100644
--- a/test/lld/recursive.wat.out
+++ b/test/lld/recursive.wat.out
@@ -3,10 +3,10 @@
(type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
(import "env" "iprintf" (func $iprintf (param i32 i32) (result i32)))
+ (global $__stack_pointer (mut i32) (i32.const 66128))
(memory $0 2)
(data $.rodata (i32.const 568) "%d:%d\n\00Result: %d\n\00")
(table $0 1 1 funcref)
- (global $__stack_pointer (mut i32) (i32.const 66128))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/recursive_safe_stack.wat.out b/test/lld/recursive_safe_stack.wat.out
index 7e8037ea0..d906b777b 100644
--- a/test/lld/recursive_safe_stack.wat.out
+++ b/test/lld/recursive_safe_stack.wat.out
@@ -5,14 +5,14 @@
(type $2 (func (result i32)))
(import "env" "printf" (func $printf (param i32 i32) (result i32)))
(import "env" "__handle_stack_overflow" (func $__handle_stack_overflow))
- (memory $0 2)
- (data (i32.const 568) "%d:%d\n\00Result: %d\n\00")
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 66128))
(global $global$1 i32 (i32.const 66128))
(global $global$2 i32 (i32.const 587))
(global $__stack_base (mut i32) (i32.const 0))
(global $__stack_limit (mut i32) (i32.const 0))
+ (memory $0 2)
+ (data (i32.const 568) "%d:%d\n\00Result: %d\n\00")
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/reserved_func_ptr.wat.out b/test/lld/reserved_func_ptr.wat.out
index 5b4fc2447..d1924226f 100644
--- a/test/lld/reserved_func_ptr.wat.out
+++ b/test/lld/reserved_func_ptr.wat.out
@@ -8,10 +8,10 @@
(type $f32_f32_i32_=>_f32 (func (param f32 f32 i32) (result f32)))
(type $f64_i32_=>_f64 (func (param f64 i32) (result f64)))
(import "env" "_Z4atoiPKc" (func $atoi\28char\20const*\29 (param i32) (result i32)))
+ (global $__stack_pointer (mut i32) (i32.const 66112))
(memory $0 2)
(table $0 3 3 funcref)
(elem (i32.const 1) $address_taken_func\28int\2c\20int\2c\20int\29 $address_taken_func2\28int\2c\20int\2c\20int\29)
- (global $__stack_pointer (mut i32) (i32.const 66112))
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/lld/safe_stack_standalone-wasm.wat.out b/test/lld/safe_stack_standalone-wasm.wat.out
index 87d723ed5..1e598c4fa 100644
--- a/test/lld/safe_stack_standalone-wasm.wat.out
+++ b/test/lld/safe_stack_standalone-wasm.wat.out
@@ -4,14 +4,14 @@
(type $i32_i32_=>_none (func (param i32 i32)))
(type $2 (func (result i32)))
(import "env" "printf" (func $printf (param i32 i32) (result i32)))
- (memory $0 2)
- (data (i32.const 568) "%d:%d\n\00Result: %d\n\00")
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 66128))
(global $global$1 i32 (i32.const 66128))
(global $global$2 i32 (i32.const 587))
(global $__stack_base (mut i32) (i32.const 0))
(global $__stack_limit (mut i32) (i32.const 0))
+ (memory $0 2)
+ (data (i32.const 568) "%d:%d\n\00Result: %d\n\00")
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/standalone-wasm-with-start.wat.out b/test/lld/standalone-wasm-with-start.wat.out
index 027e026d1..650ef4542 100644
--- a/test/lld/standalone-wasm-with-start.wat.out
+++ b/test/lld/standalone-wasm-with-start.wat.out
@@ -1,11 +1,11 @@
(module
(type $none_=>_i32 (func (result i32)))
- (memory $0 2)
- (table $0 1 1 funcref)
- (elem (i32.const 0) $foo)
(global $global$0 (mut i32) (i32.const 66112))
(global $global$1 i32 (i32.const 66112))
(global $global$2 i32 (i32.const 576))
+ (memory $0 2)
+ (table $0 1 1 funcref)
+ (elem (i32.const 0) $foo)
(export "memory" (memory $0))
(export "_start" (func $_start))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/standalone-wasm.wat.out b/test/lld/standalone-wasm.wat.out
index f8339a270..d3a589c7d 100644
--- a/test/lld/standalone-wasm.wat.out
+++ b/test/lld/standalone-wasm.wat.out
@@ -1,12 +1,12 @@
(module
(type $none_=>_i32 (func (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
- (memory $0 2)
- (table $0 1 1 funcref)
- (elem (i32.const 0) $foo)
(global $global$0 (mut i32) (i32.const 66112))
(global $global$1 i32 (i32.const 66112))
(global $global$2 i32 (i32.const 576))
+ (memory $0 2)
+ (table $0 1 1 funcref)
+ (elem (i32.const 0) $foo)
(export "memory" (memory $0))
(export "main" (func $main))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/standalone-wasm2.wat.out b/test/lld/standalone-wasm2.wat.out
index fec51bb24..4f3cb355c 100644
--- a/test/lld/standalone-wasm2.wat.out
+++ b/test/lld/standalone-wasm2.wat.out
@@ -1,9 +1,9 @@
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
- (memory $0 2)
(global $global$0 (mut i32) (i32.const 66112))
(global $global$1 i32 (i32.const 66112))
(global $global$2 i32 (i32.const 576))
+ (memory $0 2)
(export "memory" (memory $0))
(export "main" (func $main))
(export "__heap_base" (global $global$1))
diff --git a/test/lld/standalone-wasm3.wat.out b/test/lld/standalone-wasm3.wat.out
index 57e31ffb5..9f63753c5 100644
--- a/test/lld/standalone-wasm3.wat.out
+++ b/test/lld/standalone-wasm3.wat.out
@@ -1,9 +1,9 @@
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
- (memory $0 2)
(global $global$0 (mut i32) (i32.const 66112))
(global $global$1 i32 (i32.const 66112))
(global $global$2 i32 (i32.const 576))
+ (memory $0 2)
(export "memory" (memory $0))
(export "__heap_base" (global $global$1))
(export "__data_end" (global $global$2))
diff --git a/test/passes/O3_inlining.txt b/test/passes/O3_inlining.txt
index 9c8f9eb4e..808f03ae8 100644
--- a/test/passes/O3_inlining.txt
+++ b/test/passes/O3_inlining.txt
@@ -1,7 +1,7 @@
(module
(type $i32_=>_none (func (param i32)))
- (memory $0 1 1)
(global $global$1 (mut i32) (i32.const 100))
+ (memory $0 1 1)
(export "func_217" (func $1))
(func $1 (param $0 i32)
(if
diff --git a/test/passes/O4_disable-bulk-memory.txt b/test/passes/O4_disable-bulk-memory.txt
index 9bf5f71d6..210f47013 100644
--- a/test/passes/O4_disable-bulk-memory.txt
+++ b/test/passes/O4_disable-bulk-memory.txt
@@ -14,11 +14,11 @@
(import "env" "memory" (memory $1 1))
(data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
- (table $0 1 funcref)
- (elem (i32.const 0) $null)
(global $global$0 (mut i32) (i32.const 0))
(global $global$1 (mut i32) (i32.const 0))
(global $global$5 (mut i32) (i32.const 0))
+ (table $0 1 funcref)
+ (elem (i32.const 0) $null)
(export "memory" (memory $0))
(export "table" (table $0))
(export "init" (func $assembly/index/init))
diff --git a/test/passes/asyncify.txt b/test/passes/asyncify.txt
index 194c71ff3..faf8fc54f 100644
--- a/test/passes/asyncify.txt
+++ b/test/passes/asyncify.txt
@@ -5,11 +5,11 @@
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (param i32)))
+ (global $__asyncify_state (mut i32) (i32.const 0))
+ (global $__asyncify_data (mut i32) (i32.const 0))
(memory $0 1 2)
(table $0 2 2 funcref)
(elem (i32.const 0) $liveness2 $liveness2)
- (global $__asyncify_state (mut i32) (i32.const 0))
- (global $__asyncify_data (mut i32) (i32.const 0))
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_enable-multivalue.txt b/test/passes/asyncify_enable-multivalue.txt
index 7d92b0c97..7e95e451a 100644
--- a/test/passes/asyncify_enable-multivalue.txt
+++ b/test/passes/asyncify_enable-multivalue.txt
@@ -2,10 +2,10 @@
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
- (memory $0 1 2)
(global $sleeping (mut i32) (i32.const 0))
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
@@ -329,9 +329,9 @@
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
(import "env" "import-mv" (func $import-mv (result i32 i64)))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
@@ -2508,9 +2508,9 @@
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
- (memory $0 1 1)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 1)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_mod-asyncify-always-and-only-unwind.txt b/test/passes/asyncify_mod-asyncify-always-and-only-unwind.txt
index ecf0a41c8..d622dd5f0 100644
--- a/test/passes/asyncify_mod-asyncify-always-and-only-unwind.txt
+++ b/test/passes/asyncify_mod-asyncify-always-and-only-unwind.txt
@@ -5,9 +5,9 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_mod-asyncify-always-and-only-unwind_O.txt b/test/passes/asyncify_mod-asyncify-always-and-only-unwind_O.txt
index 3c7b72f44..735ae3551 100644
--- a/test/passes/asyncify_mod-asyncify-always-and-only-unwind_O.txt
+++ b/test/passes/asyncify_mod-asyncify-always-and-only-unwind_O.txt
@@ -3,9 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "calls-import" (func $calls-import))
(export "calls-import2" (func $calls-import))
(export "calls-import2-drop" (func $calls-import))
diff --git a/test/passes/asyncify_mod-asyncify-never-unwind.txt b/test/passes/asyncify_mod-asyncify-never-unwind.txt
index 2177c5220..dd08335af 100644
--- a/test/passes/asyncify_mod-asyncify-never-unwind.txt
+++ b/test/passes/asyncify_mod-asyncify-never-unwind.txt
@@ -5,9 +5,9 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_mod-asyncify-never-unwind_O.txt b/test/passes/asyncify_mod-asyncify-never-unwind_O.txt
index d4840bfda..d9308c21c 100644
--- a/test/passes/asyncify_mod-asyncify-never-unwind_O.txt
+++ b/test/passes/asyncify_mod-asyncify-never-unwind_O.txt
@@ -3,9 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "calls-import" (func $calls-import))
(export "calls-import2" (func $calls-import))
(export "calls-import2-drop" (func $calls-import))
diff --git a/test/passes/asyncify_optimize-level=1.txt b/test/passes/asyncify_optimize-level=1.txt
index c61ab8b04..2c8835edf 100644
--- a/test/passes/asyncify_optimize-level=1.txt
+++ b/test/passes/asyncify_optimize-level=1.txt
@@ -6,9 +6,9 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-addlist@foo.txt b/test/passes/asyncify_pass-arg=asyncify-addlist@foo.txt
index 8119cfc6a..e42be2b6e 100644
--- a/test/passes/asyncify_pass-arg=asyncify-addlist@foo.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-addlist@foo.txt
@@ -3,9 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt b/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt
index 63cee4395..152fba58b 100644
--- a/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt
@@ -3,10 +3,10 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
- (table $0 1 funcref)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
+ (table $0 1 funcref)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt b/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt
index 90f7769c6..96eedff68 100644
--- a/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.txt
@@ -5,11 +5,11 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
+ (global $__asyncify_state (mut i32) (i32.const 0))
+ (global $__asyncify_data (mut i32) (i32.const 0))
(memory $0 1 2)
(table $0 2 2 funcref)
(elem (i32.const 0) $calls-import2-drop $calls-import2-drop)
- (global $__asyncify_state (mut i32) (i32.const 0))
- (global $__asyncify_data (mut i32) (i32.const 0))
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt b/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
index 8a27a97cf..22349e07a 100644
--- a/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt
@@ -3,9 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt b/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt
index 2992c7134..f09e4d097 100644
--- a/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-ignore-imports.txt
@@ -5,11 +5,11 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
+ (global $__asyncify_state (mut i32) (i32.const 0))
+ (global $__asyncify_data (mut i32) (i32.const 0))
(memory $0 1 2)
(table $0 2 2 funcref)
(elem (i32.const 0) $calls-import2-drop $calls-import2-drop)
- (global $__asyncify_state (mut i32) (i32.const 0))
- (global $__asyncify_data (mut i32) (i32.const 0))
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt b/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt
index 6e73dd093..21a943761 100644
--- a/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-ignore-indirect.txt
@@ -5,11 +5,11 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
+ (global $__asyncify_state (mut i32) (i32.const 0))
+ (global $__asyncify_data (mut i32) (i32.const 0))
(memory $0 1 2)
(table $0 2 2 funcref)
(elem (i32.const 0) $calls-import2-drop $calls-import2-drop)
- (global $__asyncify_state (mut i32) (i32.const 0))
- (global $__asyncify_data (mut i32) (i32.const 0))
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt b/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt
index 2a8c0061a..a936f01b0 100644
--- a/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.txt
@@ -2,10 +2,10 @@
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
- (memory $0 1 2)
(global $sleeping (mut i32) (i32.const 0))
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
@@ -326,9 +326,9 @@
(import "env" "import" (func $import))
(import "env" "import2" (func $import2 (result i32)))
(import "env" "import3" (func $import3 (param i32)))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.txt b/test/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.txt
index 30d4f0f10..4446b619d 100644
--- a/test/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.txt
@@ -3,9 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/asyncify_pass-arg=asyncify-verbose.txt b/test/passes/asyncify_pass-arg=asyncify-verbose.txt
index 359d83f5e..7e99b0c26 100644
--- a/test/passes/asyncify_pass-arg=asyncify-verbose.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-verbose.txt
@@ -7,9 +7,9 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_i32 (func (result i32)))
(import "env" "import" (func $import))
- (memory $0 1 2)
(global $__asyncify_state (mut i32) (i32.const 0))
(global $__asyncify_data (mut i32) (i32.const 0))
+ (memory $0 1 2)
(export "asyncify_start_unwind" (func $asyncify_start_unwind))
(export "asyncify_stop_unwind" (func $asyncify_stop_unwind))
(export "asyncify_start_rewind" (func $asyncify_start_rewind))
diff --git a/test/passes/dce_all-features.txt b/test/passes/dce_all-features.txt
index 8be4a3f71..97ce86980 100644
--- a/test/passes/dce_all-features.txt
+++ b/test/passes/dce_all-features.txt
@@ -6,10 +6,10 @@
(type $f32_i64_=>_none (func (param f32 i64)))
(type $f32_i64_=>_i32 (func (param f32 i64) (result i32)))
(type $i64_i64_=>_i64 (func (param i64 i64) (result i64)))
+ (global $x (mut i32) (i32.const 0))
(memory $0 10)
(table $0 1 1 funcref)
(elem (i32.const 0) $call-me)
- (global $x (mut i32) (i32.const 0))
(func $call-me (param $0 i32) (param $1 i32)
(nop)
)
diff --git a/test/passes/directize_all-features.txt b/test/passes/directize_all-features.txt
index 0e3276bb5..42adb65e6 100644
--- a/test/passes/directize_all-features.txt
+++ b/test/passes/directize_all-features.txt
@@ -110,9 +110,9 @@
)
(module
(type $ii (func (param i32 i32)))
+ (global $g (mut i32) (i32.const 1))
(table $0 5 5 funcref)
(elem (global.get $g) $foo)
- (global $g (mut i32) (i32.const 1))
(func $foo (param $0 i32) (param $1 i32)
(unreachable)
)
@@ -126,10 +126,10 @@
)
(module
(type $ii (func (param i32 i32)))
+ (global $g (mut i32) (i32.const 1))
(table $0 5 5 funcref)
(table $1 5 5 funcref)
(elem (table $1) (global.get $g) func $foo)
- (global $g (mut i32) (i32.const 1))
(func $foo (param $0 i32) (param $1 i32)
(unreachable)
)
diff --git a/test/passes/duplicate-function-elimination_all-features.txt b/test/passes/duplicate-function-elimination_all-features.txt
index 6dd5a1004..f714d481d 100644
--- a/test/passes/duplicate-function-elimination_all-features.txt
+++ b/test/passes/duplicate-function-elimination_all-features.txt
@@ -11,8 +11,8 @@
)
(module
(type $none_=>_none (func))
- (memory $foo 16 16)
(global $bar i32 (i32.const 0))
+ (memory $foo 16 16)
(export "memory" (memory $foo))
(export "global" (global $bar))
(func $bar
diff --git a/test/passes/dwarf-local-order.bin.txt b/test/passes/dwarf-local-order.bin.txt
index 0c75e99dd..e854507e5 100644
--- a/test/passes/dwarf-local-order.bin.txt
+++ b/test/passes/dwarf-local-order.bin.txt
@@ -1,10 +1,10 @@
(module
(type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
- (memory $0 256 256)
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 5243904))
(global $global$1 i32 (i32.const 1024))
+ (memory $0 256 256)
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "foo" (func $foo))
@@ -160,10 +160,10 @@
(module
(type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
- (memory $0 256 256)
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 5243904))
(global $global$1 i32 (i32.const 1024))
+ (memory $0 256 256)
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "foo" (func $foo))
@@ -394,10 +394,10 @@
(module
(type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
- (memory $0 256 256)
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 5243904))
(global $global$1 i32 (i32.const 1024))
+ (memory $0 256 256)
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "foo" (func $foo))
@@ -549,10 +549,10 @@
(module
(type $none_=>_none (func))
(type $none_=>_i32 (func (result i32)))
- (memory $0 256 256)
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 5243904))
(global $global$1 i32 (i32.const 1024))
+ (memory $0 256 256)
+ (table $0 1 1 funcref)
(export "memory" (memory $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "foo" (func $foo))
diff --git a/test/passes/dwarf_with_exceptions.bin.txt b/test/passes/dwarf_with_exceptions.bin.txt
index 9e8ed37d5..a08ecf9e5 100644
--- a/test/passes/dwarf_with_exceptions.bin.txt
+++ b/test/passes/dwarf_with_exceptions.bin.txt
@@ -6,8 +6,8 @@
(import "env" "__cxa_begin_catch" (func $__cxa_begin_catch (param i32) (result i32)))
(import "env" "__cxa_end_catch" (func $__cxa_end_catch))
(import "env" "_ZSt9terminatev" (func $std::terminate\28\29))
- (memory $0 2)
(global $__stack_pointer (mut i32) (i32.const 66560))
+ (memory $0 2)
(event $event$0 (attr 0) (param i32))
(export "memory" (memory $0))
(func $__wasm_call_ctors
@@ -427,8 +427,8 @@ file_names[ 1]:
(import "env" "__cxa_begin_catch" (func $__cxa_begin_catch (param i32) (result i32)))
(import "env" "__cxa_end_catch" (func $__cxa_end_catch))
(import "env" "_ZSt9terminatev" (func $std::terminate\28\29))
- (memory $0 2)
(global $__stack_pointer (mut i32) (i32.const 66560))
+ (memory $0 2)
(event $event$0 (attr 0) (param i32))
(export "memory" (memory $0))
(func $__wasm_call_ctors
diff --git a/test/passes/flatten_all-features.txt b/test/passes/flatten_all-features.txt
index 99c8cb4bb..517392d8c 100644
--- a/test/passes/flatten_all-features.txt
+++ b/test/passes/flatten_all-features.txt
@@ -6,10 +6,10 @@
(type $none_=>_f32 (func (result f32)))
(type $4 (func (param i64 i64) (result i64)))
(type $none_=>_anyref (func (result anyref)))
+ (global $x (mut i32) (i32.const 0))
(memory $0 10)
(table $0 1 1 funcref)
(elem (i32.const 0) $call-me)
- (global $x (mut i32) (i32.const 0))
(func $a1
(local $0 i32)
(local.set $0
diff --git a/test/passes/flatten_i64-to-i32-lowering.txt b/test/passes/flatten_i64-to-i32-lowering.txt
index b069ff6b2..973d855f8 100644
--- a/test/passes/flatten_i64-to-i32-lowering.txt
+++ b/test/passes/flatten_i64-to-i32-lowering.txt
@@ -3,8 +3,8 @@
(type $none_=>_none (func))
(type $none_=>_i64 (func (result i64)))
(import "env" "func" (func $import (result i64)))
- (memory $0 1 1)
(global $i64toi32_i32$HIGH_BITS (mut i32) (i32.const 0))
+ (memory $0 1 1)
(func $defined (result i32)
(local $0 i32)
(local $0$hi i32)
@@ -551,8 +551,8 @@
)
(module
(type $none_=>_none (func))
- (table $0 37 funcref)
(global $i64toi32_i32$HIGH_BITS (mut i32) (i32.const 0))
+ (table $0 37 funcref)
(func $0
(unreachable)
(block
diff --git a/test/passes/flatten_local-cse_all-features.txt b/test/passes/flatten_local-cse_all-features.txt
index ffd2b7945..c3396b8dc 100644
--- a/test/passes/flatten_local-cse_all-features.txt
+++ b/test/passes/flatten_local-cse_all-features.txt
@@ -583,8 +583,8 @@
(type $0 (func))
(type $2 (func (param i64 f32 i32)))
(type $1 (func (param i32 f64) (result i32)))
- (table $0 23 23 funcref)
(global $global$0 (mut i32) (i32.const 10))
+ (table $0 23 23 funcref)
(export "func_1_invoker" (func $1))
(export "func_6" (func $2))
(func $0 (param $var$0 i64) (param $var$1 f32) (param $var$2 i32)
diff --git a/test/passes/flatten_rereloop.txt b/test/passes/flatten_rereloop.txt
index fc4b49ace..50392f444 100644
--- a/test/passes/flatten_rereloop.txt
+++ b/test/passes/flatten_rereloop.txt
@@ -5,8 +5,8 @@
(type $none_=>_f32 (func (result f32)))
(type $i32_=>_f32 (func (param i32) (result f32)))
(type $none_=>_f64 (func (result f64)))
- (memory $0 1)
(global $global (mut i32) (i32.const 0))
+ (memory $0 1)
(func $0 (result f64)
(local $0 f64)
(local $1 f64)
diff --git a/test/passes/fpcast-emu.txt b/test/passes/fpcast-emu.txt
index fbb18114e..a549cda18 100644
--- a/test/passes/fpcast-emu.txt
+++ b/test/passes/fpcast-emu.txt
@@ -237,8 +237,8 @@
(module
(type $1 (func (param f32) (result i64)))
(type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
- (table $0 42 42 funcref)
(global $global$0 (mut i32) (i32.const 10))
+ (table $0 42 42 funcref)
(export "func_106" (func $0))
(func $0 (param $0 f32) (result i64)
(block $label$1 (result i64)
diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt
index 197e35a41..7782599e7 100644
--- a/test/passes/func-metrics.txt
+++ b/test/passes/func-metrics.txt
@@ -36,11 +36,11 @@ func: ifs
(module
(type $none_=>_none (func))
(type $0 (func (param i32)))
+ (global $glob i32 (i32.const 1337))
(memory $0 256 256)
(data (i32.const 0) "\ff\ef\0f\1f 0@P\99")
(table $0 256 256 funcref)
(elem (i32.const 0) $ifs $ifs $ifs)
- (global $glob i32 (i32.const 1337))
(func $empty
(nop)
)
diff --git a/test/passes/inlined_to_start_dwarf.bin.txt b/test/passes/inlined_to_start_dwarf.bin.txt
index 7205cf070..be1d028d3 100644
--- a/test/passes/inlined_to_start_dwarf.bin.txt
+++ b/test/passes/inlined_to_start_dwarf.bin.txt
@@ -416,9 +416,9 @@ file_names[ 1]:
(type $i32_=>_i32 (func (param i32) (result i32)))
(import "env" "memory" (memory $mimport$0 256 256))
(data (i32.const 1024) "\00\00\00\00")
- (table $0 1 1 funcref)
(global $global$0 (mut i32) (i32.const 5243920))
(global $global$1 i32 (i32.const 1028))
+ (table $0 1 1 funcref)
(export "__indirect_function_table" (table $0))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "main" (func $main))
diff --git a/test/passes/inlining_enable-tail-call.txt b/test/passes/inlining_enable-tail-call.txt
index 2092d70c2..e6a5d8667 100644
--- a/test/passes/inlining_enable-tail-call.txt
+++ b/test/passes/inlining_enable-tail-call.txt
@@ -166,8 +166,8 @@
(module
(type $none_=>_none (func))
(type $f32_i32_=>_i32 (func (param f32 i32) (result i32)))
- (memory $0 1 1)
(global $hangLimit (mut i32) (i32.const 25))
+ (memory $0 1 1)
(export "hangLimitInitializer" (func $hangLimitInitializer))
(func $func_4 (param $0 f32) (param $1 i32) (result i32)
(local $2 i64)
@@ -380,8 +380,8 @@
)
(module
(type $6 (func))
- (memory $0 1 1)
(global $global$0 (mut i32) (i32.const 10))
+ (memory $0 1 1)
(export "func_102_invoker" (func $19))
(func $19
(block
diff --git a/test/passes/licm.txt b/test/passes/licm.txt
index fe721c3ac..8f256af3e 100644
--- a/test/passes/licm.txt
+++ b/test/passes/licm.txt
@@ -4,8 +4,8 @@
(type $i32_=>_none (func (param i32)))
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $none_=>_i64 (func (result i64)))
- (memory $0 1)
(global $glob (mut i32) (i32.const 1))
+ (memory $0 1)
(func $loop1
(drop
(i32.const 10)
diff --git a/test/passes/memory-packing_all-features.txt b/test/passes/memory-packing_all-features.txt
index 3cf5a415f..731383188 100644
--- a/test/passes/memory-packing_all-features.txt
+++ b/test/passes/memory-packing_all-features.txt
@@ -67,6 +67,9 @@
)
(module
(type $none_=>_none (func))
+ (global $__mem_segment_drop_state (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
(memory $0 2048 2048)
(data "zeroes at start")
(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\00zeroes at start")
@@ -85,9 +88,6 @@
(data "more")
(data "zeroes")
(data "no zeroes")
- (global $__mem_segment_drop_state (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
(func $zeroes-at-start
(block
(if
@@ -367,6 +367,14 @@
(module
(type $none_=>_none (func))
(import "env" "param" (global $param i32))
+ (global $__mem_segment_drop_state (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_3 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_4 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_5 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_6 (mut i32) (i32.const 0))
(memory $0 2048 2048)
(data "even")
(data "more")
@@ -400,14 +408,6 @@
(data "even")
(data "more")
(data "zeroes")
- (global $__mem_segment_drop_state (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_3 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_4 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_5 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_6 (mut i32) (i32.const 0))
(func $nonconst-dest
(local $0 i32)
(block
@@ -826,6 +826,10 @@
)
(module
(type $none_=>_none (func))
+ (global $__mem_segment_drop_state (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
+ (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
(memory $0 2048 2048)
(data "hi")
(data "even")
@@ -837,10 +841,6 @@
(data "hi")
(data "even")
(data "hi")
- (global $__mem_segment_drop_state (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
- (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
(func $zero-length-init-zeroes
(if
(i32.or
@@ -1541,10 +1541,10 @@
)
(module
(type $none_=>_none (func))
+ (global $__mem_segment_drop_state (mut i32) (i32.const 0))
(memory $0 1 1)
(data "skipped")
(data "included")
- (global $__mem_segment_drop_state (mut i32) (i32.const 0))
(export "func_54" (func $0))
(func $0
(if
diff --git a/test/passes/metrics_all-features.txt b/test/passes/metrics_all-features.txt
index 14c1bc72d..7462e768c 100644
--- a/test/passes/metrics_all-features.txt
+++ b/test/passes/metrics_all-features.txt
@@ -18,11 +18,11 @@ total
(module
(type $0 (func (param i32)))
(type $i32_i32_=>_none (func (param i32 i32)))
+ (global $glob i32 (i32.const 1337))
(memory $0 256 256)
(data (i32.const 0) "\ff\ef\0f\1f 0@P\99")
(table $0 256 256 funcref)
(elem (i32.const 0) $ifs $ifs $ifs)
- (global $glob i32 (i32.const 1337))
(event $e0 (attr 0) (param i32))
(event $e1 (attr 0) (param i32 i32))
(func $ifs (param $x i32)
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index 28c7dc0e2..814e132db 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -6,11 +6,11 @@
(type $0 (func (param i32)))
(type $none_=>_externref (func (result externref)))
(type $none_=>_i32_i64 (func (result i32 i64)))
+ (global $global i32 (i32.const 1))
+ (global $global-mut (mut i32) (i32.const 2))
(memory $0 512 512)
(data (i32.const 0) "hello!")
(elem declare func $dummy)
- (global $global i32 (i32.const 1))
- (global $global-mut (mut i32) (i32.const 2))
(func $x (param $x i32)
(call $x
(i32.const 2300)
diff --git a/test/passes/remove-non-js-ops.txt b/test/passes/remove-non-js-ops.txt
index 96bb3e6f0..e4c3cdfa1 100644
--- a/test/passes/remove-non-js-ops.txt
+++ b/test/passes/remove-non-js-ops.txt
@@ -30,8 +30,8 @@
(import "env" "wasm2js_atomic_wait_i32" (func $wasm2js_atomic_wait_i32 (param i32 i32 i32 i32) (result i32)))
(import "env" "wasm2js_atomic_rmw_i64" (func $wasm2js_atomic_rmw_i64 (param i32 i32 i32 i32 i32 i32) (result i32)))
(import "env" "wasm2js_get_stashed_bits" (func $wasm2js_get_stashed_bits (result i32)))
- (memory $0 1)
(global $__wasm-intrinsics-temp-i64 (mut i64) (i64.const 0))
+ (memory $0 1)
(func $copysign64 (param $0 f64) (param $1 f64) (result f64)
(f64.reinterpret_i64
(i64.or
diff --git a/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt b/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt
index b422798c7..6386636fd 100644
--- a/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt
+++ b/test/passes/remove-unused-names_vacuum_ignore-implicit-traps.txt
@@ -20,8 +20,8 @@
(import "env" "wasm2js_scratch_store_i64" (func $legalimport$wasm2js_scratch_store_i64 (param i32 i32)))
(import "env" "wasm2js_scratch_load_i64" (func $wasm2js_scratch_load_i64 (result i64)))
(import "env" "wasm2js_scratch_store_i64" (func $wasm2js_scratch_store_i64 (param i64)))
- (memory $0 1 1)
(global $i64toi32_i32$HIGH_BITS (mut i32) (i32.const 0))
+ (memory $0 1 1)
(func $0
(local $0 f64)
(local $1 i32)
diff --git a/test/passes/roundtrip_signed.bin.txt b/test/passes/roundtrip_signed.bin.txt
index 0406da34a..f696e074e 100644
--- a/test/passes/roundtrip_signed.bin.txt
+++ b/test/passes/roundtrip_signed.bin.txt
@@ -1,7 +1,7 @@
(module
(type $none_=>_none (func))
- (memory $0 16 17)
(global $global$0 (mut i32) (i32.const 10))
+ (memory $0 16 17)
(export "as-br_table-index" (func $0))
(export "as-local.set-value" (func $0))
(func $0
diff --git a/test/passes/simplify-globals_all-features_fuzz-exec.txt b/test/passes/simplify-globals_all-features_fuzz-exec.txt
index 68330b69f..d38d06704 100644
--- a/test/passes/simplify-globals_all-features_fuzz-exec.txt
+++ b/test/passes/simplify-globals_all-features_fuzz-exec.txt
@@ -3,8 +3,8 @@
(module
(type $f32_i31ref_i64_f64_funcref_=>_none (func (param f32 i31ref i64 f64 funcref)))
(type $none_=>_funcref (func (result funcref)))
- (elem declare func $0)
(global $global$0 (mut funcref) (ref.null func))
+ (elem declare func $0)
(export "export" (func $1))
(func $0 (param $0 f32) (param $1 i31ref) (param $2 i64) (param $3 f64) (param $4 funcref)
(nop)
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index e38b460db..ff3834558 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -18,8 +18,8 @@
(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)))
- (memory $0 256 256)
(global $global$0 (mut i32) (i32.const 10))
+ (memory $0 256 256)
(func $contrast
(local $x i32)
(local $y i32)
@@ -1135,8 +1135,8 @@
(import "fuzzing-support" "log1" (func $fimport$0 (result i32)))
(import "fuzzing-support" "log2" (func $fimport$1 (param i32)))
(import "fuzzing-support" "log3" (func $fimport$2 (param f32)))
- (memory $0 (shared 256 256))
(global $global$0 (mut i32) (i32.const 10))
+ (memory $0 (shared 256 256))
(func $nonatomics (result i32)
(local $x i32)
(nop)
diff --git a/test/passes/simplify-locals_all-features_disable-exception-handling.txt b/test/passes/simplify-locals_all-features_disable-exception-handling.txt
index 3254aff45..5289bd931 100644
--- a/test/passes/simplify-locals_all-features_disable-exception-handling.txt
+++ b/test/passes/simplify-locals_all-features_disable-exception-handling.txt
@@ -18,8 +18,8 @@
(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)))
- (memory $0 256 256)
(global $global$0 (mut i32) (i32.const 10))
+ (memory $0 256 256)
(func $contrast
(local $x i32)
(local $y i32)
@@ -1129,8 +1129,8 @@
(import "fuzzing-support" "log1" (func $fimport$0 (result i32)))
(import "fuzzing-support" "log2" (func $fimport$1 (param i32)))
(import "fuzzing-support" "log3" (func $fimport$2 (param f32)))
- (memory $0 (shared 256 256))
(global $global$0 (mut i32) (i32.const 10))
+ (memory $0 (shared 256 256))
(func $nonatomics (result i32)
(local $x i32)
(nop)
diff --git a/test/passes/ssa-nomerge_enable-simd.txt b/test/passes/ssa-nomerge_enable-simd.txt
index 60618e679..c51ca1aa6 100644
--- a/test/passes/ssa-nomerge_enable-simd.txt
+++ b/test/passes/ssa-nomerge_enable-simd.txt
@@ -2,8 +2,8 @@
(type $i32_=>_none (func (param i32)))
(type $none_=>_none (func))
(type $i32_i32_=>_none (func (param i32 i32)))
- (memory $0 1 1)
(global $global$0 (mut i32) (i32.const 1))
+ (memory $0 1 1)
(func $basics (param $x i32)
(local $y i32)
(local $z f32)
diff --git a/test/passes/vacuum_all-features.txt b/test/passes/vacuum_all-features.txt
index 7de8ffa42..3dd051992 100644
--- a/test/passes/vacuum_all-features.txt
+++ b/test/passes/vacuum_all-features.txt
@@ -6,8 +6,8 @@
(type $4 (func (param i32 f64 i32 i32)))
(type $none_=>_f64 (func (result f64)))
(import "env" "int" (func $int (result i32)))
- (memory $0 256 256)
(global $Int i32 (i32.const 0))
+ (memory $0 256 256)
(func $b
(nop)
)
@@ -322,8 +322,8 @@
(module
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
- (memory $0 1 1)
(global $global$1 (mut i32) (i32.const 0))
+ (memory $0 1 1)
(export "compress" (func $3))
(func $_deflate (param $0 i32) (result i32)
(call $_deflate
diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast
index 5a8147584..f1cefdb92 100644
--- a/test/reference-types.wast.from-wast
+++ b/test/reference-types.wast.from-wast
@@ -10,9 +10,6 @@
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $import_global externref))
(import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (table $0 3 3 funcref)
- (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
- (elem declare func $foo $ref-taken-but-not-in-table)
(global $global_externref (mut externref) (ref.null extern))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
@@ -20,6 +17,9 @@
(global $global_anyref2 (mut anyref) (ref.null extern))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
+ (elem declare func $foo $ref-taken-but-not-in-table)
(event $e-i32 (attr 0) (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary
index 16f59d07a..ee99c0d4e 100644
--- a/test/reference-types.wast.fromBinary
+++ b/test/reference-types.wast.fromBinary
@@ -10,9 +10,6 @@
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $import_global externref))
(import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (table $0 3 3 funcref)
- (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
- (elem declare func $foo $ref-taken-but-not-in-table)
(global $global_externref (mut externref) (ref.null extern))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
@@ -20,6 +17,9 @@
(global $global_anyref2 (mut anyref) (ref.null extern))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
+ (elem declare func $foo $ref-taken-but-not-in-table)
(event $event$0 (attr 0) (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo
index 5d168c185..5acf0871d 100644
--- a/test/reference-types.wast.fromBinary.noDebugInfo
+++ b/test/reference-types.wast.fromBinary.noDebugInfo
@@ -10,9 +10,6 @@
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $gimport$0 externref))
(import "env" "import_func" (func $fimport$0 (param externref) (result funcref)))
- (table $0 3 3 funcref)
- (elem (i32.const 0) $0 $1 $2)
- (elem declare func $27 $3)
(global $global$0 (mut externref) (ref.null extern))
(global $global$1 (mut funcref) (ref.null func))
(global $global$2 (mut funcref) (ref.func $3))
@@ -20,6 +17,9 @@
(global $global$4 (mut anyref) (ref.null extern))
(global $global$5 (mut anyref) (ref.null func))
(global $global$6 (mut anyref) (ref.func $3))
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $0 $1 $2)
+ (elem declare func $27 $3)
(event $event$0 (attr 0) (param i32))
(export "export_func" (func $fimport$0))
(export "export_global" (global $gimport$0))