diff options
author | Sam Clegg <sbc@chromium.org> | 2022-08-07 07:08:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-07 07:08:28 -0700 |
commit | 680e4ecb581dd29947ecbaf3fb11817c187c30c9 (patch) | |
tree | 38b4fd822f5335d71be37eef5cff6c8003dd6059 | |
parent | da916dbae19d213321225da2658423c09b85205b (diff) | |
download | binaryen-680e4ecb581dd29947ecbaf3fb11817c187c30c9.tar.gz binaryen-680e4ecb581dd29947ecbaf3fb11817c187c30c9.tar.bz2 binaryen-680e4ecb581dd29947ecbaf3fb11817c187c30c9.zip |
Remove metadata generation from wasm-emscripten-finalize (#4863)
This is no longer needed by emscripten as of:
https://github.com/emscripten-core/emscripten/pull/16529
45 files changed, 4 insertions, 1361 deletions
diff --git a/scripts/test/lld.py b/scripts/test/lld.py index 2fc3261a8..4f1bbc0ee 100644 --- a/scripts/test/lld.py +++ b/scripts/test/lld.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json import os from . import shared from . import support @@ -26,8 +25,6 @@ def args_for_finalize(filename): ret += ['--side-module'] if 'standalone-wasm' in filename: ret += ['--standalone-wasm'] - if 'no-emit-metadata' in filename: - ret += ['--no-emit-metadata'] return ret @@ -59,13 +56,6 @@ def run_test(input_path): actual = support.run_command(cmd) shared.fail_if_not_identical_to_file(actual, expected_file) - if ext == '.out' and '--no-emit-metadata' not in cmd: - start = actual.find('--BEGIN METADATA --\n') - end = actual.find('-- END METADATA --\n') - if start == -1 or end == -1: - shared.fail_with_error('json metadata tags not found') - the_json = actual[start + len('--BEGIN METADATA --\n'):end] - json.loads(the_json) if ext == '.mem.out': with open(mem_file) as mf: diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp index b4e27ca5c..99d03cec0 100644 --- a/src/tools/wasm-emscripten-finalize.cpp +++ b/src/tools/wasm-emscripten-finalize.cpp @@ -47,7 +47,6 @@ int main(int argc, const char* argv[]) { std::string outputSourceMapUrl; std::string dataSegmentFile; bool emitBinary = true; - bool emitMetadata = true; bool debugInfo = false; bool DWARF = false; bool sideModule = false; @@ -95,13 +94,6 @@ int main(int argc, const char* argv[]) { WasmEmscriptenFinalizeOption, Options::Arguments::Zero, [&emitBinary](Options*, const std::string&) { emitBinary = false; }) - .add( - "--no-emit-metadata", - "-n", - "Skip the writing to emscripten metadata JSON to stdout.", - WasmEmscriptenFinalizeOption, - Options::Arguments::Zero, - [&emitMetadata](Options*, const std::string&) { emitMetadata = false; }) .add("--global-base", "", "The address at which static globals were placed", @@ -228,9 +220,8 @@ int main(int argc, const char* argv[]) { options.applyFeatures(wasm); ModuleReader reader; // If we are not writing output then we definitely don't need to read debug - // info, as it does not affect the metadata we will emit. (However, if we - // emit output then definitely load the names section so that we roundtrip - // names properly.) + // info. However, if we emit output then definitely load the names section so + // that we roundtrip names properly. reader.setDebugInfo(writeOutput); reader.setDWARF(DWARF && writeOutput); if (!writeOutput) { @@ -296,7 +287,6 @@ int main(int argc, const char* argv[]) { : ABI::LegalizationLevel::Minimal)); } - // Strip target features section (its information is in the metadata) passRunner.add("strip-target-features"); // If DWARF is unused, strip it out. This avoids us keeping it alive @@ -307,15 +297,7 @@ int main(int argc, const char* argv[]) { passRunner.run(); - BYN_TRACE("generated metadata\n"); - // Substantial changes to the wasm are done, enough to create the metadata. - std::string metadata; - if (emitMetadata) { - metadata = generator.generateEmscriptenMetadata(); - } - - // Finally, separate out data segments if relevant (they may have been needed - // for metadata). + // Finally, separate out data segments if relevant if (!dataSegmentFile.empty()) { Output memInitFile(dataSegmentFile, Flags::Binary); if (globalBase == INVALID_BASE) { @@ -338,16 +320,6 @@ int main(int argc, const char* argv[]) { writer.setSourceMapUrl(outputSourceMapUrl); } writer.write(wasm, output); - if (emitMetadata && !emitBinary) { - output << "(;\n"; - output << "--BEGIN METADATA --\n" << metadata << "-- END METADATA --\n"; - output << ";)\n"; - } - } - // If we emit text then we emitted the metadata together with that text - // earlier. Otherwise emit it to stdout. - if (emitMetadata && emitBinary) { - std::cout << metadata; } return 0; } diff --git a/src/wasm-emscripten.h b/src/wasm-emscripten.h index 694eb1368..4d20b8706 100644 --- a/src/wasm-emscripten.h +++ b/src/wasm-emscripten.h @@ -33,8 +33,6 @@ public: : wasm(wasm), builder(wasm), stackPointerOffset(stackPointerOffset), useStackPointerGlobal(stackPointerOffset == 0) {} - std::string generateEmscriptenMetadata(); - void fixInvokeFunctionNames(); // Emits the data segments to a file. The file contains data from address base diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index f143310ce..0bc74580d 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -188,242 +188,6 @@ struct AsmConst { std::string code; }; -static Address getExportedAddress(Module& wasm, Export* export_) { - Global* g = wasm.getGlobal(export_->value); - auto* addrConst = g->init->dynCast<Const>(); - return addrConst->value.getUnsigned(); -} - -static std::vector<AsmConst> findEmAsmConsts(Module& wasm, - bool minimizeWasmChanges) { - // Newer version of emscripten/llvm export these symbols so we can use them to - // find all the EM_ASM constants. Sadly __start_em_asm and __stop_em_asm - // don't alwasy mark the start and end of segment because in dynamic linking - // we merge all data segments into one. - Export* start = wasm.getExportOrNull("__start_em_asm"); - Export* end = wasm.getExportOrNull("__stop_em_asm"); - if (!start && !end) { - BYN_TRACE("findEmAsmConsts: no start/stop symbols\n"); - return {}; - } - - if (!start || !end) { - Fatal() << "Found only one of __start_em_asm and __stop_em_asm"; - } - - StringConstantTracker stringTracker(wasm); - Address startAddress = getExportedAddress(wasm, start); - Address endAddress = getExportedAddress(wasm, end); - for (Index i = 0; i < wasm.dataSegments.size(); i++) { - Address segmentStart = stringTracker.segmentOffsets[i]; - size_t segmentSize = wasm.dataSegments[i]->data.size(); - if (segmentStart <= startAddress && - segmentStart + segmentSize >= endAddress) { - std::vector<AsmConst> asmConsts; - Address address = startAddress; - while (address < endAddress) { - auto code = stringTracker.stringAtAddr(address); - asmConsts.push_back({address, code}); - address.addr += strlen(code) + 1; - } - assert(asmConsts.size()); - return asmConsts; - } - } - Fatal() << "Segment data not found between symbols __start_em_asm and " - "__stop_em_asm"; -} - -struct EmJsWalker : public PostWalker<EmJsWalker> { - Module& wasm; - StringConstantTracker stringTracker; - - std::map<std::string, std::string> codeByName; - - EmJsWalker(Module& _wasm) : wasm(_wasm), stringTracker(_wasm) {} - - void visitExport(Export* curr) { - if (!curr->name.startsWith(EM_JS_PREFIX.str)) { - return; - } - - Address address; - if (curr->kind == ExternalKind::Global) { - auto* global = wasm.getGlobal(curr->value); - Const* const_ = global->init->cast<Const>(); - address = const_->value.getUnsigned(); - } else if (curr->kind == ExternalKind::Function) { - auto* func = wasm.getFunction(curr->value); - // An EM_JS has a single const in the body. Typically it is just returned, - // but in unoptimized code it might be stored to a local and loaded from - // there, and in relocatable code it might get added to __memory_base etc. - FindAll<Const> consts(func->body); - if (consts.list.size() != 1) { - Fatal() << "Unexpected generated __em_js__ function body: " - << curr->name; - } - auto* addrConst = consts.list[0]; - address = addrConst->value.getUnsigned(); - } else { - return; - } - - auto code = stringTracker.stringAtAddr(address); - auto funcName = std::string(curr->name.stripPrefix(EM_JS_PREFIX.str)); - codeByName[funcName] = code; - } -}; - -EmJsWalker findEmJsFuncsAndReturnWalker(Module& wasm) { - EmJsWalker walker(wasm); - walker.walkModule(&wasm); - return walker; -} - -std::string EmscriptenGlueGenerator::generateEmscriptenMetadata() { - bool commaFirst; - auto nextElement = [&commaFirst]() { - if (commaFirst) { - commaFirst = false; - return "\n "; - } else { - return ",\n "; - } - }; - - std::stringstream meta; - meta << "{\n"; - - std::vector<AsmConst> asmConsts = findEmAsmConsts(wasm, minimizeWasmChanges); - - // print - commaFirst = true; - if (!asmConsts.empty()) { - meta << " \"asmConsts\": {"; - for (auto& asmConst : asmConsts) { - meta << nextElement(); - meta << '"' << asmConst.id << "\": \"" << escape(asmConst.code) << "\""; - } - meta << "\n },\n"; - } - - EmJsWalker emJsWalker = findEmJsFuncsAndReturnWalker(wasm); - if (!emJsWalker.codeByName.empty()) { - meta << " \"emJsFuncs\": {"; - commaFirst = true; - for (auto& [name, code] : emJsWalker.codeByName) { - meta << nextElement(); - meta << '"' << name << "\": \"" << escape(code) << '"'; - } - meta << "\n },\n"; - } - - // Avoid adding duplicate imports to `declares' or `invokeFuncs`. Even - // though we might import the same function multiple times (i.e. with - // different sigs) we only need to list is in the metadata once. - std::set<std::string> declares; - std::set<std::string> invokeFuncs; - - // We use the `base` rather than the `name` of the imports here and below - // becasue this is the externally visible name that the embedder (JS) will - // see. - meta << " \"declares\": ["; - commaFirst = true; - ModuleUtils::iterImportedFunctions(wasm, [&](Function* import) { - if (emJsWalker.codeByName.count(import->base.str) == 0 && - !import->base.startsWith("invoke_")) { - if (declares.insert(import->base.str).second) { - meta << nextElement() << '"' << import->base.str << '"'; - } - } - }); - meta << "\n ],\n"; - - meta << " \"globalImports\": ["; - commaFirst = true; - ModuleUtils::iterImportedGlobals(wasm, [&](Global* import) { - meta << nextElement() << '"' << import->base.str << '"'; - }); - meta << "\n ],\n"; - - if (!wasm.exports.empty()) { - meta << " \"exports\": ["; - commaFirst = true; - for (const auto& ex : wasm.exports) { - if (ex->kind == ExternalKind::Function || ex->kind == ExternalKind::Tag) { - meta << nextElement() << '"' << ex->name.str << '"'; - } - } - meta << "\n ],\n"; - - meta << " \"namedGlobals\": {"; - commaFirst = true; - for (const auto& ex : wasm.exports) { - if (ex->kind == ExternalKind::Global) { - const Global* g = wasm.getGlobal(ex->value); - assert(g->type == Type::i32 || g->type == Type::i64); - Const* init = g->init->cast<Const>(); - uint64_t addr = init->value.getInteger(); - meta << nextElement() << '"' << ex->name.str << "\" : \"" << addr - << '"'; - } - } - meta << "\n },\n"; - } - - meta << " \"invokeFuncs\": ["; - commaFirst = true; - ModuleUtils::iterImportedFunctions(wasm, [&](Function* import) { - if (import->module == ENV && import->base.startsWith("invoke_")) { - if (invokeFuncs.insert(import->base.str).second) { - meta << nextElement() << '"' << import->base.str << '"'; - } - } - }); - meta << "\n ],\n"; - - // In normal mode we attempt to determine if main takes argumnts or not - // In standalone mode we export _start instead and rely on the presence - // of the __wasi_args_get and __wasi_args_sizes_get syscalls allow us to - // DCE to the argument handling JS code instead. - if (!standalone) { - auto mainReadsParams = false; - auto* exp = wasm.getExportOrNull("main"); - if (!exp) { - exp = wasm.getExportOrNull("__main_argc_argv"); - } - if (exp) { - if (exp->kind == ExternalKind::Function) { - auto* main = wasm.getFunction(exp->value); - mainReadsParams = main->getNumParams() > 0; - if (mainReadsParams) { - // Main could also be stub that just calls __original_main with - // no parameters. - // TODO(sbc): Remove this once https://reviews.llvm.org/D75277 - // lands. - if (auto* call = main->body->dynCast<Call>()) { - if (call->operands.empty()) { - mainReadsParams = false; - } - } - } - } - } - meta << " \"mainReadsParams\": " << int(mainReadsParams) << ",\n"; - } - - meta << " \"features\": ["; - commaFirst = true; - wasm.features.iterFeatures([&](FeatureSet::Feature f) { - meta << nextElement() << "\"--enable-" << FeatureSet::toString(f) << '"'; - }); - meta << "\n ]\n"; - - meta << "}\n"; - - return meta.str(); -} - void EmscriptenGlueGenerator::separateDataSegments(Output* outfile, Address base) { size_t lastEnd = 0; diff --git a/test/lit/help/wasm-emscripten-finalize.test b/test/lit/help/wasm-emscripten-finalize.test index 5079f192f..43e1652c5 100644 --- a/test/lit/help/wasm-emscripten-finalize.test +++ b/test/lit/help/wasm-emscripten-finalize.test @@ -20,9 +20,6 @@ ;; CHECK-NEXT: output file. In this mode if no output ;; CHECK-NEXT: file is specified, we write to stdout. ;; CHECK-NEXT: -;; CHECK-NEXT: --no-emit-metadata,-n Skip the writing to emscripten metadata -;; CHECK-NEXT: JSON to stdout. -;; CHECK-NEXT: ;; CHECK-NEXT: --global-base The address at which static globals were ;; CHECK-NEXT: placed ;; CHECK-NEXT: diff --git a/test/lit/wasm-emscripten-finalize/em_asm.wat b/test/lit/wasm-emscripten-finalize/em_asm.wat deleted file mode 100644 index 195c4b9af..000000000 --- a/test/lit/wasm-emscripten-finalize/em_asm.wat +++ /dev/null @@ -1,22 +0,0 @@ -;; Test that em_asm string are extracted correctly when the __start_em_asm -;; and __stop_em_asm globals are exported. - -;; RUN: wasm-emscripten-finalize %s -S | filecheck %s - -;; Check that the data segment that contains only EM_ASM strings resized to -;; zero, and that the string are extracted into the metadata. - -;; CHECK: "asmConsts": { -;; CHECK-NEXT: "512": "{ console.log('JS hello'); }", -;; CHECK-NEXT: "541": "{ console.log('hello again'); }" -;; CHECK-NEXT: }, - -(module - (memory 1 1) - (global (export "__start_em_asm") i32 (i32.const 512)) - (global (export "__stop_em_asm") i32 (i32.const 573)) - - (data (i32.const 100) "normal data") - (data (i32.const 512) "{ console.log('JS hello'); }\00{ console.log('hello again'); }\00") - (data (i32.const 1024) "more data") -) diff --git a/test/lit/wasm-emscripten-finalize/em_js.wat b/test/lit/wasm-emscripten-finalize/em_js.wat deleted file mode 100644 index b10774ed3..000000000 --- a/test/lit/wasm-emscripten-finalize/em_js.wat +++ /dev/null @@ -1,25 +0,0 @@ -;; Test that funcions exported with __em_js are correctly removed -;; once they strings they return are extracted. - -;; RUN: wasm-emscripten-finalize %s -S | filecheck %s - -;; CHECK: "emJsFuncs": { -;; CHECK-NEXT: "bar": "more JS string data", -;; CHECK-NEXT: "baz": "Only em_js strings here", -;; CHECK-NEXT: "foo": "some JS string data" -;; CHECK-NEXT: }, - -(module - (memory 1 1) - (data (i32.const 1024) "some JS string data\00xxx") - (data (i32.const 512) "Only em_js strings here\00") - (data (i32.const 2048) "more JS string data\00yyy") - (export "__em_js__foo" (global $__em_js__foo)) - (export "__em_js__bar" (global $bar)) - (export "__em_js__baz" (global $baz)) - ;; Name matches export name - (global $__em_js__foo i32 (i32.const 1024)) - ;; Name does not match export name - (global $bar i32 (i32.const 2048)) - (global $baz i32 (i32.const 512)) -) diff --git a/test/lit/wasm-emscripten-finalize/passive-pic.wat b/test/lit/wasm-emscripten-finalize/passive-pic.wat deleted file mode 100644 index 63e2cb72c..000000000 --- a/test/lit/wasm-emscripten-finalize/passive-pic.wat +++ /dev/null @@ -1,40 +0,0 @@ -;; Test that wasm-emscripten-finalize can locate data within passive segments -;; even when compiled with PIC, which means that segment addresses are non-constant. - -;; RUN: wasm-emscripten-finalize --enable-bulk-memory %s -o out.wasm | filecheck %s - -;; CHECK: "asmConsts": { -;; CHECK: "3": "hello" -;; CHECK: }, - -(module - (import "env" "memory" (memory $memory 1 1)) - (import "env" "__memory_base" (global $__memory_base i32)) - (import "env" "emscripten_asm_const_int" (func $emscripten_asm_const_int (param i32 i32 i32) (result i32))) - (data "xxxhello\00yyy") - (global (export "__start_em_asm") i32 (i32.const 3)) - (global (export "__stop_em_asm") i32 (i32.const 9)) - ;; memory init function similar to those generated by wasm-ld - (start $__wasm_init_memory) - (func $__wasm_init_memory - (memory.init 0 - (i32.add - (i32.const 0) - (global.get $__memory_base) - ) - (i32.const 0) - (i32.const 12) - ) - ) - ;; EM_ASM call passing string at address 3 in the passive segment - (func $foo (result i32) - (call $emscripten_asm_const_int - (i32.add - (global.get $__memory_base) - (i32.const 3) - ) - (i32.const 0) - (i32.const 0) - ) - ) -) diff --git a/test/lit/wasm-emscripten-finalize/tag_export.wat b/test/lit/wasm-emscripten-finalize/tag_export.wat deleted file mode 100644 index 86c8c1331..000000000 --- a/test/lit/wasm-emscripten-finalize/tag_export.wat +++ /dev/null @@ -1,12 +0,0 @@ -;; RUN: wasm-emscripten-finalize %s | filecheck %s - -(module - (tag $e1 (export "e1") (param i32)) - (tag $e2 (param f32)) - (export "e2" (tag $e2)) -) - -;; CHECK: "exports": [ -;; CHECK: "e1", -;; CHECK: "e2" -;; CHECK: ], diff --git a/test/lld/basic_safe_stack.wat.out b/test/lld/basic_safe_stack.wat.out index 9ed9eb221..d0bcd0563 100644 --- a/test/lld/basic_safe_stack.wat.out +++ b/test/lld/basic_safe_stack.wat.out @@ -88,28 +88,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "__handle_stack_overflow" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "stackRestore", - "stackAlloc", - "main", - "__set_stack_limits" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/duplicate_imports.wat.out b/test/lld/duplicate_imports.wat.out index 68f4d96a6..5cb68af56 100644 --- a/test/lld/duplicate_imports.wat.out +++ b/test/lld/duplicate_imports.wat.out @@ -64,30 +64,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "puts" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main", - "dynCall_ffd", - "dynCall_fdd" - ], - "namedGlobals": { - "__heap_base" : "66128", - "__data_end" : "581" - }, - "invokeFuncs": [ - "invoke_ffd" - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm.wat.mem.out b/test/lld/em_asm.wat.mem.out index ddf3aa739..6647b397c 100644 --- a/test/lld/em_asm.wat.mem.out +++ b/test/lld/em_asm.wat.mem.out @@ -66,32 +66,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "574": "{ Module.print(\"Hello \\ world\\t\\n\"); }", - "614": "{ return $0 + $1; }", - "634": "{ Module.print(\"Got \" + $0); }" - }, - "declares": [ - "emscripten_asm_const_int" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - "__start_em_asm" : "574", - "__stop_em_asm" : "665" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm.wat.out b/test/lld/em_asm.wat.out index 8afbfda3d..8ed3d72ba 100644 --- a/test/lld/em_asm.wat.out +++ b/test/lld/em_asm.wat.out @@ -70,32 +70,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "574": "{ Module.print(\"Hello \\ world\\t\\n\"); }", - "614": "{ return $0 + $1; }", - "634": "{ Module.print(\"Got \" + $0); }" - }, - "declares": [ - "emscripten_asm_const_int" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - "__start_em_asm" : "574", - "__stop_em_asm" : "665" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm64.wat.out b/test/lld/em_asm64.wat.out index bac187c23..33e5bb176 100644 --- a/test/lld/em_asm64.wat.out +++ b/test/lld/em_asm64.wat.out @@ -70,33 +70,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "574": "{ Module.print(\"Hello world\"); }", - "607": "{ return $0 + $1; }", - "627": "{ Module.print(\"Got \" + $0); }" - }, - "declares": [ - "emscripten_asm_const_int" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - "__start_em_asm" : "574", - "__stop_em_asm" : "658" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - "--enable-memory64" - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm_O0.wat.out b/test/lld/em_asm_O0.wat.out index 5a533cdef..fb2495476 100644 --- a/test/lld/em_asm_O0.wat.out +++ b/test/lld/em_asm_O0.wat.out @@ -98,32 +98,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "568": "{ Module.print(\"Hello world\"); }", - "601": "{ return $0 + $1; }", - "621": "{ Module.print(\"Got \" + $0); }" - }, - "declares": [ - "emscripten_asm_const_int" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - "__start_em_asm" : "568", - "__stop_em_asm" : "652" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm_main_thread.wat.out b/test/lld/em_asm_main_thread.wat.out index 5c279a598..621465913 100644 --- a/test/lld/em_asm_main_thread.wat.out +++ b/test/lld/em_asm_main_thread.wat.out @@ -194,34 +194,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "568": "{ Module.print(\"Hello world\"); }", - "601": "{ return $0 + $1; }", - "621": "{ Module.print(\"Got \" + $0); }" - }, - "declares": [ - "emscripten_asm_const_int_sync_on_main_thread" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - "__start_em_asm" : "568", - "__stop_em_asm" : "652", - "__heap_base" : "66192", - "__data_end" : "652" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm_pthread.wasm.out b/test/lld/em_asm_pthread.wasm.out index 0f684e224..0bf7927dd 100644 --- a/test/lld/em_asm_pthread.wasm.out +++ b/test/lld/em_asm_pthread.wasm.out @@ -12829,91 +12829,3 @@ ) ;; custom section "producers", size 172 ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "1658": "{ console.log(\"Hello.\"); }", - "1685": "throw 'Canceled!'", - "1703": "{ setTimeout(function() { __emscripten_do_dispatch_to_thread($0, $1); }, 0); }" - }, - "emJsFuncs": { - "initPthreadsJS": "(void)<::>{ PThread.initRuntime(); }", - "world": "()<::>{ console.log(\"World.\"); }" - }, - "declares": [ - "emscripten_asm_const_int", - "__cxa_thread_atexit", - "__clock_gettime", - "emscripten_get_now", - "emscripten_conditional_set_current_thread_status", - "emscripten_futex_wait", - "emscripten_futex_wake", - "__assert_fail", - "emscripten_set_current_thread_status", - "_emscripten_notify_thread_queue", - "emscripten_webgl_create_context", - "emscripten_set_canvas_element_size", - "pthread_create", - "emscripten_receive_on_main_thread_js", - "emscripten_resize_heap", - "fd_write", - "setTempRet0" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main", - "emscripten_tls_init", - "emscripten_get_global_libc", - "__errno_location", - "fflush", - "__emscripten_pthread_data_constructor", - "pthread_self", - "__pthread_tsd_run_dtors", - "emscripten_current_thread_process_queued_calls", - "emscripten_register_main_browser_thread_id", - "emscripten_main_browser_thread_id", - "_emscripten_do_dispatch_to_thread", - "emscripten_sync_run_in_main_thread_2", - "emscripten_sync_run_in_main_thread_4", - "emscripten_main_thread_process_queued_calls", - "emscripten_run_in_main_runtime_thread_js", - "_emscripten_call_on_thread", - "_emscripten_thread_init", - "stackSave", - "stackRestore", - "stackAlloc", - "emscripten_stack_init", - "emscripten_stack_set_limits", - "emscripten_stack_get_free", - "emscripten_stack_get_end", - "malloc", - "free", - "memalign", - "dynCall_vi", - "dynCall_ii", - "dynCall_iiii", - "dynCall_jiji" - ], - "namedGlobals": { - "__em_js__world" : "1588", - "__em_js__initPthreadsJS" : "1621", - "_emscripten_allow_main_runtime_queued_calls" : "1432", - "_emscripten_main_thread_futex" : "1836", - "__start_em_asm" : "1658", - "__stop_em_asm" : "1782" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 1, - "features": [ - "--enable-threads", - "--enable-mutable-globals", - "--enable-bulk-memory", - "--enable-sign-ext" - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm_shared.wat.out b/test/lld/em_asm_shared.wat.out index ac15b0fd9..0962d3504 100644 --- a/test/lld/em_asm_shared.wat.out +++ b/test/lld/em_asm_shared.wat.out @@ -96,43 +96,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "asmConsts": { - "6": "{ Module.print(\"Hello world\"); }", - "39": "{ return $0 + $1; }", - "59": "{ Module.print(\"Got \" + $0); }" - }, - "declares": [ - "emscripten_asm_const_int" - ], - "globalImports": [ - "__stack_pointer", - "__memory_base", - "__table_base", - "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJEEE6bufferE", - "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiiEEE6bufferE", - "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiEEE6bufferE" - ], - "exports": [ - "__wasm_call_ctors", - "__wasm_apply_data_relocs", - "__original_main", - "main" - ], - "namedGlobals": { - "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJEEE6bufferE" : "0", - "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiiEEE6bufferE" : "1", - "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiEEE6bufferE" : "4", - "__start_em_asm" : "6", - "__stop_em_asm" : "90" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_asm_table.wat.out b/test/lld/em_asm_table.wat.out index 4a654c141..c91f774ed 100644 --- a/test/lld/em_asm_table.wat.out +++ b/test/lld/em_asm_table.wat.out @@ -29,27 +29,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "emscripten_log", - "emscripten_asm_const_int" - ], - "globalImports": [ - ], - "exports": [ - "dynCall_vii", - "dynCall_iiii" - ], - "namedGlobals": { - "__data_end" : "1048" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/em_js_O0.wat.out b/test/lld/em_js_O0.wat.out index e3271166b..bda4f1b52 100644 --- a/test/lld/em_js_O0.wat.out +++ b/test/lld/em_js_O0.wat.out @@ -20,28 +20,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "emJsFuncs": { - "noarg": "(void)<::>{ out(\"no args works\"); }" - }, - "declares": [ - ], - "globalImports": [ - ], - "exports": [ - "__em_js__noarg" - ], - "namedGlobals": { - "__heap_base" : "5250112", - "__data_end" : "7232" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/hello_world.passive.wat.out b/test/lld/hello_world.passive.wat.out index 1c96749d2..4cd5ed3c7 100644 --- a/test/lld/hello_world.passive.wat.out +++ b/test/lld/hello_world.passive.wat.out @@ -37,27 +37,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "puts" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - "__heap_base" : "66128", - "__data_end" : "581" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/hello_world.wat.mem.out b/test/lld/hello_world.wat.mem.out index f55fbcf89..c482a7465 100644 --- a/test/lld/hello_world.wat.mem.out +++ b/test/lld/hello_world.wat.mem.out @@ -25,25 +25,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "puts" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/hello_world.wat.out b/test/lld/hello_world.wat.out index de4d9670f..8081048d8 100644 --- a/test/lld/hello_world.wat.out +++ b/test/lld/hello_world.wat.out @@ -26,25 +26,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "puts" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/init.wat.out b/test/lld/init.wat.out index 7525cf131..68388eecb 100644 --- a/test/lld/init.wat.out +++ b/test/lld/init.wat.out @@ -38,24 +38,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/longjmp.wat.out b/test/lld/longjmp.wat.out index bef99c9d4..3bb1c6dd4 100644 --- a/test/lld/longjmp.wat.out +++ b/test/lld/longjmp.wat.out @@ -141,33 +141,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "malloc", - "saveSetjmp", - "getTempRet0", - "emscripten_longjmp", - "testSetjmp", - "setTempRet0", - "free" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main", - "dynCall_vii" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - "invoke_vii" - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/main_module.wat.out b/test/lld/main_module.wat.out index 1c27ba34f..1761b6dde 100644 --- a/test/lld/main_module.wat.out +++ b/test/lld/main_module.wat.out @@ -53,34 +53,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "puts" - ], - "globalImports": [ - "__stack_pointer", - "__memory_base", - "__table_base", - "external_var", - "puts", - "_Z13print_messagev" - ], - "exports": [ - "__wasm_call_ctors", - "_Z13print_messagev" - ], - "namedGlobals": { - "ptr_puts" : "16", - "ptr_local_func" : "20", - "__data_end" : "42" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/main_module_table.wat.out b/test/lld/main_module_table.wat.out index dd37f93b6..368df93b6 100644 --- a/test/lld/main_module_table.wat.out +++ b/test/lld/main_module_table.wat.out @@ -9,26 +9,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - "__stack_pointer", - "__stdio_write" - ], - "exports": [ - "__stdio_write" - ], - "namedGlobals": { - "__data_end" : "42" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/main_module_table_2.wat.out b/test/lld/main_module_table_2.wat.out index 37a162860..7d4046d16 100644 --- a/test/lld/main_module_table_2.wat.out +++ b/test/lld/main_module_table_2.wat.out @@ -10,26 +10,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - "__stack_pointer", - "__stdio_write" - ], - "exports": [ - "__stdio_write" - ], - "namedGlobals": { - "__data_end" : "42" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/main_module_table_3.wat.out b/test/lld/main_module_table_3.wat.out index 8153a2770..72a29a7f2 100644 --- a/test/lld/main_module_table_3.wat.out +++ b/test/lld/main_module_table_3.wat.out @@ -11,26 +11,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - "__stack_pointer", - "__stdio_write" - ], - "exports": [ - "__stdio_write" - ], - "namedGlobals": { - "__data_end" : "42" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/main_module_table_4.wat.out b/test/lld/main_module_table_4.wat.out index e09e42238..09008d4e8 100644 --- a/test/lld/main_module_table_4.wat.out +++ b/test/lld/main_module_table_4.wat.out @@ -12,27 +12,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - "__stack_pointer", - "__stdio_write", - "__table_base" - ], - "exports": [ - "__stdio_write" - ], - "namedGlobals": { - "__data_end" : "42" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/main_module_table_5.wat.out b/test/lld/main_module_table_5.wat.out index bf543f98a..3620dc0b4 100644 --- a/test/lld/main_module_table_5.wat.out +++ b/test/lld/main_module_table_5.wat.out @@ -25,28 +25,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - "__stack_pointer", - "__stdio_write", - "__table_base" - ], - "exports": [ - "__stdio_write", - "dynCall_v" - ], - "namedGlobals": { - "__data_end" : "42" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/no-emit-metadata.wat b/test/lld/no-emit-metadata.wat deleted file mode 100644 index 2ccbf3f29..000000000 --- a/test/lld/no-emit-metadata.wat +++ /dev/null @@ -1,20 +0,0 @@ -(module - (memory $0 2) - (table $0 1 1 funcref) - (elem (i32.const 0) $foo) - (global $global$0 (mut i32) (i32.const 66112)) - (global $global$1 i32 (i32.const 66112)) - (global $global$2 i32 (i32.const 576)) - (export "memory" (memory $0)) - (export "main" (func $main)) - (export "__heap_base" (global $global$1)) - (export "__data_end" (global $global$2)) - (func $__original_main (result i32) - (nop) - ) - (func $main (param $0 i32) (param $1 i32) (result i32) - (call $__original_main) - ) - (func $foo (result i32)) -) - diff --git a/test/lld/no-emit-metadata.wat.out b/test/lld/no-emit-metadata.wat.out deleted file mode 100644 index 281eba998..000000000 --- a/test/lld/no-emit-metadata.wat.out +++ /dev/null @@ -1,30 +0,0 @@ -(module - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (global $global$0 (mut i32) (i32.const 66112)) - (global $global$1 i32 (i32.const 66112)) - (global $global$2 i32 (i32.const 576)) - (memory $0 2) - (table $0 1 1 funcref) - (elem (i32.const 0) $foo) - (export "memory" (memory $0)) - (export "main" (func $main)) - (export "__heap_base" (global $global$1)) - (export "__data_end" (global $global$2)) - (export "dynCall_i" (func $dynCall_i)) - (func $__original_main (result i32) - (nop) - ) - (func $main (param $0 i32) (param $1 i32) (result i32) - (call $__original_main) - ) - (func $foo (result i32) - (nop) - ) - (func $dynCall_i (param $fptr i32) (result i32) - (call_indirect (type $none_=>_i32) - (local.get $fptr) - ) - ) -) diff --git a/test/lld/recursive.wat.out b/test/lld/recursive.wat.out index 5ffbf8210..ae7945a2a 100644 --- a/test/lld/recursive.wat.out +++ b/test/lld/recursive.wat.out @@ -83,25 +83,3 @@ (call $__original_main) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "iprintf" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/recursive_safe_stack.wat.out b/test/lld/recursive_safe_stack.wat.out index d6cd8f63a..f5808ee88 100644 --- a/test/lld/recursive_safe_stack.wat.out +++ b/test/lld/recursive_safe_stack.wat.out @@ -181,29 +181,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "printf", - "__handle_stack_overflow" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main", - "__set_stack_limits" - ], - "namedGlobals": { - "__heap_base" : "66128", - "__data_end" : "587" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/reserved_func_ptr.wat.out b/test/lld/reserved_func_ptr.wat.out index 373800dbc..d20ecbc51 100644 --- a/test/lld/reserved_func_ptr.wat.out +++ b/test/lld/reserved_func_ptr.wat.out @@ -118,26 +118,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "_Z4atoiPKc" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "__main_argc_argv", - "dynCall_viii" - ], - "namedGlobals": { - }, - "invokeFuncs": [ - ], - "mainReadsParams": 1, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/safe_stack_standalone-wasm.wat.out b/test/lld/safe_stack_standalone-wasm.wat.out index b5bd4a869..876e9fabc 100644 --- a/test/lld/safe_stack_standalone-wasm.wat.out +++ b/test/lld/safe_stack_standalone-wasm.wat.out @@ -171,27 +171,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "printf" - ], - "globalImports": [ - ], - "exports": [ - "__wasm_call_ctors", - "main", - "__set_stack_limits" - ], - "namedGlobals": { - "__heap_base" : "66128", - "__data_end" : "587" - }, - "invokeFuncs": [ - ], - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/shared.wat.out b/test/lld/shared.wat.out index b152d52b8..1a496e436 100644 --- a/test/lld/shared.wat.out +++ b/test/lld/shared.wat.out @@ -51,33 +51,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "puts" - ], - "globalImports": [ - "__memory_base", - "__table_base", - "external_var", - "puts", - "_Z13print_messagev" - ], - "exports": [ - "__wasm_call_ctors", - "__wasm_apply_data_relocs", - "_Z13print_messagev" - ], - "namedGlobals": { - "ptr_puts" : "16", - "ptr_local_func" : "20" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/shared_add_to_table.wasm.out b/test/lld/shared_add_to_table.wasm.out index f4551d34a..91be03860 100644 --- a/test/lld/shared_add_to_table.wasm.out +++ b/test/lld/shared_add_to_table.wasm.out @@ -68,37 +68,3 @@ ;; tablealignment: 0 ;; custom section "producers", size 157 ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "_Z16waka_func_theirsi" - ], - "globalImports": [ - "__stack_pointer", - "__memory_base", - "__table_base", - "_Z16waka_func_theirsi", - "_Z14waka_func_minei", - "waka_mine", - "waka_others" - ], - "exports": [ - "__wasm_call_ctors", - "__wasm_apply_relocs", - "_Z14waka_func_minei", - "__original_main", - "main" - ], - "namedGlobals": { - "waka_mine" : "0", - "__dso_handle" : "0" - }, - "invokeFuncs": [ - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/shared_longjmp.wat.out b/test/lld/shared_longjmp.wat.out index 65d6b088c..449714270 100644 --- a/test/lld/shared_longjmp.wat.out +++ b/test/lld/shared_longjmp.wat.out @@ -151,41 +151,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - "malloc", - "saveSetjmp", - "getTempRet0", - "emscripten_longjmp", - "testSetjmp", - "setTempRet0", - "free" - ], - "globalImports": [ - "__memory_base", - "__table_base", - "__THREW__", - "emscripten_longjmp", - "__threwValue" - ], - "exports": [ - "__wasm_call_ctors", - "__wasm_apply_data_relocs", - "_start", - "dynCall_vii" - ], - "namedGlobals": { - "__THREW__" : "0", - "__threwValue" : "4" - }, - "invokeFuncs": [ - "invoke_vii" - ], - "mainReadsParams": 0, - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/standalone-wasm-with-start.wat.out b/test/lld/standalone-wasm-with-start.wat.out index b5bbb22b4..e158a7433 100644 --- a/test/lld/standalone-wasm-with-start.wat.out +++ b/test/lld/standalone-wasm-with-start.wat.out @@ -17,24 +17,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - ], - "exports": [ - "_start" - ], - "namedGlobals": { - "__heap_base" : "66112", - "__data_end" : "576" - }, - "invokeFuncs": [ - ], - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/standalone-wasm.wat.out b/test/lld/standalone-wasm.wat.out index 54519e820..dfce73e5c 100644 --- a/test/lld/standalone-wasm.wat.out +++ b/test/lld/standalone-wasm.wat.out @@ -21,24 +21,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - ], - "exports": [ - "main" - ], - "namedGlobals": { - "__heap_base" : "66112", - "__data_end" : "576" - }, - "invokeFuncs": [ - ], - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/standalone-wasm2.wat.out b/test/lld/standalone-wasm2.wat.out index 8863dc151..bc8c94d1a 100644 --- a/test/lld/standalone-wasm2.wat.out +++ b/test/lld/standalone-wasm2.wat.out @@ -18,24 +18,3 @@ ) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - ], - "exports": [ - "main" - ], - "namedGlobals": { - "__heap_base" : "66112", - "__data_end" : "576" - }, - "invokeFuncs": [ - ], - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/lld/standalone-wasm3.wat.out b/test/lld/standalone-wasm3.wat.out index df6c277c6..bbbd38c82 100644 --- a/test/lld/standalone-wasm3.wat.out +++ b/test/lld/standalone-wasm3.wat.out @@ -11,23 +11,3 @@ (nop) ) ) -(; ---BEGIN METADATA -- -{ - "declares": [ - ], - "globalImports": [ - ], - "exports": [ - ], - "namedGlobals": { - "__heap_base" : "66112", - "__data_end" : "576" - }, - "invokeFuncs": [ - ], - "features": [ - ] -} --- END METADATA -- -;) diff --git a/test/unit/test_finalize.py b/test/unit/test_finalize.py index 6733155cb..4f5029bd5 100644 --- a/test/unit/test_finalize.py +++ b/test/unit/test_finalize.py @@ -4,14 +4,10 @@ from . import utils class EmscriptenFinalizeTest(utils.BinaryenTestCase): def do_output_test(self, args): - # without any output file specified, don't error, don't write the wasm, - # but do emit metadata + # without any output file specified, don't error, don't write the wasm p = shared.run_process(shared.WASM_EMSCRIPTEN_FINALIZE + [ self.input_path('empty_lld.wat'), '--global-base=1024' ] + args, capture_output=True) - # metadata is always present - self.assertIn('{', p.stdout) - self.assertIn('}', p.stdout) return p.stdout def test_no_output(self): |