summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/O3_inlining.txt2
-rw-r--r--test/passes/coalesce-locals-learning.txt2
-rw-r--r--test/passes/coalesce-locals.txt2
-rw-r--r--test/passes/code-folding.txt2
-rw-r--r--test/passes/converge_O3_metrics.bin.txt42
-rw-r--r--test/passes/dce.txt4
-rw-r--r--test/passes/duplicate-function-elimination_optimize-level=1.txt12
-rw-r--r--test/passes/duplicate-function-elimination_optimize-level=2.txt12
-rw-r--r--test/passes/flatten.txt4
-rw-r--r--test/passes/flatten_local-cse.txt2
-rw-r--r--test/passes/fpcast-emu.txt4
-rw-r--r--test/passes/func-metrics.txt20
-rw-r--r--test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt16
-rw-r--r--test/passes/inlining-optimizing.txt2
-rw-r--r--test/passes/inlining-optimizing_optimize-level=3.txt12
-rw-r--r--test/passes/inlining.txt2
-rw-r--r--test/passes/instrument-memory.txt2
-rw-r--r--test/passes/legalize-js-interface.txt47
-rw-r--r--test/passes/legalize-js-interface.wast4
-rw-r--r--test/passes/memory-packing.txt2
-rw-r--r--test/passes/metrics.txt6
-rw-r--r--test/passes/post-emscripten.txt2
-rw-r--r--test/passes/precompute.txt2
-rw-r--r--test/passes/print-call-graph.txt38
-rw-r--r--test/passes/remove-imports.txt2
-rw-r--r--test/passes/remove-unused-module-elements.txt8
-rw-r--r--test/passes/remove-unused-names_merge-blocks.txt2
-rw-r--r--test/passes/remove-unused-names_remove-unused-brs_vacuum.txt8
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements.txt8
-rw-r--r--test/passes/safe-heap.txt6
-rw-r--r--test/passes/simplify-locals.txt2
-rw-r--r--test/passes/spill-pointers.txt4
-rw-r--r--test/passes/spill-pointers.wast2
-rw-r--r--test/passes/ssa_fuzz-exec.txt2
-rw-r--r--test/passes/translate-to-fuzz.txt8
-rw-r--r--test/passes/vacuum.txt2
36 files changed, 170 insertions, 127 deletions
diff --git a/test/passes/O3_inlining.txt b/test/passes/O3_inlining.txt
index 67c7931ef..8710a0bef 100644
--- a/test/passes/O3_inlining.txt
+++ b/test/passes/O3_inlining.txt
@@ -1,7 +1,7 @@
(module
(type $1 (func (param i32)))
- (global $global$1 (mut i32) (i32.const 100))
(memory $0 1 1)
+ (global $global$1 (mut i32) (i32.const 100))
(export "func_217" (func $1))
(func $1 (; 0 ;) (type $1) (param $0 i32)
(if
diff --git a/test/passes/coalesce-locals-learning.txt b/test/passes/coalesce-locals-learning.txt
index ecf2f4cd7..95eb36729 100644
--- a/test/passes/coalesce-locals-learning.txt
+++ b/test/passes/coalesce-locals-learning.txt
@@ -4,8 +4,8 @@
(type $2 (func))
(type $3 (func (param i32 f32)))
(type $4 (func (param i32)))
- (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32)))
(memory $0 10)
+ (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32)))
(func $nothing-to-do (; 1 ;) (type $2)
(local $0 i32)
(nop)
diff --git a/test/passes/coalesce-locals.txt b/test/passes/coalesce-locals.txt
index 4f856d0dc..e286135a3 100644
--- a/test/passes/coalesce-locals.txt
+++ b/test/passes/coalesce-locals.txt
@@ -10,10 +10,10 @@
(type $8 (func (param f64 i32) (result i64)))
(type $9 (func (param i32 i32)))
(type $10 (func (result f64)))
+ (memory $0 10)
(import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32)))
(import "env" "get" (func $get (result i32)))
(import "env" "set" (func $set (param i32)))
- (memory $0 10)
(func $nothing-to-do (; 3 ;) (type $2)
(local $0 i32)
(nop)
diff --git a/test/passes/code-folding.txt b/test/passes/code-folding.txt
index 054e58104..e7eeb55e3 100644
--- a/test/passes/code-folding.txt
+++ b/test/passes/code-folding.txt
@@ -2,8 +2,8 @@
(type $13 (func (param f32)))
(type $1 (func))
(type $2 (func (result f32)))
- (table 282 282 anyfunc)
(memory $0 1 1)
+ (table 282 282 anyfunc)
(func $0 (; 0 ;) (type $1)
(block $label$1
(if
diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt
index 637a9522f..8751bccf4 100644
--- a/test/passes/converge_O3_metrics.bin.txt
+++ b/test/passes/converge_O3_metrics.bin.txt
@@ -1,5 +1,6 @@
total
[funcs] : 8
+ [imports] : 3
[memory-data] : 28
[table-data] : 429
[total] : 132
@@ -7,8 +8,7 @@ total
binary : 12
block : 8
break : 3
- call : 2
- call_import : 1
+ call : 3
call_indirect : 4
const : 47
drop : 3
@@ -26,11 +26,7 @@ total
(type $2 (func (param i32) (result i32)))
(type $6 (func (param i32 i32 i32 i32 i32 i32 i32) (result i32)))
(type $7 (func (result i32)))
- (import "env" "memory" (memory $0 256 256))
- (import "env" "table" (table 478 478 anyfunc))
- (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 1))
- (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 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$b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi)
+ (import "env" "memory" (memory $1 256 256))
(data (i32.const 2948) "\03")
(data (i32.const 6828) "\04")
(data (i32.const 7028) "\0d\00\00\00\06")
@@ -39,6 +35,10 @@ total
(data (i32.const 18128) ",I")
(data (i32.const 18732) "D\1b")
(data (i32.const 18764) "`\0b")
+ (import "env" "table" (table 478 478 anyfunc))
+ (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b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0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi)
+ (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32)))
+ (global $global$0 (mut i32) (i32.const 1))
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
(func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
@@ -241,6 +241,7 @@ total
)
total
[funcs] : 8
+ [imports] : 3
[memory-data] : 28
[table-data] : 429
[total] : 132
@@ -248,8 +249,7 @@ total
binary : 12
block : 8
break : 3
- call : 2
- call_import : 1
+ call : 3
call_indirect : 4
const : 47
drop : 3
@@ -268,11 +268,7 @@ total
(type $6 (func (param i32 i32 i32 i32 i32 i32 i32) (result i32)))
(type $7 (func (result i32)))
(type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256 256))
- (import "env" "table" (table 478 478 anyfunc))
- (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 1))
- (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0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 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi)
+ (import "env" "memory" (memory $1 256 256))
(data (i32.const 2948) "\03")
(data (i32.const 6828) "\04")
(data (i32.const 7028) "\0d\00\00\00\06")
@@ -281,6 +277,10 @@ total
(data (i32.const 18128) ",I")
(data (i32.const 18732) "D\1b")
(data (i32.const 18764) "`\0b")
+ (import "env" "table" (table 478 478 anyfunc))
+ (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $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b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi)
+ (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32)))
+ (global $global$0 (mut i32) (i32.const 1))
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
(func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
@@ -483,6 +483,7 @@ total
)
total
[funcs] : 8
+ [imports] : 3
[memory-data] : 28
[table-data] : 429
[total] : 132
@@ -490,8 +491,7 @@ total
binary : 12
block : 8
break : 3
- call : 2
- call_import : 1
+ call : 3
call_indirect : 4
const : 47
drop : 3
@@ -510,11 +510,7 @@ total
(type $6 (func (param i32 i32 i32 i32 i32 i32 i32) (result i32)))
(type $7 (func (result i32)))
(type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256 256))
- (import "env" "table" (table 478 478 anyfunc))
- (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 1))
- (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b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0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi)
+ (import "env" "memory" (memory $1 256 256))
(data (i32.const 2948) "\03")
(data (i32.const 6828) "\04")
(data (i32.const 7028) "\0d\00\00\00\06")
@@ -523,6 +519,10 @@ total
(data (i32.const 18128) ",I")
(data (i32.const 18732) "D\1b")
(data (i32.const 18764) "`\0b")
+ (import "env" "table" (table 478 478 anyfunc))
+ (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 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$b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi)
+ (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32)))
+ (global $global$0 (mut i32) (i32.const 1))
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
(func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
diff --git a/test/passes/dce.txt b/test/passes/dce.txt
index b2976432b..6931ef038 100644
--- a/test/passes/dce.txt
+++ b/test/passes/dce.txt
@@ -6,10 +6,10 @@
(type $4 (func (param i64 i64) (result i64)))
(type $5 (func (param f32 i64)))
(type $6 (func (param f32 i64) (result i32)))
- (global $x (mut i32) (i32.const 0))
+ (memory $0 10)
(table 1 1 anyfunc)
(elem (i32.const 0) $call-me)
- (memory $0 10)
+ (global $x (mut i32) (i32.const 0))
(func $call-me (; 0 ;) (type $ii) (param $0 i32) (param $1 i32)
(nop)
)
diff --git a/test/passes/duplicate-function-elimination_optimize-level=1.txt b/test/passes/duplicate-function-elimination_optimize-level=1.txt
index c44b4cc28..276debca1 100644
--- a/test/passes/duplicate-function-elimination_optimize-level=1.txt
+++ b/test/passes/duplicate-function-elimination_optimize-level=1.txt
@@ -42,9 +42,9 @@
)
(module
(type $0 (func))
+ (memory $0 0)
(table 3 3 anyfunc)
(elem (i32.const 0) $keep2 $keep2 $caller)
- (memory $0 0)
(export "keep2" (func $keep2))
(export "other" (func $keep2))
(start $keep2)
@@ -369,18 +369,18 @@
)
(module
(type $FUNCSIG$v (func))
+ (memory $0 0)
(import "env" "i" (func $i))
(import "env" "j" (func $j))
- (memory $0 0)
(func $erase (; 2 ;) (type $FUNCSIG$v)
(call $i)
)
)
(module
(type $FUNCSIG$v (func))
+ (memory $0 0)
(import "env" "i" (func $i))
(import "env" "j" (func $j))
- (memory $0 0)
(func $keep2 (; 2 ;) (type $FUNCSIG$v)
(call $i)
)
@@ -390,9 +390,9 @@
)
(module
(type $T (func))
+ (memory $0 0)
(table 2 2 anyfunc)
(elem (i32.const 0) $erase $erase)
- (memory $0 0)
(func $erase (; 0 ;) (type $T)
(call_indirect (type $T)
(i32.const 0)
@@ -401,9 +401,9 @@
)
(module
(type $T (func))
+ (memory $0 0)
(table 2 2 anyfunc)
(elem (i32.const 0) $keep2 $other)
- (memory $0 0)
(func $keep2 (; 0 ;) (type $T)
(call_indirect (type $T)
(i32.const 0)
@@ -418,9 +418,9 @@
(module
(type $T (func))
(type $S (func))
+ (memory $0 0)
(table 2 2 anyfunc)
(elem (i32.const 0) $keep2 $other)
- (memory $0 0)
(func $keep2 (; 0 ;) (type $T)
(call_indirect (type $T)
(i32.const 0)
diff --git a/test/passes/duplicate-function-elimination_optimize-level=2.txt b/test/passes/duplicate-function-elimination_optimize-level=2.txt
index baf4fedf2..4294b28c4 100644
--- a/test/passes/duplicate-function-elimination_optimize-level=2.txt
+++ b/test/passes/duplicate-function-elimination_optimize-level=2.txt
@@ -42,9 +42,9 @@
)
(module
(type $0 (func))
+ (memory $0 0)
(table 3 3 anyfunc)
(elem (i32.const 0) $keep2 $keep2 $caller)
- (memory $0 0)
(export "keep2" (func $keep2))
(export "other" (func $keep2))
(start $keep2)
@@ -366,18 +366,18 @@
)
(module
(type $FUNCSIG$v (func))
+ (memory $0 0)
(import "env" "i" (func $i))
(import "env" "j" (func $j))
- (memory $0 0)
(func $erase (; 2 ;) (type $FUNCSIG$v)
(call $i)
)
)
(module
(type $FUNCSIG$v (func))
+ (memory $0 0)
(import "env" "i" (func $i))
(import "env" "j" (func $j))
- (memory $0 0)
(func $keep2 (; 2 ;) (type $FUNCSIG$v)
(call $i)
)
@@ -387,9 +387,9 @@
)
(module
(type $T (func))
+ (memory $0 0)
(table 2 2 anyfunc)
(elem (i32.const 0) $erase $erase)
- (memory $0 0)
(func $erase (; 0 ;) (type $T)
(call_indirect (type $T)
(i32.const 0)
@@ -398,9 +398,9 @@
)
(module
(type $T (func))
+ (memory $0 0)
(table 2 2 anyfunc)
(elem (i32.const 0) $keep2 $other)
- (memory $0 0)
(func $keep2 (; 0 ;) (type $T)
(call_indirect (type $T)
(i32.const 0)
@@ -415,9 +415,9 @@
(module
(type $T (func))
(type $S (func))
+ (memory $0 0)
(table 2 2 anyfunc)
(elem (i32.const 0) $keep2 $other)
- (memory $0 0)
(func $keep2 (; 0 ;) (type $T)
(call_indirect (type $T)
(i32.const 0)
diff --git a/test/passes/flatten.txt b/test/passes/flatten.txt
index 201cad478..90d0ab269 100644
--- a/test/passes/flatten.txt
+++ b/test/passes/flatten.txt
@@ -5,10 +5,10 @@
(type $3 (func (param i32) (result i32)))
(type $4 (func (param i64 i64) (result i64)))
(type $5 (func (result f32)))
- (global $x (mut i32) (i32.const 0))
+ (memory $0 10)
(table 1 1 anyfunc)
(elem (i32.const 0) $call-me)
- (memory $0 10)
+ (global $x (mut i32) (i32.const 0))
(func $a1 (; 0 ;) (type $1)
(local $0 i32)
(set_local $0
diff --git a/test/passes/flatten_local-cse.txt b/test/passes/flatten_local-cse.txt
index defa27c92..d8dd852b5 100644
--- a/test/passes/flatten_local-cse.txt
+++ b/test/passes/flatten_local-cse.txt
@@ -637,8 +637,8 @@
(type $0 (func))
(type $1 (func (param i32 f64) (result i32)))
(type $2 (func (param i64 f32 i32)))
- (global $global$0 (mut i32) (i32.const 10))
(table 23 23 anyfunc)
+ (global $global$0 (mut i32) (i32.const 10))
(export "func_1_invoker" (func $1))
(export "func_6" (func $2))
(func $0 (; 0 ;) (type $2) (param $var$0 i64) (param $var$1 f32) (param $var$2 i32)
diff --git a/test/passes/fpcast-emu.txt b/test/passes/fpcast-emu.txt
index b1560517c..8349a04f6 100644
--- a/test/passes/fpcast-emu.txt
+++ b/test/passes/fpcast-emu.txt
@@ -11,9 +11,9 @@
(type $FUNCSIG$fjj (func (param i64 i64) (result f32)))
(type $FUNCSIG$dff (func (param f32 f32) (result f64)))
(type $FUNCSIG$idd (func (param f64 f64) (result i32)))
- (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32)))
(table 10 10 anyfunc)
(elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b $byn$fpcast-emu$c $byn$fpcast-emu$d $byn$fpcast-emu$e $byn$fpcast-emu$e $byn$fpcast-emu$imported-func)
+ (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32)))
(export "dynCall_dff" (func $dynCall_dff))
(export "dynCall_idd" (func $dynCall_idd))
(func $a (; 1 ;) (type $vijfd) (param $x i32) (param $y i64) (param $z f32) (param $w f64)
@@ -296,8 +296,8 @@
(type $0 (func (param i64)))
(type $1 (func (param f32) (result i64)))
(type $FUNCSIG$jjjjjjjjjjjjjjjj (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
- (global $global$0 (mut i32) (i32.const 10))
(table 42 42 anyfunc)
+ (global $global$0 (mut i32) (i32.const 10))
(export "func_106" (func $0))
(func $0 (; 0 ;) (type $1) (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 b778962a1..19ba9ba24 100644
--- a/test/passes/func-metrics.txt
+++ b/test/passes/func-metrics.txt
@@ -28,11 +28,11 @@ func: ifs
(module
(type $0 (func (param i32)))
(type $1 (func))
- (global $glob i32 (i32.const 1337))
- (table 256 256 anyfunc)
- (elem (i32.const 0) $ifs $ifs $ifs)
(memory $0 256 256)
(data (i32.const 0) "\ff\ef\0f\1f 0@P\99")
+ (table 256 256 anyfunc)
+ (elem (i32.const 0) $ifs $ifs $ifs)
+ (global $glob i32 (i32.const 1337))
(func $empty (; 0 ;) (type $1)
(nop)
)
@@ -88,22 +88,22 @@ global
)
global
[funcs] : 3
+ [imports] : 1
func: func_a
[binary-bytes] : 16
[total] : 8
block : 1
- call : 2
- call_import : 5
+ call : 7
func: func_b
[binary-bytes] : 22
[total] : 11
block : 1
- call_import : 10
+ call : 10
func: func_c
[binary-bytes] : 32
[total] : 16
block : 1
- call_import : 15
+ call : 15
export: a (func_a)
[removable-bytes-without-it]: 72
export: b (func_b)
@@ -154,11 +154,12 @@ export: b (func_b)
)
global
[funcs] : 1
+ [imports] : 1
func: func_a
[binary-bytes] : 12
[total] : 6
block : 1
- call_import : 5
+ call : 5
export: a (func_a)
[removable-bytes-without-it]: 7
start: func_a
@@ -178,11 +179,12 @@ start: func_a
)
global
[funcs] : 1
+ [imports] : 1
func: func_a
[binary-bytes] : 12
[total] : 6
block : 1
- call_import : 5
+ call : 5
start: func_a
[removable-bytes-without-it]: 67
(module
diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt
index 627f5bd19..043d0deef 100644
--- a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt
+++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt
@@ -9,13 +9,13 @@
(type $7 (func (param f64) (result f64)))
(type $8 (func (result i64)))
(type $9 (func (param i32 i64)))
+ (memory $0 4096 4096)
+ (data (i32.const 1026) "\14\00")
+ (table 10 anyfunc)
+ (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi))
(import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32)))
(import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64)))
- (table 10 anyfunc)
- (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
- (memory $0 4096 4096)
- (data (i32.const 1026) "\14\00")
(export "big_negative" (func $big_negative))
(func $big_negative (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$v)
(local $temp f64)
@@ -639,13 +639,13 @@
(type $7 (func (param f64) (result f64)))
(type $8 (func (result i64)))
(type $9 (func (param i32 i64)))
+ (memory $0 4096 4096)
+ (data (i32.const 1026) "\14\00")
+ (table 10 anyfunc)
+ (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi))
(import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32)))
(import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64)))
- (table 10 anyfunc)
- (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
- (memory $0 4096 4096)
- (data (i32.const 1026) "\14\00")
(export "big_negative" (func $big_negative))
(func $big_negative (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$v)
(local $temp f64)
diff --git a/test/passes/inlining-optimizing.txt b/test/passes/inlining-optimizing.txt
index 8b55459c2..036835614 100644
--- a/test/passes/inlining-optimizing.txt
+++ b/test/passes/inlining-optimizing.txt
@@ -78,8 +78,8 @@
(module
(type $0 (func))
(type $1 (func (param i32 i32) (result i32)))
- (table 89 89 anyfunc)
(memory $0 17)
+ (table 89 89 anyfunc)
(start $1)
(func $1 (; 0 ;) (type $0)
(i32.store
diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt
index 9636e0467..6a34ac454 100644
--- a/test/passes/inlining-optimizing_optimize-level=3.txt
+++ b/test/passes/inlining-optimizing_optimize-level=3.txt
@@ -12,9 +12,15 @@
(type $10 (func (param i32 i32 i32)))
(type $11 (func (param i32 i32 i32 i32 i32)))
(type $12 (func (param i32 i32 i32 i32) (result i32)))
+ (import "env" "memory" (memory $0 256 256))
+ (data (i32.const 1024) "emcc_hello_world.asm.js")
+ (import "env" "table" (table 18 18 anyfunc))
+ (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
(import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "memoryBase" (global $memoryBase i32))
+ (import "env" "tableBase" (global $tableBase i32))
(import "env" "abort" (func $abort))
(import "env" "nullFunc_ii" (func $nullFunc_ii (param i32)))
(import "env" "nullFunc_iiii" (func $nullFunc_iiii (param i32)))
@@ -33,18 +39,12 @@
(import "env" "_pthread_cleanup_push" (func $_pthread_cleanup_push (param i32 i32)))
(import "env" "_sysconf" (func $_sysconf (param i32) (result i32)))
(import "env" "___syscall146" (func $___syscall146 (param i32 i32) (result i32)))
- (import "env" "memory" (memory $0 256 256))
- (import "env" "table" (table 18 18 anyfunc))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
(global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
(global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
(global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
(global $__THREW__ (mut i32) (i32.const 0))
(global $threwValue (mut i32) (i32.const 0))
(global $tempRet0 (mut i32) (i32.const 0))
- (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
- (data (i32.const 1024) "emcc_hello_world.asm.js")
(export "_i64Subtract" (func $_i64Subtract))
(export "_free" (func $_free))
(export "_main" (func $_main))
diff --git a/test/passes/inlining.txt b/test/passes/inlining.txt
index 2076d078f..9271de34a 100644
--- a/test/passes/inlining.txt
+++ b/test/passes/inlining.txt
@@ -170,8 +170,8 @@
(type $0 (func (result i32)))
(type $1 (func (param f32 i32) (result i32)))
(type $2 (func))
- (global $hangLimit (mut i32) (i32.const 25))
(memory $0 1 1)
+ (global $hangLimit (mut i32) (i32.const 25))
(export "hangLimitInitializer" (func $hangLimitInitializer))
(func $func_4 (; 0 ;) (type $1) (param $0 f32) (param $1 i32) (result i32)
(local $2 i64)
diff --git a/test/passes/instrument-memory.txt b/test/passes/instrument-memory.txt
index fc5221c3e..3e2f674b2 100644
--- a/test/passes/instrument-memory.txt
+++ b/test/passes/instrument-memory.txt
@@ -1,9 +1,9 @@
(module
(type $1 (func))
(type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32)))
+ (memory $0 256 256)
(import "instrument" "load" (func $load (param i32 i32 i32 i32) (result i32)))
(import "instrument" "store" (func $store (param i32 i32 i32 i32) (result i32)))
- (memory $0 256 256)
(func $A (; 2 ;) (type $1)
(drop
(i32.load8_s
diff --git a/test/passes/legalize-js-interface.txt b/test/passes/legalize-js-interface.txt
index 8f833de87..5d232778f 100644
--- a/test/passes/legalize-js-interface.txt
+++ b/test/passes/legalize-js-interface.txt
@@ -1,13 +1,20 @@
(module
- (type $0 (func (result i64)))
+ (type $FUNCSIG$j (func (result i64)))
+ (type $legaltype$imported (func (result i32)))
+ (import "env" "imported" (func $legalimport$imported (result i32)))
(global $tempRet0 (mut i32) (i32.const 0))
(export "func" (func $legalstub$func))
+ (export "imported" (func $legalstub$imported))
+ (export "imported_again" (func $legalstub$imported))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $func (; 0 ;) (type $0) (result i64)
+ (func $func (; 1 ;) (type $FUNCSIG$j) (result i64)
+ (drop
+ (call $legalfunc$imported)
+ )
(unreachable)
)
- (func $legalstub$func (; 1 ;) (result i32)
+ (func $legalstub$func (; 2 ;) (result i32)
(local $0 i64)
(set_local $0
(call $func)
@@ -24,10 +31,40 @@
(get_local $0)
)
)
- (func $getTempRet0 (; 2 ;) (result i32)
+ (func $legalstub$imported (; 3 ;) (result i32)
+ (local $0 i64)
+ (set_local $0
+ (call $legalfunc$imported)
+ )
+ (set_global $tempRet0
+ (i32.wrap/i64
+ (i64.shr_u
+ (get_local $0)
+ (i64.const 32)
+ )
+ )
+ )
+ (i32.wrap/i64
+ (get_local $0)
+ )
+ )
+ (func $legalfunc$imported (; 4 ;) (result i64)
+ (i64.or
+ (i64.extend_u/i32
+ (call $legalimport$imported)
+ )
+ (i64.shl
+ (i64.extend_u/i32
+ (get_global $tempRet0)
+ )
+ (i64.const 32)
+ )
+ )
+ )
+ (func $getTempRet0 (; 5 ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 3 ;) (param $0 i32)
+ (func $setTempRet0 (; 6 ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
diff --git a/test/passes/legalize-js-interface.wast b/test/passes/legalize-js-interface.wast
index bae2a8c75..5e1341653 100644
--- a/test/passes/legalize-js-interface.wast
+++ b/test/passes/legalize-js-interface.wast
@@ -1,6 +1,10 @@
(module
+ (import "env" "imported" (func $imported (result i64)))
(export "func" (func $func))
+ (export "imported" (func $imported))
+ (export "imported_again" (func $imported))
(func $func (result i64)
+ (drop (call $imported))
(unreachable)
)
)
diff --git a/test/passes/memory-packing.txt b/test/passes/memory-packing.txt
index 6f67f9dcb..e60f716c0 100644
--- a/test/passes/memory-packing.txt
+++ b/test/passes/memory-packing.txt
@@ -1,6 +1,5 @@
(module
(import "env" "memory" (memory $0 2048 2048))
- (import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $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")
(data (i32.const 1024) "waka this CAN be optimized")
(data (i32.const 1107) "we DO know where it will go")
@@ -9,6 +8,7 @@
(data (i32.const 4000) "zeros\00in\00the\00middle")
(data (i32.const 4035) "nice skip here")
(data (i32.const 4066) "another\00but no")
+ (import "env" "memoryBase" (global $memoryBase i32))
)
(module
(import "env" "memory" (memory $0 2048 2048))
diff --git a/test/passes/metrics.txt b/test/passes/metrics.txt
index 9cc5d03ec..a3765585f 100644
--- a/test/passes/metrics.txt
+++ b/test/passes/metrics.txt
@@ -11,11 +11,11 @@ total
if : 4
(module
(type $0 (func (param i32)))
- (global $glob i32 (i32.const 1337))
- (table 256 256 anyfunc)
- (elem (i32.const 0) $ifs $ifs $ifs)
(memory $0 256 256)
(data (i32.const 0) "\ff\ef\0f\1f 0@P\99")
+ (table 256 256 anyfunc)
+ (elem (i32.const 0) $ifs $ifs $ifs)
+ (global $glob i32 (i32.const 1337))
(func $ifs (; 0 ;) (type $0) (param $x i32)
(local $y f32)
(block $block0
diff --git a/test/passes/post-emscripten.txt b/test/passes/post-emscripten.txt
index a1bac030a..c938d8174 100644
--- a/test/passes/post-emscripten.txt
+++ b/test/passes/post-emscripten.txt
@@ -3,8 +3,8 @@
(type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
(type $2 (func (param i32) (result i32)))
(type $3 (func))
- (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64)))
(memory $0 256 256)
+ (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64)))
(export "load-off-2" (func $load-off-2))
(func $b0 (; 1 ;) (type $0) (param $x i32)
(drop
diff --git a/test/passes/precompute.txt b/test/passes/precompute.txt
index 166d0b575..11bd93fc4 100644
--- a/test/passes/precompute.txt
+++ b/test/passes/precompute.txt
@@ -3,9 +3,9 @@
(type $1 (func (result i32)))
(type $2 (func))
(type $3 (func (result f64)))
+ (memory $0 0)
(global $global i32 (i32.const 1))
(global $global-mut (mut i32) (i32.const 2))
- (memory $0 0)
(func $x (; 0 ;) (type $0) (param $x i32)
(call $x
(i32.const 2300)
diff --git a/test/passes/print-call-graph.txt b/test/passes/print-call-graph.txt
index 50c67d9d7..fc3927ed6 100644
--- a/test/passes/print-call-graph.txt
+++ b/test/passes/print-call-graph.txt
@@ -75,32 +75,32 @@ digraph call {
"$dynCall_vi" [style="filled", fillcolor="gray"];
"$dynCall_v" [style="filled", fillcolor="gray"];
"$_main" -> "$__Znwj"; // call
- "$___stdio_close" -> "$___syscall6"; // callImport
+ "$___stdio_close" -> "$___syscall6"; // call
"$___stdio_close" -> "$___syscall_ret"; // call
- "$___stdio_write" -> "$_pthread_cleanup_push"; // callImport
- "$___stdio_write" -> "$___syscall146"; // callImport
+ "$___stdio_write" -> "$_pthread_cleanup_push"; // call
+ "$___stdio_write" -> "$___syscall146"; // call
"$___stdio_write" -> "$___syscall_ret"; // call
- "$___stdio_write" -> "$_pthread_cleanup_pop"; // callImport
- "$___stdio_seek" -> "$___syscall140"; // callImport
+ "$___stdio_write" -> "$_pthread_cleanup_pop"; // call
+ "$___stdio_seek" -> "$___syscall140"; // call
"$___stdio_seek" -> "$___syscall_ret"; // call
"$___syscall_ret" -> "$___errno_location"; // call
"$___errno_location" -> "$_pthread_self"; // call
"$_cleanup_387" -> "$_free"; // call
- "$___stdout_write" -> "$___syscall54"; // callImport
+ "$___stdout_write" -> "$___syscall54"; // call
"$___stdout_write" -> "$___stdio_write"; // call
"$_fflush" -> "$___fflush_unlocked"; // call
"$_fflush" -> "$_malloc"; // call
"$_fflush" -> "$_free"; // call
"$_fflush" -> "$_fflush"; // call
- "$_fflush" -> "$___lock"; // callImport
- "$_fflush" -> "$___unlock"; // callImport
+ "$_fflush" -> "$___lock"; // call
+ "$_fflush" -> "$___unlock"; // call
"$__Znwj" -> "$_malloc"; // call
"$__Znwj" -> "$__ZSt15get_new_handlerv"; // call
- "$_memcpy" -> "$_emscripten_memcpy_big"; // callImport
- "$b0" -> "$abort"; // callImport
- "$b1" -> "$abort"; // callImport
- "$b2" -> "$abort"; // callImport
- "$b3" -> "$abort"; // callImport
+ "$_memcpy" -> "$_emscripten_memcpy_big"; // call
+ "$b0" -> "$abort"; // call
+ "$b1" -> "$abort"; // call
+ "$b2" -> "$abort"; // call
+ "$b3" -> "$abort"; // call
"$b0" [style="filled, rounded"];
"$___stdio_close" [style="filled, rounded"];
"$b1" [style="filled, rounded"];
@@ -120,6 +120,10 @@ digraph call {
(type $FUNCSIG$vii (func (param i32 i32)))
(type $6 (func (result i32)))
(type $7 (func (param i32 i32 i32 i32) (result i32)))
+ (import "env" "memory" (memory $0 256 256))
+ (data (get_global $memoryBase) "\05\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\b0\04\00\00\00\04\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\n\ff\ff\ff\ff\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\04")
+ (import "env" "table" (table 9 9 anyfunc))
+ (elem (i32.const 0) $b0 $___stdio_close $b1 $___stdout_write $___stdio_seek $___stdio_write $b2 $_cleanup_387 $b3)
(import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
(import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR$asm2wasm$import i32))
@@ -127,6 +131,8 @@ digraph call {
(import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
(import "global" "NaN" (global $nan$asm2wasm$import f64))
(import "global" "Infinity" (global $inf$asm2wasm$import f64))
+ (import "env" "memoryBase" (global $memoryBase i32))
+ (import "env" "tableBase" (global $tableBase i32))
(import "env" "abort" (func $abort (param i32)))
(import "env" "_pthread_cleanup_pop" (func $_pthread_cleanup_pop (param i32)))
(import "env" "___lock" (func $___lock (param i32)))
@@ -137,10 +143,6 @@ digraph call {
(import "env" "___syscall54" (func $___syscall54 (param i32 i32) (result i32)))
(import "env" "___unlock" (func $___unlock (param i32)))
(import "env" "___syscall146" (func $___syscall146 (param i32 i32) (result i32)))
- (import "env" "memory" (memory $0 256 256))
- (import "env" "table" (table 9 9 anyfunc))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
(global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
(global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
(global $DYNAMICTOP_PTR (mut i32) (get_global $DYNAMICTOP_PTR$asm2wasm$import))
@@ -164,8 +166,6 @@ digraph call {
(global $tempRet0 (mut i32) (i32.const 0))
(global $tempFloat (mut f32) (f32.const 0))
(global $f0 (mut f32) (f32.const 0))
- (elem (i32.const 0) $b0 $___stdio_close $b1 $___stdout_write $___stdio_seek $___stdio_write $b2 $_cleanup_387 $b3)
- (data (get_global $memoryBase) "\05\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\b0\04\00\00\00\04\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\n\ff\ff\ff\ff\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\04")
(export "_fflush" (func $_fflush))
(export "_main" (func $_main))
(export "_pthread_self" (func $_pthread_self))
diff --git a/test/passes/remove-imports.txt b/test/passes/remove-imports.txt
index 9c7444b8d..05ec5bae2 100644
--- a/test/passes/remove-imports.txt
+++ b/test/passes/remove-imports.txt
@@ -2,8 +2,8 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$d (func (result f64)))
- (import "env" "memBase" (global $import$global0 i32))
(memory $0 1024 1024)
+ (import "env" "memBase" (global $import$global0 i32))
(func $nada (; 0 ;) (type $FUNCSIG$v)
(nop)
(drop
diff --git a/test/passes/remove-unused-module-elements.txt b/test/passes/remove-unused-module-elements.txt
index 7c85eec58..077ed0b0c 100644
--- a/test/passes/remove-unused-module-elements.txt
+++ b/test/passes/remove-unused-module-elements.txt
@@ -2,9 +2,9 @@
(type $0 (func))
(type $1 (func (param i32)))
(type $2 (func (param i32) (result i32)))
+ (memory $0 0)
(table 1 1 anyfunc)
(elem (i32.const 0) $called_indirect)
- (memory $0 0)
(export "memory" (memory $0))
(export "exported" (func $exported))
(export "other1" (func $other1))
@@ -92,9 +92,9 @@
(module
(type $0 (func))
(import "env" "memory" (memory $0 256))
+ (data (i32.const 1) "hello, world!")
(import "env" "table" (table 1 anyfunc))
(elem (i32.const 0) $waka)
- (data (i32.const 1) "hello, world!")
(func $waka (; 0 ;) (type $0)
(nop)
)
@@ -207,11 +207,11 @@
(module
(type $0 (func))
(import "env" "memory" (memory $0 256))
+ (data (get_global $memoryBase) "hello, world!")
(import "env" "table" (table 0 anyfunc))
+ (elem (get_global $tableBase) $waka)
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (elem (get_global $tableBase) $waka)
- (data (get_global $memoryBase) "hello, world!")
(func $waka (; 0 ;) (type $0)
(nop)
)
diff --git a/test/passes/remove-unused-names_merge-blocks.txt b/test/passes/remove-unused-names_merge-blocks.txt
index 410febead..c38ab7429 100644
--- a/test/passes/remove-unused-names_merge-blocks.txt
+++ b/test/passes/remove-unused-names_merge-blocks.txt
@@ -5,9 +5,9 @@
(type $3 (func))
(type $4 (func (result i32)))
(type $5 (func (result f64)))
+ (memory $0 (shared 256 256))
(table 1 1 anyfunc)
(elem (i32.const 0) $call-i)
- (memory $0 (shared 256 256))
(func $call-i (; 0 ;) (type $i) (param $0 i32)
(nop)
)
diff --git a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt
index e6b01cc11..fc975a788 100644
--- a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt
+++ b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt
@@ -23,6 +23,8 @@
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$id (func (param f64) (result i32)))
(type $23 (func (param i32) (result i64)))
+ (import "env" "memory" (memory $0 256))
+ (import "env" "table" (table 18 18 anyfunc))
(import "env" "DYNAMICTOP_PTR" (global $import$0 i32))
(import "env" "tempDoublePtr" (global $import$1 i32))
(import "env" "ABORT" (global $import$2 i32))
@@ -30,6 +32,8 @@
(import "env" "STACK_MAX" (global $import$4 i32))
(import "global" "NaN" (global $import$5 f64))
(import "global" "Infinity" (global $import$6 f64))
+ (import "env" "memoryBase" (global $import$32 i32))
+ (import "env" "tableBase" (global $import$33 i32))
(import "env" "enlargeMemory" (func $import$7 (result i32)))
(import "env" "getTotalMemory" (func $import$8 (result i32)))
(import "env" "abortOnCannotGrowMemory" (func $import$9 (result i32)))
@@ -53,10 +57,6 @@
(import "asm2wasm" "i32s-rem" (func $import$27 (param i32 i32) (result i32)))
(import "asm2wasm" "i32u-rem" (func $import$28 (param i32 i32) (result i32)))
(import "asm2wasm" "i32u-div" (func $import$29 (param i32 i32) (result i32)))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 18 18 anyfunc))
- (import "env" "memoryBase" (global $import$32 i32))
- (import "env" "tableBase" (global $import$33 i32))
(global $global$0 (mut i32) (get_global $import$0))
(global $global$1 (mut i32) (get_global $import$1))
(global $global$2 (mut i32) (get_global $import$2))
diff --git a/test/passes/remove-unused-nonfunction-module-elements.txt b/test/passes/remove-unused-nonfunction-module-elements.txt
index bd4a8c7d4..2eb4aebba 100644
--- a/test/passes/remove-unused-nonfunction-module-elements.txt
+++ b/test/passes/remove-unused-nonfunction-module-elements.txt
@@ -2,9 +2,9 @@
(type $0 (func))
(type $1 (func (param i32)))
(type $2 (func (param i32) (result i32)))
+ (memory $0 0)
(table 1 1 anyfunc)
(elem (i32.const 0) $called_indirect)
- (memory $0 0)
(export "memory" (memory $0))
(export "exported" (func $exported))
(export "other1" (func $other1))
@@ -107,9 +107,9 @@
(module
(type $0 (func))
(import "env" "memory" (memory $0 256))
+ (data (i32.const 1) "hello, world!")
(import "env" "table" (table 1 anyfunc))
(elem (i32.const 0) $waka)
- (data (i32.const 1) "hello, world!")
(func $waka (; 0 ;) (type $0)
(nop)
)
@@ -222,11 +222,11 @@
(module
(type $0 (func))
(import "env" "memory" (memory $0 256))
+ (data (get_global $memoryBase) "hello, world!")
(import "env" "table" (table 0 anyfunc))
+ (elem (get_global $tableBase) $waka)
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (elem (get_global $tableBase) $waka)
- (data (get_global $memoryBase) "hello, world!")
(func $waka (; 0 ;) (type $0)
(nop)
)
diff --git a/test/passes/safe-heap.txt b/test/passes/safe-heap.txt
index 74920cc7f..4e0fe6f43 100644
--- a/test/passes/safe-heap.txt
+++ b/test/passes/safe-heap.txt
@@ -1,10 +1,10 @@
(module
(type $0 (func))
(type $FUNCSIG$v (func))
+ (memory $0 (shared 100 100))
(import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR i32))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
(func $loads (; 2 ;) (type $0)
(drop
(call $SAFE_HEAP_LOAD_i32_4_U_4
@@ -4183,10 +4183,10 @@
(module
(type $0 (func))
(type $FUNCSIG$v (func))
+ (memory $0 100 100)
(import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR i32))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 100 100)
(func $loads (; 2 ;) (type $0)
(drop
(call $SAFE_HEAP_LOAD_i32_4_U_4
@@ -6945,10 +6945,10 @@
)
(module
(type $FUNCSIG$v (func))
+ (memory $0 (shared 100 100))
(import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR i32))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
(func $actions (; 2 ;) (type $FUNCSIG$v)
(drop
(call $SAFE_HEAP_LOAD_i32_4_U_4
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
index 2e380049f..d170315de 100644
--- a/test/passes/simplify-locals.txt
+++ b/test/passes/simplify-locals.txt
@@ -10,12 +10,12 @@
(type $8 (func (param i32 i32)))
(type $9 (func (param i32 i32 i32) (result i32)))
(type $10 (func (param i64)))
+ (memory $0 256 256)
(import "env" "waka" (func $waka))
(import "env" "waka_int" (func $waka_int (result i32)))
(import "env" "i64sub" (func $_i64Subtract (param i32 i32 i32 i32) (result i32)))
(import "env" "moddi" (func $___udivmoddi4 (param i32 i32 i32 i32 i32) (result i32)))
(import "env" "lp" (func $lp (param i32 i32) (result i32)))
- (memory $0 256 256)
(func $contrast (; 5 ;) (type $FUNCSIG$v)
(local $x i32)
(local $y i32)
diff --git a/test/passes/spill-pointers.txt b/test/passes/spill-pointers.txt
index 30febbec6..d8c8d96f4 100644
--- a/test/passes/spill-pointers.txt
+++ b/test/passes/spill-pointers.txt
@@ -5,11 +5,11 @@
(type $3 (func (result i32)))
(type $4 (func (param i32) (result i32)))
(type $5 (func (param f64)))
+ (memory $0 10)
+ (table 1 1 anyfunc)
(import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "segfault" (func $segfault (param i32)))
(global $stack_ptr (mut i32) (get_global $STACKTOP$asm2wasm$import))
- (table 1 1 anyfunc)
- (memory $0 10)
(func $nothing (; 1 ;) (type $2)
(nop)
)
diff --git a/test/passes/spill-pointers.wast b/test/passes/spill-pointers.wast
index c9bccd3b5..ca7f12518 100644
--- a/test/passes/spill-pointers.wast
+++ b/test/passes/spill-pointers.wast
@@ -159,7 +159,7 @@
)
(func $spill-call_import
(local $x i32)
- (call_import $segfault
+ (call $segfault
(i32.const 200)
)
(drop (get_local $x))
diff --git a/test/passes/ssa_fuzz-exec.txt b/test/passes/ssa_fuzz-exec.txt
index ad5724351..6c00c81a9 100644
--- a/test/passes/ssa_fuzz-exec.txt
+++ b/test/passes/ssa_fuzz-exec.txt
@@ -3,8 +3,8 @@
(module
(type $0 (func (result i32)))
(type $1 (func))
- (table 0 0 anyfunc)
(memory $0 (shared 1 1))
+ (table 0 0 anyfunc)
(export "func_0" (func $0))
(func $0 (; 0 ;) (type $0) (result i32)
(local $var$0 i32)
diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt
index 7edb06934..618096286 100644
--- a/test/passes/translate-to-fuzz.txt
+++ b/test/passes/translate-to-fuzz.txt
@@ -2,15 +2,15 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$ifj (func (param f32 i64) (result i32)))
+ (memory $0 (shared 1 1))
+ (data (i32.const 0) "n\00\05E\00\00\00\00")
+ (table 4 anyfunc)
+ (elem (i32.const 0) $func_2 $func_4 $func_5 $func_8)
(global $global$0 (mut f32) (f32.const 536870912))
(global $global$1 (mut f32) (f32.const 2147483648))
(global $global$2 (mut f64) (f64.const -1048576))
(global $global$3 (mut f64) (f64.const 23643))
(global $hangLimit (mut i32) (i32.const 10))
- (table 4 anyfunc)
- (elem (i32.const 0) $func_2 $func_4 $func_5 $func_8)
- (memory $0 (shared 1 1))
- (data (i32.const 0) "n\00\05E\00\00\00\00")
(export "func_0" (func $func_0))
(export "func_2_invoker" (func $func_2_invoker))
(export "func_4" (func $func_4))
diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt
index d3b972129..85c4625bc 100644
--- a/test/passes/vacuum.txt
+++ b/test/passes/vacuum.txt
@@ -6,9 +6,9 @@
(type $4 (func (param i32 f64 i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(type $6 (func (result f64)))
+ (memory $0 256 256)
(import "env" "int" (func $int (result i32)))
(global $Int i32 (i32.const 0))
- (memory $0 256 256)
(func $b (; 1 ;) (type $0)
(nop)
)