diff options
87 files changed, 119 insertions, 191 deletions
diff --git a/src/support/archive.cpp b/src/support/archive.cpp index b394294c6..b9ca827e4 100644 --- a/src/support/archive.cpp +++ b/src/support/archive.cpp @@ -129,15 +129,11 @@ std::string Archive::Child::getRawName() const { } Archive::Child Archive::Child::getNext(bool& error) const { - size_t toSkip = len; - // Members are aligned to even byte boundaries. - if (toSkip & 1) ++toSkip; - const uint8_t* nextLoc = data + toSkip; - if (nextLoc >= (uint8_t*)&*parent->data.end()) { // End of the archive. + uint32_t nextOffset = len + (len & 1); // Members are aligned to even byte boundaries. + if ((size_t)(data - (const uint8_t*)parent->data.data() + nextOffset) >= parent->data.size()) { // End of the archive. return Child(); } - - return Child(parent, nextLoc, &error); + return Child(parent, data + nextOffset, &error); } std::string Archive::Child::getName() const { diff --git a/src/tools/s2wasm.cpp b/src/tools/s2wasm.cpp index 8c36a0d58..ef5d276d3 100644 --- a/src/tools/s2wasm.cpp +++ b/src/tools/s2wasm.cpp @@ -132,7 +132,8 @@ int main(int argc, const char *argv[]) { if (options.debug) std::cerr << "Global base " << globalBase << '\n'; Linker linker(globalBase, stackAllocation, initialMem, maxMem, - ignoreUnknownSymbols, startFunction, options.debug); + generateEmscriptenGlue, ignoreUnknownSymbols, startFunction, + options.debug); S2WasmBuilder mainbuilder(input.c_str(), options.debug); linker.linkObject(mainbuilder); diff --git a/src/wasm-linker.cpp b/src/wasm-linker.cpp index 014dfe6a9..56ec03851 100644 --- a/src/wasm-linker.cpp +++ b/src/wasm-linker.cpp @@ -107,14 +107,25 @@ void Linker::layout() { } else { out.wasm.memory.initial = initialMem / Memory::kPageSize; } + out.wasm.memory.exists = true; if (userMaxMemory) out.wasm.memory.max = userMaxMemory / Memory::kPageSize; - auto memoryExport = make_unique<Export>(); - memoryExport->name = MEMORY; - memoryExport->value = Name::fromInt(0); - memoryExport->kind = ExternalKind::Memory; - out.wasm.addExport(memoryExport.release()); + if (importMemory) { + auto memoryImport = make_unique<Import>(); + memoryImport->name = MEMORY; + memoryImport->module = ENV; + memoryImport->base = MEMORY; + memoryImport->kind = ExternalKind::Memory; + out.wasm.memory.imported = true; + out.wasm.addImport(memoryImport.release()); + } else { + auto memoryExport = make_unique<Export>(); + memoryExport->name = MEMORY; + memoryExport->value = Name::fromInt(0); + memoryExport->kind = ExternalKind::Memory; + out.wasm.addExport(memoryExport.release()); + } // XXX For now, export all functions marked .globl. for (Name name : out.globls) exportFunction(name, false); diff --git a/src/wasm-linker.h b/src/wasm-linker.h index 4a0e1e0b9..3660b3038 100644 --- a/src/wasm-linker.h +++ b/src/wasm-linker.h @@ -193,18 +193,18 @@ class LinkerObject { // applying the relocations, resulting in an executable wasm module. class Linker { public: - Linker(Address globalBase, Address stackAllocation, - Address userInitialMemory, Address userMaxMemory, - bool ignoreUnknownSymbols, Name startFunction, - bool debug) : - ignoreUnknownSymbols(ignoreUnknownSymbols), - startFunction(startFunction), - globalBase(globalBase), - nextStatic(globalBase), - userInitialMemory(userInitialMemory), - userMaxMemory(userMaxMemory), - stackAllocation(stackAllocation), - debug(debug) { + Linker(Address globalBase, Address stackAllocation, Address userInitialMemory, + Address userMaxMemory, bool importMemory, bool ignoreUnknownSymbols, + Name startFunction, bool debug) + : ignoreUnknownSymbols(ignoreUnknownSymbols), + startFunction(startFunction), + globalBase(globalBase), + nextStatic(globalBase), + userInitialMemory(userInitialMemory), + userMaxMemory(userMaxMemory), + importMemory(importMemory), + stackAllocation(stackAllocation), + debug(debug) { if (userMaxMemory && userMaxMemory < userInitialMemory) { Fatal() << "Specified max memory " << userMaxMemory << " is < specified initial memory " << userInitialMemory; @@ -217,6 +217,7 @@ class Linker { Fatal() << "Specified initial memory " << userInitialMemory << " is not a multiple of 64k"; } + // Don't allow anything to be allocated at address 0 if (globalBase == 0) nextStatic = 1; @@ -312,6 +313,8 @@ class Linker { Address userInitialMemory; // Initial memory size (in bytes) specified by the user. Address userMaxMemory; // Max memory size (in bytes) specified by the user. //(after linking, this is rounded and set on the wasm object in pages) + bool importMemory; // Whether the memory should be imported instead of + // defined. Address stackAllocation; bool debug; diff --git a/test/dot_s/alias.wast b/test/dot_s/alias.wast index 1f450fa57..05e36f1d1 100644 --- a/test/dot_s/alias.wast +++ b/test/dot_s/alias.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$v (func)) + (import "env" "memory" (memory $0 1)) (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") - (export "memory" (memory $0)) (export "__exit" (func $__exit)) (export "__needs_exit" (func $__needs_exit)) (export "dynCall_v" (func $dynCall_v)) diff --git a/test/dot_s/alternate-lcomm.wast b/test/dot_s/alternate-lcomm.wast index c380944ab..aab4adc09 100644 --- a/test/dot_s/alternate-lcomm.wast +++ b/test/dot_s/alternate-lcomm.wast @@ -1,6 +1,5 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) ) ;; METADATA: { "asmConsts": {},"staticBump": 16, "initializers": [] } diff --git a/test/dot_s/asm_const.wast b/test/dot_s/asm_const.wast index 4edc6c476..c9c8c638d 100644 --- a/test/dot_s/asm_const.wast +++ b/test/dot_s/asm_const.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$vi (func (param i32))) + (import "env" "memory" (memory $0 1)) (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)) (func $main (result i32) (call $emscripten_asm_const_vi diff --git a/test/dot_s/basics.wast b/test/dot_s/basics.wast index 3b539fa11..5482fd469 100644 --- a/test/dot_s/basics.wast +++ b/test/dot_s/basics.wast @@ -3,13 +3,12 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (import "env" "puts" (func $puts (param i32))) + (import "env" "memory" (memory $0 1)) (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)) (func $main (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) diff --git a/test/dot_s/bcp-1.wast b/test/dot_s/bcp-1.wast index 5529ce62d..eb1560fa1 100644 --- a/test/dot_s/bcp-1.wast +++ b/test/dot_s/bcp-1.wast @@ -5,9 +5,9 @@ (type $FUNCSIG$vi (func (param i32))) (import "env" "abort" (func $abort)) (import "env" "exit" (func $exit (param i32))) + (import "env" "memory" (memory $0 1)) (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") (data (i32.const 52) "\n\00\00\00\0b\00\00\00") @@ -15,7 +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") - (export "memory" (memory $0)) (export "bad0" (func $bad0)) (export "bad1" (func $bad1)) (export "bad2" (func $bad2)) diff --git a/test/dot_s/data-offset-folding.wast b/test/dot_s/data-offset-folding.wast index 9c179a112..e4e753f59 100644 --- a/test/dot_s/data-offset-folding.wast +++ b/test/dot_s/data-offset-folding.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) ) ;; METADATA: { "asmConsts": {},"staticBump": 420, "initializers": [] } diff --git a/test/dot_s/debug.wast b/test/dot_s/debug.wast index 0d96c92c7..921a2a4d6 100644 --- a/test/dot_s/debug.wast +++ b/test/dot_s/debug.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "fib" (func $fib)) (func $fib (param $0 i32) (result i32) (local $1 i32) diff --git a/test/dot_s/dso_handle.wast b/test/dot_s/dso_handle.wast index e75d11410..673ec4d3e 100644 --- a/test/dot_s/dso_handle.wast +++ b/test/dot_s/dso_handle.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (func $main (result i32) (return diff --git a/test/dot_s/dyncall.wast b/test/dot_s/dyncall.wast index 40d36f73a..fb1c1b5ee 100644 --- a/test/dot_s/dyncall.wast +++ b/test/dot_s/dyncall.wast @@ -4,10 +4,9 @@ (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))) + (import "env" "memory" (memory $0 1)) (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)) (export "vd" (func $vd)) diff --git a/test/dot_s/exit.wast b/test/dot_s/exit.wast index 9e71a9bdc..6213612fc 100644 --- a/test/dot_s/exit.wast +++ b/test/dot_s/exit.wast @@ -1,9 +1,8 @@ (module (type $FUNCSIG$vi (func (param i32))) (import "env" "exit" (func $exit (param i32))) + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (func $main (result i32) (local $0 i32) diff --git a/test/dot_s/export_malloc_free.wast b/test/dot_s/export_malloc_free.wast index 22ae51549..96bcdf4ac 100644 --- a/test/dot_s/export_malloc_free.wast +++ b/test/dot_s/export_malloc_free.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (export "malloc" (func $malloc)) (export "free" (func $free)) diff --git a/test/dot_s/fix_em_ehsjlj_names.wast b/test/dot_s/fix_em_ehsjlj_names.wast index fb1722a68..ff13f635e 100644 --- a/test/dot_s/fix_em_ehsjlj_names.wast +++ b/test/dot_s/fix_em_ehsjlj_names.wast @@ -12,10 +12,9 @@ (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))) + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/dot_s/function-data-sections.wast b/test/dot_s/function-data-sections.wast index f634ec38e..f50c7c9cb 100644 --- a/test/dot_s/function-data-sections.wast +++ b/test/dot_s/function-data-sections.wast @@ -1,10 +1,9 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 12) "\00\00\00\00") (data (i32.const 16) "\01\00\00\00") (data (i32.const 20) "33\13@") - (export "memory" (memory $0)) (export "foo" (func $foo)) (export "bar" (func $bar)) (export "qux" (func $qux)) diff --git a/test/dot_s/hostFinalize.wast b/test/dot_s/hostFinalize.wast index 97ba45498..c3953823a 100644 --- a/test/dot_s/hostFinalize.wast +++ b/test/dot_s/hostFinalize.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (func $_main (drop (grow_memory diff --git a/test/dot_s/indidx.wast b/test/dot_s/indidx.wast index c96043b0c..e3dedd2b5 100644 --- a/test/dot_s/indidx.wast +++ b/test/dot_s/indidx.wast @@ -2,11 +2,10 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$v (func)) (import "env" "getchar" (func $getchar (result i32))) + (import "env" "memory" (memory $0 1)) (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)) (func $a (type $FUNCSIG$i) (result i32) diff --git a/test/dot_s/indirect-import.wast b/test/dot_s/indirect-import.wast index 0f1c3b751..64dbe30ae 100644 --- a/test/dot_s/indirect-import.wast +++ b/test/dot_s/indirect-import.wast @@ -7,13 +7,12 @@ (import "env" "extern_ijidf" (func $extern_ijidf (param i64 i32 f64 f32) (result i32))) (import "env" "extern_v" (func $extern_v)) (import "env" "extern_vj" (func $extern_vj (param i64))) + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/dot_s/initializers.wast b/test/dot_s/initializers.wast index 19e7b8c85..857eb37ba 100644 --- a/test/dot_s/initializers.wast +++ b/test/dot_s/initializers.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (export "f1" (func $f1)) (export "f2" (func $f2)) diff --git a/test/dot_s/lcomm-in-text-segment.wast b/test/dot_s/lcomm-in-text-segment.wast index 2442d8f97..344167ba8 100644 --- a/test/dot_s/lcomm-in-text-segment.wast +++ b/test/dot_s/lcomm-in-text-segment.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 20) "\10\00\00\00") - (export "memory" (memory $0)) ) ;; METADATA: { "asmConsts": {},"staticBump": 24, "initializers": [] } diff --git a/test/dot_s/local_align.wast b/test/dot_s/local_align.wast index f25555bb5..a10e205b3 100644 --- a/test/dot_s/local_align.wast +++ b/test/dot_s/local_align.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (func $foo (param $0 i32) ) diff --git a/test/dot_s/macClangMetaData.wast b/test/dot_s/macClangMetaData.wast index f295ec8d0..6a08c523a 100644 --- a/test/dot_s/macClangMetaData.wast +++ b/test/dot_s/macClangMetaData.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "puts" (func $puts (param i32) (result i32))) + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 16) "Hello, World!\00") - (export "memory" (memory $0)) (export "main" (func $main)) (func $main (param $0 i32) (param $1 i32) (result i32) (drop diff --git a/test/dot_s/memops.wast b/test/dot_s/memops.wast index 71c08395f..bb55b5b51 100644 --- a/test/dot_s/memops.wast +++ b/test/dot_s/memops.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$vi (func (param i32))) + (import "env" "memory" (memory $0 1)) (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)) (func $_Z6reporti (param $0 i32) (i32.store diff --git a/test/dot_s/minimal.wast b/test/dot_s/minimal.wast index d9f4c18a6..0babc39df 100644 --- a/test/dot_s/minimal.wast +++ b/test/dot_s/minimal.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (func $main (result i32) (return diff --git a/test/dot_s/permute.wast b/test/dot_s/permute.wast index d72b5bd57..d5db99f1c 100644 --- a/test/dot_s/permute.wast +++ b/test/dot_s/permute.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (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)) ) ;; METADATA: { "asmConsts": {},"staticBump": 272, "initializers": [] } diff --git a/test/dot_s/relocation.wast b/test/dot_s/relocation.wast index 94dc69a3e..0c74aa7b8 100644 --- a/test/dot_s/relocation.wast +++ b/test/dot_s/relocation.wast @@ -1,9 +1,8 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $main (result i32) (local $0 i32) diff --git a/test/dot_s/return.wast b/test/dot_s/return.wast index 339ea275c..896e99357 100644 --- a/test/dot_s/return.wast +++ b/test/dot_s/return.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "return_i32" (func $return_i32)) (export "return_void" (func $return_void)) (func $return_i32 (result i32) diff --git a/test/dot_s/start_main0.wast b/test/dot_s/start_main0.wast index 430da2675..1586e0ed7 100644 --- a/test/dot_s/start_main0.wast +++ b/test/dot_s/start_main0.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (export "_start" (func $_start)) (start $_start) diff --git a/test/dot_s/start_main2.wast b/test/dot_s/start_main2.wast index 014e456a8..ccd48c1f1 100644 --- a/test/dot_s/start_main2.wast +++ b/test/dot_s/start_main2.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (export "_start" (func $_start)) (start $_start) diff --git a/test/dot_s/symbolic-offset.wast b/test/dot_s/symbolic-offset.wast index dafb6b705..3ba10d4c5 100644 --- a/test/dot_s/symbolic-offset.wast +++ b/test/dot_s/symbolic-offset.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $f (param $0 i32) (param $1 i32) (i32.store offset=16 diff --git a/test/dot_s/text_before_type.wast b/test/dot_s/text_before_type.wast index 4a161a6aa..a5a027698 100644 --- a/test/dot_s/text_before_type.wast +++ b/test/dot_s/text_before_type.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "main" (func $main)) (func $main (result i32) (call $foo) diff --git a/test/dot_s/unreachable_blocks.wast b/test/dot_s/unreachable_blocks.wast index a5176e633..3c7b0d158 100644 --- a/test/dot_s/unreachable_blocks.wast +++ b/test/dot_s/unreachable_blocks.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (func $unreachable_block_void (block $label$0 ) diff --git a/test/dot_s/visibilities.wast b/test/dot_s/visibilities.wast index 99670851f..de0f32d90 100644 --- a/test/dot_s/visibilities.wast +++ b/test/dot_s/visibilities.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) - (export "memory" (memory $0)) (export "foo" (func $foo)) (export "bar" (func $bar)) (export "qux" (func $qux)) diff --git a/test/llvm_autogenerated/byval.wast b/test/llvm_autogenerated/byval.wast index 440ec7bf4..660a0557b 100644 --- a/test/llvm_autogenerated/byval.wast +++ b/test/llvm_autogenerated/byval.wast @@ -9,10 +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))) + (import "env" "memory" (memory $0 1)) (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)) (export "byval_arg_double" (func $byval_arg_double)) diff --git a/test/llvm_autogenerated/call.wast b/test/llvm_autogenerated/call.wast index 1fca6c4ab..724d79c5b 100644 --- a/test/llvm_autogenerated/call.wast +++ b/test/llvm_autogenerated/call.wast @@ -13,10 +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)) + (import "env" "memory" (memory $0 1)) (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)) (export "call_float_nullary" (func $call_float_nullary)) diff --git a/test/llvm_autogenerated/cfg-stackify.wast b/test/llvm_autogenerated/cfg-stackify.wast index 6f97cb08d..ab5989f27 100644 --- a/test/llvm_autogenerated/cfg-stackify.wast +++ b/test/llvm_autogenerated/cfg-stackify.wast @@ -6,10 +6,9 @@ (import "env" "something" (func $something)) (import "env" "test15_callee0" (func $test15_callee0)) (import "env" "test15_callee1" (func $test15_callee1)) + (import "env" "memory" (memory $0 1)) (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)) (export "test2" (func $test2)) diff --git a/test/llvm_autogenerated/comparisons_f32.wast b/test/llvm_autogenerated/comparisons_f32.wast index 7a8c1d2dd..b8d5016b3 100644 --- a/test/llvm_autogenerated/comparisons_f32.wast +++ b/test/llvm_autogenerated/comparisons_f32.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "ord_f32" (func $ord_f32)) (export "uno_f32" (func $uno_f32)) (export "oeq_f32" (func $oeq_f32)) diff --git a/test/llvm_autogenerated/comparisons_f64.wast b/test/llvm_autogenerated/comparisons_f64.wast index ae750dd92..1b3b7b6ff 100644 --- a/test/llvm_autogenerated/comparisons_f64.wast +++ b/test/llvm_autogenerated/comparisons_f64.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "ord_f64" (func $ord_f64)) (export "uno_f64" (func $uno_f64)) (export "oeq_f64" (func $oeq_f64)) diff --git a/test/llvm_autogenerated/comparisons_i32.wast b/test/llvm_autogenerated/comparisons_i32.wast index 1ee0c02e7..76977ebe8 100644 --- a/test/llvm_autogenerated/comparisons_i32.wast +++ b/test/llvm_autogenerated/comparisons_i32.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "eq_i32" (func $eq_i32)) (export "ne_i32" (func $ne_i32)) (export "slt_i32" (func $slt_i32)) diff --git a/test/llvm_autogenerated/comparisons_i64.wast b/test/llvm_autogenerated/comparisons_i64.wast index f04f1eedb..179005d7c 100644 --- a/test/llvm_autogenerated/comparisons_i64.wast +++ b/test/llvm_autogenerated/comparisons_i64.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "eq_i64" (func $eq_i64)) (export "ne_i64" (func $ne_i64)) (export "slt_i64" (func $slt_i64)) diff --git a/test/llvm_autogenerated/conv.wast b/test/llvm_autogenerated/conv.wast index a1673e25b..60f158590 100644 --- a/test/llvm_autogenerated/conv.wast +++ b/test/llvm_autogenerated/conv.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "i32_wrap_i64" (func $i32_wrap_i64)) (export "i64_extend_s_i32" (func $i64_extend_s_i32)) (export "i64_extend_u_i32" (func $i64_extend_u_i32)) diff --git a/test/llvm_autogenerated/copysign-casts.wast b/test/llvm_autogenerated/copysign-casts.wast index 43cd8a908..3ea53f947 100644 --- a/test/llvm_autogenerated/copysign-casts.wast +++ b/test/llvm_autogenerated/copysign-casts.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (import "env" "memory" (memory $0 1)) (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)) (func $fold_promote (param $0 f64) (param $1 f32) (result f64) diff --git a/test/llvm_autogenerated/cpus.wast b/test/llvm_autogenerated/cpus.wast index cdef27ee8..1e0803853 100644 --- a/test/llvm_autogenerated/cpus.wast +++ b/test/llvm_autogenerated/cpus.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "f" (func $f)) (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 b41745078..eaf2f9d72 100644 --- a/test/llvm_autogenerated/dead-vreg.wast +++ b/test/llvm_autogenerated/dead-vreg.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "foo" (func $foo)) (func $foo (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) diff --git a/test/llvm_autogenerated/divrem-constant.wast b/test/llvm_autogenerated/divrem-constant.wast index 2d8af57f7..9419b9b25 100644 --- a/test/llvm_autogenerated/divrem-constant.wast +++ b/test/llvm_autogenerated/divrem-constant.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "test_udiv_2" (func $test_udiv_2)) (export "test_udiv_5" (func $test_udiv_5)) (export "test_sdiv_2" (func $test_sdiv_2)) diff --git a/test/llvm_autogenerated/f32.wast b/test/llvm_autogenerated/f32.wast index 2f4811361..c79d1083f 100644 --- a/test/llvm_autogenerated/f32.wast +++ b/test/llvm_autogenerated/f32.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$ffff (func (param f32 f32 f32) (result f32))) (import "env" "fmaf" (func $fmaf (param f32 f32 f32) (result f32))) + (import "env" "memory" (memory $0 1)) (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)) (export "fmul32" (func $fmul32)) diff --git a/test/llvm_autogenerated/f64.wast b/test/llvm_autogenerated/f64.wast index 9d4ed937b..da5f219be 100644 --- a/test/llvm_autogenerated/f64.wast +++ b/test/llvm_autogenerated/f64.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$dddd (func (param f64 f64 f64) (result f64))) (import "env" "fma" (func $fma (param f64 f64 f64) (result f64))) + (import "env" "memory" (memory $0 1)) (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)) (export "fmul64" (func $fmul64)) diff --git a/test/llvm_autogenerated/fast-isel-noreg.wast b/test/llvm_autogenerated/fast-isel-noreg.wast index eaaa78ebb..f092512d0 100644 --- a/test/llvm_autogenerated/fast-isel-noreg.wast +++ b/test/llvm_autogenerated/fast-isel-noreg.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/llvm_autogenerated/fast-isel.wast b/test/llvm_autogenerated/fast-isel.wast index 54701dae3..bc3f6fb39 100644 --- a/test/llvm_autogenerated/fast-isel.wast +++ b/test/llvm_autogenerated/fast-isel.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "immediate_f32" (func $immediate_f32)) (export "immediate_f64" (func $immediate_f64)) (export "bitcast_i32_f32" (func $bitcast_i32_f32)) diff --git a/test/llvm_autogenerated/frem.wast b/test/llvm_autogenerated/frem.wast index 01047d9e8..0f24f3c44 100644 --- a/test/llvm_autogenerated/frem.wast +++ b/test/llvm_autogenerated/frem.wast @@ -3,10 +3,9 @@ (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))) + (import "env" "memory" (memory $0 1)) (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)) (func $frem32 (param $0 f32) (param $1 f32) (result f32) diff --git a/test/llvm_autogenerated/func.wast b/test/llvm_autogenerated/func.wast index 5967904b8..98da2a847 100644 --- a/test/llvm_autogenerated/func.wast +++ b/test/llvm_autogenerated/func.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "f0" (func $f0)) (export "f1" (func $f1)) (export "f2" (func $f2)) diff --git a/test/llvm_autogenerated/global.wast b/test/llvm_autogenerated/global.wast index 459245d7c..670b0c104 100644 --- a/test/llvm_autogenerated/global.wast +++ b/test/llvm_autogenerated/global.wast @@ -1,8 +1,8 @@ (module (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32))) + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\b0\08\00\00") (data (i32.const 12) "9\05\00\00") (data (i32.const 28) "\01\00\00\00") @@ -16,7 +16,6 @@ (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") - (export "memory" (memory $0)) (export "foo" (func $foo)) (export "call_memcpy" (func $call_memcpy)) (func $foo (result i32) diff --git a/test/llvm_autogenerated/globl.wast b/test/llvm_autogenerated/globl.wast index ccdba4ae8..226082d6b 100644 --- a/test/llvm_autogenerated/globl.wast +++ b/test/llvm_autogenerated/globl.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "foo" (func $foo)) (func $foo ) diff --git a/test/llvm_autogenerated/i128.wast b/test/llvm_autogenerated/i128.wast index 2cd971e19..2403b0f91 100644 --- a/test/llvm_autogenerated/i128.wast +++ b/test/llvm_autogenerated/i128.wast @@ -9,10 +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))) + (import "env" "memory" (memory $0 1)) (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)) (export "mul128" (func $mul128)) diff --git a/test/llvm_autogenerated/i32-load-store-alignment.wast b/test/llvm_autogenerated/i32-load-store-alignment.wast index 59f57a0b2..2c8bce025 100644 --- a/test/llvm_autogenerated/i32-load-store-alignment.wast +++ b/test/llvm_autogenerated/i32-load-store-alignment.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "ldi32_a1" (func $ldi32_a1)) (export "ldi32_a2" (func $ldi32_a2)) (export "ldi32_a4" (func $ldi32_a4)) diff --git a/test/llvm_autogenerated/i32.wast b/test/llvm_autogenerated/i32.wast index 2afbfb70b..f90f31919 100644 --- a/test/llvm_autogenerated/i32.wast +++ b/test/llvm_autogenerated/i32.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "add32" (func $add32)) (export "sub32" (func $sub32)) (export "mul32" (func $mul32)) diff --git a/test/llvm_autogenerated/i64-load-store-alignment.wast b/test/llvm_autogenerated/i64-load-store-alignment.wast index 538d1a465..c26d855cc 100644 --- a/test/llvm_autogenerated/i64-load-store-alignment.wast +++ b/test/llvm_autogenerated/i64-load-store-alignment.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "ldi64_a1" (func $ldi64_a1)) (export "ldi64_a2" (func $ldi64_a2)) (export "ldi64_a4" (func $ldi64_a4)) diff --git a/test/llvm_autogenerated/i64.wast b/test/llvm_autogenerated/i64.wast index d04dcadc4..dbfb48016 100644 --- a/test/llvm_autogenerated/i64.wast +++ b/test/llvm_autogenerated/i64.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "add64" (func $add64)) (export "sub64" (func $sub64)) (export "mul64" (func $mul64)) diff --git a/test/llvm_autogenerated/ident.wast b/test/llvm_autogenerated/ident.wast index 4290c684e..ba0ae642d 100644 --- a/test/llvm_autogenerated/ident.wast +++ b/test/llvm_autogenerated/ident.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) ) ;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] } diff --git a/test/llvm_autogenerated/immediates.wast b/test/llvm_autogenerated/immediates.wast index c1e2fdaf4..d71e2ae66 100644 --- a/test/llvm_autogenerated/immediates.wast +++ b/test/llvm_autogenerated/immediates.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "zero_i32" (func $zero_i32)) (export "one_i32" (func $one_i32)) (export "max_i32" (func $max_i32)) diff --git a/test/llvm_autogenerated/indirect-import.wast b/test/llvm_autogenerated/indirect-import.wast index 0af1cf1b0..eb93e29b6 100644 --- a/test/llvm_autogenerated/indirect-import.wast +++ b/test/llvm_autogenerated/indirect-import.wast @@ -8,14 +8,13 @@ (import "env" "extern_ijidf" (func $extern_ijidf (param i64 i32 f64 f32) (result i32))) (import "env" "extern_v" (func $extern_v)) (import "env" "extern_vj" (func $extern_vj (param i64))) + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/llvm_autogenerated/irreducible-cfg.wast b/test/llvm_autogenerated/irreducible-cfg.wast index 223cf1ae9..8712809cc 100644 --- a/test/llvm_autogenerated/irreducible-cfg.wast +++ b/test/llvm_autogenerated/irreducible-cfg.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $test0 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) diff --git a/test/llvm_autogenerated/legalize.wast b/test/llvm_autogenerated/legalize.wast index e5d5887bf..ac4f1ca81 100644 --- a/test/llvm_autogenerated/legalize.wast +++ b/test/llvm_autogenerated/legalize.wast @@ -2,10 +2,9 @@ (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))) + (import "env" "memory" (memory $0 1)) (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)) (export "sext_in_reg_i32_i64" (func $sext_in_reg_i32_i64)) diff --git a/test/llvm_autogenerated/load-ext.wast b/test/llvm_autogenerated/load-ext.wast index f2ebe1943..ff63355c0 100644 --- a/test/llvm_autogenerated/load-ext.wast +++ b/test/llvm_autogenerated/load-ext.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "sext_i8_i32" (func $sext_i8_i32)) (export "zext_i8_i32" (func $zext_i8_i32)) (export "sext_i16_i32" (func $sext_i16_i32)) diff --git a/test/llvm_autogenerated/load-store-i1.wast b/test/llvm_autogenerated/load-store-i1.wast index adfb032a1..b205c9073 100644 --- a/test/llvm_autogenerated/load-store-i1.wast +++ b/test/llvm_autogenerated/load-store-i1.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "load_u_i1_i32" (func $load_u_i1_i32)) (export "load_s_i1_i32" (func $load_s_i1_i32)) (export "load_u_i1_i64" (func $load_u_i1_i64)) diff --git a/test/llvm_autogenerated/load.wast b/test/llvm_autogenerated/load.wast index 22bd0d5f6..8c4b707f5 100644 --- a/test/llvm_autogenerated/load.wast +++ b/test/llvm_autogenerated/load.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "ldi32" (func $ldi32)) (export "ldi64" (func $ldi64)) (export "ldf32" (func $ldf32)) diff --git a/test/llvm_autogenerated/lower-em-ehsjlj-options.wast b/test/llvm_autogenerated/lower-em-ehsjlj-options.wast index e2c020a1e..83f4c1b9a 100644 --- a/test/llvm_autogenerated/lower-em-ehsjlj-options.wast +++ b/test/llvm_autogenerated/lower-em-ehsjlj-options.wast @@ -10,15 +10,14 @@ (import "env" "invoke_v" (func $invoke_v (param i32))) (import "env" "longjmp" (func $longjmp (param i32 i32))) (import "env" "setjmp" (func $setjmp (param i32) (result i32))) + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/llvm_autogenerated/mem-intrinsics.wast b/test/llvm_autogenerated/mem-intrinsics.wast index d0a1996e2..553a3d1b9 100644 --- a/test/llvm_autogenerated/mem-intrinsics.wast +++ b/test/llvm_autogenerated/mem-intrinsics.wast @@ -7,10 +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))) + (import "env" "memory" (memory $0 1)) (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)) (export "move_yes" (func $move_yes)) diff --git a/test/llvm_autogenerated/memory-addr32.wast b/test/llvm_autogenerated/memory-addr32.wast index b6aeb2d76..bb11929fd 100644 --- a/test/llvm_autogenerated/memory-addr32.wast +++ b/test/llvm_autogenerated/memory-addr32.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $current_memory (result i32) diff --git a/test/llvm_autogenerated/negative-base-reg.wast b/test/llvm_autogenerated/negative-base-reg.wast index 5d55462ce..34b1646af 100644 --- a/test/llvm_autogenerated/negative-base-reg.wast +++ b/test/llvm_autogenerated/negative-base-reg.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\90\04\00\00") - (export "memory" (memory $0)) (export "main" (func $main)) (func $main (result i32) (local $0 i32) diff --git a/test/llvm_autogenerated/non-executable-stack.wast b/test/llvm_autogenerated/non-executable-stack.wast index 4290c684e..ba0ae642d 100644 --- a/test/llvm_autogenerated/non-executable-stack.wast +++ b/test/llvm_autogenerated/non-executable-stack.wast @@ -1,7 +1,6 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) ) ;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] } diff --git a/test/llvm_autogenerated/offset.wast b/test/llvm_autogenerated/offset.wast index 6996812ed..a17dd3089 100644 --- a/test/llvm_autogenerated/offset.wast +++ b/test/llvm_autogenerated/offset.wast @@ -1,9 +1,8 @@ (module + (import "env" "memory" (memory $0 1)) (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 "load_i32_with_folded_offset" (func $load_i32_with_folded_offset)) (export "load_i32_with_folded_gep_offset" (func $load_i32_with_folded_gep_offset)) (export "load_i32_with_unfolded_gep_negative_offset" (func $load_i32_with_unfolded_gep_negative_offset)) diff --git a/test/llvm_autogenerated/phi.wast b/test/llvm_autogenerated/phi.wast index 7adfce863..77fd49181 100644 --- a/test/llvm_autogenerated/phi.wast +++ b/test/llvm_autogenerated/phi.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $test0 (param $0 i32) (result i32) diff --git a/test/llvm_autogenerated/reg-stackify.wast b/test/llvm_autogenerated/reg-stackify.wast index c05846045..8c65949e0 100644 --- a/test/llvm_autogenerated/reg-stackify.wast +++ b/test/llvm_autogenerated/reg-stackify.wast @@ -17,11 +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))) + (import "env" "memory" (memory $0 1)) (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)) (export "yes0" (func $yes0)) diff --git a/test/llvm_autogenerated/return-int32.wast b/test/llvm_autogenerated/return-int32.wast index 961c4ec4a..2e1eb5c09 100644 --- a/test/llvm_autogenerated/return-int32.wast +++ b/test/llvm_autogenerated/return-int32.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $return_i32 (param $0 i32) (result i32) diff --git a/test/llvm_autogenerated/return-void.wast b/test/llvm_autogenerated/return-void.wast index 2a4e5fc5a..1dd02f082 100644 --- a/test/llvm_autogenerated/return-void.wast +++ b/test/llvm_autogenerated/return-void.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (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)) (func $return_void diff --git a/test/llvm_autogenerated/select.wast b/test/llvm_autogenerated/select.wast index 73a480309..e86ae9c3d 100644 --- a/test/llvm_autogenerated/select.wast +++ b/test/llvm_autogenerated/select.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "select_i32_bool" (func $select_i32_bool)) (export "select_i32_eq" (func $select_i32_eq)) (export "select_i32_ne" (func $select_i32_ne)) diff --git a/test/llvm_autogenerated/signext-zeroext.wast b/test/llvm_autogenerated/signext-zeroext.wast index 436dc05de..e206eedc2 100644 --- a/test/llvm_autogenerated/signext-zeroext.wast +++ b/test/llvm_autogenerated/signext-zeroext.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "z2s_func" (func $z2s_func)) (export "s2z_func" (func $s2z_func)) (export "z2s_call" (func $z2s_call)) diff --git a/test/llvm_autogenerated/store-trunc.wast b/test/llvm_autogenerated/store-trunc.wast index f861018c5..935904727 100644 --- a/test/llvm_autogenerated/store-trunc.wast +++ b/test/llvm_autogenerated/store-trunc.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "trunc_i8_i32" (func $trunc_i8_i32)) (export "trunc_i16_i32" (func $trunc_i16_i32)) (export "trunc_i8_i64" (func $trunc_i8_i64)) diff --git a/test/llvm_autogenerated/store.wast b/test/llvm_autogenerated/store.wast index 8ff0f023a..be2909210 100644 --- a/test/llvm_autogenerated/store.wast +++ b/test/llvm_autogenerated/store.wast @@ -1,8 +1,7 @@ (module + (import "env" "memory" (memory $0 1)) (table 0 anyfunc) - (memory $0 1) (data (i32.const 4) "\10\04\00\00") - (export "memory" (memory $0)) (export "sti32" (func $sti32)) (export "sti64" (func $sti64)) (export "stf32" (func $stf32)) diff --git a/test/llvm_autogenerated/switch.wast b/test/llvm_autogenerated/switch.wast index 3a426edd7..904fd14f4 100644 --- a/test/llvm_autogenerated/switch.wast +++ b/test/llvm_autogenerated/switch.wast @@ -6,10 +6,9 @@ (import "env" "foo3" (func $foo3)) (import "env" "foo4" (func $foo4)) (import "env" "foo5" (func $foo5)) + (import "env" "memory" (memory $0 1)) (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)) (func $bar32 (param $0 i32) diff --git a/test/llvm_autogenerated/unreachable.wast b/test/llvm_autogenerated/unreachable.wast index 30ed5432b..01b6d9bfb 100644 --- a/test/llvm_autogenerated/unreachable.wast +++ b/test/llvm_autogenerated/unreachable.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$v (func)) (import "env" "abort" (func $abort)) + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/llvm_autogenerated/unused-argument.wast b/test/llvm_autogenerated/unused-argument.wast index 22442eb9c..60d4e5936 100644 --- a/test/llvm_autogenerated/unused-argument.wast +++ b/test/llvm_autogenerated/unused-argument.wast @@ -1,10 +1,9 @@ (module (type $FUNCSIG$i (func (result i32))) (import "env" "return_something" (func $return_something (result i32))) + (import "env" "memory" (memory $0 1)) (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)) diff --git a/test/llvm_autogenerated/userstack.wast b/test/llvm_autogenerated/userstack.wast index 33f45bd40..cdeccf075 100644 --- a/test/llvm_autogenerated/userstack.wast +++ b/test/llvm_autogenerated/userstack.wast @@ -3,10 +3,9 @@ (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))) + (import "env" "memory" (memory $0 1)) (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)) (export "allocarray" (func $allocarray)) diff --git a/test/llvm_autogenerated/varargs.wast b/test/llvm_autogenerated/varargs.wast index cc4396322..3e4a4042a 100644 --- a/test/llvm_autogenerated/varargs.wast +++ b/test/llvm_autogenerated/varargs.wast @@ -2,10 +2,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (import "env" "callee" (func $callee (param i32))) + (import "env" "memory" (memory $0 1)) (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)) (export "copy" (func $copy)) |