summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/Print.cpp19
-rw-r--r--test/example/c-api-multiple-tables.txt2
-rw-r--r--test/example/module-splitting.txt22
-rw-r--r--test/lit/wasm-split/basic.wast4
-rw-r--r--test/lld/main_module_table_3.wat.out1
-rw-r--r--test/lld/main_module_table_4.wat.out1
-rw-r--r--test/lld/main_module_table_5.wat.out2
-rw-r--r--test/metadce/corners.wast.dced2
-rw-r--r--test/metadce/outside.wast.dced2
-rw-r--r--test/multi-table.wast.from-wast9
-rw-r--r--test/multi-table.wast.fromBinary9
-rw-r--r--test/multi-table.wast.fromBinary.noDebugInfo17
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.txt1
-rw-r--r--test/passes/converge_O3_metrics.bin.txt6
-rw-r--r--test/passes/directize_all-features.txt8
-rw-r--r--test/passes/generate-dyncalls_all-features.txt2
-rw-r--r--test/passes/inlining-optimizing_optimize-level=3.txt2
-rw-r--r--test/passes/print-call-graph.txt2
-rw-r--r--test/passes/remove-imports.txt2
-rw-r--r--test/passes/remove-unused-module-elements_all-features.txt2
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.txt2
-rw-r--r--test/passes/reverse_dwarf_abbrevs.bin.txt2
-rw-r--r--test/table-import.wast.from-wast2
-rw-r--r--test/table-import.wast.fromBinary2
-rw-r--r--test/table-import.wast.fromBinary.noDebugInfo2
25 files changed, 59 insertions, 66 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index fa61a3d1c..1392ccb6f 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -2634,23 +2634,8 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
printTableHeader(curr);
o << maybeNewLine;
}
-
- ModuleUtils::iterTableSegments(
- *currModule, curr->name, [&](ElementSegment* segment) {
- printElementSegment(segment);
- });
}
void visitElementSegment(ElementSegment* curr) {
- if (curr->table.is()) {
- return;
- }
- printElementSegment(curr);
- }
- void printElementSegment(ElementSegment* curr) {
- // Don't print empty segments
- if (curr->data.empty()) {
- return;
- }
bool allElementsRefFunc =
std::all_of(curr->data.begin(), curr->data.end(), [](Expression* entry) {
return entry->is<RefFunc>();
@@ -2666,7 +2651,9 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
doIndent(o, indent);
o << '(';
printMedium(o, "elem");
- if (curr->hasExplicitName) {
+ // If there is no explicit name, and there are multiple segments, use our
+ // internal names to differentiate them.
+ if (curr->hasExplicitName || currModule->elementSegments.size() > 1) {
o << ' ';
printName(curr->name, o);
}
diff --git a/test/example/c-api-multiple-tables.txt b/test/example/c-api-multiple-tables.txt
index 8a2963729..a6c5ce18a 100644
--- a/test/example/c-api-multiple-tables.txt
+++ b/test/example/c-api-multiple-tables.txt
@@ -1,8 +1,8 @@
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(table $tab 1 1 funcref)
- (elem $0 (table $tab) (i32.const 0) func $adder)
(table $table2 2 2 funcref)
+ (elem $0 (table $tab) (i32.const 0) func $adder)
(elem $1 (table $table2) (i32.const 0) func $adder)
(elem $passive func $adder)
(func $adder (param $0 i32) (param $1 i32) (result i32)
diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt
index 8c6a8df75..48a4edf03 100644
--- a/test/example/module-splitting.txt
+++ b/test/example/module-splitting.txt
@@ -513,8 +513,8 @@ Secondary:
(module
(type $i32_=>_i32 (func (param i32) (result i32)))
(import "primary" "%table" (table $table 1000 funcref))
- (elem (global.get $base) $foo)
(import "primary" "%global" (global $base i32))
+ (elem (global.get $base) $foo)
(func $foo (param $0 i32) (result i32)
(local.get $0)
)
@@ -609,9 +609,9 @@ Secondary:
(type $none_=>_none (func))
(type $i32_=>_i32 (func (param i32) (result i32)))
(import "primary" "%table" (table $table 1000 funcref))
- (elem (global.get $base) $null $foo)
(import "primary" "%global" (global $base i32))
(import "primary" "%null" (func $null))
+ (elem (global.get $base) $null $foo)
(func $foo (param $0 i32) (result i32)
(local.get $0)
)
@@ -768,8 +768,8 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $0 1 funcref))
- (elem (i32.const 0) $bar)
(import "primary" "%foo_0" (func $foo))
+ (elem (i32.const 0) $bar)
(func $bar
(call $foo)
)
@@ -814,8 +814,8 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $table 4 funcref))
- (elem (i32.const 0) $foo)
- (elem (i32.const 2) $baz)
+ (elem $0 (i32.const 0) $foo)
+ (elem $1 (i32.const 2) $baz)
(func $baz
(nop)
)
@@ -867,9 +867,9 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $table 4 funcref))
- (elem (global.get $base) $foo $bar $baz)
(import "primary" "%global" (global $base i32))
(import "primary" "%bar" (func $bar))
+ (elem (global.get $base) $foo $bar $baz)
(func $baz
(nop)
)
@@ -915,8 +915,8 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $table 4 funcref))
- (elem (i32.const 0) $foo $bar)
- (elem (i32.const 3) $quux)
+ (elem $0 (i32.const 0) $foo $bar)
+ (elem $1 (i32.const 3) $quux)
(func $bar
(nop)
)
@@ -969,9 +969,9 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $table 4 funcref))
- (elem (global.get $base) $foo $bar $baz $quux)
(import "primary" "%global" (global $base i32))
(import "primary" "%baz" (func $baz))
+ (elem (global.get $base) $foo $bar $baz $quux)
(func $bar
(nop)
)
@@ -1016,9 +1016,9 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $table 2 funcref))
- (elem (global.get $base) $foo $bar)
(import "primary" "%global" (global $base i32))
(import "primary" "%foo" (func $foo))
+ (elem (global.get $base) $foo $bar)
(func $bar
(call $foo)
)
@@ -1061,8 +1061,8 @@ Secondary:
(module
(type $i32_=>_i32 (func (param i32) (result i32)))
(import "primary" "%table" (table $table 2 2 funcref))
- (elem (i32.const 1) $bar)
(import "primary" "%foo" (func $foo (param i32) (result i32)))
+ (elem (i32.const 1) $bar)
(func $bar (param $0 i32) (result i32)
(call $foo
(i32.const 1)
diff --git a/test/lit/wasm-split/basic.wast b/test/lit/wasm-split/basic.wast
index d282b0bd6..98fe433f3 100644
--- a/test/lit/wasm-split/basic.wast
+++ b/test/lit/wasm-split/basic.wast
@@ -76,8 +76,8 @@
;; KEEP-FOO-SECONDARY: (module
;; KEEP-FOO-SECONDARY-NEXT: (type $i32_=>_i32 (func (param i32) (result i32)))
;; KEEP-FOO-SECONDARY-NEXT: (import "primary" "%table" (table $timport$0 2 2 funcref))
-;; KEEP-FOO-SECONDARY-NEXT: (elem (i32.const 1) $0)
;; KEEP-FOO-SECONDARY-NEXT: (import "primary" "%foo" (func $fimport$0 (param i32) (result i32)))
+;; KEEP-FOO-SECONDARY-NEXT: (elem (i32.const 1) $0)
;; KEEP-FOO-SECONDARY-NEXT: (func $0 (param $0 i32) (result i32)
;; KEEP-FOO-SECONDARY-NEXT: (call $fimport$0
;; KEEP-FOO-SECONDARY-NEXT: (i32.const 1)
@@ -106,8 +106,8 @@
;; KEEP-BAR-SECONDARY: (module
;; KEEP-BAR-SECONDARY-NEXT: (type $i32_=>_i32 (func (param i32) (result i32)))
;; KEEP-BAR-SECONDARY-NEXT: (import "primary" "%table" (table $timport$0 1 1 funcref))
-;; KEEP-BAR-SECONDARY-NEXT: (elem (i32.const 0) $0)
;; KEEP-BAR-SECONDARY-NEXT: (import "primary" "%bar" (func $fimport$0 (param i32) (result i32)))
+;; KEEP-BAR-SECONDARY-NEXT: (elem (i32.const 0) $0)
;; KEEP-BAR-SECONDARY-NEXT: (func $0 (param $0 i32) (result i32)
;; KEEP-BAR-SECONDARY-NEXT: (call $fimport$0
;; KEEP-BAR-SECONDARY-NEXT: (i32.const 0)
diff --git a/test/lld/main_module_table_3.wat.out b/test/lld/main_module_table_3.wat.out
index d8938bcc2..d0f810f80 100644
--- a/test/lld/main_module_table_3.wat.out
+++ b/test/lld/main_module_table_3.wat.out
@@ -4,6 +4,7 @@
(import "env" "__stack_pointer" (global $sp (mut i32)))
(import "GOT.func" "__stdio_write" (global $gimport$9 (mut i32)))
(global $global i32 (i32.const 42))
+ (elem (i32.const 0))
(export "__stdio_write" (func $__stdio_write))
(export "__data_end" (global $global))
(func $__stdio_write
diff --git a/test/lld/main_module_table_4.wat.out b/test/lld/main_module_table_4.wat.out
index c8c5c2099..2aba23d77 100644
--- a/test/lld/main_module_table_4.wat.out
+++ b/test/lld/main_module_table_4.wat.out
@@ -5,6 +5,7 @@
(import "GOT.func" "__stdio_write" (global $gimport$9 (mut i32)))
(import "env" "__table_base" (global $tb i32))
(global $global i32 (i32.const 42))
+ (elem (global.get $tb))
(export "__stdio_write" (func $__stdio_write))
(export "__data_end" (global $global))
(func $__stdio_write
diff --git a/test/lld/main_module_table_5.wat.out b/test/lld/main_module_table_5.wat.out
index f26ca8ae8..7d8577b4f 100644
--- a/test/lld/main_module_table_5.wat.out
+++ b/test/lld/main_module_table_5.wat.out
@@ -2,11 +2,11 @@
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(import "env" "table" (table $timport$9 1 funcref))
- (elem (global.get $tb) $other $stuff)
(import "env" "__stack_pointer" (global $sp (mut i32)))
(import "GOT.func" "__stdio_write" (global $gimport$9 (mut i32)))
(import "env" "__table_base" (global $tb i32))
(global $global i32 (i32.const 42))
+ (elem (global.get $tb) $other $stuff)
(export "__stdio_write" (func $__stdio_write))
(export "__data_end" (global $global))
(export "dynCall_v" (func $dynCall_v))
diff --git a/test/metadce/corners.wast.dced b/test/metadce/corners.wast.dced
index dd21e7af9..c91acc69e 100644
--- a/test/metadce/corners.wast.dced
+++ b/test/metadce/corners.wast.dced
@@ -1,11 +1,11 @@
(module
(type $none_=>_none (func))
(import "env" "table" (table $timport$0 10 10 funcref))
- (elem (i32.const 0) $imported_table_func)
(import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "imported_twice" (func $imported_twice_a))
(import "env" "an-imported-table-func" (func $imported_table_func))
(global $STACKTOP (mut i32) (global.get $STACKTOP$asm2wasm$import))
+ (elem (i32.const 0) $imported_table_func)
(export "stackAlloc" (func $stackAlloc))
(func $stackAlloc
(drop
diff --git a/test/metadce/outside.wast.dced b/test/metadce/outside.wast.dced
index 1f1c37f1f..a1c74c8d9 100644
--- a/test/metadce/outside.wast.dced
+++ b/test/metadce/outside.wast.dced
@@ -4,11 +4,11 @@
(data (i32.const 1024) "abcd")
(data (global.get $from_segment) "abcd")
(import "env" "table" (table $timport$0 10 10 funcref))
- (elem (global.get $from_segment_2) $table_func)
(import "env" "js_func" (func $a_js_func))
(global $__THREW__ (mut i32) (i32.const 0))
(global $from_segment (mut i32) (i32.const 0))
(global $from_segment_2 (mut i32) (i32.const 0))
+ (elem (global.get $from_segment_2) $table_func)
(export "wasm_func" (func $a_wasm_func))
(func $table_func
(nop)
diff --git a/test/multi-table.wast.from-wast b/test/multi-table.wast.from-wast
index 34900e54c..474e89c53 100644
--- a/test/multi-table.wast.from-wast
+++ b/test/multi-table.wast.from-wast
@@ -1,19 +1,20 @@
(module
(type $none_=>_none (func))
(import "a" "b" (table $t1 1 10 funcref))
- (elem (table $t1) (i32.const 0) func $f)
(global $g1 (ref null $none_=>_none) (ref.func $f))
(global $g2 i32 (i32.const 0))
(table $t2 3 3 funcref)
- (elem (table $t2) (i32.const 0) func $f)
- (elem $activeNonZeroOffset (table $t2) (i32.const 1) func $f $g)
(table $t3 4 4 funcref)
+ (table $textern 0 externref)
+ (elem $0 (table $t1) (i32.const 0) func $f)
+ (elem $1 (table $t2) (i32.const 0) func $f)
+ (elem $activeNonZeroOffset (table $t2) (i32.const 1) func $f $g)
(elem $e3-1 (table $t3) (global.get $g2) funcref (ref.func $f) (ref.null func))
(elem $e3-2 (table $t3) (i32.const 2) func $f $g)
- (table $textern 0 externref)
(elem $passive-1 func $f $g)
(elem $passive-2 funcref (ref.func $f) (ref.func $g) (ref.null func))
(elem $passive-3 (ref null $none_=>_none) (ref.func $f) (ref.func $g) (ref.null $none_=>_none) (global.get $g1))
+ (elem $empty func)
(elem declare func $h)
(func $f
(drop
diff --git a/test/multi-table.wast.fromBinary b/test/multi-table.wast.fromBinary
index db652b8db..809740549 100644
--- a/test/multi-table.wast.fromBinary
+++ b/test/multi-table.wast.fromBinary
@@ -1,19 +1,20 @@
(module
(type $none_=>_none (func))
(import "a" "b" (table $t1 1 10 funcref))
- (elem (table $t1) (i32.const 0) func $f)
(global $g1 (ref null $none_=>_none) (ref.func $f))
(global $g2 i32 (i32.const 0))
(table $t2 3 3 funcref)
- (elem (table $t2) (i32.const 0) func $f)
- (elem $activeNonZeroOffset (table $t2) (i32.const 1) func $f $g)
(table $t3 4 4 funcref)
+ (table $textern 0 externref)
+ (elem $0 (table $t1) (i32.const 0) func $f)
+ (elem $1 (table $t2) (i32.const 0) func $f)
+ (elem $activeNonZeroOffset (table $t2) (i32.const 1) func $f $g)
(elem $e3-1 (table $t3) (global.get $g2) funcref (ref.func $f) (ref.null func))
(elem $e3-2 (table $t3) (i32.const 2) func $f $g)
- (table $textern 0 externref)
(elem $passive-1 func $f $g)
(elem $passive-2 funcref (ref.func $f) (ref.func $g) (ref.null func))
(elem $passive-3 (ref null $none_=>_none) (ref.func $f) (ref.func $g) (ref.null $none_=>_none) (global.get $g1))
+ (elem $empty func)
(elem declare func $h)
(func $f
(drop
diff --git a/test/multi-table.wast.fromBinary.noDebugInfo b/test/multi-table.wast.fromBinary.noDebugInfo
index 4125f5ee8..1fcd2a9be 100644
--- a/test/multi-table.wast.fromBinary.noDebugInfo
+++ b/test/multi-table.wast.fromBinary.noDebugInfo
@@ -1,19 +1,20 @@
(module
(type $none_=>_none (func))
(import "a" "b" (table $timport$0 1 10 funcref))
- (elem (table $timport$0) (i32.const 0) func $0)
(global $global$0 (ref null $none_=>_none) (ref.func $0))
(global $global$1 i32 (i32.const 0))
(table $0 3 3 funcref)
- (elem (table $0) (i32.const 0) func $0)
- (elem (table $0) (i32.const 1) func $0 $1)
(table $1 4 4 funcref)
- (elem (table $1) (global.get $global$1) funcref (ref.func $0) (ref.null func))
- (elem (table $1) (i32.const 2) func $0 $1)
(table $2 0 externref)
- (elem func $0 $1)
- (elem funcref (ref.func $0) (ref.func $1) (ref.null func))
- (elem (ref null $none_=>_none) (ref.func $0) (ref.func $1) (ref.null $none_=>_none) (global.get $global$0))
+ (elem $0 (table $timport$0) (i32.const 0) func $0)
+ (elem $1 (table $0) (i32.const 0) func $0)
+ (elem $2 (table $0) (i32.const 1) func $0 $1)
+ (elem $3 (table $1) (global.get $global$1) funcref (ref.func $0) (ref.null func))
+ (elem $4 (table $1) (i32.const 2) func $0 $1)
+ (elem $5 func $0 $1)
+ (elem $6 funcref (ref.func $0) (ref.func $1) (ref.null func))
+ (elem $7 (ref null $none_=>_none) (ref.func $0) (ref.func $1) (ref.null $none_=>_none) (global.get $global$0))
+ (elem $8 func)
(elem declare func $2)
(func $0
(drop
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 152fba58b..213ead5aa 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
@@ -7,6 +7,7 @@
(global $__asyncify_data (mut i32) (i32.const 0))
(memory $0 1 2)
(table $0 1 funcref)
+ (elem (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/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt
index efdebb899..0bc9c1335 100644
--- a/test/passes/converge_O3_metrics.bin.txt
+++ b/test/passes/converge_O3_metrics.bin.txt
@@ -40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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 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $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))
+ (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 $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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 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $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)
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
(func $b0 (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
@@ -269,8 +269,8 @@ total
(data (i32.const 18732) "D\1b")
(data (i32.const 18764) "`\0b")
(import "env" "table" (table $timport$0 478 478 funcref))
- (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 $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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 $__ZNSt3__211__stdoutbufIcE8overflowEi)
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
(func $b0 (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
@@ -492,8 +492,8 @@ total
(data (i32.const 18732) "D\1b")
(data (i32.const 18764) "`\0b")
(import "env" "table" (table $timport$0 478 478 funcref))
- (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 $b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func $_main))
(export "_malloc" (func $_malloc))
(func $b0 (; has Stack IR ;) (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/directize_all-features.txt b/test/passes/directize_all-features.txt
index 42adb65e6..dae7c8746 100644
--- a/test/passes/directize_all-features.txt
+++ b/test/passes/directize_all-features.txt
@@ -16,9 +16,9 @@
(type $ii (func (param i32 i32)))
(type $i32_=>_i32 (func (param i32) (result i32)))
(table $0 5 5 funcref)
- (elem (table $0) (i32.const 1) func $dummy)
(table $1 5 5 funcref)
- (elem (table $1) (i32.const 1) func $f)
+ (elem $0 (table $0) (i32.const 1) func $dummy)
+ (elem $1 (table $1) (i32.const 1) func $f)
(func $dummy (param $0 i32) (result i32)
(local.get $0)
)
@@ -64,9 +64,9 @@
(module
(type $ii (func (param i32 i32)))
(table $0 5 5 funcref)
- (elem (table $0) (i32.const 0) func $foo $foo $foo $foo $foo)
(table $1 5 5 funcref)
- (elem (table $1) (i32.const 0) func $foo $foo $foo $foo $foo)
+ (elem $0 (table $0) (i32.const 0) func $foo $foo $foo $foo $foo)
+ (elem $1 (table $1) (i32.const 0) func $foo $foo $foo $foo $foo)
(func $foo (param $0 i32) (param $1 i32)
(unreachable)
)
diff --git a/test/passes/generate-dyncalls_all-features.txt b/test/passes/generate-dyncalls_all-features.txt
index efee27acf..114a84715 100644
--- a/test/passes/generate-dyncalls_all-features.txt
+++ b/test/passes/generate-dyncalls_all-features.txt
@@ -42,8 +42,8 @@
(type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_=>_i32 (func (param i32) (result i32)))
(import "env" "table" (table $timport$0 1 1 funcref))
- (elem (i32.const 0) $f)
(import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
+ (elem (i32.const 0) $f)
(export "dynCall_i" (func $dynCall_i))
(export "dynCall_vii" (func $dynCall_vii))
(func $f (result i32)
diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt
index a46fb8028..7712e47c0 100644
--- a/test/passes/inlining-optimizing_optimize-level=3.txt
+++ b/test/passes/inlining-optimizing_optimize-level=3.txt
@@ -14,7 +14,6 @@
(import "env" "memory" (memory $0 256 256))
(data (i32.const 1024) "emcc_hello_world.asm.js")
(import "env" "table" (table $timport$0 18 18 funcref))
- (elem (global.get $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))
@@ -44,6 +43,7 @@
(global $__THREW__ (mut i32) (i32.const 0))
(global $threwValue (mut i32) (i32.const 0))
(global $tempRet0 (mut i32) (i32.const 0))
+ (elem (global.get $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(export "_i64Subtract" (func $_i64Subtract))
(export "_free" (func $_free))
(export "_main" (func $_main))
diff --git a/test/passes/print-call-graph.txt b/test/passes/print-call-graph.txt
index 0011fb16b..1ab4efd23 100644
--- a/test/passes/print-call-graph.txt
+++ b/test/passes/print-call-graph.txt
@@ -123,7 +123,6 @@ digraph call {
(import "env" "memory" (memory $0 256 256))
(data (global.get $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 $timport$0 9 9 funcref))
- (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" "ABORT" (global $ABORT$asm2wasm$import i32))
@@ -162,6 +161,7 @@ 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)
(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 641e57723..73019628a 100644
--- a/test/passes/remove-imports.txt
+++ b/test/passes/remove-imports.txt
@@ -1,10 +1,10 @@
(module
(type $FUNCSIG$v (func))
(import "env" "table" (table $table 1 1 funcref))
- (elem (i32.const 0) $waka-sneaky)
(import "env" "memBase" (global $gimport$0 i32))
(import "somewhere" "waka-sneaky" (func $waka-sneaky))
(memory $0 1024 1024)
+ (elem (i32.const 0) $waka-sneaky)
(func $nada
(nop)
(drop
diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt
index 025079225..2a82fc291 100644
--- a/test/passes/remove-unused-module-elements_all-features.txt
+++ b/test/passes/remove-unused-module-elements_all-features.txt
@@ -221,9 +221,9 @@
(import "env" "memory" (memory $0 256))
(data (global.get $memoryBase) "hello, world!")
(import "env" "table" (table $timport$0 0 funcref))
- (elem (global.get $tableBase) $waka)
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
+ (elem (global.get $tableBase) $waka)
(func $waka
(nop)
)
diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
index 8df4d1ec9..a4157d4dc 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
@@ -224,9 +224,9 @@
(import "env" "memory" (memory $0 256))
(data (global.get $memoryBase) "hello, world!")
(import "env" "table" (table $timport$0 0 funcref))
- (elem (global.get $tableBase) $waka)
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
+ (elem (global.get $tableBase) $waka)
(func $waka
(nop)
)
diff --git a/test/passes/reverse_dwarf_abbrevs.bin.txt b/test/passes/reverse_dwarf_abbrevs.bin.txt
index 2da36c1d4..79c13cdf1 100644
--- a/test/passes/reverse_dwarf_abbrevs.bin.txt
+++ b/test/passes/reverse_dwarf_abbrevs.bin.txt
@@ -128,12 +128,12 @@ file_names[ 1]:
(data (i32.const 1108) "\01")
(data (i32.const 1123) "\n\ff\ff\ff\ff")
(import "env" "__indirect_function_table" (table $timport$0 4 funcref))
- (elem (i32.const 1) $6 $5 $7)
(import "wasi_snapshot_preview1" "fd_write" (func $fimport$0 (param i32 i32 i32 i32) (result i32)))
(import "env" "emscripten_memcpy_big" (func $fimport$1 (param i32 i32 i32) (result i32)))
(import "env" "setTempRet0" (func $fimport$2 (param i32)))
(global $global$0 (mut i32) (i32.const 5245136))
(global $global$1 i32 (i32.const 2248))
+ (elem (i32.const 1) $6 $5 $7)
(export "__wasm_call_ctors" (func $0))
(export "main" (func $2))
(export "__errno_location" (func $3))
diff --git a/test/table-import.wast.from-wast b/test/table-import.wast.from-wast
index 6592dc3f0..bbace54cf 100644
--- a/test/table-import.wast.from-wast
+++ b/test/table-import.wast.from-wast
@@ -1,8 +1,8 @@
(module
(type $0 (func))
(import "env" "table" (table $timport$0 1 1 funcref))
- (elem (i32.const 0) $foo)
(memory $0 0)
+ (elem (i32.const 0) $foo)
(func $foo
(nop)
)
diff --git a/test/table-import.wast.fromBinary b/test/table-import.wast.fromBinary
index d55857a45..7c09f0291 100644
--- a/test/table-import.wast.fromBinary
+++ b/test/table-import.wast.fromBinary
@@ -1,8 +1,8 @@
(module
(type $0 (func))
(import "env" "table" (table $timport$0 1 1 funcref))
- (elem (i32.const 0) $foo)
(memory $0 0)
+ (elem (i32.const 0) $foo)
(func $foo
(nop)
)
diff --git a/test/table-import.wast.fromBinary.noDebugInfo b/test/table-import.wast.fromBinary.noDebugInfo
index eb00a0b18..ed53490cb 100644
--- a/test/table-import.wast.fromBinary.noDebugInfo
+++ b/test/table-import.wast.fromBinary.noDebugInfo
@@ -1,8 +1,8 @@
(module
(type $none_=>_none (func))
(import "env" "table" (table $timport$0 1 1 funcref))
- (elem (i32.const 0) $0)
(memory $0 0)
+ (elem (i32.const 0) $0)
(func $0
(nop)
)