diff options
153 files changed, 615 insertions, 688 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 590f9bce2..0a2026f25 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -630,8 +630,9 @@ struct PrintSExpression : public Visitor<PrintSExpression> { if (!found) { doIndent(o, indent); printTableHeader(curr); - o << '\n'; } + if (curr->segments.empty()) return; + if (!found) o << '\n'; doIndent(o, indent); for (auto& segment : curr->segments) { // Don't print empty segments @@ -698,12 +699,6 @@ struct PrintSExpression : public Visitor<PrintSExpression> { currModule = curr; printOpening(o, "module", true); incIndent(); - visitMemory(&curr->memory); - if (curr->start.is()) { - doIndent(o, indent); - printOpening(o, "start") << ' ' << curr->start << ')'; - o << maybeNewLine; - } for (auto& child : curr->functionTypes) { doIndent(o, indent); printOpening(o, "type") << ' '; @@ -716,18 +711,24 @@ struct PrintSExpression : public Visitor<PrintSExpression> { visitImport(child.get()); o << maybeNewLine; } - for (auto& child : curr->exports) { - doIndent(o, indent); - visitExport(child.get()); + if (curr->table.exists) { + visitTable(&curr->table); o << maybeNewLine; } + visitMemory(&curr->memory); for (auto& child : curr->globals) { doIndent(o, indent); visitGlobal(child.get()); o << maybeNewLine; } - if (curr->table.exists) { - visitTable(&curr->table); + for (auto& child : curr->exports) { + doIndent(o, indent); + visitExport(child.get()); + o << maybeNewLine; + } + if (curr->start.is()) { + doIndent(o, indent); + printOpening(o, "start") << ' ' << curr->start << ')'; o << maybeNewLine; } for (auto& child : curr->functions) { diff --git a/test/dot_s/alias.wast b/test/dot_s/alias.wast index cc54fa08c..1f450fa57 100644 --- a/test/dot_s/alias.wast +++ b/test/dot_s/alias.wast @@ -1,13 +1,13 @@ (module + (type $FUNCSIG$v (func)) + (table 2 2 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $__exit) (memory $0 1) (data (i32.const 16) "\d2\04\00\00\00\00\00\00)\t\00\00") - (type $FUNCSIG$v (func)) (export "memory" (memory $0)) (export "__exit" (func $__exit)) (export "__needs_exit" (func $__needs_exit)) (export "dynCall_v" (func $dynCall_v)) - (table 2 2 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $__exit) (func $__exit (type $FUNCSIG$v) (return (i32.add diff --git a/test/dot_s/alternate-lcomm.wast b/test/dot_s/alternate-lcomm.wast index e9cb735ac..c380944ab 100644 --- a/test/dot_s/alternate-lcomm.wast +++ b/test/dot_s/alternate-lcomm.wast @@ -1,7 +1,6 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) - (table 0 anyfunc) - ) ;; METADATA: { "asmConsts": {},"staticBump": 16, "initializers": [] } diff --git a/test/dot_s/asm_const.wast b/test/dot_s/asm_const.wast index 2a1a58bcf..4edc6c476 100644 --- a/test/dot_s/asm_const.wast +++ b/test/dot_s/asm_const.wast @@ -1,12 +1,11 @@ (module - (memory $0 1) - (data (i32.const 16) "{ Module.print(\"hello, world!\"); }\00") (type $FUNCSIG$vi (func (param i32))) (import "env" "emscripten_asm_const_vi" (func $emscripten_asm_const_vi (param i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 16) "{ Module.print(\"hello, world!\"); }\00") (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (call $emscripten_asm_const_vi (i32.const 0) diff --git a/test/dot_s/basics.wast b/test/dot_s/basics.wast index 99ad24806..3b539fa11 100644 --- a/test/dot_s/basics.wast +++ b/test/dot_s/basics.wast @@ -1,17 +1,17 @@ (module - (memory $0 1) - (data (i32.const 16) "hello, world!\n\00") - (data (i32.const 32) "vcq") - (data (i32.const 48) "\16\00\00\00") (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (import "env" "puts" (func $puts (param i32))) + (table 2 2 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $main) + (memory $0 1) + (data (i32.const 16) "hello, world!\n\00") + (data (i32.const 32) "vcq") + (data (i32.const 48) "\16\00\00\00") (export "memory" (memory $0)) (export "main" (func $main)) (export "dynCall_iii" (func $dynCall_iii)) - (table 2 2 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $main) (func $main (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (call $puts (i32.const 16) diff --git a/test/dot_s/bcp-1.wast b/test/dot_s/bcp-1.wast index 1aafc1289..5529ce62d 100644 --- a/test/dot_s/bcp-1.wast +++ b/test/dot_s/bcp-1.wast @@ -1,4 +1,12 @@ (module + (type $FUNCSIG$i (func (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$v (func)) + (type $FUNCSIG$vi (func (param i32))) + (import "env" "abort" (func $abort)) + (import "env" "exit" (func $exit (param i32))) + (table 18 18 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $bad0 $bad1 $bad5 $bad7 $bad8 $bad10 $bad2 $bad3 $bad6 $bad4 $bad9 $good0 $good1 $good2 $opt0 $opt1 $opt2) (memory $0 1) (data (i32.const 16) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00") (data (i32.const 40) "\07\00\00\00\08\00\00\00\t\00\00\00") @@ -7,12 +15,6 @@ (data (i32.const 72) "\0f\00\00\00\10\00\00\00\11\00\00\00") (data (i32.const 96) "hi\00") (data (i32.const 100) "\00\00\00\00") - (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$v (func)) - (type $FUNCSIG$vi (func (param i32))) - (import "env" "abort" (func $abort)) - (import "env" "exit" (func $exit (param i32))) (export "memory" (memory $0)) (export "bad0" (func $bad0)) (export "bad1" (func $bad1)) @@ -34,8 +36,6 @@ (export "main" (func $main)) (export "dynCall_i" (func $dynCall_i)) (export "dynCall_ii" (func $dynCall_ii)) - (table 18 18 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $bad0 $bad1 $bad5 $bad7 $bad8 $bad10 $bad2 $bad3 $bad6 $bad4 $bad9 $good0 $good1 $good2 $opt0 $opt1 $opt2) (func $bad0 (type $FUNCSIG$i) (result i32) (return (i32.const 0) diff --git a/test/dot_s/data-offset-folding.wast b/test/dot_s/data-offset-folding.wast index 5cec37c54..9c179a112 100644 --- a/test/dot_s/data-offset-folding.wast +++ b/test/dot_s/data-offset-folding.wast @@ -1,9 +1,8 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 12) "\00\00\00\00") (data (i32.const 416) "`\00\00\00") (export "memory" (memory $0)) - (table 0 anyfunc) - ) ;; METADATA: { "asmConsts": {},"staticBump": 420, "initializers": [] } diff --git a/test/dot_s/debug.wast b/test/dot_s/debug.wast index eef7cca0a..0d96c92c7 100644 --- a/test/dot_s/debug.wast +++ b/test/dot_s/debug.wast @@ -1,9 +1,8 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "fib" (func $fib)) - (table 0 anyfunc) - (func $fib (param $0 i32) (result i32) (local $1 i32) (local $2 i32) diff --git a/test/dot_s/dso_handle.wast b/test/dot_s/dso_handle.wast index 6e12fabf0..e75d11410 100644 --- a/test/dot_s/dso_handle.wast +++ b/test/dot_s/dso_handle.wast @@ -1,9 +1,8 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (return (i32.const 8) diff --git a/test/dot_s/dyncall.wast b/test/dot_s/dyncall.wast index a4c7880a3..40d36f73a 100644 --- a/test/dot_s/dyncall.wast +++ b/test/dot_s/dyncall.wast @@ -1,10 +1,12 @@ (module - (memory $0 1) (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$vd (func (param f64))) (type $FUNCSIG$ffjjdi (func (param f32 i64 i64 f64 i32) (result f32))) + (table 6 6 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $i $i_f $vd $ffjjdi $vd2) + (memory $0 1) (export "memory" (memory $0)) (export "i" (func $i)) (export "i_f" (func $i_f)) @@ -15,8 +17,6 @@ (export "dynCall_i" (func $dynCall_i)) (export "dynCall_if" (func $dynCall_if)) (export "dynCall_vd" (func $dynCall_vd)) - (table 6 6 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $i $i_f $vd $ffjjdi $vd2) (func $i (type $FUNCSIG$i) (result i32) (i32.const 0) ) diff --git a/test/dot_s/exit.wast b/test/dot_s/exit.wast index 92963a847..9e71a9bdc 100644 --- a/test/dot_s/exit.wast +++ b/test/dot_s/exit.wast @@ -1,11 +1,10 @@ (module - (memory $0 1) (type $FUNCSIG$vi (func (param i32))) (import "env" "exit" (func $exit (param i32))) + (table 0 anyfunc) + (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (local $0 i32) (call $exit diff --git a/test/dot_s/export_malloc_free.wast b/test/dot_s/export_malloc_free.wast index 42ae62497..22ae51549 100644 --- a/test/dot_s/export_malloc_free.wast +++ b/test/dot_s/export_malloc_free.wast @@ -1,12 +1,11 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) (export "malloc" (func $malloc)) (export "free" (func $free)) (export "realloc" (func $realloc)) - (table 0 anyfunc) - (func $main (result i32) (i32.const 0) ) diff --git a/test/dot_s/fix_em_ehsjlj_names.wast b/test/dot_s/fix_em_ehsjlj_names.wast index 5d21caea9..fb1722a68 100644 --- a/test/dot_s/fix_em_ehsjlj_names.wast +++ b/test/dot_s/fix_em_ehsjlj_names.wast @@ -1,5 +1,4 @@ (module - (memory $0 1) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$fifd (func (param i32 f32 f64) (result f32))) @@ -13,14 +12,15 @@ (import "env" "invoke_iii" (func $invoke_iii (param i32 i32 i32) (result i32))) (import "env" "invoke_iiii" (func $invoke_iiii (param i32 i32 i32 i32) (result i32))) (import "env" "invoke_v" (func $invoke_v (param i32))) + (table 5 5 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $_Z5func1v $_Z5func2iii $_Z5func3fd $_Z5func4P8mystructS_) + (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) (export "dynCall_v" (func $dynCall_v)) (export "dynCall_iiii" (func $dynCall_iiii)) (export "dynCall_ffd" (func $dynCall_ffd)) (export "dynCall_iii" (func $dynCall_iii)) - (table 5 5 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $_Z5func1v $_Z5func2iii $_Z5func3fd $_Z5func4P8mystructS_) (func $_Z5func1v (type $FUNCSIG$v) ) (func $_Z5func2iii (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/test/dot_s/function-data-sections.wast b/test/dot_s/function-data-sections.wast index 59b13c81c..f634ec38e 100644 --- a/test/dot_s/function-data-sections.wast +++ b/test/dot_s/function-data-sections.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 12) "\00\00\00\00") (data (i32.const 16) "\01\00\00\00") @@ -7,8 +8,6 @@ (export "foo" (func $foo)) (export "bar" (func $bar)) (export "qux" (func $qux)) - (table 0 anyfunc) - (func $foo (return) ) diff --git a/test/dot_s/hostFinalize.wast b/test/dot_s/hostFinalize.wast index 3f87397b9..97ba45498 100644 --- a/test/dot_s/hostFinalize.wast +++ b/test/dot_s/hostFinalize.wast @@ -1,8 +1,7 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) - (table 0 anyfunc) - (func $_main (drop (grow_memory diff --git a/test/dot_s/indidx.wast b/test/dot_s/indidx.wast index 8c3cc60a5..c96043b0c 100644 --- a/test/dot_s/indidx.wast +++ b/test/dot_s/indidx.wast @@ -1,14 +1,14 @@ (module - (memory $0 1) - (data (i32.const 16) "\04\00\00\00\02\00\00\00\01\00\00\00\03\00\00\00") (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$v (func)) (import "env" "getchar" (func $getchar (result i32))) + (table 5 5 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $c $b $d $a) + (memory $0 1) + (data (i32.const 16) "\04\00\00\00\02\00\00\00\01\00\00\00\03\00\00\00") (export "memory" (memory $0)) (export "main" (func $main)) (export "dynCall_i" (func $dynCall_i)) - (table 5 5 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $c $b $d $a) (func $a (type $FUNCSIG$i) (result i32) (i32.const 0) ) diff --git a/test/dot_s/indirect-import.wast b/test/dot_s/indirect-import.wast index 6eb032629..0f1c3b751 100644 --- a/test/dot_s/indirect-import.wast +++ b/test/dot_s/indirect-import.wast @@ -1,5 +1,4 @@ (module - (memory $0 1) (type $FUNCSIG$fd (func (param f64) (result f32))) (type $FUNCSIG$vj (func (param i64))) (type $FUNCSIG$v (func)) @@ -11,14 +10,15 @@ (import "env" "extern_fd" (func $extern_fd (param f64) (result f32))) (import "env" "extern_struct" (func $extern_struct (param i32))) (import "env" "extern_sret" (func $extern_sret (param i32))) + (table 7 7 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $__importThunk_extern_fd $__importThunk_extern_vj $__importThunk_extern_v $__importThunk_extern_ijidf $__importThunk_extern_struct $__importThunk_extern_sret) + (memory $0 1) (export "memory" (memory $0)) (export "bar" (func $bar)) (export "baz" (func $baz)) (export "dynCall_fd" (func $dynCall_fd)) (export "dynCall_v" (func $dynCall_v)) (export "dynCall_vi" (func $dynCall_vi)) - (table 7 7 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $__importThunk_extern_fd $__importThunk_extern_vj $__importThunk_extern_v $__importThunk_extern_ijidf $__importThunk_extern_struct $__importThunk_extern_sret) (func $bar (result i32) (local $0 i32) (local $1 i32) diff --git a/test/dot_s/initializers.wast b/test/dot_s/initializers.wast index 51d9d2c4c..19e7b8c85 100644 --- a/test/dot_s/initializers.wast +++ b/test/dot_s/initializers.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) (export "f1" (func $f1)) (export "f2" (func $f2)) - (table 0 anyfunc) - (func $main (result i32) (return (i32.const 5) diff --git a/test/dot_s/lcomm-in-text-segment.wast b/test/dot_s/lcomm-in-text-segment.wast index 5de03e8c9..2442d8f97 100644 --- a/test/dot_s/lcomm-in-text-segment.wast +++ b/test/dot_s/lcomm-in-text-segment.wast @@ -1,8 +1,7 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 20) "\10\00\00\00") (export "memory" (memory $0)) - (table 0 anyfunc) - ) ;; METADATA: { "asmConsts": {},"staticBump": 24, "initializers": [] } diff --git a/test/dot_s/local_align.wast b/test/dot_s/local_align.wast index 075250df4..f25555bb5 100644 --- a/test/dot_s/local_align.wast +++ b/test/dot_s/local_align.wast @@ -1,9 +1,8 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $foo (param $0 i32) ) (func $main (result i32) diff --git a/test/dot_s/macClangMetaData.wast b/test/dot_s/macClangMetaData.wast index 33a08ec6c..f295ec8d0 100644 --- a/test/dot_s/macClangMetaData.wast +++ b/test/dot_s/macClangMetaData.wast @@ -1,12 +1,11 @@ (module - (memory $0 1) - (data (i32.const 16) "Hello, World!\00") (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "puts" (func $puts (param i32) (result i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 16) "Hello, World!\00") (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (param $0 i32) (param $1 i32) (result i32) (drop (call $puts diff --git a/test/dot_s/memops.wast b/test/dot_s/memops.wast index e7b3490e1..71c08395f 100644 --- a/test/dot_s/memops.wast +++ b/test/dot_s/memops.wast @@ -1,12 +1,11 @@ (module - (memory $0 1) - (data (i32.const 16) "{ Module.print(\"hello, world! \" + HEAP32[8>>2]); }\00") (type $FUNCSIG$vi (func (param i32))) (import "env" "emscripten_asm_const_vi" (func $emscripten_asm_const_vi (param i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 16) "{ Module.print(\"hello, world! \" + HEAP32[8>>2]); }\00") (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $_Z6reporti (param $0 i32) (i32.store (i32.const 8) diff --git a/test/dot_s/minimal.wast b/test/dot_s/minimal.wast index 5c95a4ffb..d9f4c18a6 100644 --- a/test/dot_s/minimal.wast +++ b/test/dot_s/minimal.wast @@ -1,9 +1,8 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (return (i32.const 5) diff --git a/test/dot_s/permute.wast b/test/dot_s/permute.wast index e1359ec7d..d72b5bd57 100644 --- a/test/dot_s/permute.wast +++ b/test/dot_s/permute.wast @@ -1,8 +1,7 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 16) "hE?\8ds\0e7\db[g\8f\955it\c4k\0b\e2\ef\bcld\e0\fd\8c\9e\86&~\d8\94\89+\c8\a4\c2\f2\fb\12\1cej\d99\b7\b3W\c6w\af\ae\caM>\92ub\96\84\b6\b0N\ec;q\11\f7\bf\e31\e6\a7\90\fc\03\e4\aa\d7\cc- \15\83DH\80r\fa\01X\eb:_\00A\cd\e9o`n\ac(\ad\ba0\dcyS#\f4$\"\82\7f}\8e\f6\93L\'\bb\bdZ\ed4\18\f3\c0\cf\ff\a3\f8\07\05\9c\d3\0f\a0\06m%\\\f9^B<\e7\b1\17\98]\0c\dd\c5\f5p\e5\fezJ\ab,F\a5@\08R\85!\b8\1a\ce\d5\04\nI\a6\d1\9f\8a\c9\a9|\97\9aG\be8Y\8b\c1\1b\d4\ea\b9\19\14\9b\9163\d0\1d\d2\df=C\1f\0dc\e1\c7QUv\02\b5aK\b4\tV\c3x\e8\a1\1e\81\de/{\da\d6Pf\10T\f0)\88\16\ee\a8\9d\f1\cbO*\b2\99\132\87.\a2") (export "memory" (memory $0)) - (table 0 anyfunc) - ) ;; METADATA: { "asmConsts": {},"staticBump": 272, "initializers": [] } diff --git a/test/dot_s/relocation.wast b/test/dot_s/relocation.wast index 2d653518a..94dc69a3e 100644 --- a/test/dot_s/relocation.wast +++ b/test/dot_s/relocation.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 12) "\10\00\00\00") (data (i32.const 16) "\0c\00\00\00") (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (local $0 i32) (return diff --git a/test/dot_s/return.wast b/test/dot_s/return.wast index 21b81b215..339ea275c 100644 --- a/test/dot_s/return.wast +++ b/test/dot_s/return.wast @@ -1,10 +1,9 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "return_i32" (func $return_i32)) (export "return_void" (func $return_void)) - (table 0 anyfunc) - (func $return_i32 (result i32) (i32.const 5) ) diff --git a/test/dot_s/start_main0.wast b/test/dot_s/start_main0.wast index 835e56579..430da2675 100644 --- a/test/dot_s/start_main0.wast +++ b/test/dot_s/start_main0.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) - (start $_start) (export "memory" (memory $0)) (export "main" (func $main)) (export "_start" (func $_start)) - (table 0 anyfunc) - + (start $_start) (func $main ) (func $_start diff --git a/test/dot_s/start_main2.wast b/test/dot_s/start_main2.wast index 4aeb3c0b9..014e456a8 100644 --- a/test/dot_s/start_main2.wast +++ b/test/dot_s/start_main2.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) - (start $_start) (export "memory" (memory $0)) (export "main" (func $main)) (export "_start" (func $_start)) - (table 0 anyfunc) - + (start $_start) (func $main (param $0 i32) (param $1 i32) (result i32) (return (get_local $0) diff --git a/test/dot_s/symbolic-offset.wast b/test/dot_s/symbolic-offset.wast index 6b64b6cc4..dafb6b705 100644 --- a/test/dot_s/symbolic-offset.wast +++ b/test/dot_s/symbolic-offset.wast @@ -1,10 +1,9 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 12) "\01\00\00\00\00\00\00\00\00\00\00\00") (export "memory" (memory $0)) (export "f" (func $f)) - (table 0 anyfunc) - (func $f (param $0 i32) (param $1 i32) (i32.store offset=16 (get_local $0) diff --git a/test/dot_s/text_before_type.wast b/test/dot_s/text_before_type.wast index 5a86d133e..4a161a6aa 100644 --- a/test/dot_s/text_before_type.wast +++ b/test/dot_s/text_before_type.wast @@ -1,9 +1,8 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (call $foo) (i32.const 0) diff --git a/test/dot_s/unreachable_blocks.wast b/test/dot_s/unreachable_blocks.wast index d7e9ac095..a5176e633 100644 --- a/test/dot_s/unreachable_blocks.wast +++ b/test/dot_s/unreachable_blocks.wast @@ -1,8 +1,7 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) - (table 0 anyfunc) - (func $unreachable_block_void (block $label$0 ) diff --git a/test/dot_s/visibilities.wast b/test/dot_s/visibilities.wast index 14abb9bb2..99670851f 100644 --- a/test/dot_s/visibilities.wast +++ b/test/dot_s/visibilities.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (export "memory" (memory $0)) (export "foo" (func $foo)) (export "bar" (func $bar)) (export "qux" (func $qux)) - (table 0 anyfunc) - (func $foo (return) ) diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm index c463aa3bc..e96071d64 100644 --- a/test/emcc_O2_hello_world.fromasm +++ b/test/emcc_O2_hello_world.fromasm @@ -1,5 +1,4 @@ (module - (data (get_global $memoryBase) "emcc_O2_hello_world.asm.js") (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) @@ -33,24 +32,8 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) + (data (get_global $memoryBase) "emcc_O2_hello_world.asm.js") (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)) @@ -81,7 +64,24 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) + (export "_free" (func $_free)) + (export "_main" (func $_main)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) (func $_malloc (param $0 i32) (result i32) (local $1 i32) (local $2 i32) diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise index 958acfd25..cac338f33 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise +++ b/test/emcc_O2_hello_world.fromasm.imprecise @@ -31,24 +31,7 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (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)) @@ -79,7 +62,24 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) + (export "_free" (func $_free)) + (export "_main" (func $_main)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) (func $_malloc (param $0 i32) (result i32) (local $1 i32) (local $2 i32) diff --git a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts index bbf492bf3..56ec1341c 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts +++ b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts @@ -31,24 +31,7 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (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)) @@ -79,7 +62,24 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) + (export "_free" (func $_free)) + (export "_main" (func $_main)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) (func $_malloc (param $i1 i32) (result i32) (local $i2 i32) (local $i3 i32) diff --git a/test/emcc_O2_hello_world.fromasm.no-opts b/test/emcc_O2_hello_world.fromasm.no-opts index 466424b0a..31f96c751 100644 --- a/test/emcc_O2_hello_world.fromasm.no-opts +++ b/test/emcc_O2_hello_world.fromasm.no-opts @@ -32,24 +32,7 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (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)) @@ -80,7 +63,24 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) + (export "_free" (func $_free)) + (export "_main" (func $_main)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) (func $_malloc (param $i1 i32) (result i32) (local $i2 i32) (local $i3 i32) diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm index d345230e7..a8d86e1bf 100644 --- a/test/emcc_hello_world.fromasm +++ b/test/emcc_hello_world.fromasm @@ -1,5 +1,4 @@ (module - (data (get_global $memoryBase) "emcc_hello_world.asm.js") (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) @@ -42,29 +41,8 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_i64Subtract" (func $_i64Subtract)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_i64Add" (func $_i64Add)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_bitshift64Lshr" (func $_bitshift64Lshr)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "_bitshift64Shl" (func $_bitshift64Shl)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) - (export "___udivmoddi4" (func $___udivmoddi4)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) + (data (get_global $memoryBase) "emcc_hello_world.asm.js") (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)) @@ -96,7 +74,29 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $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)) + (export "_i64Add" (func $_i64Add)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_bitshift64Lshr" (func $_bitshift64Lshr)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "_bitshift64Shl" (func $_bitshift64Shl)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) + (export "___udivmoddi4" (func $___udivmoddi4)) (func $stackAlloc (param $0 i32) (result i32) (local $1 i32) (set_local $1 diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise index aa43d5f97..73176446f 100644 --- a/test/emcc_hello_world.fromasm.imprecise +++ b/test/emcc_hello_world.fromasm.imprecise @@ -35,29 +35,7 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_i64Subtract" (func $_i64Subtract)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_i64Add" (func $_i64Add)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_bitshift64Lshr" (func $_bitshift64Lshr)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "_bitshift64Shl" (func $_bitshift64Shl)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) - (export "___udivmoddi4" (func $___udivmoddi4)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (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)) @@ -89,7 +67,29 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $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)) + (export "_i64Add" (func $_i64Add)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_bitshift64Lshr" (func $_bitshift64Lshr)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "_bitshift64Shl" (func $_bitshift64Shl)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) + (export "___udivmoddi4" (func $___udivmoddi4)) (func $stackAlloc (param $0 i32) (result i32) (local $1 i32) (set_local $1 diff --git a/test/emcc_hello_world.fromasm.imprecise.no-opts b/test/emcc_hello_world.fromasm.imprecise.no-opts index 684d0047d..9fbc85898 100644 --- a/test/emcc_hello_world.fromasm.imprecise.no-opts +++ b/test/emcc_hello_world.fromasm.imprecise.no-opts @@ -35,29 +35,7 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_i64Subtract" (func $_i64Subtract)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_i64Add" (func $_i64Add)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_bitshift64Lshr" (func $_bitshift64Lshr)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "_bitshift64Shl" (func $_bitshift64Shl)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) - (export "___udivmoddi4" (func $___udivmoddi4)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (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)) @@ -89,7 +67,29 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $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)) + (export "_i64Add" (func $_i64Add)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_bitshift64Lshr" (func $_bitshift64Lshr)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "_bitshift64Shl" (func $_bitshift64Shl)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) + (export "___udivmoddi4" (func $___udivmoddi4)) (func $stackAlloc (param $size i32) (result i32) (local $ret i32) (set_local $ret diff --git a/test/emcc_hello_world.fromasm.no-opts b/test/emcc_hello_world.fromasm.no-opts index c592ec5a1..39efb7986 100644 --- a/test/emcc_hello_world.fromasm.no-opts +++ b/test/emcc_hello_world.fromasm.no-opts @@ -41,29 +41,7 @@ (import "env" "table" (table 18 18 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_i64Subtract" (func $_i64Subtract)) - (export "_free" (func $_free)) - (export "_main" (func $_main)) - (export "_i64Add" (func $_i64Add)) - (export "_memset" (func $_memset)) - (export "_malloc" (func $_malloc)) - (export "_memcpy" (func $_memcpy)) - (export "_bitshift64Lshr" (func $_bitshift64Lshr)) - (export "_fflush" (func $_fflush)) - (export "___errno_location" (func $___errno_location)) - (export "_bitshift64Shl" (func $_bitshift64Shl)) - (export "runPostSets" (func $runPostSets)) - (export "stackAlloc" (func $stackAlloc)) - (export "stackSave" (func $stackSave)) - (export "stackRestore" (func $stackRestore)) - (export "establishStackSpace" (func $establishStackSpace)) - (export "setThrew" (func $setThrew)) - (export "setTempRet0" (func $setTempRet0)) - (export "getTempRet0" (func $getTempRet0)) - (export "dynCall_ii" (func $dynCall_ii)) - (export "dynCall_iiii" (func $dynCall_iiii)) - (export "dynCall_vi" (func $dynCall_vi)) - (export "___udivmoddi4" (func $___udivmoddi4)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (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)) @@ -95,7 +73,29 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (i32.const 0) $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)) + (export "_i64Add" (func $_i64Add)) + (export "_memset" (func $_memset)) + (export "_malloc" (func $_malloc)) + (export "_memcpy" (func $_memcpy)) + (export "_bitshift64Lshr" (func $_bitshift64Lshr)) + (export "_fflush" (func $_fflush)) + (export "___errno_location" (func $___errno_location)) + (export "_bitshift64Shl" (func $_bitshift64Shl)) + (export "runPostSets" (func $runPostSets)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackSave" (func $stackSave)) + (export "stackRestore" (func $stackRestore)) + (export "establishStackSpace" (func $establishStackSpace)) + (export "setThrew" (func $setThrew)) + (export "setTempRet0" (func $setTempRet0)) + (export "getTempRet0" (func $getTempRet0)) + (export "dynCall_ii" (func $dynCall_ii)) + (export "dynCall_iiii" (func $dynCall_iiii)) + (export "dynCall_vi" (func $dynCall_vi)) + (export "___udivmoddi4" (func $___udivmoddi4)) (func $stackAlloc (param $size i32) (result i32) (local $ret i32) (set_local $ret diff --git a/test/empty.fromasm b/test/empty.fromasm index 71b53653f..055939559 100644 --- a/test/empty.fromasm +++ b/test/empty.fromasm @@ -1,7 +1,7 @@ (module - (data (get_global $memoryBase) "empty.asm.js") (import "env" "memory" (memory $0 256 256)) (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (data (get_global $memoryBase) "empty.asm.js") ) diff --git a/test/example/c-api-hello-world.txt b/test/example/c-api-hello-world.txt index 46647f9f6..0ca9a0ae3 100644 --- a/test/example/c-api-hello-world.txt +++ b/test/example/c-api-hello-world.txt @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $iii (func (param i32 i32) (result i32))) + (memory $0 0) (func $adder (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.add (get_local $0) diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 9364edeae..d16999b47 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -7,18 +7,18 @@ BinaryenFloat64: 4 (f32.const -33.61199951171875) ) (module - (memory $0 1 256) - (data (i32.const 10) "hello, world") - (start $starter) (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (export "kitchen_sinker" (func "$kitchen()sinker")) - (export "mem" (memory $0)) (table 1 1 anyfunc) (elem (i32.const 0) "$kitchen()sinker") + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (export "kitchen_sinker" (func "$kitchen()sinker")) + (export "mem" (memory $0)) + (start $starter) (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) (local $4 i32) (block $the-body i32 @@ -538,11 +538,11 @@ BinaryenFloat64: 4 ) raw: (module - (memory $0 0) (type $v (func)) (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) + (memory $0 0) (func $just-one-block (type $v) (local $0 i32) (call $check @@ -1025,11 +1025,11 @@ raw: ) optimized: (module - (memory $0 0) (type $v (func)) (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) + (memory $0 0) (func $just-one-block (type $v) (call $check (i32.const 1337) @@ -1182,8 +1182,8 @@ optimized: ) module loaded from binary form: (module - (memory $0 0) (type $0 (func (param i32 i32) (result i32))) + (memory $0 0) (func $adder (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.add (get_local $var$0) @@ -1192,11 +1192,11 @@ module loaded from binary form: ) ) (module - (memory $0 0) - (start $starter) (type $vi (func (param i32))) (type $v (func)) (import "spectest" "print" (func $print-i32 (param i32))) + (memory $0 0) + (start $starter) (func $starter (type $v) (call $print-i32 (i32.const 1234) @@ -1205,8 +1205,8 @@ module loaded from binary form: ) (i32.const 1234) (module - (memory $0 0) (type $v (func)) + (memory $0 0) (func $func (type $v) (local $0 i32) (set_local $0 @@ -1550,18 +1550,18 @@ int main() { BinaryenModuleValidate(the_module); BinaryenModulePrint(the_module); (module - (memory $0 1 256) - (data (i32.const 10) "hello, world") - (start $starter) (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (export "kitchen_sinker" (func "$kitchen()sinker")) - (export "mem" (memory $0)) (table 1 1 anyfunc) (elem (i32.const 0) "$kitchen()sinker") + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (export "kitchen_sinker" (func "$kitchen()sinker")) + (export "mem" (memory $0)) + (start $starter) (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) (local $4 i32) (block $the-body i32 @@ -2541,11 +2541,11 @@ int main() { raw: BinaryenModulePrint(the_module); (module - (memory $0 0) (type $v (func)) (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) + (memory $0 0) (func $just-one-block (type $v) (local $0 i32) (call $check @@ -3032,11 +3032,11 @@ raw: optimized: BinaryenModulePrint(the_module); (module - (memory $0 0) (type $v (func)) (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) + (memory $0 0) (func $just-one-block (type $v) (call $check (i32.const 1337) diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index b77e5c6c4..26a765b26 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -2,18 +2,18 @@ (f32.const -33.61199951171875) ) (module - (memory $0 1 256) - (data (i32.const 10) "hello, world") - (start $starter) (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (export "kitchen_sinker" (func "$kitchen()sinker")) - (export "mem" (memory $0)) (table 1 1 anyfunc) (elem (i32.const 0) "$kitchen()sinker") + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (export "kitchen_sinker" (func "$kitchen()sinker")) + (export "mem" (memory $0)) + (start $starter) (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) (local $4 i32) (block $the-body i32 @@ -532,11 +532,11 @@ ) ) (module - (memory $0 0) (type $v (func)) (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) + (memory $0 0) (func $just-one-block (type $v) (local $0 i32) (call $check @@ -1018,11 +1018,11 @@ ) ) (module - (memory $0 0) (type $v (func)) (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) + (memory $0 0) (func $just-one-block (type $v) (call $check (i32.const 1337) diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt index 5a631c41c..f0ddfdc19 100644 --- a/test/example/relooper-fuzz.txt +++ b/test/example/relooper-fuzz.txt @@ -1,11 +1,11 @@ (module - (memory $0 1 1) - (start $main) (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) (export "mem" (memory $0)) + (start $main) (func $check (type $i) (result i32) (if (i32.eq @@ -292,13 +292,13 @@ ) ) (module - (memory $0 1 1) - (start $main) (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) (export "mem" (memory $0)) + (start $main) (func $check (type $i) (result i32) (if (i32.eq diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt index 16ec88e57..0a29c1a03 100644 --- a/test/example/relooper-fuzz1.txt +++ b/test/example/relooper-fuzz1.txt @@ -1,11 +1,11 @@ (module - (memory $0 1 1) - (start $main) (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) (export "mem" (memory $0)) + (start $main) (func $check (type $i) (result i32) (if (i32.eq @@ -268,13 +268,13 @@ ) ) (module - (memory $0 1 1) - (start $main) (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) (export "mem" (memory $0)) + (start $main) (func $check (type $i) (result i32) (if (i32.eq diff --git a/test/hello_world.fromasm b/test/hello_world.fromasm index cd2ebc6ec..f88f3e94a 100644 --- a/test/hello_world.fromasm +++ b/test/hello_world.fromasm @@ -1,9 +1,9 @@ (module - (data (get_global $memoryBase) "hello_world.asm.js") (import "env" "memory" (memory $0 256 256)) (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (data (get_global $memoryBase) "hello_world.asm.js") (export "add" (func $add)) (func $add (param $0 i32) (param $1 i32) (result i32) (i32.add diff --git a/test/hello_world.wast b/test/hello_world.wast index e66692f97..44a1f9336 100644 --- a/test/hello_world.wast +++ b/test/hello_world.wast @@ -1,6 +1,6 @@ (module - (memory $0 256 256) (type $0 (func (param i32 i32) (result i32))) + (memory $0 256 256) (export "add" (func $add)) (func $add (type $0) (param $x i32) (param $y i32) (result i32) (i32.add diff --git a/test/hello_world.wast.fromBinary b/test/hello_world.wast.fromBinary index 2241fb07b..b0731b555 100644 --- a/test/hello_world.wast.fromBinary +++ b/test/hello_world.wast.fromBinary @@ -1,6 +1,6 @@ (module - (memory $0 256 256) (type $0 (func (param i32 i32) (result i32))) + (memory $0 256 256) (export "add" (func $add)) (func $add (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.add diff --git a/test/hello_world.wast.fromBinary.noDebugInfo b/test/hello_world.wast.fromBinary.noDebugInfo index b71cddfcb..acbd140ee 100644 --- a/test/hello_world.wast.fromBinary.noDebugInfo +++ b/test/hello_world.wast.fromBinary.noDebugInfo @@ -1,6 +1,6 @@ (module - (memory $0 256 256) (type $0 (func (param i32 i32) (result i32))) + (memory $0 256 256) (export "add" (func $0)) (func $0 (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.add diff --git a/test/i64-setTempRet0.fromasm b/test/i64-setTempRet0.fromasm index 01189d806..52710e5cc 100644 --- a/test/i64-setTempRet0.fromasm +++ b/test/i64-setTempRet0.fromasm @@ -1,5 +1,4 @@ (module - (data (get_global $memoryBase) "i64-setTempRet0.asm.js") (type $FUNCSIG$j (func (result i64))) (type $legaltype$illegalImportResult (func (result i32))) (import "env" "illegalImportResult" (func $illegalImportResult (result i64))) @@ -8,9 +7,10 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (data (get_global $memoryBase) "i64-setTempRet0.asm.js") + (global $tempRet0 (mut i32) (i32.const 0)) (export "illegalResult" (func $legalstub$illegalResult)) (export "imports" (func $imports)) - (global $tempRet0 (mut i32) (i32.const 0)) (func $illegalResult (result i64) (i64.const 8589934593) ) diff --git a/test/i64-setTempRet0.fromasm.imprecise b/test/i64-setTempRet0.fromasm.imprecise index d83f8729a..6151e53d4 100644 --- a/test/i64-setTempRet0.fromasm.imprecise +++ b/test/i64-setTempRet0.fromasm.imprecise @@ -7,9 +7,9 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (global $tempRet0 (mut i32) (i32.const 0)) (export "illegalResult" (func $legalstub$illegalResult)) (export "imports" (func $imports)) - (global $tempRet0 (mut i32) (i32.const 0)) (func $illegalResult (result i64) (i64.const 8589934593) ) diff --git a/test/i64-setTempRet0.fromasm.imprecise.no-opts b/test/i64-setTempRet0.fromasm.imprecise.no-opts index 3475f8e35..7d8ea6e3a 100644 --- a/test/i64-setTempRet0.fromasm.imprecise.no-opts +++ b/test/i64-setTempRet0.fromasm.imprecise.no-opts @@ -7,9 +7,9 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (global $tempRet0 (mut i32) (i32.const 0)) (export "illegalResult" (func $legalstub$illegalResult)) (export "imports" (func $imports)) - (global $tempRet0 (mut i32) (i32.const 0)) (func $illegalResult (result i64) (return (i64.const 8589934593) diff --git a/test/i64-setTempRet0.fromasm.no-opts b/test/i64-setTempRet0.fromasm.no-opts index 3475f8e35..7d8ea6e3a 100644 --- a/test/i64-setTempRet0.fromasm.no-opts +++ b/test/i64-setTempRet0.fromasm.no-opts @@ -7,9 +7,9 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (global $tempRet0 (mut i32) (i32.const 0)) (export "illegalResult" (func $legalstub$illegalResult)) (export "imports" (func $imports)) - (global $tempRet0 (mut i32) (i32.const 0)) (func $illegalResult (result i64) (return (i64.const 8589934593) diff --git a/test/kitchen_sink.wast b/test/kitchen_sink.wast index b3927ef4c..7598ee989 100644 --- a/test/kitchen_sink.wast +++ b/test/kitchen_sink.wast @@ -1,7 +1,7 @@ (module + (type $0 (func (result i32))) (memory $0 4096 4096) (data (i32.const 1026) "\14\00") - (type $0 (func (result i32))) (func $kitchensink (type $0) (result i32) (block $block0 i32 (drop diff --git a/test/kitchen_sink.wast.fromBinary b/test/kitchen_sink.wast.fromBinary index 84c12f732..548855c3c 100644 --- a/test/kitchen_sink.wast.fromBinary +++ b/test/kitchen_sink.wast.fromBinary @@ -1,7 +1,7 @@ (module + (type $0 (func (result i32))) (memory $0 4096 4096) (data (i32.const 1026) "\14\00") - (type $0 (func (result i32))) (func $kitchensink (type $0) (result i32) (block $label$0 i32 (drop diff --git a/test/kitchen_sink.wast.fromBinary.noDebugInfo b/test/kitchen_sink.wast.fromBinary.noDebugInfo index 1b54470c6..f8052ee6a 100644 --- a/test/kitchen_sink.wast.fromBinary.noDebugInfo +++ b/test/kitchen_sink.wast.fromBinary.noDebugInfo @@ -1,7 +1,7 @@ (module + (type $0 (func (result i32))) (memory $0 4096 4096) (data (i32.const 1026) "\14\00") - (type $0 (func (result i32))) (func $0 (type $0) (result i32) (block $label$0 i32 (drop diff --git a/test/llvm_autogenerated/byval.wast b/test/llvm_autogenerated/byval.wast index f7787011e..440ec7bf4 100644 --- a/test/llvm_autogenerated/byval.wast +++ b/test/llvm_autogenerated/byval.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (import "env" "big_byval_callee" (func $big_byval_callee (param i32))) @@ -11,6 +9,9 @@ (import "env" "ext_func" (func $ext_func (param i32))) (import "env" "ext_func_empty" (func $ext_func_empty (param i32))) (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "byval_arg" (func $byval_arg)) (export "byval_arg_align8" (func $byval_arg_align8)) @@ -19,8 +20,6 @@ (export "byval_empty_caller" (func $byval_empty_caller)) (export "byval_empty_callee" (func $byval_empty_callee)) (export "big_byval" (func $big_byval)) - (table 0 anyfunc) - (func $byval_arg (param $0 i32) (local $1 i32) (i32.store offset=4 diff --git a/test/llvm_autogenerated/call.wast b/test/llvm_autogenerated/call.wast index c4ee58910..1fca6c4ab 100644 --- a/test/llvm_autogenerated/call.wast +++ b/test/llvm_autogenerated/call.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) @@ -15,6 +13,9 @@ (import "env" "i32_unary" (func $i32_unary (param i32) (result i32))) (import "env" "i64_nullary" (func $i64_nullary (result i64))) (import "env" "void_nullary" (func $void_nullary)) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "call_i32_nullary" (func $call_i32_nullary)) (export "call_i64_nullary" (func $call_i64_nullary)) @@ -28,8 +29,6 @@ (export "tail_call_void_nullary" (func $tail_call_void_nullary)) (export "fastcc_tail_call_void_nullary" (func $fastcc_tail_call_void_nullary)) (export "coldcc_tail_call_void_nullary" (func $coldcc_tail_call_void_nullary)) - (table 0 anyfunc) - (func $call_i32_nullary (result i32) (return (call $i32_nullary) diff --git a/test/llvm_autogenerated/cfg-stackify.wast b/test/llvm_autogenerated/cfg-stackify.wast index de3fbba9c..6f97cb08d 100644 --- a/test/llvm_autogenerated/cfg-stackify.wast +++ b/test/llvm_autogenerated/cfg-stackify.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (import "env" "a" (func $a (result i32))) @@ -8,6 +6,9 @@ (import "env" "something" (func $something)) (import "env" "test15_callee0" (func $test15_callee0)) (import "env" "test15_callee1" (func $test15_callee1)) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "test0" (func $test0)) (export "test1" (func $test1)) @@ -34,8 +35,6 @@ (export "test13" (func $test13)) (export "test14" (func $test14)) (export "test15" (func $test15)) - (table 0 anyfunc) - (func $test0 (param $0 i32) (local $1 i32) (set_local $1 diff --git a/test/llvm_autogenerated/comparisons_f32.wast b/test/llvm_autogenerated/comparisons_f32.wast index ec48c00a3..7a8c1d2dd 100644 --- a/test/llvm_autogenerated/comparisons_f32.wast +++ b/test/llvm_autogenerated/comparisons_f32.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -16,8 +17,6 @@ (export "ule_f32" (func $ule_f32)) (export "ugt_f32" (func $ugt_f32)) (export "uge_f32" (func $uge_f32)) - (table 0 anyfunc) - (func $ord_f32 (param $0 f32) (param $1 f32) (result i32) (return (i32.and diff --git a/test/llvm_autogenerated/comparisons_f64.wast b/test/llvm_autogenerated/comparisons_f64.wast index a6cc35839..ae750dd92 100644 --- a/test/llvm_autogenerated/comparisons_f64.wast +++ b/test/llvm_autogenerated/comparisons_f64.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -16,8 +17,6 @@ (export "ule_f64" (func $ule_f64)) (export "ugt_f64" (func $ugt_f64)) (export "uge_f64" (func $uge_f64)) - (table 0 anyfunc) - (func $ord_f64 (param $0 f64) (param $1 f64) (result i32) (return (i32.and diff --git a/test/llvm_autogenerated/comparisons_i32.wast b/test/llvm_autogenerated/comparisons_i32.wast index fc64fad81..1ee0c02e7 100644 --- a/test/llvm_autogenerated/comparisons_i32.wast +++ b/test/llvm_autogenerated/comparisons_i32.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -12,8 +13,6 @@ (export "sge_i32" (func $sge_i32)) (export "ugt_i32" (func $ugt_i32)) (export "uge_i32" (func $uge_i32)) - (table 0 anyfunc) - (func $eq_i32 (param $0 i32) (param $1 i32) (result i32) (return (i32.eq diff --git a/test/llvm_autogenerated/comparisons_i64.wast b/test/llvm_autogenerated/comparisons_i64.wast index 82c491ae3..f04f1eedb 100644 --- a/test/llvm_autogenerated/comparisons_i64.wast +++ b/test/llvm_autogenerated/comparisons_i64.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -12,8 +13,6 @@ (export "sge_i64" (func $sge_i64)) (export "ugt_i64" (func $ugt_i64)) (export "uge_i64" (func $uge_i64)) - (table 0 anyfunc) - (func $eq_i64 (param $0 i64) (param $1 i64) (result i32) (return (i64.eq diff --git a/test/llvm_autogenerated/conv.wast b/test/llvm_autogenerated/conv.wast index 28b10fbfd..a1673e25b 100644 --- a/test/llvm_autogenerated/conv.wast +++ b/test/llvm_autogenerated/conv.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -28,8 +29,6 @@ (export "bitcast_float_to_i32" (func $bitcast_float_to_i32)) (export "bitcast_i64_to_double" (func $bitcast_i64_to_double)) (export "bitcast_double_to_i64" (func $bitcast_double_to_i64)) - (table 0 anyfunc) - (func $i32_wrap_i64 (param $0 i64) (result i32) (return (i32.wrap/i64 diff --git a/test/llvm_autogenerated/copysign-casts.wast b/test/llvm_autogenerated/copysign-casts.wast index e6e62fe34..43cd8a908 100644 --- a/test/llvm_autogenerated/copysign-casts.wast +++ b/test/llvm_autogenerated/copysign-casts.wast @@ -1,13 +1,12 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "fold_promote" (func $fold_promote)) (export "fold_demote" (func $fold_demote)) - (table 0 anyfunc) - (func $fold_promote (param $0 f64) (param $1 f32) (result f64) (f64.copysign (get_local $0) diff --git a/test/llvm_autogenerated/cpus.wast b/test/llvm_autogenerated/cpus.wast index d528c58fd..cdef27ee8 100644 --- a/test/llvm_autogenerated/cpus.wast +++ b/test/llvm_autogenerated/cpus.wast @@ -1,10 +1,9 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "f" (func $f)) - (table 0 anyfunc) - (func $f (param $0 i32) (result i32) (get_local $0) ) diff --git a/test/llvm_autogenerated/dead-vreg.wast b/test/llvm_autogenerated/dead-vreg.wast index f6d440bc3..b41745078 100644 --- a/test/llvm_autogenerated/dead-vreg.wast +++ b/test/llvm_autogenerated/dead-vreg.wast @@ -1,10 +1,9 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "foo" (func $foo)) - (table 0 anyfunc) - (func $foo (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) diff --git a/test/llvm_autogenerated/divrem-constant.wast b/test/llvm_autogenerated/divrem-constant.wast index 8c985e436..2d8af57f7 100644 --- a/test/llvm_autogenerated/divrem-constant.wast +++ b/test/llvm_autogenerated/divrem-constant.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -10,8 +11,6 @@ (export "test_urem_5" (func $test_urem_5)) (export "test_srem_2" (func $test_srem_2)) (export "test_srem_5" (func $test_srem_5)) - (table 0 anyfunc) - (func $test_udiv_2 (param $0 i32) (result i32) (i32.shr_u (get_local $0) diff --git a/test/llvm_autogenerated/f32.wast b/test/llvm_autogenerated/f32.wast index dfbe7fc0c..2f4811361 100644 --- a/test/llvm_autogenerated/f32.wast +++ b/test/llvm_autogenerated/f32.wast @@ -1,8 +1,9 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$ffff (func (param f32 f32 f32) (result f32))) (import "env" "fmaf" (func $fmaf (param f32 f32 f32) (result f32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "fadd32" (func $fadd32)) (export "fsub32" (func $fsub32)) @@ -20,8 +21,6 @@ (export "fmin32" (func $fmin32)) (export "fmax32" (func $fmax32)) (export "fma32" (func $fma32)) - (table 0 anyfunc) - (func $fadd32 (param $0 f32) (param $1 f32) (result f32) (return (f32.add diff --git a/test/llvm_autogenerated/f64.wast b/test/llvm_autogenerated/f64.wast index 4350d5dc7..9d4ed937b 100644 --- a/test/llvm_autogenerated/f64.wast +++ b/test/llvm_autogenerated/f64.wast @@ -1,8 +1,9 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$dddd (func (param f64 f64 f64) (result f64))) (import "env" "fma" (func $fma (param f64 f64 f64) (result f64))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "fadd64" (func $fadd64)) (export "fsub64" (func $fsub64)) @@ -20,8 +21,6 @@ (export "fmin64" (func $fmin64)) (export "fmax64" (func $fmax64)) (export "fma64" (func $fma64)) - (table 0 anyfunc) - (func $fadd64 (param $0 f64) (param $1 f64) (result f64) (return (f64.add diff --git a/test/llvm_autogenerated/fast-isel-noreg.wast b/test/llvm_autogenerated/fast-isel-noreg.wast index c336591a6..eaaa78ebb 100644 --- a/test/llvm_autogenerated/fast-isel-noreg.wast +++ b/test/llvm_autogenerated/fast-isel-noreg.wast @@ -1,12 +1,11 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "a" (func $a)) (export "b" (func $b)) (export "c" (func $c)) - (table 0 anyfunc) - (func $a (result i32) (return (i32.const 0) diff --git a/test/llvm_autogenerated/fast-isel.wast b/test/llvm_autogenerated/fast-isel.wast index 285f649a4..54701dae3 100644 --- a/test/llvm_autogenerated/fast-isel.wast +++ b/test/llvm_autogenerated/fast-isel.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -8,8 +9,6 @@ (export "bitcast_f32_i32" (func $bitcast_f32_i32)) (export "bitcast_i64_f64" (func $bitcast_i64_f64)) (export "bitcast_f64_i64" (func $bitcast_f64_i64)) - (table 0 anyfunc) - (func $immediate_f32 (result f32) (f32.const 2.5) ) diff --git a/test/llvm_autogenerated/frem.wast b/test/llvm_autogenerated/frem.wast index 1272ee2e9..01047d9e8 100644 --- a/test/llvm_autogenerated/frem.wast +++ b/test/llvm_autogenerated/frem.wast @@ -1,15 +1,14 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) (import "env" "fmod" (func $fmod (param f64 f64) (result f64))) (import "env" "fmodf" (func $fmodf (param f32 f32) (result f32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "frem32" (func $frem32)) (export "frem64" (func $frem64)) - (table 0 anyfunc) - (func $frem32 (param $0 f32) (param $1 f32) (result f32) (return (call $fmodf diff --git a/test/llvm_autogenerated/func.wast b/test/llvm_autogenerated/func.wast index 06144cab7..5967904b8 100644 --- a/test/llvm_autogenerated/func.wast +++ b/test/llvm_autogenerated/func.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -8,8 +9,6 @@ (export "f3" (func $f3)) (export "f4" (func $f4)) (export "f5" (func $f5)) - (table 0 anyfunc) - (func $f0 (return) ) diff --git a/test/llvm_autogenerated/global.wast b/test/llvm_autogenerated/global.wast index c7821455a..459245d7c 100644 --- a/test/llvm_autogenerated/global.wast +++ b/test/llvm_autogenerated/global.wast @@ -1,4 +1,7 @@ (module + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\b0\08\00\00") (data (i32.const 12) "9\05\00\00") @@ -13,13 +16,9 @@ (data (i32.const 136) "\00\00\00\00\00\00\00@") (data (i32.const 656) "\e0\00\00\00") (data (i32.const 1192) "\a4\04\00\00") - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) (export "memory" (memory $0)) (export "foo" (func $foo)) (export "call_memcpy" (func $call_memcpy)) - (table 0 anyfunc) - (func $foo (result i32) (return (i32.load offset=32 diff --git a/test/llvm_autogenerated/globl.wast b/test/llvm_autogenerated/globl.wast index f628844f7..ccdba4ae8 100644 --- a/test/llvm_autogenerated/globl.wast +++ b/test/llvm_autogenerated/globl.wast @@ -1,10 +1,9 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "foo" (func $foo)) - (table 0 anyfunc) - (func $foo ) ) diff --git a/test/llvm_autogenerated/i128.wast b/test/llvm_autogenerated/i128.wast index eedabe170..2cd971e19 100644 --- a/test/llvm_autogenerated/i128.wast +++ b/test/llvm_autogenerated/i128.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$vijji (func (param i32 i64 i64 i32))) (type $FUNCSIG$vijjjj (func (param i32 i64 i64 i64 i64))) (import "env" "__ashlti3" (func $__ashlti3 (param i32 i64 i64 i32))) @@ -11,6 +9,9 @@ (import "env" "__multi3" (func $__multi3 (param i32 i64 i64 i64 i64))) (import "env" "__udivti3" (func $__udivti3 (param i32 i64 i64 i64 i64))) (import "env" "__umodti3" (func $__umodti3 (param i32 i64 i64 i64 i64))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "add128" (func $add128)) (export "sub128" (func $sub128)) @@ -35,8 +36,6 @@ (export "masked_rotl" (func $masked_rotl)) (export "rotr" (func $rotr)) (export "masked_rotr" (func $masked_rotr)) - (table 0 anyfunc) - (func $add128 (param $0 i32) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (local $5 i64) (i64.store diff --git a/test/llvm_autogenerated/i32-load-store-alignment.wast b/test/llvm_autogenerated/i32-load-store-alignment.wast index 85dcdaeb6..59f57a0b2 100644 --- a/test/llvm_autogenerated/i32-load-store-alignment.wast +++ b/test/llvm_autogenerated/i32-load-store-alignment.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -22,8 +23,6 @@ (export "sti16_a1" (func $sti16_a1)) (export "sti16_a2" (func $sti16_a2)) (export "sti16_a4" (func $sti16_a4)) - (table 0 anyfunc) - (func $ldi32_a1 (param $0 i32) (result i32) (return (i32.load align=1 diff --git a/test/llvm_autogenerated/i32.wast b/test/llvm_autogenerated/i32.wast index e0bd84c93..2afbfb70b 100644 --- a/test/llvm_autogenerated/i32.wast +++ b/test/llvm_autogenerated/i32.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -25,8 +26,6 @@ (export "masked_rotl" (func $masked_rotl)) (export "rotr" (func $rotr)) (export "masked_rotr" (func $masked_rotr)) - (table 0 anyfunc) - (func $add32 (param $0 i32) (param $1 i32) (result i32) (return (i32.add diff --git a/test/llvm_autogenerated/i64-load-store-alignment.wast b/test/llvm_autogenerated/i64-load-store-alignment.wast index 929f68618..538d1a465 100644 --- a/test/llvm_autogenerated/i64-load-store-alignment.wast +++ b/test/llvm_autogenerated/i64-load-store-alignment.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -32,8 +33,6 @@ (export "sti32_a2" (func $sti32_a2)) (export "sti32_a4" (func $sti32_a4)) (export "sti32_a8" (func $sti32_a8)) - (table 0 anyfunc) - (func $ldi64_a1 (param $0 i32) (result i64) (return (i64.load align=1 diff --git a/test/llvm_autogenerated/i64.wast b/test/llvm_autogenerated/i64.wast index 6cd4766e5..d04dcadc4 100644 --- a/test/llvm_autogenerated/i64.wast +++ b/test/llvm_autogenerated/i64.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -25,8 +26,6 @@ (export "masked_rotl" (func $masked_rotl)) (export "rotr" (func $rotr)) (export "masked_rotr" (func $masked_rotr)) - (table 0 anyfunc) - (func $add64 (param $0 i64) (param $1 i64) (result i64) (return (i64.add diff --git a/test/llvm_autogenerated/ident.wast b/test/llvm_autogenerated/ident.wast index 42d1df53e..4290c684e 100644 --- a/test/llvm_autogenerated/ident.wast +++ b/test/llvm_autogenerated/ident.wast @@ -1,8 +1,7 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) - (table 0 anyfunc) - ) ;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] } diff --git a/test/llvm_autogenerated/immediates.wast b/test/llvm_autogenerated/immediates.wast index e10d21b06..c1e2fdaf4 100644 --- a/test/llvm_autogenerated/immediates.wast +++ b/test/llvm_autogenerated/immediates.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -30,8 +31,6 @@ (export "neginf_f64" (func $neginf_f64)) (export "custom_nan_f64" (func $custom_nan_f64)) (export "custom_nans_f64" (func $custom_nans_f64)) - (table 0 anyfunc) - (func $zero_i32 (result i32) (return (i32.const 0) diff --git a/test/llvm_autogenerated/indirect-import.wast b/test/llvm_autogenerated/indirect-import.wast index a6fb24641..0af1cf1b0 100644 --- a/test/llvm_autogenerated/indirect-import.wast +++ b/test/llvm_autogenerated/indirect-import.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$fd (func (param f64) (result f32))) (type $FUNCSIG$vj (func (param i64))) (type $FUNCSIG$v (func)) @@ -13,13 +11,15 @@ (import "env" "extern_fd" (func $extern_fd (param f64) (result f32))) (import "env" "extern_struct" (func $extern_struct (param i32))) (import "env" "extern_sret" (func $extern_sret (param i32))) + (table 7 7 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $__importThunk_extern_fd $__importThunk_extern_vj $__importThunk_extern_v $__importThunk_extern_ijidf $__importThunk_extern_struct $__importThunk_extern_sret) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "bar" (func $bar)) (export "dynCall_fd" (func $dynCall_fd)) (export "dynCall_v" (func $dynCall_v)) (export "dynCall_vi" (func $dynCall_vi)) - (table 7 7 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $__importThunk_extern_fd $__importThunk_extern_vj $__importThunk_extern_v $__importThunk_extern_ijidf $__importThunk_extern_struct $__importThunk_extern_sret) (func $bar (result i32) (local $0 i32) (local $1 i32) diff --git a/test/llvm_autogenerated/irreducible-cfg.wast b/test/llvm_autogenerated/irreducible-cfg.wast index 783922490..223cf1ae9 100644 --- a/test/llvm_autogenerated/irreducible-cfg.wast +++ b/test/llvm_autogenerated/irreducible-cfg.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "test0" (func $test0)) (export "test1" (func $test1)) - (table 0 anyfunc) - (func $test0 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 f64) (local $5 i32) diff --git a/test/llvm_autogenerated/legalize.wast b/test/llvm_autogenerated/legalize.wast index 3473859e1..e5d5887bf 100644 --- a/test/llvm_autogenerated/legalize.wast +++ b/test/llvm_autogenerated/legalize.wast @@ -1,9 +1,10 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$vijji (func (param i32 i64 i64 i32))) (import "env" "__ashlti3" (func $__ashlti3 (param i32 i64 i64 i32))) (import "env" "__lshrti3" (func $__lshrti3 (param i32 i64 i64 i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "shl_i3" (func $shl_i3)) (export "shl_i53" (func $shl_i53)) @@ -11,8 +12,6 @@ (export "fpext_f32_f64" (func $fpext_f32_f64)) (export "fpconv_f64_f32" (func $fpconv_f64_f32)) (export "bigshift" (func $bigshift)) - (table 0 anyfunc) - (func $shl_i3 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (return (i32.shl diff --git a/test/llvm_autogenerated/load-ext.wast b/test/llvm_autogenerated/load-ext.wast index d28332dd0..f2ebe1943 100644 --- a/test/llvm_autogenerated/load-ext.wast +++ b/test/llvm_autogenerated/load-ext.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -12,8 +13,6 @@ (export "zext_i16_i64" (func $zext_i16_i64)) (export "sext_i32_i64" (func $sext_i32_i64)) (export "zext_i32_i64" (func $zext_i32_i64)) - (table 0 anyfunc) - (func $sext_i8_i32 (param $0 i32) (result i32) (return (i32.load8_s diff --git a/test/llvm_autogenerated/load-store-i1.wast b/test/llvm_autogenerated/load-store-i1.wast index 45d34dceb..adfb032a1 100644 --- a/test/llvm_autogenerated/load-store-i1.wast +++ b/test/llvm_autogenerated/load-store-i1.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -8,8 +9,6 @@ (export "load_s_i1_i64" (func $load_s_i1_i64)) (export "store_i32_i1" (func $store_i32_i1)) (export "store_i64_i1" (func $store_i64_i1)) - (table 0 anyfunc) - (func $load_u_i1_i32 (param $0 i32) (result i32) (return (i32.load8_u diff --git a/test/llvm_autogenerated/load.wast b/test/llvm_autogenerated/load.wast index 4574857d6..22bd0d5f6 100644 --- a/test/llvm_autogenerated/load.wast +++ b/test/llvm_autogenerated/load.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -6,8 +7,6 @@ (export "ldi64" (func $ldi64)) (export "ldf32" (func $ldf32)) (export "ldf64" (func $ldf64)) - (table 0 anyfunc) - (func $ldi32 (param $0 i32) (result i32) (return (i32.load diff --git a/test/llvm_autogenerated/lower-em-ehsjlj-options.wast b/test/llvm_autogenerated/lower-em-ehsjlj-options.wast index a312038ce..e2c020a1e 100644 --- a/test/llvm_autogenerated/lower-em-ehsjlj-options.wast +++ b/test/llvm_autogenerated/lower-em-ehsjlj-options.wast @@ -1,9 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) " \04\00\00") - (data (i32.const 12) "\00\00\00\00") - (data (i32.const 16) "\00\00\00\00") - (data (i32.const 20) "\00\00\00\00") (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) @@ -16,14 +11,19 @@ (import "env" "longjmp" (func $longjmp (param i32 i32))) (import "env" "setjmp" (func $setjmp (param i32) (result i32))) (import "env" "foo" (func $foo)) + (table 2 2 anyfunc) + (elem (i32.const 0) $__wasm_nullptr $__importThunk_foo) + (memory $0 1) + (data (i32.const 4) " \04\00\00") + (data (i32.const 12) "\00\00\00\00") + (data (i32.const 16) "\00\00\00\00") + (data (i32.const 20) "\00\00\00\00") (export "memory" (memory $0)) (export "exception" (func $exception)) (export "setjmp_longjmp" (func $setjmp_longjmp)) (export "setThrew" (func $setThrew)) (export "setTempRet0" (func $setTempRet0)) (export "dynCall_v" (func $dynCall_v)) - (table 2 2 anyfunc) - (elem (i32.const 0) $__wasm_nullptr $__importThunk_foo) (func $exception (local $0 i32) (i32.store offset=12 diff --git a/test/llvm_autogenerated/mem-intrinsics.wast b/test/llvm_autogenerated/mem-intrinsics.wast index 7fc5edf51..d0a1996e2 100644 --- a/test/llvm_autogenerated/mem-intrinsics.wast +++ b/test/llvm_autogenerated/mem-intrinsics.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) @@ -9,6 +7,9 @@ (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) (import "env" "memmove" (func $memmove (param i32 i32 i32) (result i32))) (import "env" "memset" (func $memset (param i32 i32 i32) (result i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "copy_yes" (func $copy_yes)) (export "copy_no" (func $copy_no)) @@ -19,8 +20,6 @@ (export "frame_index" (func $frame_index)) (export "drop_result" (func $drop_result)) (export "tail_dup_to_reuse_result" (func $tail_dup_to_reuse_result)) - (table 0 anyfunc) - (func $copy_yes (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (return (call $memcpy diff --git a/test/llvm_autogenerated/memory-addr32.wast b/test/llvm_autogenerated/memory-addr32.wast index 96934599a..b6aeb2d76 100644 --- a/test/llvm_autogenerated/memory-addr32.wast +++ b/test/llvm_autogenerated/memory-addr32.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "current_memory" (func $current_memory)) (export "grow_memory" (func $grow_memory)) - (table 0 anyfunc) - (func $current_memory (result i32) (return (current_memory) diff --git a/test/llvm_autogenerated/negative-base-reg.wast b/test/llvm_autogenerated/negative-base-reg.wast index 05d7d5488..5d55462ce 100644 --- a/test/llvm_autogenerated/negative-base-reg.wast +++ b/test/llvm_autogenerated/negative-base-reg.wast @@ -1,10 +1,9 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\90\04\00\00") (export "memory" (memory $0)) (export "main" (func $main)) - (table 0 anyfunc) - (func $main (result i32) (local $0 i32) (set_local $0 diff --git a/test/llvm_autogenerated/non-executable-stack.wast b/test/llvm_autogenerated/non-executable-stack.wast index 42d1df53e..4290c684e 100644 --- a/test/llvm_autogenerated/non-executable-stack.wast +++ b/test/llvm_autogenerated/non-executable-stack.wast @@ -1,8 +1,7 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) - (table 0 anyfunc) - ) ;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] } diff --git a/test/llvm_autogenerated/offset.wast b/test/llvm_autogenerated/offset.wast index 44a60305b..6996812ed 100644 --- a/test/llvm_autogenerated/offset.wast +++ b/test/llvm_autogenerated/offset.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (data (i32.const 12) "\00\00\00\00") @@ -38,8 +39,6 @@ (export "aggregate_load_store" (func $aggregate_load_store)) (export "aggregate_return" (func $aggregate_return)) (export "aggregate_return_without_merge" (func $aggregate_return_without_merge)) - (table 0 anyfunc) - (func $load_i32_with_folded_offset (param $0 i32) (result i32) (i32.load offset=24 (get_local $0) diff --git a/test/llvm_autogenerated/phi.wast b/test/llvm_autogenerated/phi.wast index 710a3fdc4..7adfce863 100644 --- a/test/llvm_autogenerated/phi.wast +++ b/test/llvm_autogenerated/phi.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "test0" (func $test0)) (export "test1" (func $test1)) - (table 0 anyfunc) - (func $test0 (param $0 i32) (result i32) (block $label$0 (br_if $label$0 diff --git a/test/llvm_autogenerated/reg-stackify.wast b/test/llvm_autogenerated/reg-stackify.wast index 80dc657ac..c05846045 100644 --- a/test/llvm_autogenerated/reg-stackify.wast +++ b/test/llvm_autogenerated/reg-stackify.wast @@ -1,7 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") - (data (i32.const 12) "\00\00\00\00") (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$v (func)) @@ -20,6 +17,10 @@ (import "env" "use_a" (func $use_a (param i32))) (import "env" "use_b" (func $use_b (param i32))) (import "env" "use_memory" (func $use_memory (param i32) (result i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") + (data (i32.const 12) "\00\00\00\00") (export "memory" (memory $0)) (export "no0" (func $no0)) (export "no1" (func $no1)) @@ -45,8 +46,6 @@ (export "no_stackify_past_epilogue" (func $no_stackify_past_epilogue)) (export "stackify_indvar" (func $stackify_indvar)) (export "stackpointer_dependency" (func $stackpointer_dependency)) - (table 0 anyfunc) - (func $no0 (param $0 i32) (param $1 i32) (result i32) (set_local $1 (i32.load diff --git a/test/llvm_autogenerated/return-int32.wast b/test/llvm_autogenerated/return-int32.wast index b9bd266ec..961c4ec4a 100644 --- a/test/llvm_autogenerated/return-int32.wast +++ b/test/llvm_autogenerated/return-int32.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "return_i32" (func $return_i32)) (export "return_i32_twice" (func $return_i32_twice)) - (table 0 anyfunc) - (func $return_i32 (param $0 i32) (result i32) (get_local $0) ) diff --git a/test/llvm_autogenerated/return-void.wast b/test/llvm_autogenerated/return-void.wast index eb61d6fbd..2a4e5fc5a 100644 --- a/test/llvm_autogenerated/return-void.wast +++ b/test/llvm_autogenerated/return-void.wast @@ -1,11 +1,10 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "return_void" (func $return_void)) (export "return_void_twice" (func $return_void_twice)) - (table 0 anyfunc) - (func $return_void ) (func $return_void_twice (param $0 i32) diff --git a/test/llvm_autogenerated/select.wast b/test/llvm_autogenerated/select.wast index 3de8bbf43..73a480309 100644 --- a/test/llvm_autogenerated/select.wast +++ b/test/llvm_autogenerated/select.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -14,8 +15,6 @@ (export "select_f64_bool" (func $select_f64_bool)) (export "select_f64_eq" (func $select_f64_eq)) (export "select_f64_ne" (func $select_f64_ne)) - (table 0 anyfunc) - (func $select_i32_bool (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (return (select diff --git a/test/llvm_autogenerated/signext-zeroext.wast b/test/llvm_autogenerated/signext-zeroext.wast index d9db2fef4..436dc05de 100644 --- a/test/llvm_autogenerated/signext-zeroext.wast +++ b/test/llvm_autogenerated/signext-zeroext.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -6,8 +7,6 @@ (export "s2z_func" (func $s2z_func)) (export "z2s_call" (func $z2s_call)) (export "s2z_call" (func $s2z_call)) - (table 0 anyfunc) - (func $z2s_func (param $0 i32) (result i32) (return (i32.shr_s diff --git a/test/llvm_autogenerated/store-trunc.wast b/test/llvm_autogenerated/store-trunc.wast index 6fd2f9896..f861018c5 100644 --- a/test/llvm_autogenerated/store-trunc.wast +++ b/test/llvm_autogenerated/store-trunc.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -7,8 +8,6 @@ (export "trunc_i8_i64" (func $trunc_i8_i64)) (export "trunc_i16_i64" (func $trunc_i16_i64)) (export "trunc_i32_i64" (func $trunc_i32_i64)) - (table 0 anyfunc) - (func $trunc_i8_i32 (param $0 i32) (param $1 i32) (i32.store8 (get_local $0) diff --git a/test/llvm_autogenerated/store.wast b/test/llvm_autogenerated/store.wast index d24fb0a18..8ff0f023a 100644 --- a/test/llvm_autogenerated/store.wast +++ b/test/llvm_autogenerated/store.wast @@ -1,4 +1,5 @@ (module + (table 0 anyfunc) (memory $0 1) (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) @@ -6,8 +7,6 @@ (export "sti64" (func $sti64)) (export "stf32" (func $stf32)) (export "stf64" (func $stf64)) - (table 0 anyfunc) - (func $sti32 (param $0 i32) (param $1 i32) (i32.store (get_local $0) diff --git a/test/llvm_autogenerated/switch.wast b/test/llvm_autogenerated/switch.wast index 0fb7d15aa..3a426edd7 100644 --- a/test/llvm_autogenerated/switch.wast +++ b/test/llvm_autogenerated/switch.wast @@ -1,6 +1,4 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$v (func)) (import "env" "foo0" (func $foo0)) (import "env" "foo1" (func $foo1)) @@ -8,11 +6,12 @@ (import "env" "foo3" (func $foo3)) (import "env" "foo4" (func $foo4)) (import "env" "foo5" (func $foo5)) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "bar32" (func $bar32)) (export "bar64" (func $bar64)) - (table 0 anyfunc) - (func $bar32 (param $0 i32) (block $label$0 (br_if $label$0 diff --git a/test/llvm_autogenerated/unreachable.wast b/test/llvm_autogenerated/unreachable.wast index 8d8b57639..30ed5432b 100644 --- a/test/llvm_autogenerated/unreachable.wast +++ b/test/llvm_autogenerated/unreachable.wast @@ -1,14 +1,13 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$v (func)) (import "env" "abort" (func $abort)) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "f1" (func $f1)) (export "f2" (func $f2)) (export "f3" (func $f3)) - (table 0 anyfunc) - (func $f1 (result i32) (call $abort) (unreachable) diff --git a/test/llvm_autogenerated/unused-argument.wast b/test/llvm_autogenerated/unused-argument.wast index efb80c29c..22442eb9c 100644 --- a/test/llvm_autogenerated/unused-argument.wast +++ b/test/llvm_autogenerated/unused-argument.wast @@ -1,14 +1,13 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$i (func (result i32))) (import "env" "return_something" (func $return_something (result i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "unused_first" (func $unused_first)) (export "unused_second" (func $unused_second)) (export "call_something" (func $call_something)) - (table 0 anyfunc) - (func $unused_first (param $0 i32) (param $1 i32) (result i32) (return (get_local $1) diff --git a/test/llvm_autogenerated/userstack.wast b/test/llvm_autogenerated/userstack.wast index 0d7ea4e27..33f45bd40 100644 --- a/test/llvm_autogenerated/userstack.wast +++ b/test/llvm_autogenerated/userstack.wast @@ -1,10 +1,11 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$vi (func (param i32))) (import "env" "ext_func" (func $ext_func (param i32))) (import "env" "ext_func_i32" (func $ext_func_i32 (param i32))) (import "env" "use_i8_star" (func $use_i8_star (param i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "alloca32" (func $alloca32)) (export "alloca3264" (func $alloca3264)) @@ -20,8 +21,6 @@ (export "frameaddress_0" (func $frameaddress_0)) (export "frameaddress_1" (func $frameaddress_1)) (export "inline_asm" (func $inline_asm)) - (table 0 anyfunc) - (func $alloca32 (local $0 i32) (i32.store offset=4 diff --git a/test/llvm_autogenerated/varargs.wast b/test/llvm_autogenerated/varargs.wast index 89c014999..cc4396322 100644 --- a/test/llvm_autogenerated/varargs.wast +++ b/test/llvm_autogenerated/varargs.wast @@ -1,9 +1,10 @@ (module - (memory $0 1) - (data (i32.const 4) "\10\04\00\00") (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (import "env" "callee" (func $callee (param i32))) + (table 0 anyfunc) + (memory $0 1) + (data (i32.const 4) "\10\04\00\00") (export "memory" (memory $0)) (export "start" (func $start)) (export "end" (func $end)) @@ -14,8 +15,6 @@ (export "caller_none" (func $caller_none)) (export "caller_some" (func $caller_some)) (export "startbb" (func $startbb)) - (table 0 anyfunc) - (func $start (param $0 i32) (param $1 i32) (i32.store (get_local $0) diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm index aee3e878c..f3f217292 100644 --- a/test/memorygrowth.fromasm +++ b/test/memorygrowth.fromasm @@ -1,5 +1,4 @@ (module - (data (get_global $memoryBase) "memorygrowth.asm.js") (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) @@ -29,26 +28,8 @@ (import "env" "table" (table 8 8 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $fb)) - (export "_main" (func $Na)) - (export "_pthread_self" (func $ib)) - (export "_memset" (func $hb)) - (export "_malloc" (func $eb)) - (export "_memcpy" (func $jb)) - (export "_fflush" (func $_a)) - (export "___errno_location" (func $Qa)) - (export "runPostSets" (func $gb)) - (export "stackAlloc" (func $Ea)) - (export "stackSave" (func $Fa)) - (export "stackRestore" (func $Ga)) - (export "establishStackSpace" (func $Ha)) - (export "setThrew" (func $Ia)) - (export "setTempRet0" (func $La)) - (export "getTempRet0" (func $Ma)) - (export "dynCall_ii" (func $kb)) - (export "dynCall_iiii" (func $lb)) - (export "dynCall_vi" (func $mb)) - (export "__growWasmMemory" (func $__growWasmMemory)) + (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) + (data (get_global $memoryBase) "memorygrowth.asm.js") (global $r (mut i32) (get_global $r$asm2wasm$import)) (global $s (mut i32) (get_global $s$asm2wasm$import)) (global $t (mut i32) (get_global $t$asm2wasm$import)) @@ -79,7 +60,26 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) + (export "_free" (func $fb)) + (export "_main" (func $Na)) + (export "_pthread_self" (func $ib)) + (export "_memset" (func $hb)) + (export "_malloc" (func $eb)) + (export "_memcpy" (func $jb)) + (export "_fflush" (func $_a)) + (export "___errno_location" (func $Qa)) + (export "runPostSets" (func $gb)) + (export "stackAlloc" (func $Ea)) + (export "stackSave" (func $Fa)) + (export "stackRestore" (func $Ga)) + (export "establishStackSpace" (func $Ha)) + (export "setThrew" (func $Ia)) + (export "setTempRet0" (func $La)) + (export "getTempRet0" (func $Ma)) + (export "dynCall_ii" (func $kb)) + (export "dynCall_iiii" (func $lb)) + (export "dynCall_vi" (func $mb)) + (export "__growWasmMemory" (func $__growWasmMemory)) (func $eb (param $0 i32) (result i32) (local $1 i32) (local $2 i32) diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise index 433c0c2a4..882197b46 100644 --- a/test/memorygrowth.fromasm.imprecise +++ b/test/memorygrowth.fromasm.imprecise @@ -27,26 +27,7 @@ (import "env" "table" (table 8 8 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $fb)) - (export "_main" (func $Na)) - (export "_pthread_self" (func $ib)) - (export "_memset" (func $hb)) - (export "_malloc" (func $eb)) - (export "_memcpy" (func $jb)) - (export "_fflush" (func $_a)) - (export "___errno_location" (func $Qa)) - (export "runPostSets" (func $gb)) - (export "stackAlloc" (func $Ea)) - (export "stackSave" (func $Fa)) - (export "stackRestore" (func $Ga)) - (export "establishStackSpace" (func $Ha)) - (export "setThrew" (func $Ia)) - (export "setTempRet0" (func $La)) - (export "getTempRet0" (func $Ma)) - (export "dynCall_ii" (func $kb)) - (export "dynCall_iiii" (func $lb)) - (export "dynCall_vi" (func $mb)) - (export "__growWasmMemory" (func $__growWasmMemory)) + (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (global $r (mut i32) (get_global $r$asm2wasm$import)) (global $s (mut i32) (get_global $s$asm2wasm$import)) (global $t (mut i32) (get_global $t$asm2wasm$import)) @@ -77,7 +58,26 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) + (export "_free" (func $fb)) + (export "_main" (func $Na)) + (export "_pthread_self" (func $ib)) + (export "_memset" (func $hb)) + (export "_malloc" (func $eb)) + (export "_memcpy" (func $jb)) + (export "_fflush" (func $_a)) + (export "___errno_location" (func $Qa)) + (export "runPostSets" (func $gb)) + (export "stackAlloc" (func $Ea)) + (export "stackSave" (func $Fa)) + (export "stackRestore" (func $Ga)) + (export "establishStackSpace" (func $Ha)) + (export "setThrew" (func $Ia)) + (export "setTempRet0" (func $La)) + (export "getTempRet0" (func $Ma)) + (export "dynCall_ii" (func $kb)) + (export "dynCall_iiii" (func $lb)) + (export "dynCall_vi" (func $mb)) + (export "__growWasmMemory" (func $__growWasmMemory)) (func $eb (param $0 i32) (result i32) (local $1 i32) (local $2 i32) diff --git a/test/memorygrowth.fromasm.imprecise.no-opts b/test/memorygrowth.fromasm.imprecise.no-opts index 37879d6a4..54ae2646d 100644 --- a/test/memorygrowth.fromasm.imprecise.no-opts +++ b/test/memorygrowth.fromasm.imprecise.no-opts @@ -27,26 +27,7 @@ (import "env" "table" (table 8 8 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $fb)) - (export "_main" (func $Na)) - (export "_pthread_self" (func $ib)) - (export "_memset" (func $hb)) - (export "_malloc" (func $eb)) - (export "_memcpy" (func $jb)) - (export "_fflush" (func $_a)) - (export "___errno_location" (func $Qa)) - (export "runPostSets" (func $gb)) - (export "stackAlloc" (func $Ea)) - (export "stackSave" (func $Fa)) - (export "stackRestore" (func $Ga)) - (export "establishStackSpace" (func $Ha)) - (export "setThrew" (func $Ia)) - (export "setTempRet0" (func $La)) - (export "getTempRet0" (func $Ma)) - (export "dynCall_ii" (func $kb)) - (export "dynCall_iiii" (func $lb)) - (export "dynCall_vi" (func $mb)) - (export "__growWasmMemory" (func $__growWasmMemory)) + (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (global $r (mut i32) (get_global $r$asm2wasm$import)) (global $s (mut i32) (get_global $s$asm2wasm$import)) (global $t (mut i32) (get_global $t$asm2wasm$import)) @@ -77,7 +58,26 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) + (export "_free" (func $fb)) + (export "_main" (func $Na)) + (export "_pthread_self" (func $ib)) + (export "_memset" (func $hb)) + (export "_malloc" (func $eb)) + (export "_memcpy" (func $jb)) + (export "_fflush" (func $_a)) + (export "___errno_location" (func $Qa)) + (export "runPostSets" (func $gb)) + (export "stackAlloc" (func $Ea)) + (export "stackSave" (func $Fa)) + (export "stackRestore" (func $Ga)) + (export "establishStackSpace" (func $Ha)) + (export "setThrew" (func $Ia)) + (export "setTempRet0" (func $La)) + (export "getTempRet0" (func $Ma)) + (export "dynCall_ii" (func $kb)) + (export "dynCall_iiii" (func $lb)) + (export "dynCall_vi" (func $mb)) + (export "__growWasmMemory" (func $__growWasmMemory)) (func $eb (param $a i32) (result i32) (local $b i32) (local $c i32) diff --git a/test/memorygrowth.fromasm.no-opts b/test/memorygrowth.fromasm.no-opts index 5583a6238..a595d965d 100644 --- a/test/memorygrowth.fromasm.no-opts +++ b/test/memorygrowth.fromasm.no-opts @@ -28,26 +28,7 @@ (import "env" "table" (table 8 8 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "_free" (func $fb)) - (export "_main" (func $Na)) - (export "_pthread_self" (func $ib)) - (export "_memset" (func $hb)) - (export "_malloc" (func $eb)) - (export "_memcpy" (func $jb)) - (export "_fflush" (func $_a)) - (export "___errno_location" (func $Qa)) - (export "runPostSets" (func $gb)) - (export "stackAlloc" (func $Ea)) - (export "stackSave" (func $Fa)) - (export "stackRestore" (func $Ga)) - (export "establishStackSpace" (func $Ha)) - (export "setThrew" (func $Ia)) - (export "setTempRet0" (func $La)) - (export "getTempRet0" (func $Ma)) - (export "dynCall_ii" (func $kb)) - (export "dynCall_iiii" (func $lb)) - (export "dynCall_vi" (func $mb)) - (export "__growWasmMemory" (func $__growWasmMemory)) + (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (global $r (mut i32) (get_global $r$asm2wasm$import)) (global $s (mut i32) (get_global $s$asm2wasm$import)) (global $t (mut i32) (get_global $t$asm2wasm$import)) @@ -78,7 +59,26 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) + (export "_free" (func $fb)) + (export "_main" (func $Na)) + (export "_pthread_self" (func $ib)) + (export "_memset" (func $hb)) + (export "_malloc" (func $eb)) + (export "_memcpy" (func $jb)) + (export "_fflush" (func $_a)) + (export "___errno_location" (func $Qa)) + (export "runPostSets" (func $gb)) + (export "stackAlloc" (func $Ea)) + (export "stackSave" (func $Fa)) + (export "stackRestore" (func $Ga)) + (export "establishStackSpace" (func $Ha)) + (export "setThrew" (func $Ia)) + (export "setTempRet0" (func $La)) + (export "getTempRet0" (func $Ma)) + (export "dynCall_ii" (func $kb)) + (export "dynCall_iiii" (func $lb)) + (export "dynCall_vi" (func $mb)) + (export "__growWasmMemory" (func $__growWasmMemory)) (func $eb (param $a i32) (result i32) (local $b i32) (local $c i32) diff --git a/test/min.fromasm b/test/min.fromasm index d53950b92..0ce8573af 100644 --- a/test/min.fromasm +++ b/test/min.fromasm @@ -1,14 +1,14 @@ (module - (data (get_global $memoryBase) "min.asm.js") (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32)) (import "env" "memory" (memory $0 256 256)) (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "floats" (func $floats)) - (export "getTempRet0" (func $ub)) + (data (get_global $memoryBase) "min.asm.js") (global $tDP (mut i32) (get_global $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) + (export "floats" (func $floats)) + (export "getTempRet0" (func $ub)) (func $floats (param $0 f32) (result f32) (local $1 f32) (f32.add diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise index 3ac6ba12f..30f58d884 100644 --- a/test/min.fromasm.imprecise +++ b/test/min.fromasm.imprecise @@ -4,10 +4,10 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "floats" (func $floats)) - (export "getTempRet0" (func $ub)) (global $tDP (mut i32) (get_global $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) + (export "floats" (func $floats)) + (export "getTempRet0" (func $ub)) (func $floats (param $0 f32) (result f32) (local $1 f32) (f32.add diff --git a/test/min.fromasm.imprecise.no-opts b/test/min.fromasm.imprecise.no-opts index 133f734ad..8244c4c70 100644 --- a/test/min.fromasm.imprecise.no-opts +++ b/test/min.fromasm.imprecise.no-opts @@ -4,10 +4,10 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "floats" (func $floats)) - (export "getTempRet0" (func $ub)) (global $tDP (mut i32) (get_global $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) + (export "floats" (func $floats)) + (export "getTempRet0" (func $ub)) (func $floats (param $f f32) (result f32) (local $t f32) (return diff --git a/test/min.fromasm.no-opts b/test/min.fromasm.no-opts index 133f734ad..8244c4c70 100644 --- a/test/min.fromasm.no-opts +++ b/test/min.fromasm.no-opts @@ -4,10 +4,10 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "floats" (func $floats)) - (export "getTempRet0" (func $ub)) (global $tDP (mut i32) (get_global $tDP$asm2wasm$import)) (global $M (mut i32) (i32.const 0)) + (export "floats" (func $floats)) + (export "getTempRet0" (func $ub)) (func $floats (param $f f32) (result f32) (local $t f32) (return diff --git a/test/min.wast b/test/min.wast index 0a101594f..28a1b1b89 100644 --- a/test/min.wast +++ b/test/min.wast @@ -1,9 +1,9 @@ (module - (memory $0 256 256) (type $0 (func (param f32) (result f32))) (type $1 (func (param i32 i32) (result f32))) (type $2 (func (param i32) (result i32))) (type $3 (func (param i32 i32 i32) (result i32))) + (memory $0 256 256) (export "floats" (func $floats)) (func $floats (type $0) (param $f f32) (result f32) (local $t f32) diff --git a/test/min.wast.fromBinary b/test/min.wast.fromBinary index 2dd495580..46336ca70 100644 --- a/test/min.wast.fromBinary +++ b/test/min.wast.fromBinary @@ -1,9 +1,9 @@ (module - (memory $0 256 256) (type $0 (func (param f32) (result f32))) (type $1 (func (param i32 i32) (result f32))) (type $2 (func (param i32) (result i32))) (type $3 (func (param i32 i32 i32) (result i32))) + (memory $0 256 256) (export "floats" (func $floats)) (func $floats (type $0) (param $var$0 f32) (result f32) (local $var$1 f32) diff --git a/test/min.wast.fromBinary.noDebugInfo b/test/min.wast.fromBinary.noDebugInfo index 731d6095d..eae45c8a6 100644 --- a/test/min.wast.fromBinary.noDebugInfo +++ b/test/min.wast.fromBinary.noDebugInfo @@ -1,9 +1,9 @@ (module - (memory $0 256 256) (type $0 (func (param f32) (result f32))) (type $1 (func (param i32 i32) (result f32))) (type $2 (func (param i32) (result i32))) (type $3 (func (param i32 i32 i32) (result i32))) + (memory $0 256 256) (export "floats" (func $0)) (func $0 (type $0) (param $var$0 f32) (result f32) (local $var$1 f32) diff --git a/test/passes/O.txt b/test/passes/O.txt index 855e736ff..531712311 100644 --- a/test/passes/O.txt +++ b/test/passes/O.txt @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func (result i32))) + (memory $0 0) (func $ret (type $0) (result i32) (block $out i32 (drop diff --git a/test/passes/coalesce-locals-learning.txt b/test/passes/coalesce-locals-learning.txt index ae9843094..49afc98ec 100644 --- a/test/passes/coalesce-locals-learning.txt +++ b/test/passes/coalesce-locals-learning.txt @@ -1,11 +1,11 @@ (module - (memory $0 10) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (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) (func $nothing-to-do (type $2) (local $0 i32) (nop) diff --git a/test/passes/coalesce-locals.txt b/test/passes/coalesce-locals.txt index 4306adef8..1f89b9fa7 100644 --- a/test/passes/coalesce-locals.txt +++ b/test/passes/coalesce-locals.txt @@ -1,11 +1,11 @@ (module - (memory $0 10) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (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) (func $nothing-to-do (type $2) (local $0 i32) (nop) diff --git a/test/passes/dce.txt b/test/passes/dce.txt index 4128a9c98..edcaaa749 100644 --- a/test/passes/dce.txt +++ b/test/passes/dce.txt @@ -1,11 +1,11 @@ (module - (memory $0 10) (type $ii (func (param i32 i32))) (type $1 (func)) (type $2 (func (result i32))) (type $3 (func (param i32) (result i32))) (table 1 1 anyfunc) (elem (i32.const 0) $call-me) + (memory $0 10) (func $call-me (type $ii) (param $0 i32) (param $1 i32) (nop) ) diff --git a/test/passes/dce_vacuum.txt b/test/passes/dce_vacuum.txt index 876eb3c34..8009fa89f 100644 --- a/test/passes/dce_vacuum.txt +++ b/test/passes/dce_vacuum.txt @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func (result i32))) + (memory $0 0) (func $__Z12serveroptionPc (type $0) (result i32) (block $switch$0 (return diff --git a/test/passes/duplicate-function-elimination.txt b/test/passes/duplicate-function-elimination.txt index 5d827d134..7c30dfa64 100644 --- a/test/passes/duplicate-function-elimination.txt +++ b/test/passes/duplicate-function-elimination.txt @@ -1,13 +1,13 @@ (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (nop) ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (i32.const 0) @@ -18,8 +18,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (drop (i32.const 0) @@ -27,8 +27,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (i32.const 0) @@ -41,13 +41,13 @@ ) ) (module - (memory $0 0) - (start $keep2) (type $0 (func)) - (export "keep2" (func $keep2)) - (export "other" (func $keep2)) (table 3 3 anyfunc) (elem (i32.const 0) $keep2 $keep2 $caller) + (memory $0 0) + (export "keep2" (func $keep2)) + (export "other" (func $keep2)) + (start $keep2) (func $keep2 (type $0) (nop) ) @@ -57,8 +57,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2-after-two-passes (type $0) (nop) ) @@ -67,8 +67,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep-4 (type $0) (nop) ) @@ -83,11 +83,11 @@ ) ) (module - (memory $0 0) (type $T (func (result i32))) (type $S (func (result i32))) (type $2 (func)) (type $3 (func (param i32))) + (memory $0 0) (func $keep4-similar-but-func-sig-differs (type $2) (drop (i32.const 0) @@ -106,9 +106,9 @@ ) ) (module - (memory $0 0) (type $S (func (result i32))) (type $1 (func (param i32))) + (memory $0 0) (func $keep2-similar-but-func-sig-differs (type $1) (param $i i32) (drop (i32.const 0) @@ -119,8 +119,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (nop) ) @@ -130,16 +130,16 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (block $block0 ) ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $block0 ) @@ -151,8 +151,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (block $block0 (nop) @@ -160,8 +160,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $block0 (nop) @@ -175,8 +175,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $block0 (nop) @@ -189,16 +189,16 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase-since-block-names-do-not-matter (type $0) (block $foo ) ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase-since-block-names-do-not-matter (type $0) (block $foo (br $foo) @@ -209,8 +209,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $foo (block $block @@ -233,8 +233,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $foo (br_if $foo @@ -251,8 +251,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (block $foo (br_if $foo @@ -262,8 +262,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $foo (br_table $foo $foo @@ -280,8 +280,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (loop $bar (nop) @@ -289,8 +289,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (block $foo i32 @@ -313,8 +313,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (block $foo (block $bar @@ -326,8 +326,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (block $foo (block $bar @@ -348,15 +348,15 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (call $erase) ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2-but-in-theory-we-could-erase (type $0) (call $keep2-but-in-theory-we-could-erase) ) @@ -365,19 +365,19 @@ ) ) (module - (memory $0 0) (type $FUNCSIG$v (func)) (import "env" "i" (func $i)) (import "env" "j" (func $j)) + (memory $0 0) (func $erase (type $FUNCSIG$v) (call $i) ) ) (module - (memory $0 0) (type $FUNCSIG$v (func)) (import "env" "i" (func $i)) (import "env" "j" (func $j)) + (memory $0 0) (func $keep2 (type $FUNCSIG$v) (call $i) ) @@ -386,10 +386,10 @@ ) ) (module - (memory $0 0) (type $T (func)) (table 2 2 anyfunc) (elem (i32.const 0) $erase $erase) + (memory $0 0) (func $erase (type $T) (call_indirect $T (i32.const 0) @@ -397,10 +397,10 @@ ) ) (module - (memory $0 0) (type $T (func)) (table 2 2 anyfunc) (elem (i32.const 0) $keep2 $other) + (memory $0 0) (func $keep2 (type $T) (call_indirect $T (i32.const 0) @@ -413,11 +413,11 @@ ) ) (module - (memory $0 0) (type $T (func)) (type $S (func)) (table 2 2 anyfunc) (elem (i32.const 0) $keep2 $other) + (memory $0 0) (func $keep2 (type $T) (call_indirect $T (i32.const 0) @@ -430,8 +430,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase-even-locals-with-different-names (type $0) (local $i i32) (drop @@ -440,8 +440,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (local $i i32) (drop @@ -456,8 +456,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase-even-locals-with-different-names (type $0) (local $i i32) (set_local $i @@ -466,8 +466,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (local $i i32) (set_local $i @@ -482,8 +482,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (local $i i32) (set_local $i @@ -498,8 +498,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $erase (type $0) (drop (i32.load @@ -514,8 +514,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (drop (i32.load offset=3 @@ -532,8 +532,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (drop (i32.load16_s offset=3 @@ -550,8 +550,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (drop (i32.load16_s @@ -568,8 +568,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (drop (i32.load16_s offset=3 @@ -586,8 +586,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (drop (i32.load16_u offset=3 @@ -604,8 +604,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $erase (type $0) (i32.store (i32.const 0) @@ -618,8 +618,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (i32.store offset=3 (i32.const 0) @@ -634,8 +634,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (i32.store16 offset=3 (i32.const 0) @@ -650,8 +650,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (i32.store16 (i32.const 0) @@ -666,8 +666,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (i32.store16 offset=3 (i32.const 0) @@ -682,8 +682,8 @@ ) ) (module - (memory $0 10) (type $0 (func)) + (memory $0 10) (func $keep2 (type $0) (i32.store16 offset=3 (i32.const 0) @@ -698,8 +698,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (i32.const 0) @@ -712,8 +712,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (i32.const 0) @@ -726,8 +726,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (i32.const 0) @@ -740,8 +740,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (i64.const 0) @@ -754,8 +754,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f32.const 0.10000000149011612) @@ -768,8 +768,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f64.const 0.1) @@ -782,8 +782,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (drop (f32.abs @@ -793,8 +793,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f32.abs @@ -811,8 +811,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f32.abs @@ -829,8 +829,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (drop (f32.add @@ -841,8 +841,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f32.add @@ -861,8 +861,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f32.add @@ -881,8 +881,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep2 (type $0) (drop (f32.add @@ -901,8 +901,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (drop (select @@ -914,8 +914,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep (type $0) (drop (select @@ -936,8 +936,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep (type $0) (drop (select @@ -958,8 +958,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep (type $0) (drop (select @@ -980,15 +980,15 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (return) ) ) (module - (memory $0 0) (type $0 (func (result i32))) + (memory $0 0) (func $erase (type $0) (result i32) (return (i32.const 0) @@ -996,8 +996,8 @@ ) ) (module - (memory $0 0) (type $0 (func (result i32))) + (memory $0 0) (func $keep (type $0) (result i32) (return (i32.const 0) @@ -1010,8 +1010,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (drop (current_memory) @@ -1019,8 +1019,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $erase (type $0) (drop (grow_memory @@ -1030,8 +1030,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep (type $0) (drop (grow_memory @@ -1048,8 +1048,8 @@ ) ) (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $keep (type $0) (drop (current_memory) diff --git a/test/passes/metrics.txt b/test/passes/metrics.txt index 24a2dd381..041c79872 100644 --- a/test/passes/metrics.txt +++ b/test/passes/metrics.txt @@ -8,8 +8,8 @@ Counts drop : 6 if : 4 (module - (memory $0 256 256) (type $0 (func (param i32))) + (memory $0 256 256) (func $ifs (type $0) (param $x i32) (local $y f32) (block $block0 diff --git a/test/passes/nm.txt b/test/passes/nm.txt index ebd12edd4..00bdf4a6c 100644 --- a/test/passes/nm.txt +++ b/test/passes/nm.txt @@ -2,8 +2,8 @@ $b : 5 $c : 13 (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $a (type $0) (nop) ) diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index 611b16e41..bda6fd97f 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func (param i32 i64))) + (memory $0 0) (func $f (type $0) (param $i1 i32) (param $i2 i64) (if (i32.eqz diff --git a/test/passes/post-emscripten.txt b/test/passes/post-emscripten.txt index f51111524..a2acbbb28 100644 --- a/test/passes/post-emscripten.txt +++ b/test/passes/post-emscripten.txt @@ -1,6 +1,6 @@ (module - (memory $0 256 256) (type $0 (func (param i32))) + (memory $0 256 256) (func $b0 (type $0) (param $x i32) (drop (i32.load offset=1 diff --git a/test/passes/precompute.txt b/test/passes/precompute.txt index de18b9721..e7fc6526f 100644 --- a/test/passes/precompute.txt +++ b/test/passes/precompute.txt @@ -1,8 +1,8 @@ (module - (memory $0 0) (type $0 (func (param i32))) (type $1 (func (result i32))) (type $2 (func)) + (memory $0 0) (func $x (type $0) (param $x i32) (nop) (drop diff --git a/test/passes/remove-imports.txt b/test/passes/remove-imports.txt index 9ae45a593..f4fe439bc 100644 --- a/test/passes/remove-imports.txt +++ b/test/passes/remove-imports.txt @@ -1,8 +1,8 @@ (module - (memory $0 1024 1024) (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$d (func (result f64))) + (memory $0 1024 1024) (func $nada (type $FUNCSIG$v) (nop) (drop diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt index 43da58c88..3661ef9ae 100644 --- a/test/passes/remove-unused-brs.txt +++ b/test/passes/remove-unused-brs.txt @@ -1,10 +1,10 @@ (module - (memory $0 256 256) (type $0 (func (param i32))) (type $1 (func)) (type $2 (func (result i32))) (type $3 (func (param i32 i32) (result i32))) (type $4 (func (param i32 i32))) + (memory $0 256 256) (func $b0-yes (type $0) (param $i1 i32) (block $topmost ) diff --git a/test/passes/remove-unused-functions.txt b/test/passes/remove-unused-functions.txt index 5e5aa1349..0e3cef1b9 100644 --- a/test/passes/remove-unused-functions.txt +++ b/test/passes/remove-unused-functions.txt @@ -1,10 +1,10 @@ (module - (memory $0 0) - (start $start) (type $0 (func)) - (export "exported" (func $exported)) (table 1 1 anyfunc) (elem (i32.const 0) $called_indirect) + (memory $0 0) + (export "exported" (func $exported)) + (start $start) (func $start (type $0) (call $called0) ) diff --git a/test/passes/remove-unused-names.txt b/test/passes/remove-unused-names.txt index a5d2e1f0c..d1399d552 100644 --- a/test/passes/remove-unused-names.txt +++ b/test/passes/remove-unused-names.txt @@ -1,7 +1,7 @@ (module - (memory $0 256 256) (type $0 (func (param i32) (result i32))) (type $1 (func)) + (memory $0 256 256) (func $b0 (type $0) (param $i1 i32) (result i32) (i32.const 0) ) diff --git a/test/passes/remove-unused-names_merge-blocks.txt b/test/passes/remove-unused-names_merge-blocks.txt index 55abcfe7f..0d13bcaa3 100644 --- a/test/passes/remove-unused-names_merge-blocks.txt +++ b/test/passes/remove-unused-names_merge-blocks.txt @@ -1,11 +1,11 @@ (module - (memory $0 256 256) (type $i (func (param i32))) (type $ii (func (param i32 i32))) (type $iii (func (param i32 i32 i32))) (type $3 (func)) (table 1 1 anyfunc) (elem (i32.const 0) $call-i) + (memory $0 256 256) (func $call-i (type $i) (param $0 i32) (nop) ) diff --git a/test/passes/remove-unused-names_vacuum.txt b/test/passes/remove-unused-names_vacuum.txt index 3819fcbec..4da159f92 100644 --- a/test/passes/remove-unused-names_vacuum.txt +++ b/test/passes/remove-unused-names_vacuum.txt @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func (result i32))) + (memory $0 0) (func $return-i32-but-body-is-unreachable3 (type $0) (result i32) (local $label i32) (unreachable) diff --git a/test/passes/reorder-functions.txt b/test/passes/reorder-functions.txt index ae12e0797..db222d6df 100644 --- a/test/passes/reorder-functions.txt +++ b/test/passes/reorder-functions.txt @@ -1,6 +1,6 @@ (module - (memory $0 256 256) (type $0 (func)) + (memory $0 256 256) (func $c (type $0) (call $c) (call $c) diff --git a/test/passes/reorder-locals.txt b/test/passes/reorder-locals.txt index cd8ca37e5..6c12c9e9e 100644 --- a/test/passes/reorder-locals.txt +++ b/test/passes/reorder-locals.txt @@ -1,7 +1,7 @@ (module - (memory $0 256 256) (type $0 (func (param i32 i32))) (type $1 (func)) + (memory $0 256 256) (func $b0-yes (type $0) (param $a i32) (param $b i32) (local $z i32) (local $y i32) diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt index 359f46cb1..4fed54992 100644 --- a/test/passes/simplify-locals.txt +++ b/test/passes/simplify-locals.txt @@ -1,5 +1,4 @@ (module - (memory $0 256 256) (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) @@ -15,6 +14,7 @@ (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 $b0-yes (type $4) (param $i1 i32) (local $x i32) (local $y i32) diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt index 0c2feeb09..e89321f74 100644 --- a/test/passes/vacuum.txt +++ b/test/passes/vacuum.txt @@ -1,5 +1,4 @@ (module - (memory $0 256 256) (type $0 (func)) (type $1 (func (param i32))) (type $2 (func (result f32))) @@ -7,6 +6,7 @@ (type $4 (func (param i32 f64 i32 i32))) (type $FUNCSIG$i (func (result i32))) (import "env" "int" (func $int (result i32))) + (memory $0 256 256) (global $Int i32 (i32.const 0)) (func $b (type $0) (nop) diff --git a/test/reg_switch.wast b/test/reg_switch.wast index 4a17d6590..3bae4683d 100644 --- a/test/reg_switch.wast +++ b/test/reg_switch.wast @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $0 (type $0) (if (i32.const 0) diff --git a/test/reg_switch.wast.fromBinary b/test/reg_switch.wast.fromBinary index ba51e89f4..9b8d82b79 100644 --- a/test/reg_switch.wast.fromBinary +++ b/test/reg_switch.wast.fromBinary @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $0 (type $0) (if (i32.const 0) diff --git a/test/reg_switch.wast.fromBinary.noDebugInfo b/test/reg_switch.wast.fromBinary.noDebugInfo index ba51e89f4..9b8d82b79 100644 --- a/test/reg_switch.wast.fromBinary.noDebugInfo +++ b/test/reg_switch.wast.fromBinary.noDebugInfo @@ -1,6 +1,6 @@ (module - (memory $0 0) (type $0 (func)) + (memory $0 0) (func $0 (type $0) (if (i32.const 0) diff --git a/test/two_sides.fromasm b/test/two_sides.fromasm index 3f9344720..8b8886727 100644 --- a/test/two_sides.fromasm +++ b/test/two_sides.fromasm @@ -1,11 +1,11 @@ (module - (data (get_global $memoryBase) "two_sides.asm.js") (type $FUNCSIG$id (func (param f64) (result i32))) (import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32))) (import "env" "memory" (memory $0 256 256)) (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (data (get_global $memoryBase) "two_sides.asm.js") (export "_test" (func $_test)) (func $_test (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 f64) diff --git a/test/unit.fromasm b/test/unit.fromasm index b73e38516..9388f0a96 100644 --- a/test/unit.fromasm +++ b/test/unit.fromasm @@ -1,5 +1,4 @@ (module - (data (get_global $memoryBase) "unit.asm.js") (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) @@ -25,8 +24,8 @@ (import "env" "table" (table 10 10 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "big_negative" (func $big_negative)) - (export "pick" (func $big_negative)) + (elem (i32.const 0) $big_negative $big_negative $big_negative $big_negative $big_negative $big_negative $importedDoubles $big_negative $big_negative $cneg) + (data (get_global $memoryBase) "unit.asm.js") (global $t (mut f64) (get_global $t$asm2wasm$import)) (global $u (mut f64) (get_global $u$asm2wasm$import)) (global $Int (mut i32) (i32.const 0)) @@ -34,7 +33,8 @@ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) - (elem (i32.const 0) $big_negative $big_negative $big_negative $big_negative $big_negative $big_negative $importedDoubles $big_negative $big_negative $cneg) + (export "big_negative" (func $big_negative)) + (export "pick" (func $big_negative)) (func $big_negative (nop) ) diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index 84ff8d404..ccf1d5ada 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -20,8 +20,7 @@ (import "env" "table" (table 10 10 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "big_negative" (func $big_negative)) - (export "pick" (func $big_negative)) + (elem (i32.const 0) $big_negative $big_negative $big_negative $big_negative $big_negative $big_negative $importedDoubles $big_negative $big_negative $cneg) (global $t (mut f64) (get_global $t$asm2wasm$import)) (global $u (mut f64) (get_global $u$asm2wasm$import)) (global $Int (mut i32) (i32.const 0)) @@ -29,7 +28,8 @@ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) - (elem (i32.const 0) $big_negative $big_negative $big_negative $big_negative $big_negative $big_negative $importedDoubles $big_negative $big_negative $cneg) + (export "big_negative" (func $big_negative)) + (export "pick" (func $big_negative)) (func $big_negative (nop) ) diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts index 60f2b411d..f62c079ec 100644 --- a/test/unit.fromasm.imprecise.no-opts +++ b/test/unit.fromasm.imprecise.no-opts @@ -20,8 +20,7 @@ (import "env" "table" (table 10 10 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "big_negative" (func $big_negative)) - (export "pick" (func $exportMe)) + (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (global $t (mut f64) (get_global $t$asm2wasm$import)) (global $u (mut f64) (get_global $u$asm2wasm$import)) (global $Int (mut i32) (i32.const 0)) @@ -29,7 +28,8 @@ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) - (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) + (export "big_negative" (func $big_negative)) + (export "pick" (func $exportMe)) (func $big_negative (local $temp f64) (set_local $temp diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts index c48dbd619..6ae0f701a 100644 --- a/test/unit.fromasm.no-opts +++ b/test/unit.fromasm.no-opts @@ -24,8 +24,7 @@ (import "env" "table" (table 10 10 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (export "big_negative" (func $big_negative)) - (export "pick" (func $exportMe)) + (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (global $t (mut f64) (get_global $t$asm2wasm$import)) (global $u (mut f64) (get_global $u$asm2wasm$import)) (global $Int (mut i32) (i32.const 0)) @@ -33,7 +32,8 @@ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) - (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) + (export "big_negative" (func $big_negative)) + (export "pick" (func $exportMe)) (func $big_negative (local $temp f64) (set_local $temp diff --git a/test/unit.wast b/test/unit.wast index 9aa256298..ca90eeeb9 100644 --- a/test/unit.wast +++ b/test/unit.wast @@ -1,6 +1,4 @@ (module - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (type $FUNCSIG$vf (func (param f32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$id (func (param f64) (result i32))) @@ -14,9 +12,11 @@ (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))) - (export "big_negative" (func $big_negative)) (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 (type $FUNCSIG$v) (local $temp f64) (block $block0 diff --git a/test/unit.wast.fromBinary b/test/unit.wast.fromBinary index 0e25dfe07..1f1cf753f 100644 --- a/test/unit.wast.fromBinary +++ b/test/unit.wast.fromBinary @@ -1,6 +1,4 @@ (module - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (type $0 (func (param f32))) (type $1 (func)) (type $2 (func (param f64) (result i32))) @@ -14,9 +12,11 @@ (import "env" "_emscripten_asm_const_vi" (func $import$0)) (import "asm2wasm" "f64-to-int" (func $import$1 (param f64) (result i32))) (import "asm2wasm" "f64-rem" (func $import$2 (param f64 f64) (result f64))) - (export "big_negative" (func $big_negative)) (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 (type $1) (local $var$0 f64) (block $label$0 diff --git a/test/unit.wast.fromBinary.noDebugInfo b/test/unit.wast.fromBinary.noDebugInfo index 0b8ca6b2d..508080e21 100644 --- a/test/unit.wast.fromBinary.noDebugInfo +++ b/test/unit.wast.fromBinary.noDebugInfo @@ -1,6 +1,4 @@ (module - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (type $0 (func (param f32))) (type $1 (func)) (type $2 (func (param f64) (result i32))) @@ -14,9 +12,11 @@ (import "env" "_emscripten_asm_const_vi" (func $import$0)) (import "asm2wasm" "f64-to-int" (func $import$1 (param f64) (result i32))) (import "asm2wasm" "f64-rem" (func $import$2 (param f64 f64) (result f64))) - (export "big_negative" (func $0)) (table 10 anyfunc) (elem (i32.const 0) $17 $0 $17 $17 $18 $18 $1 $18 $17 $15) + (memory $0 4096 4096) + (data (i32.const 1026) "\14\00") + (export "big_negative" (func $0)) (func $0 (type $1) (local $var$0 f64) (block $label$0 diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index ea02d8a16..a2c335b1c 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -1,5 +1,4 @@ (module - (data (get_global $memoryBase) "wasm-only.asm.js") (type $FUNCSIG$vdji (func (param f64 i64 i32))) (type $FUNCSIG$j (func (result i64))) (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) @@ -12,6 +11,7 @@ (import "env" "table" (table 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (data (get_global $memoryBase) "wasm-only.asm.js") (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$result)) |