summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--README.md2
-rwxr-xr-xauto_update_tests.py33
-rwxr-xr-xcheck.py34
-rw-r--r--scripts/test/shared.py1
-rw-r--r--src/tools/wasm-merge.cpp672
-rw-r--r--test/merge/basics.wast40
-rw-r--r--test/merge/basics.wast.combined133
-rw-r--r--test/merge/basics.wast.combined.finalized133
-rw-r--r--test/merge/basics.wast.combined.finalized.opt107
-rw-r--r--test/merge/basics.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/basics.wast.combined.finalized.stdout3
-rw-r--r--test/merge/basics.wast.combined.opt107
-rw-r--r--test/merge/basics.wast.combined.opt.stdout3
-rw-r--r--test/merge/basics.wast.combined.stdout3
-rw-r--r--test/merge/basics.wast.toMerge65
-rw-r--r--test/merge/dylib.wasmbin386 -> 0 bytes
-rw-r--r--test/merge/dylib.wasm.combined101
-rw-r--r--test/merge/dylib.wasm.combined.finalized101
-rw-r--r--test/merge/dylib.wasm.combined.finalized.opt87
-rw-r--r--test/merge/dylib.wasm.combined.finalized.opt.stdout3
-rw-r--r--test/merge/dylib.wasm.combined.finalized.stdout3
-rw-r--r--test/merge/dylib.wasm.combined.opt88
-rw-r--r--test/merge/dylib.wasm.combined.opt.stdout3
-rw-r--r--test/merge/dylib.wasm.combined.stdout3
-rw-r--r--test/merge/dylib.wasm.toMergebin340 -> 0 bytes
-rw-r--r--test/merge/fusing.wast18
-rw-r--r--test/merge/fusing.wast.combined47
-rw-r--r--test/merge/fusing.wast.combined.finalized47
-rw-r--r--test/merge/fusing.wast.combined.finalized.opt20
-rw-r--r--test/merge/fusing.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/fusing.wast.combined.finalized.stdout3
-rw-r--r--test/merge/fusing.wast.combined.opt23
-rw-r--r--test/merge/fusing.wast.combined.opt.stdout3
-rw-r--r--test/merge/fusing.wast.combined.stdout3
-rw-r--r--test/merge/fusing.wast.toMerge20
-rw-r--r--test/merge/global-init.wast12
-rw-r--r--test/merge/global-init.wast.combined23
-rw-r--r--test/merge/global-init.wast.combined.finalized23
-rw-r--r--test/merge/global-init.wast.combined.finalized.opt4
-rw-r--r--test/merge/global-init.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/global-init.wast.combined.finalized.stdout3
-rw-r--r--test/merge/global-init.wast.combined.opt7
-rw-r--r--test/merge/global-init.wast.combined.opt.stdout3
-rw-r--r--test/merge/global-init.wast.combined.stdout3
-rw-r--r--test/merge/global-init.wast.toMerge12
-rw-r--r--test/merge/main-lacks-segments.wast7
-rw-r--r--test/merge/main-lacks-segments.wast.combined23
-rw-r--r--test/merge/main-lacks-segments.wast.combined.finalized23
-rw-r--r--test/merge/main-lacks-segments.wast.combined.finalized.opt17
-rw-r--r--test/merge/main-lacks-segments.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/main-lacks-segments.wast.combined.finalized.stdout3
-rw-r--r--test/merge/main-lacks-segments.wast.combined.opt19
-rw-r--r--test/merge/main-lacks-segments.wast.combined.opt.stdout3
-rw-r--r--test/merge/main-lacks-segments.wast.combined.stdout3
-rw-r--r--test/merge/main-lacks-segments.wast.toMerge13
-rw-r--r--test/merge/noBases.wast34
-rw-r--r--test/merge/noBases.wast.combined88
-rw-r--r--test/merge/noBases.wast.combined.finalized88
-rw-r--r--test/merge/noBases.wast.combined.finalized.opt61
-rw-r--r--test/merge/noBases.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/noBases.wast.combined.finalized.stdout3
-rw-r--r--test/merge/noBases.wast.combined.opt64
-rw-r--r--test/merge/noBases.wast.combined.opt.stdout3
-rw-r--r--test/merge/noBases.wast.combined.stdout3
-rw-r--r--test/merge/noBases.wast.toMerge35
-rw-r--r--test/merge/post-instantiate-a.wast9
-rw-r--r--test/merge/post-instantiate-a.wast.combined21
-rw-r--r--test/merge/post-instantiate-a.wast.combined.finalized21
-rw-r--r--test/merge/post-instantiate-a.wast.combined.finalized.opt7
-rw-r--r--test/merge/post-instantiate-a.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/post-instantiate-a.wast.combined.finalized.stdout3
-rw-r--r--test/merge/post-instantiate-a.wast.combined.opt9
-rw-r--r--test/merge/post-instantiate-a.wast.combined.opt.stdout3
-rw-r--r--test/merge/post-instantiate-a.wast.combined.stdout3
-rw-r--r--test/merge/post-instantiate-a.wast.toMerge6
-rw-r--r--test/merge/post-instantiate-b.wast6
-rw-r--r--test/merge/post-instantiate-b.wast.combined21
-rw-r--r--test/merge/post-instantiate-b.wast.combined.finalized21
-rw-r--r--test/merge/post-instantiate-b.wast.combined.finalized.opt7
-rw-r--r--test/merge/post-instantiate-b.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/post-instantiate-b.wast.combined.finalized.stdout3
-rw-r--r--test/merge/post-instantiate-b.wast.combined.opt9
-rw-r--r--test/merge/post-instantiate-b.wast.combined.opt.stdout3
-rw-r--r--test/merge/post-instantiate-b.wast.combined.stdout3
-rw-r--r--test/merge/post-instantiate-b.wast.toMerge9
-rw-r--r--test/merge/printf.wast13
-rw-r--r--test/merge/printf.wast.combined31
-rw-r--r--test/merge/printf.wast.combined.finalized31
-rw-r--r--test/merge/printf.wast.combined.finalized.opt9
-rw-r--r--test/merge/printf.wast.combined.finalized.opt.stdout3
-rw-r--r--test/merge/printf.wast.combined.finalized.stdout3
-rw-r--r--test/merge/printf.wast.combined.opt12
-rw-r--r--test/merge/printf.wast.combined.opt.stdout3
-rw-r--r--test/merge/printf.wast.combined.stdout3
-rw-r--r--test/merge/printf.wast.toMerge14
96 files changed, 5 insertions, 2801 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c1401ad5..ceef73c1a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -198,16 +198,6 @@ SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-opt DESTINATION ${CMAKE_INSTALL_BINDIR})
-SET(wasm-merge_SOURCES
- src/tools/wasm-merge.cpp
-)
-ADD_EXECUTABLE(wasm-merge
- ${wasm-merge_SOURCES})
-TARGET_LINK_LIBRARIES(wasm-merge wasm asmjs emscripten-optimizer passes ir cfg support wasm)
-SET_PROPERTY(TARGET wasm-merge PROPERTY CXX_STANDARD 11)
-SET_PROPERTY(TARGET wasm-merge PROPERTY CXX_STANDARD_REQUIRED ON)
-INSTALL(TARGETS wasm-merge DESTINATION bin)
-
SET(wasm-metadce_SOURCES
src/tools/wasm-metadce.cpp
)
diff --git a/README.md b/README.md
index 5fb66338a..1a068fcb8 100644
--- a/README.md
+++ b/README.md
@@ -142,8 +142,6 @@ This repository contains code that builds the following tools in `bin/`:
optimizer infrastructure. This is used by Emscripten in Binaryen mode when it
uses Emscripten's fastcomp asm.js backend.
* **wasm2js**: A WebAssembly-to-JS compiler (still experimental).
- * **wasm-merge**: Combines wasm files into a single big wasm file (without
- sophisticated linking).
* **wasm-ctor-eval**: A tool that can execute C++ global constructors ahead of
time. Used by Emscripten.
* **wasm-emscripten-finalize**: Takes a wasm binary produced by llvm+lld and
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 24006f59d..14a14f936 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -22,9 +22,8 @@ import sys
from scripts.test.support import run_command, split_wast, node_test_glue, node_has_webassembly
from scripts.test.shared import (
ASM2WASM, MOZJS, NODEJS, WASM_OPT, WASM_AS, WASM_DIS,
- WASM_CTOR_EVAL, WASM_MERGE, WASM_REDUCE, WASM_METADCE,
- BINARYEN_INSTALL_DIR, BINARYEN_JS,
- has_shell_timeout, options)
+ WASM_CTOR_EVAL, WASM_REDUCE, WASM_METADCE, BINARYEN_INSTALL_DIR,
+ BINARYEN_JS, has_shell_timeout, options)
from scripts.test import lld
from scripts.test import wasm2js
@@ -245,33 +244,6 @@ def update_wasm_dis_tests():
open(t + '.fromBinary', 'w').write(actual)
-def update_wasm_merge_tests():
- print '\n[ checking wasm-merge... ]\n'
- for t in os.listdir(os.path.join('test', 'merge')):
- if t.endswith(('.wast', '.wasm')):
- print '..', t
- t = os.path.join('test', 'merge', t)
- u = t + '.toMerge'
- for finalize in [0, 1]:
- for opt in [0, 1]:
- cmd = WASM_MERGE + [t, u, '-o', 'a.wast', '-S', '--verbose']
- if finalize:
- cmd += ['--finalize-memory-base=1024', '--finalize-table-base=8']
- if opt:
- cmd += ['-O']
- stdout = run_command(cmd)
- actual = open('a.wast').read()
- out = t + '.combined'
- if finalize:
- out += '.finalized'
- if opt:
- out += '.opt'
- with open(out, 'w') as o:
- o.write(actual)
- with open(out + '.stdout', 'w') as o:
- o.write(stdout)
-
-
def update_binaryen_js_tests():
if not (MOZJS or NODEJS):
print 'no vm to run binaryen.js tests'
@@ -362,7 +334,6 @@ def main():
update_bin_fmt_tests()
update_example_tests()
update_wasm_dis_tests()
- update_wasm_merge_tests()
update_ctor_eval_tests()
wasm2js.update_wasm2js_tests()
update_metadce_tests()
diff --git a/check.py b/check.py
index 864642b23..a7768ad6a 100755
--- a/check.py
+++ b/check.py
@@ -22,9 +22,9 @@ import unittest
from scripts.test.support import run_command, split_wast, node_test_glue, node_has_webassembly
from scripts.test.shared import (
- BIN_DIR, MOZJS, NATIVECC, NATIVEXX, NODEJS, BINARYEN_JS,
- WASM_AS, WASM_CTOR_EVAL, WASM_OPT, WASM_SHELL, WASM_MERGE, WASM_METADCE,
- WASM_DIS, WASM_REDUCE, binary_format_check, delete_from_orbit, fail, fail_with_error,
+ BIN_DIR, MOZJS, NATIVECC, NATIVEXX, NODEJS, BINARYEN_JS, WASM_AS,
+ WASM_CTOR_EVAL, WASM_OPT, WASM_SHELL, WASM_METADCE, WASM_DIS, WASM_REDUCE,
+ binary_format_check, delete_from_orbit, fail, fail_with_error,
fail_if_not_identical, fail_if_not_contained, has_vanilla_emcc,
has_vanilla_llvm, minify_check, options, tests, requested, warnings,
has_shell_timeout, fail_if_not_identical_to_file
@@ -203,33 +203,6 @@ def run_wasm_dis_tests():
with_pass_debug(check)
-def run_wasm_merge_tests():
- print '\n[ checking wasm-merge... ]\n'
-
- test_dir = os.path.join(options.binaryen_test, 'merge')
- for t in os.listdir(test_dir):
- if t.endswith(('.wast', '.wasm')):
- print '..', t
- t = os.path.join(test_dir, t)
- u = t + '.toMerge'
- for finalize in [0, 1]:
- for opt in [0, 1]:
- cmd = WASM_MERGE + [t, u, '-o', 'a.wast', '-S', '--verbose']
- if finalize:
- cmd += ['--finalize-memory-base=1024', '--finalize-table-base=8']
- if opt:
- cmd += ['-O']
- stdout = run_command(cmd)
- actual = open('a.wast').read()
- out = t + '.combined'
- if finalize:
- out += '.finalized'
- if opt:
- out += '.opt'
- fail_if_not_identical_to_file(actual, out)
- fail_if_not_identical_to_file(stdout, out + '.stdout')
-
-
def run_crash_tests():
print "\n[ checking we don't crash on tricky inputs... ]\n"
@@ -614,7 +587,6 @@ def main():
asm2wasm.test_asm2wasm()
asm2wasm.test_asm2wasm_binary()
run_wasm_dis_tests()
- run_wasm_merge_tests()
run_crash_tests()
run_dylink_tests()
run_ctor_eval_tests()
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index 7c456db8f..7723f7cee 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -169,7 +169,6 @@ ASM2WASM = [os.path.join(options.binaryen_bin, 'asm2wasm')]
WASM2JS = [os.path.join(options.binaryen_bin, 'wasm2js')]
WASM_CTOR_EVAL = [os.path.join(options.binaryen_bin, 'wasm-ctor-eval')]
WASM_SHELL = [os.path.join(options.binaryen_bin, 'wasm-shell')]
-WASM_MERGE = [os.path.join(options.binaryen_bin, 'wasm-merge')]
WASM_REDUCE = [os.path.join(options.binaryen_bin, 'wasm-reduce')]
WASM_METADCE = [os.path.join(options.binaryen_bin, 'wasm-metadce')]
WASM_EMSCRIPTEN_FINALIZE = [os.path.join(options.binaryen_bin,
diff --git a/src/tools/wasm-merge.cpp b/src/tools/wasm-merge.cpp
deleted file mode 100644
index 6dd522d16..000000000
--- a/src/tools/wasm-merge.cpp
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
- * Copyright 2017 WebAssembly Community Group participants
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-//
-// A WebAssembly merger: loads multiple files, smashes them together,
-// and emits the result.
-//
-// This is *not* a real linker. It just does naive merging.
-//
-
-#include <memory>
-
-#include "parsing.h"
-#include "pass.h"
-#include "shared-constants.h"
-#include "asmjs/shared-constants.h"
-#include "asm_v_wasm.h"
-#include "support/command-line.h"
-#include "support/file.h"
-#include "wasm-io.h"
-#include "wasm-binary.h"
-#include "wasm-builder.h"
-#include "wasm-validator.h"
-#include "ir/module-utils.h"
-
-using namespace wasm;
-
-// Ensure a memory or table is of at least a size
-template<typename T>
-static void ensureSize(T& what, Index size) {
- // ensure the size is sufficient
- while (what.initial * what.kPageSize < size) {
- what.initial = what.initial + 1;
- }
- what.max = std::max(what.initial, what.max);
-}
-
-// A mergeable unit. This class contains basic logic to prepare for merging
-// of two modules.
-struct Mergeable {
- Mergeable(Module& wasm) : wasm(wasm) {
- // scan the module
- findSizes();
- findImports();
- standardizeSegments();
- }
-
- // The module we are working on
- Module& wasm;
-
- // Total sizes of the memory and table data, including things
- // link a bump from the dylink section
- Index totalMemorySize, totalTableSize;
-
- // The names of the imported globals for the memory and table bases
- // (sets, as each may be imported more than once)
- std::set<Name> memoryBaseGlobals, tableBaseGlobals;
-
- // Imported functions and globals provided by the other mergeable
- // are fused together. We track those here, then remove them
- std::map<Name, Name> implementedFunctionImports;
- std::map<Name, Name> implementedGlobalImports;
-
- // setups
-
- // find the memory and table sizes. if there are relocatable sections for them,
- // that is the base size, and a dylink section may increase things further
- void findSizes() {
- totalMemorySize = 0;
- totalTableSize = 0;
- for (auto& segment : wasm.memory.segments) {
- Expression* offset = segment.offset;
- if (offset->is<GetGlobal>()) {
- totalMemorySize = segment.data.size();
- break;
- }
- }
- for (auto& segment : wasm.table.segments) {
- Expression* offset = segment.offset;
- if (offset->is<GetGlobal>()) {
- totalTableSize = segment.data.size();
- break;
- }
- }
- for (auto& section : wasm.userSections) {
- if (section.name == BinaryConsts::UserSections::Dylink) {
- WasmBinaryBuilder builder(wasm, section.data, false);
- totalMemorySize = std::max(totalMemorySize, builder.getU32LEB());
- totalTableSize = std::max(totalTableSize, builder.getU32LEB());
- break; // there can be only one
- }
- }
- // align them
- while (totalMemorySize % 16 != 0) totalMemorySize++;
- while (totalTableSize % 2 != 0) totalTableSize++;
- }
-
- void findImports() {
- ModuleUtils::iterImportedGlobals(wasm, [&](Global* import) {
- if (import->module == ENV && import->base == MEMORY_BASE) {
- memoryBaseGlobals.insert(import->name);
- }
- });
- if (memoryBaseGlobals.size() == 0) {
- // add one
- auto* import = new Global;
- import->name = MEMORY_BASE;
- import->module = ENV;
- import->base = MEMORY_BASE;
- import->type = i32;
- wasm.addGlobal(import);
- memoryBaseGlobals.insert(import->name);
- }
- ModuleUtils::iterImportedGlobals(wasm, [&](Global* import) {
- if (import->module == ENV && import->base == TABLE_BASE) {
- tableBaseGlobals.insert(import->name);
- }
- });
- if (tableBaseGlobals.size() == 0) {
- auto* import = new Global;
- import->name = TABLE_BASE;
- import->module = ENV;
- import->base = TABLE_BASE;
- import->type = i32;
- wasm.addGlobal(import);
- tableBaseGlobals.insert(import->name);
- }
- }
-
- void standardizeSegments() {
- standardizeSegment<Memory, char, Memory::Segment>(wasm, wasm.memory, totalMemorySize, 0, *memoryBaseGlobals.begin());
- // if there are no functions, and we need one, we need to add one as the zero
- if (totalTableSize > 0 && wasm.functions.empty()) {
- auto func = new Function;
- func->name = Name("binaryen$merge-zero");
- func->body = Builder(wasm).makeNop();
- func->type = ensureFunctionType("v", &wasm)->name;
- wasm.addFunction(func);
- }
- Name zero;
- if (totalTableSize > 0) {
- zero = wasm.functions.begin()->get()->name;
- }
- standardizeSegment<Table, Name, Table::Segment>(wasm, wasm.table, totalTableSize, zero, *tableBaseGlobals.begin());
- }
-
- // utilities
-
- Name getNonColliding(Name initial, std::function<bool (Name)> checkIfCollides) {
- if (!checkIfCollides(initial)) {
- return initial;
- }
- int x = 0;
- while (1) {
- auto curr = Name(std::string(initial.str) + '$' + std::to_string(x));
- if (!checkIfCollides(curr)) {
- return curr;
- }
- x++;
- }
- }
-
- // ensure a relocatable segment exists, of the proper size, including
- // the dylink bump applied into it, standardized into the form of
- // not using a dylink section and instead having enough zeros at
- // the end. this makes linking much simpler.ta
- // there may be other non-relocatable segments too.
- template<typename T, typename U, typename Segment>
- void standardizeSegment(Module& wasm, T& what, Index size, U zero, Name globalName) {
- Segment* relocatable = nullptr;
- for (auto& segment : what.segments) {
- Expression* offset = segment.offset;
- if (offset->is<GetGlobal>()) {
- // this is the relocatable one.
- relocatable = &segment;
- break;
- }
- }
- if (!relocatable) {
- // none existing, add one
- what.segments.resize(what.segments.size() + 1);
- relocatable = &what.segments.back();
- relocatable->offset = Builder(wasm).makeGetGlobal(globalName, i32);
- }
- // make sure it is the right size
- while (relocatable->data.size() < size) {
- relocatable->data.push_back(zero);
- }
- ensureSize(what, relocatable->data.size());
- }
-
- // copies a relocatable segment from the input to the output, and
- // copies the non-relocatable ones as well
- template<typename T, typename V>
- void copySegments(T& output, T& input, V updater) {
- for (auto& inputSegment : input.segments) {
- Expression* inputOffset = inputSegment.offset;
- if (inputOffset->is<GetGlobal>()) {
- // this is the relocatable one. find the output's relocatable
- for (auto& segment : output.segments) {
- Expression* offset = segment.offset;
- if (offset->is<GetGlobal>()) {
- // copy our data in
- for (auto item : inputSegment.data) {
- segment.data.push_back(updater(item));
- }
- ensureSize(output, segment.data.size());
- return; // there can be only one
- }
- }
- WASM_UNREACHABLE(); // we must find a relocatable one in the output, as we standardized
- } else {
- // this is a non-relocatable one. just copy it.
- output.segments.push_back(inputSegment);
- }
- }
- }
-};
-
-// A mergeable that is an output, that is, that we merge into. This adds
-// logic to update it for the new data, namely, when an import is provided
-// by the other merged unit, we resolve to access that value directly.
-struct OutputMergeable : public PostWalker<OutputMergeable, Visitor<OutputMergeable>>, public Mergeable {
- OutputMergeable(Module& wasm) : Mergeable(wasm) {}
-
- void visitCall(Call* curr) {
- auto iter = implementedFunctionImports.find(curr->target);
- if (iter != implementedFunctionImports.end()) {
- // this import is now in the module - call it
- replaceCurrent(Builder(*getModule()).makeCall(iter->second, curr->operands, curr->type));
- }
- }
-
- void visitGetGlobal(GetGlobal* curr) {
- auto iter = implementedGlobalImports.find(curr->name);
- if (iter != implementedGlobalImports.end()) {
- // this global is now in the module - get it
- curr->name = iter->second;
- assert(curr->name.is());
- }
- }
-
- void visitModule(Module* curr) {
- // remove imports that are being implemented
- for (auto& pair : implementedFunctionImports) {
- curr->removeFunction(pair.first);
- }
- for (auto& pair : implementedGlobalImports) {
- curr->removeGlobal(pair.first);
- }
- }
-};
-
-// A mergeable that is an input, that is, that we merge into another.
-// This adds logic to disambiguate its names from the other, and to
-// perform all other merging operations.
-struct InputMergeable : public ExpressionStackWalker<InputMergeable, Visitor<InputMergeable>>, public Mergeable {
- InputMergeable(Module& wasm, OutputMergeable& outputMergeable) : Mergeable(wasm), outputMergeable(outputMergeable) {}
-
- // The unit we are being merged into
- OutputMergeable& outputMergeable;
-
- // mappings (after disambiguating with the other mergeable), old name => new name
- std::map<Name, Name> ftNames; // function types
- std::map<Name, Name> eNames; // exports
- std::map<Name, Name> fNames; // functions
- std::map<Name, Name> gNames; // globals
-
- void visitCall(Call* curr) {
- auto iter = implementedFunctionImports.find(curr->target);
- if (iter != implementedFunctionImports.end()) {
- // this import is now in the module - call it
- replaceCurrent(Builder(*getModule()).makeCall(iter->second, curr->operands, curr->type));
- return;
- }
- curr->target = fNames[curr->target];
- assert(curr->target.is());
- }
-
- void visitCallIndirect(CallIndirect* curr) {
- curr->fullType = ftNames[curr->fullType];
- assert(curr->fullType.is());
- }
-
- void visitGetGlobal(GetGlobal* curr) {
- auto iter = implementedGlobalImports.find(curr->name);
- if (iter != implementedGlobalImports.end()) {
- // this import is now in the module - use it
- curr->name = iter->second;
- return;
- }
- curr->name = gNames[curr->name];
- assert(curr->name.is());
- // if this is the memory or table base, add the bump
- if (memoryBaseGlobals.count(curr->name)) {
- addBump(outputMergeable.totalMemorySize);
- } else if (tableBaseGlobals.count(curr->name)) {
- addBump(outputMergeable.totalTableSize);
- }
- }
-
- void visitSetGlobal(SetGlobal* curr) {
- curr->name = gNames[curr->name];
- assert(curr->name.is());
- }
-
- void merge() {
- // find function imports in us that are implemented in the output
- // TODO make maps, avoid N^2
- ModuleUtils::iterImportedFunctions(wasm, [&](Function* import) {
- // per wasm dynamic library rules, we expect to see exports on 'env'
- if (import->module == ENV) {
- // seek an export on the other side that matches
- for (auto& exp : outputMergeable.wasm.exports) {
- if (exp->name == import->base) {
- // fits!
- implementedFunctionImports[import->name] = exp->value;
- break;
- }
- }
- }
- });
- ModuleUtils::iterImportedGlobals(wasm, [&](Global* import) {
- // per wasm dynamic library rules, we expect to see exports on 'env'
- if (import->module == ENV) {
- // seek an export on the other side that matches
- for (auto& exp : outputMergeable.wasm.exports) {
- if (exp->name == import->base) {
- // fits!
- implementedGlobalImports[import->name] = exp->value;
- break;
- }
- }
- }
- });
- // remove the unneeded ones
- for (auto& pair : implementedFunctionImports) {
- wasm.removeFunction(pair.first);
- }
- for (auto& pair : implementedGlobalImports) {
- wasm.removeGlobal(pair.first);
- }
-
- // find new names
- for (auto& curr : wasm.functionTypes) {
- curr->name = ftNames[curr->name] = getNonColliding(curr->name, [&](Name name) -> bool {
- return outputMergeable.wasm.getFunctionTypeOrNull(name);
- });
- }
- ModuleUtils::iterImportedFunctions(wasm, [&](Function* curr) {
- curr->name = fNames[curr->name] = getNonColliding(curr->name, [&](Name name) -> bool {
- return !!outputMergeable.wasm.getFunctionOrNull(name);
- });
- });
- ModuleUtils::iterImportedGlobals(wasm, [&](Global* curr) {
- curr->name = gNames[curr->name] = getNonColliding(curr->name, [&](Name name) -> bool {
- return !!outputMergeable.wasm.getGlobalOrNull(name);
- });
- });
- ModuleUtils::iterDefinedFunctions(wasm, [&](Function* curr) {
- curr->name = fNames[curr->name] = getNonColliding(curr->name, [&](Name name) -> bool {
- return outputMergeable.wasm.getFunctionOrNull(name);
- });
- });
- ModuleUtils::iterDefinedGlobals(wasm, [&](Global* curr) {
- curr->name = gNames[curr->name] = getNonColliding(curr->name, [&](Name name) -> bool {
- return outputMergeable.wasm.getGlobalOrNull(name);
- });
- });
-
- // update global names in input
- {
- auto temp = memoryBaseGlobals;
- memoryBaseGlobals.clear();
- for (auto x : temp) {
- memoryBaseGlobals.insert(gNames[x]);
- }
- }
- {
- auto temp = tableBaseGlobals;
- tableBaseGlobals.clear();
- for (auto x : temp) {
- tableBaseGlobals.insert(gNames[x]);
- }
- }
-
- // find function imports in output that are implemented in the input
- ModuleUtils::iterImportedFunctions(outputMergeable.wasm, [&](Function* import) {
- if (import->module == ENV) {
- for (auto& exp : wasm.exports) {
- if (exp->name == import->base) {
- outputMergeable.implementedFunctionImports[import->name] = fNames[exp->value];
- break;
- }
- }
- }
- });
- ModuleUtils::iterImportedGlobals(outputMergeable.wasm, [&](Global* import) {
- if (import->module == ENV) {
- for (auto& exp : wasm.exports) {
- if (exp->name == import->base) {
- outputMergeable.implementedGlobalImports[import->name] = gNames[exp->value];
- break;
- }
- }
- }
- });
-
- // update the output before bringing anything in. avoid doing so when possible, as in the
- // common case the output module is very large.
- if (outputMergeable.implementedFunctionImports.size() + outputMergeable.implementedGlobalImports.size() > 0) {
- outputMergeable.walkModule(&outputMergeable.wasm);
- }
-
- // memory&table: we place the new memory segments at a higher position. after the existing ones.
- copySegments(outputMergeable.wasm.memory, wasm.memory, [](char x) -> char { return x; });
- copySegments(outputMergeable.wasm.table, wasm.table, [&](Name x) -> Name { return fNames[x]; });
-
- // update the new contents about to be merged in
- walkModule(&wasm);
-
- // handle the dylink post-instantiate. this is special, as if it exists in both, we must in fact call both
- Name POST_INSTANTIATE("__post_instantiate");
- if (fNames.find(POST_INSTANTIATE) != fNames.end() &&
- outputMergeable.wasm.getExportOrNull(POST_INSTANTIATE)) {
- // indeed, both exist. add a call to the second (wasm spec does not give an order requirement)
- auto* func = outputMergeable.wasm.getFunction(outputMergeable.wasm.getExport(POST_INSTANTIATE)->value);
- Builder builder(outputMergeable.wasm);
- func->body = builder.makeSequence(
- builder.makeCall(fNames[POST_INSTANTIATE], {}, none),
- func->body
- );
- }
-
- // copy in the data
- for (auto& curr : wasm.functionTypes) {
- outputMergeable.wasm.addFunctionType(std::move(curr));
- }
- for (auto& curr : wasm.globals) {
- if (curr->imported()) {
- outputMergeable.wasm.addGlobal(curr.release());
- }
- }
- for (auto& curr : wasm.functions) {
- if (curr->imported()) {
- if (curr->type.is()) {
- curr->type = ftNames[curr->type];
- assert(curr->type.is());
- }
- outputMergeable.wasm.addFunction(curr.release());
- }
- }
- for (auto& curr : wasm.exports) {
- if (curr->kind == ExternalKind::Memory || curr->kind == ExternalKind::Table) {
- continue; // wasm has just 1 of each, they must match
- }
- // if an export would collide, do not add the new one, ignore it
- // TODO: warning/error mode?
- if (!outputMergeable.wasm.getExportOrNull(curr->name)) {
- if (curr->kind == ExternalKind::Function) {
- curr->value = fNames[curr->value];
- outputMergeable.wasm.addExport(curr.release());
- } else if (curr->kind == ExternalKind::Global) {
- curr->value = gNames[curr->value];
- outputMergeable.wasm.addExport(curr.release());
- } else {
- WASM_UNREACHABLE();
- }
- }
- }
- // Copy over the remaining non-imports (we have already transferred
- // the imports, and they are nullptrs).
- for (auto& curr : wasm.functions) {
- if (curr) {
- assert(!curr->imported());
- curr->type = ftNames[curr->type];
- assert(curr->type.is());
- outputMergeable.wasm.addFunction(curr.release());
- }
- }
- for (auto& curr : wasm.globals) {
- if (curr) {
- assert(!curr->imported());
- outputMergeable.wasm.addGlobal(curr.release());
- }
- }
- }
-
-private:
- // add an offset to a global.get. we look above, and if there is already an add,
- // we can add into it, avoiding creating a new node
- void addBump(Index bump) {
- if (expressionStack.size() >= 2) {
- auto* parent = expressionStack[expressionStack.size() - 2];
- if (auto* binary = parent->dynCast<Binary>()) {
- if (binary->op == AddInt32) {
- if (auto* num = binary->right->dynCast<Const>()) {
- num->value = num->value.add(Literal(bump));
- return;
- }
- }
- }
- }
- Builder builder(*getModule());
- replaceCurrent(
- builder.makeBinary(
- AddInt32,
- expressionStack.back(),
- builder.makeConst(Literal(int32_t(bump)))
- )
- );
- }
-};
-
-// Finalize the memory/table bases, assinging concrete values into them
-void finalizeBases(Module& wasm, Index memory, Index table) {
- struct FinalizableMergeable : public Mergeable, public PostWalker<FinalizableMergeable, Visitor<FinalizableMergeable>> {
- FinalizableMergeable(Module& wasm, Index memory, Index table) : Mergeable(wasm), memory(memory), table(table) {
- walkModule(&wasm);
- // ensure memory and table sizes suffice, after finalization we have absolute locations now
- for (auto& segment : wasm.memory.segments) {
- ensureSize(wasm.memory, memory + segment.data.size());
- }
- for (auto& segment : wasm.table.segments) {
- ensureSize(wasm.table, table + segment.data.size());
- }
- }
-
- Index memory, table;
-
- void visitGetGlobal(GetGlobal* curr) {
- if (memory != Index(-1) && memoryBaseGlobals.count(curr->name)) {
- finalize(memory);
- } else if (table != Index(-1) && tableBaseGlobals.count(curr->name)) {
- finalize(table);
- }
- }
-
- private:
- void finalize(Index value) {
- replaceCurrent(Builder(*getModule()).makeConst(Literal(int32_t(value))));
- }
- };
- FinalizableMergeable mergeable(wasm, memory, table);
-}
-
-//
-// main
-//
-
-int main(int argc, const char* argv[]) {
- std::vector<std::string> filenames;
- bool emitBinary = true;
- Index finalizeMemoryBase = Index(-1),
- finalizeTableBase = Index(-1);
- bool optimize = false;
- bool verbose = false;
-
- Options options("wasm-merge", "Merge wasm files");
- options
- .add("--output", "-o", "Output file",
- Options::Arguments::One,
- [](Options* o, const std::string& argument) {
- o->extra["output"] = argument;
- Colors::disable();
- })
- .add("--emit-text", "-S", "Emit text instead of binary for the output file",
- Options::Arguments::Zero,
- [&](Options *o, const std::string& argument) { emitBinary = false; })
- .add("--finalize-memory-base", "-fmb", "Finalize the env.__memory_base import",
- Options::Arguments::One,
- [&](Options* o, const std::string& argument) {
- finalizeMemoryBase = atoi(argument.c_str());
- })
- .add("--finalize-table-base", "-ftb", "Finalize the env.__table_base import",
- Options::Arguments::One,
- [&](Options* o, const std::string& argument) {
- finalizeTableBase = atoi(argument.c_str());
- })
- .add("-O", "-O", "Perform merge-time/finalize-time optimizations",
- Options::Arguments::Zero,
- [&](Options* o, const std::string& argument) {
- optimize = true;
- })
- .add("--verbose", "-v", "Verbose output",
- Options::Arguments::Zero,
- [&](Options* o, const std::string& argument) {
- verbose = true;
- })
- .add_positional("INFILES", Options::Arguments::N,
- [&](Options *o, const std::string& argument) {
- filenames.push_back(argument);
- });
- options.parse(argc, argv);
-
- Module output;
- std::vector<std::unique_ptr<Module>> otherModules; // keep all inputs alive, to save copies
- bool first = true;
- for (auto& filename : filenames) {
- ModuleReader reader;
- if (first) {
- // read the first right into output, don't waste time merging into an empty module
- try {
- reader.read(filename, output);
- } catch (ParseException& p) {
- p.dump(std::cerr);
- Fatal() << "error in parsing input";
- }
- first = false;
- } else {
- std::unique_ptr<Module> input = wasm::make_unique<Module>();
- try {
- reader.read(filename, *input);
- } catch (ParseException& p) {
- p.dump(std::cerr);
- Fatal() << "error in parsing input";
- }
- // perform the merge
- OutputMergeable outputMergeable(output);
- InputMergeable inputMergeable(*input, outputMergeable);
- inputMergeable.merge();
- // retain the linked in module as we may depend on parts of it
- otherModules.push_back(std::unique_ptr<Module>(input.release()));
- }
- }
-
- if (verbose) {
- // memory and table are standardized and merged, so it's easy to dump out some stats
- std::cout << "merged total memory size: " << output.memory.segments[0].data.size() << '\n';
- std::cout << "merged total table size: " << output.table.segments[0].data.size() << '\n';
- std::cout << "merged functions: " << output.functions.size() << '\n';
- }
-
- if (finalizeMemoryBase != Index(-1) || finalizeTableBase != Index(-1)) {
- finalizeBases(output, finalizeMemoryBase, finalizeTableBase);
- }
-
- if (optimize) {
- // merge-time/finalize-time optimization
- // it is beneficial to do global optimizations, as well as precomputing to get rid of finalized constants
- PassRunner passRunner(&output);
- passRunner.add("precompute");
- passRunner.add("optimize-instructions"); // things now-constant may be further optimized
- passRunner.addDefaultGlobalOptimizationPostPasses();
- passRunner.run();
- }
-
- if (!WasmValidator().validate(output)) {
- WasmPrinter::printModule(&output);
- Fatal() << "error in validating output";
- }
-
- if (options.extra.count("output") > 0) {
- ModuleWriter writer;
- writer.setDebug(options.debug);
- writer.setBinary(emitBinary);
- writer.write(output, options.extra["output"]);
- }
-}
diff --git a/test/merge/basics.wast b/test/merge/basics.wast
deleted file mode 100644
index b5c40feab..000000000
--- a/test/merge/basics.wast
+++ /dev/null
@@ -1,40 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (data (global.get $memoryBase) "hello, A!\n")
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a i32 (i32.const 1))
- (global $global-a-mut (mut i32) (i32.const 1))
- (elem (global.get $tableBase) $only-a $willCollide $some-func $some-collide $only-a)
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (func $only-a
- (drop (i32.const 100))
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (drop (global.get $global-collide))
- (drop (global.get $global-a))
- (drop (global.get $global-a-mut))
- (drop (global.get $memoryBase))
- (drop (global.get $tableBase))
- (global.set $global-collide-mut (i32.const 1234))
- )
- (func $willCollide
- (drop (i32.const 200))
- (call $willCollide)
- )
-)
-
diff --git a/test/merge/basics.wast.combined b/test/merge/basics.wast.combined
deleted file mode 100644
index 4d603b410..000000000
--- a/test/merge/basics.wast.combined
+++ /dev/null
@@ -1,133 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (type $ii$0 (func (param i32 i32)))
- (type $FUNCSIG$v$0 (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n\00\00\00\00\00\00")
- (import "env" "table" (table $0 10 funcref))
- (elem (global.get $tableBase) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0)
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a i32 (i32.const 1))
- (global $global-a-mut (mut i32) (i32.const 1))
- (global $global-collide$0 i32 (i32.const 0))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (global $global-b i32 (i32.const 1))
- (global $global-b-mut (mut i32) (i32.const 1))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 100)
- )
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (drop
- (global.get $global-collide)
- )
- (drop
- (global.get $global-a)
- )
- (drop
- (global.get $global-a-mut)
- )
- (drop
- (global.get $memoryBase)
- )
- (drop
- (global.get $tableBase)
- )
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 200)
- )
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 111)
- )
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii$0)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (drop
- (global.get $global-collide$0)
- )
- (drop
- (global.get $global-b)
- )
- (drop
- (global.get $global-b-mut)
- )
- (drop
- (global.get $memoryBase$0)
- )
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (i32.add
- (global.get $memoryBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (unreachable)
- )
- )
- (drop
- (i32.sub
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 222)
- )
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/basics.wast.combined.finalized b/test/merge/basics.wast.combined.finalized
deleted file mode 100644
index 6dbdd2c35..000000000
--- a/test/merge/basics.wast.combined.finalized
+++ /dev/null
@@ -1,133 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (type $ii$0 (func (param i32 i32)))
- (type $FUNCSIG$v$0 (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n\00\00\00\00\00\00")
- (import "env" "table" (table $0 18 funcref))
- (elem (global.get $tableBase) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0)
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a i32 (i32.const 1))
- (global $global-a-mut (mut i32) (i32.const 1))
- (global $global-collide$0 i32 (i32.const 0))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (global $global-b i32 (i32.const 1))
- (global $global-b-mut (mut i32) (i32.const 1))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 100)
- )
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (drop
- (global.get $global-collide)
- )
- (drop
- (global.get $global-a)
- )
- (drop
- (global.get $global-a-mut)
- )
- (drop
- (global.get $memoryBase)
- )
- (drop
- (global.get $tableBase)
- )
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 200)
- )
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 111)
- )
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii$0)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (drop
- (global.get $global-collide$0)
- )
- (drop
- (global.get $global-b)
- )
- (drop
- (global.get $global-b-mut)
- )
- (drop
- (global.get $memoryBase$0)
- )
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (i32.add
- (global.get $memoryBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (unreachable)
- )
- )
- (drop
- (i32.sub
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 222)
- )
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/basics.wast.combined.finalized.opt b/test/merge/basics.wast.combined.finalized.opt
deleted file mode 100644
index 057459c84..000000000
--- a/test/merge/basics.wast.combined.finalized.opt
+++ /dev/null
@@ -1,107 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n")
- (import "env" "table" (table $0 18 funcref))
- (elem (global.get $tableBase) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0)
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a-mut (mut i32) (i32.const 1))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (global $global-b-mut (mut i32) (i32.const 1))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (nop)
- (nop)
- (drop
- (global.get $global-a-mut)
- )
- (drop
- (global.get $memoryBase)
- )
- (drop
- (global.get $tableBase)
- )
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (nop)
- (nop)
- (drop
- (global.get $global-b-mut)
- )
- (drop
- (global.get $memoryBase$0)
- )
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (i32.add
- (global.get $memoryBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (unreachable)
- )
- )
- (drop
- (i32.sub
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/basics.wast.combined.finalized.opt.stdout b/test/merge/basics.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 9795060ae..000000000
--- a/test/merge/basics.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 10
-merged functions: 8
diff --git a/test/merge/basics.wast.combined.finalized.stdout b/test/merge/basics.wast.combined.finalized.stdout
deleted file mode 100644
index 9795060ae..000000000
--- a/test/merge/basics.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 10
-merged functions: 8
diff --git a/test/merge/basics.wast.combined.opt b/test/merge/basics.wast.combined.opt
deleted file mode 100644
index 1c1b020fb..000000000
--- a/test/merge/basics.wast.combined.opt
+++ /dev/null
@@ -1,107 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n")
- (import "env" "table" (table $0 10 funcref))
- (elem (global.get $tableBase) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0)
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a-mut (mut i32) (i32.const 1))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (global $global-b-mut (mut i32) (i32.const 1))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (nop)
- (nop)
- (drop
- (global.get $global-a-mut)
- )
- (drop
- (global.get $memoryBase)
- )
- (drop
- (global.get $tableBase)
- )
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (nop)
- (nop)
- (drop
- (global.get $global-b-mut)
- )
- (drop
- (global.get $memoryBase$0)
- )
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (i32.add
- (global.get $memoryBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase$0)
- (unreachable)
- )
- )
- (drop
- (i32.sub
- (global.get $tableBase$0)
- (i32.const 1000)
- )
- )
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/basics.wast.combined.opt.stdout b/test/merge/basics.wast.combined.opt.stdout
deleted file mode 100644
index 9795060ae..000000000
--- a/test/merge/basics.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 10
-merged functions: 8
diff --git a/test/merge/basics.wast.combined.stdout b/test/merge/basics.wast.combined.stdout
deleted file mode 100644
index 9795060ae..000000000
--- a/test/merge/basics.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 10
-merged functions: 8
diff --git a/test/merge/basics.wast.toMerge b/test/merge/basics.wast.toMerge
deleted file mode 100644
index 7230332cb..000000000
--- a/test/merge/basics.wast.toMerge
+++ /dev/null
@@ -1,65 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide))
- (data (global.get $memoryBase) "hello, B!\n")
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-b i32 (i32.const 1))
- (global $global-b-mut (mut i32) (i32.const 1))
- (elem (global.get $tableBase) $only-b $willCollide $some-func-b $some-collide)
- (export "exp-b" (func $only-b))
- (export "exp-collide" (func $only-b))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b-nameCollided" (func $willCollide))
- (func $only-b
- (drop (i32.const 111))
- (call $only-b)
- (call $some-func-b)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (drop (global.get $global-collide))
- (drop (global.get $global-b))
- (drop (global.get $global-b-mut))
- (drop (global.get $memoryBase))
- (drop (global.get $tableBase))
- (drop
- (i32.add
- (global.get $memoryBase)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase)
- (i32.const 1000)
- )
- )
- (drop
- (i32.add
- (global.get $tableBase)
- (unreachable) ;; bad!
- )
- )
- (drop
- (i32.sub ;; bad!
- (global.get $tableBase)
- (i32.const 1000)
- )
- )
- (global.set $global-collide-mut (i32.const 5678))
- )
- (func $willCollide
- (drop (i32.const 222))
- (call $willCollide)
- )
-)
-
diff --git a/test/merge/dylib.wasm b/test/merge/dylib.wasm
deleted file mode 100644
index 8df894a74..000000000
--- a/test/merge/dylib.wasm
+++ /dev/null
Binary files differ
diff --git a/test/merge/dylib.wasm.combined b/test/merge/dylib.wasm.combined
deleted file mode 100644
index 1e0543a5c..000000000
--- a/test/merge/dylib.wasm.combined
+++ /dev/null
@@ -1,101 +0,0 @@
-(module
- (type $0 (func (param i32 i32)))
- (type $1 (func (param i32) (result i32)))
- (type $2 (func (result i32)))
- (type $3 (func))
- (type $0$0 (func (param i32 i32)))
- (type $1$0 (func (result i32)))
- (type $2$0 (func))
- (import "env" "memory" (memory $2 256))
- (data (global.get $gimport$0) "hello, world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
- (import "env" "table" (table $timport$3 0 funcref))
- (import "env" "memoryBase" (global $gimport$0 i32))
- (import "env" "tableBase" (global $gimport$4 i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $gimport$0$0 i32))
- (import "env" "tableBase" (global $gimport$4$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "_puts" (func $import$1 (param i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 0))
- (global $global$1 (mut i32) (i32.const 0))
- (global $global$2 i32 (i32.const 0))
- (global $global$0$0 (mut i32) (i32.const 0))
- (global $global$1$0 (mut i32) (i32.const 0))
- (export "__post_instantiate" (func $__post_instantiate))
- (export "_main" (func $_main))
- (export "runPostSets" (func $runPostSets))
- (export "_str" (global $global$2))
- (export "_foo" (func $_foo))
- (func $_main (; 1 ;) (type $2) (result i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (drop
- (call $import$1
- (global.get $gimport$0)
- )
- )
- (i32.const 0)
- )
- )
- )
- (func $runPostSets (; 2 ;) (type $3)
- (block $label$1
- (nop)
- )
- )
- (func $__post_instantiate (; 3 ;) (type $3)
- (call $__post_instantiate$0)
- (block $label$1
- (block $label$2
- (global.set $global$0
- (i32.add
- (global.get $gimport$0)
- (i32.const 16)
- )
- )
- (global.set $global$1
- (i32.add
- (global.get $global$0)
- (i32.const 32)
- )
- )
- (call $runPostSets)
- )
- )
- )
- (func $_foo (; 4 ;) (type $1$0) (result i32)
- (local $0 i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (local.set $0
- (call $_main)
- )
- (local.get $0)
- )
- )
- )
- (func $runPostSets$0 (; 5 ;) (type $2$0)
- (block $label$1
- (nop)
- )
- )
- (func $__post_instantiate$0 (; 6 ;) (type $2$0)
- (block $label$1
- (block $label$2
- (global.set $global$0$0
- (global.get $gimport$0$0)
- )
- (global.set $global$1$0
- (i32.add
- (global.get $global$0$0)
- (i32.const 10)
- )
- )
- (call $runPostSets$0)
- )
- )
- )
- ;; custom section "dylink", size 2
-)
diff --git a/test/merge/dylib.wasm.combined.finalized b/test/merge/dylib.wasm.combined.finalized
deleted file mode 100644
index f5808e177..000000000
--- a/test/merge/dylib.wasm.combined.finalized
+++ /dev/null
@@ -1,101 +0,0 @@
-(module
- (type $0 (func (param i32 i32)))
- (type $1 (func (param i32) (result i32)))
- (type $2 (func (result i32)))
- (type $3 (func))
- (type $0$0 (func (param i32 i32)))
- (type $1$0 (func (result i32)))
- (type $2$0 (func))
- (import "env" "memory" (memory $2 256))
- (data (global.get $gimport$0) "hello, world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
- (import "env" "table" (table $timport$3 8 funcref))
- (import "env" "memoryBase" (global $gimport$0 i32))
- (import "env" "tableBase" (global $gimport$4 i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $gimport$0$0 i32))
- (import "env" "tableBase" (global $gimport$4$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "_puts" (func $import$1 (param i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 0))
- (global $global$1 (mut i32) (i32.const 0))
- (global $global$2 i32 (i32.const 0))
- (global $global$0$0 (mut i32) (i32.const 0))
- (global $global$1$0 (mut i32) (i32.const 0))
- (export "__post_instantiate" (func $__post_instantiate))
- (export "_main" (func $_main))
- (export "runPostSets" (func $runPostSets))
- (export "_str" (global $global$2))
- (export "_foo" (func $_foo))
- (func $_main (; 1 ;) (type $2) (result i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (drop
- (call $import$1
- (global.get $gimport$0)
- )
- )
- (i32.const 0)
- )
- )
- )
- (func $runPostSets (; 2 ;) (type $3)
- (block $label$1
- (nop)
- )
- )
- (func $__post_instantiate (; 3 ;) (type $3)
- (call $__post_instantiate$0)
- (block $label$1
- (block $label$2
- (global.set $global$0
- (i32.add
- (global.get $gimport$0)
- (i32.const 16)
- )
- )
- (global.set $global$1
- (i32.add
- (global.get $global$0)
- (i32.const 32)
- )
- )
- (call $runPostSets)
- )
- )
- )
- (func $_foo (; 4 ;) (type $1$0) (result i32)
- (local $0 i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (local.set $0
- (call $_main)
- )
- (local.get $0)
- )
- )
- )
- (func $runPostSets$0 (; 5 ;) (type $2$0)
- (block $label$1
- (nop)
- )
- )
- (func $__post_instantiate$0 (; 6 ;) (type $2$0)
- (block $label$1
- (block $label$2
- (global.set $global$0$0
- (global.get $gimport$0$0)
- )
- (global.set $global$1$0
- (i32.add
- (global.get $global$0$0)
- (i32.const 10)
- )
- )
- (call $runPostSets$0)
- )
- )
- )
- ;; custom section "dylink", size 2
-)
diff --git a/test/merge/dylib.wasm.combined.finalized.opt b/test/merge/dylib.wasm.combined.finalized.opt
deleted file mode 100644
index 9f1571ef6..000000000
--- a/test/merge/dylib.wasm.combined.finalized.opt
+++ /dev/null
@@ -1,87 +0,0 @@
-(module
- (type $1 (func (param i32) (result i32)))
- (type $2 (func (result i32)))
- (type $3 (func))
- (import "env" "memory" (memory $2 256))
- (data (global.get $gimport$0) "hello, world!")
- (import "env" "table" (table $timport$3 8 funcref))
- (import "env" "memoryBase" (global $gimport$0 i32))
- (import "env" "memoryBase" (global $gimport$0$0 i32))
- (import "env" "_puts" (func $import$1 (param i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 0))
- (global $global$1 (mut i32) (i32.const 0))
- (global $global$2 i32 (i32.const 0))
- (global $global$0$0 (mut i32) (i32.const 0))
- (global $global$1$0 (mut i32) (i32.const 0))
- (export "__post_instantiate" (func $__post_instantiate))
- (export "_main" (func $_main))
- (export "runPostSets" (func $runPostSets))
- (export "_str" (global $global$2))
- (export "_foo" (func $_foo))
- (func $_main (; 1 ;) (type $2) (result i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (drop
- (call $import$1
- (global.get $gimport$0)
- )
- )
- (i32.const 0)
- )
- )
- )
- (func $runPostSets (; 2 ;) (type $3)
- (nop)
- )
- (func $__post_instantiate (; 3 ;) (type $3)
- (call $__post_instantiate$0)
- (block $label$1
- (block $label$2
- (global.set $global$0
- (i32.add
- (global.get $gimport$0)
- (i32.const 16)
- )
- )
- (global.set $global$1
- (i32.add
- (global.get $global$0)
- (i32.const 32)
- )
- )
- (call $runPostSets)
- )
- )
- )
- (func $_foo (; 4 ;) (type $2) (result i32)
- (local $0 i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (local.set $0
- (call $_main)
- )
- (local.get $0)
- )
- )
- )
- (func $runPostSets$0 (; 5 ;) (type $3)
- (nop)
- )
- (func $__post_instantiate$0 (; 6 ;) (type $3)
- (block $label$1
- (block $label$2
- (global.set $global$0$0
- (global.get $gimport$0$0)
- )
- (global.set $global$1$0
- (i32.add
- (global.get $global$0$0)
- (i32.const 10)
- )
- )
- (call $runPostSets$0)
- )
- )
- )
- ;; custom section "dylink", size 2
-)
diff --git a/test/merge/dylib.wasm.combined.finalized.opt.stdout b/test/merge/dylib.wasm.combined.finalized.opt.stdout
deleted file mode 100644
index ce210156f..000000000
--- a/test/merge/dylib.wasm.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 64
-merged total table size: 0
-merged functions: 7
diff --git a/test/merge/dylib.wasm.combined.finalized.stdout b/test/merge/dylib.wasm.combined.finalized.stdout
deleted file mode 100644
index ce210156f..000000000
--- a/test/merge/dylib.wasm.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 64
-merged total table size: 0
-merged functions: 7
diff --git a/test/merge/dylib.wasm.combined.opt b/test/merge/dylib.wasm.combined.opt
deleted file mode 100644
index 947257bd8..000000000
--- a/test/merge/dylib.wasm.combined.opt
+++ /dev/null
@@ -1,88 +0,0 @@
-(module
- (type $1 (func (param i32) (result i32)))
- (type $2 (func (result i32)))
- (type $3 (func))
- (import "env" "memory" (memory $2 256))
- (data (global.get $gimport$0) "hello, world!")
- (import "env" "table" (table $timport$3 0 funcref))
- (import "env" "memoryBase" (global $gimport$0 i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $gimport$0$0 i32))
- (import "env" "_puts" (func $import$1 (param i32) (result i32)))
- (global $global$0 (mut i32) (i32.const 0))
- (global $global$1 (mut i32) (i32.const 0))
- (global $global$2 i32 (i32.const 0))
- (global $global$0$0 (mut i32) (i32.const 0))
- (global $global$1$0 (mut i32) (i32.const 0))
- (export "__post_instantiate" (func $__post_instantiate))
- (export "_main" (func $_main))
- (export "runPostSets" (func $runPostSets))
- (export "_str" (global $global$2))
- (export "_foo" (func $_foo))
- (func $_main (; 1 ;) (type $2) (result i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (drop
- (call $import$1
- (global.get $gimport$0)
- )
- )
- (i32.const 0)
- )
- )
- )
- (func $runPostSets (; 2 ;) (type $3)
- (nop)
- )
- (func $__post_instantiate (; 3 ;) (type $3)
- (call $__post_instantiate$0)
- (block $label$1
- (block $label$2
- (global.set $global$0
- (i32.add
- (global.get $gimport$0)
- (i32.const 16)
- )
- )
- (global.set $global$1
- (i32.add
- (global.get $global$0)
- (i32.const 32)
- )
- )
- (call $runPostSets)
- )
- )
- )
- (func $_foo (; 4 ;) (type $2) (result i32)
- (local $0 i32)
- (block $label$1 (result i32)
- (block $label$2 (result i32)
- (local.set $0
- (call $_main)
- )
- (local.get $0)
- )
- )
- )
- (func $runPostSets$0 (; 5 ;) (type $3)
- (nop)
- )
- (func $__post_instantiate$0 (; 6 ;) (type $3)
- (block $label$1
- (block $label$2
- (global.set $global$0$0
- (global.get $gimport$0$0)
- )
- (global.set $global$1$0
- (i32.add
- (global.get $global$0$0)
- (i32.const 10)
- )
- )
- (call $runPostSets$0)
- )
- )
- )
- ;; custom section "dylink", size 2
-)
diff --git a/test/merge/dylib.wasm.combined.opt.stdout b/test/merge/dylib.wasm.combined.opt.stdout
deleted file mode 100644
index ce210156f..000000000
--- a/test/merge/dylib.wasm.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 64
-merged total table size: 0
-merged functions: 7
diff --git a/test/merge/dylib.wasm.combined.stdout b/test/merge/dylib.wasm.combined.stdout
deleted file mode 100644
index ce210156f..000000000
--- a/test/merge/dylib.wasm.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 64
-merged total table size: 0
-merged functions: 7
diff --git a/test/merge/dylib.wasm.toMerge b/test/merge/dylib.wasm.toMerge
deleted file mode 100644
index 63ff1fd0a..000000000
--- a/test/merge/dylib.wasm.toMerge
+++ /dev/null
Binary files differ
diff --git a/test/merge/fusing.wast b/test/merge/fusing.wast
deleted file mode 100644
index 39b0167e0..000000000
--- a/test/merge/fusing.wast
+++ /dev/null
@@ -1,18 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (export "foo" (func $foo-func))
- (import "env" "bar" (func $bar-func))
- (global $a-global i32 (i32.const 0))
- (export "aglobal" (global $a-global))
- (import "env" "bglobal" (global $b-global f64))
- (func $foo-func
- (drop (i32.const 1337))
- (call $bar-func)
- (drop (global.get $a-global))
- (drop (global.get $b-global))
- )
-)
-
diff --git a/test/merge/fusing.wast.combined b/test/merge/fusing.wast.combined
deleted file mode 100644
index 57b9839d0..000000000
--- a/test/merge/fusing.wast.combined
+++ /dev/null
@@ -1,47 +0,0 @@
-(module
- (type $FUNCSIG$v (func))
- (type $FUNCSIG$v$0 (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "")
- (import "env" "table" (table $0 0 funcref))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (global $a-global i32 (i32.const 0))
- (global $b-global$0 f64 (f64.const 2.14281428))
- (export "foo" (func $foo-func))
- (export "aglobal" (global $a-global))
- (export "bar" (func $bar-func$0))
- (export "bglobal" (global $b-global$0))
- (func $foo-func (; 0 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 1337)
- )
- (call $bar-func$0)
- (drop
- (global.get $a-global)
- )
- (drop
- (global.get $b-global$0)
- )
- )
- (func $b (; 1 ;) (type $FUNCSIG$v$0)
- (call $foo-func)
- )
- (func $bar-func$0 (; 2 ;) (type $FUNCSIG$v$0)
- (drop
- (f64.const 3.14159)
- )
- (drop
- (global.get $a-global)
- )
- (drop
- (global.get $b-global$0)
- )
- )
-)
diff --git a/test/merge/fusing.wast.combined.finalized b/test/merge/fusing.wast.combined.finalized
deleted file mode 100644
index 3e61b13f9..000000000
--- a/test/merge/fusing.wast.combined.finalized
+++ /dev/null
@@ -1,47 +0,0 @@
-(module
- (type $FUNCSIG$v (func))
- (type $FUNCSIG$v$0 (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 1024) "")
- (import "env" "table" (table $0 8 funcref))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (global $a-global i32 (i32.const 0))
- (global $b-global$0 f64 (f64.const 2.14281428))
- (export "foo" (func $foo-func))
- (export "aglobal" (global $a-global))
- (export "bar" (func $bar-func$0))
- (export "bglobal" (global $b-global$0))
- (func $foo-func (; 0 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 1337)
- )
- (call $bar-func$0)
- (drop
- (global.get $a-global)
- )
- (drop
- (global.get $b-global$0)
- )
- )
- (func $b (; 1 ;) (type $FUNCSIG$v$0)
- (call $foo-func)
- )
- (func $bar-func$0 (; 2 ;) (type $FUNCSIG$v$0)
- (drop
- (f64.const 3.14159)
- )
- (drop
- (global.get $a-global)
- )
- (drop
- (global.get $b-global$0)
- )
- )
-)
diff --git a/test/merge/fusing.wast.combined.finalized.opt b/test/merge/fusing.wast.combined.finalized.opt
deleted file mode 100644
index 53a226ebf..000000000
--- a/test/merge/fusing.wast.combined.finalized.opt
+++ /dev/null
@@ -1,20 +0,0 @@
-(module
- (type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table $0 8 funcref))
- (global $a-global i32 (i32.const 0))
- (global $b-global$0 f64 (f64.const 2.14281428))
- (export "foo" (func $foo-func))
- (export "aglobal" (global $a-global))
- (export "bar" (func $bar-func$0))
- (export "bglobal" (global $b-global$0))
- (func $foo-func (; 0 ;) (type $FUNCSIG$v)
- (nop)
- (call $bar-func$0)
- (nop)
- (nop)
- )
- (func $bar-func$0 (; 1 ;) (type $FUNCSIG$v)
- (nop)
- )
-)
diff --git a/test/merge/fusing.wast.combined.finalized.opt.stdout b/test/merge/fusing.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/fusing.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/fusing.wast.combined.finalized.stdout b/test/merge/fusing.wast.combined.finalized.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/fusing.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/fusing.wast.combined.opt b/test/merge/fusing.wast.combined.opt
deleted file mode 100644
index a067bea4f..000000000
--- a/test/merge/fusing.wast.combined.opt
+++ /dev/null
@@ -1,23 +0,0 @@
-(module
- (type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "")
- (import "env" "table" (table $0 0 funcref))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (global $a-global i32 (i32.const 0))
- (global $b-global$0 f64 (f64.const 2.14281428))
- (export "foo" (func $foo-func))
- (export "aglobal" (global $a-global))
- (export "bar" (func $bar-func$0))
- (export "bglobal" (global $b-global$0))
- (func $foo-func (; 0 ;) (type $FUNCSIG$v)
- (nop)
- (call $bar-func$0)
- (nop)
- (nop)
- )
- (func $bar-func$0 (; 1 ;) (type $FUNCSIG$v)
- (nop)
- )
-)
diff --git a/test/merge/fusing.wast.combined.opt.stdout b/test/merge/fusing.wast.combined.opt.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/fusing.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/fusing.wast.combined.stdout b/test/merge/fusing.wast.combined.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/fusing.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/fusing.wast.toMerge b/test/merge/fusing.wast.toMerge
deleted file mode 100644
index 8d17795b1..000000000
--- a/test/merge/fusing.wast.toMerge
+++ /dev/null
@@ -1,20 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "foo" (func $b-foo))
- (export "bar" (func $bar-func))
- (global $b-global f64 (f64.const 2.14281428))
- (export "bglobal" (global $b-global))
- (import "env" "aglobal" (global $a-global i32))
- (func $b
- (call $b-foo)
- )
- (func $bar-func
- (drop (f64.const 3.14159))
- (drop (global.get $a-global))
- (drop (global.get $b-global))
- )
-)
-
diff --git a/test/merge/global-init.wast b/test/merge/global-init.wast
deleted file mode 100644
index 1f392d96c..000000000
--- a/test/merge/global-init.wast
+++ /dev/null
@@ -1,12 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "globally" (global $i-collide i32))
- (global $a i32 (global.get $i-collide))
- (global $a-mut (mut i32) (global.get $i-collide))
- (global $g-collide i32 (global.get $i-collide))
- (global $g-collide-mut (mut i32) (global.get $i-collide))
-)
-
diff --git a/test/merge/global-init.wast.combined b/test/merge/global-init.wast.combined
deleted file mode 100644
index deb4d2635..000000000
--- a/test/merge/global-init.wast.combined
+++ /dev/null
@@ -1,23 +0,0 @@
-(module
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "")
- (import "env" "table" (table $0 0 funcref))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "globally" (global $i-collide i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "globally" (global $i-collide$0 f64))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (global $a i32 (global.get $i-collide))
- (global $a-mut (mut i32) (global.get $i-collide))
- (global $g-collide i32 (global.get $i-collide))
- (global $g-collide-mut (mut i32) (global.get $i-collide))
- (global $b f64 (global.get $i-collide$0))
- (global $b-mut (mut f64) (global.get $i-collide$0))
- (global $g-collide$0 f64 (global.get $i-collide$0))
- (global $g-collide-mut$0 (mut f64) (global.get $i-collide$0))
-)
diff --git a/test/merge/global-init.wast.combined.finalized b/test/merge/global-init.wast.combined.finalized
deleted file mode 100644
index bbebd4dd5..000000000
--- a/test/merge/global-init.wast.combined.finalized
+++ /dev/null
@@ -1,23 +0,0 @@
-(module
- (import "env" "memory" (memory $0 256))
- (data (i32.const 1024) "")
- (import "env" "table" (table $0 8 funcref))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "globally" (global $i-collide i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "globally" (global $i-collide$0 f64))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (global $a i32 (global.get $i-collide))
- (global $a-mut (mut i32) (global.get $i-collide))
- (global $g-collide i32 (global.get $i-collide))
- (global $g-collide-mut (mut i32) (global.get $i-collide))
- (global $b f64 (global.get $i-collide$0))
- (global $b-mut (mut f64) (global.get $i-collide$0))
- (global $g-collide$0 f64 (global.get $i-collide$0))
- (global $g-collide-mut$0 (mut f64) (global.get $i-collide$0))
-)
diff --git a/test/merge/global-init.wast.combined.finalized.opt b/test/merge/global-init.wast.combined.finalized.opt
deleted file mode 100644
index ed7bcd6cb..000000000
--- a/test/merge/global-init.wast.combined.finalized.opt
+++ /dev/null
@@ -1,4 +0,0 @@
-(module
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table $0 8 funcref))
-)
diff --git a/test/merge/global-init.wast.combined.finalized.opt.stdout b/test/merge/global-init.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 361590ef0..000000000
--- a/test/merge/global-init.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 0
diff --git a/test/merge/global-init.wast.combined.finalized.stdout b/test/merge/global-init.wast.combined.finalized.stdout
deleted file mode 100644
index 361590ef0..000000000
--- a/test/merge/global-init.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 0
diff --git a/test/merge/global-init.wast.combined.opt b/test/merge/global-init.wast.combined.opt
deleted file mode 100644
index 797b1b82b..000000000
--- a/test/merge/global-init.wast.combined.opt
+++ /dev/null
@@ -1,7 +0,0 @@
-(module
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "")
- (import "env" "table" (table $0 0 funcref))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
-)
diff --git a/test/merge/global-init.wast.combined.opt.stdout b/test/merge/global-init.wast.combined.opt.stdout
deleted file mode 100644
index 361590ef0..000000000
--- a/test/merge/global-init.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 0
diff --git a/test/merge/global-init.wast.combined.stdout b/test/merge/global-init.wast.combined.stdout
deleted file mode 100644
index 361590ef0..000000000
--- a/test/merge/global-init.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 0
diff --git a/test/merge/global-init.wast.toMerge b/test/merge/global-init.wast.toMerge
deleted file mode 100644
index 80f450dae..000000000
--- a/test/merge/global-init.wast.toMerge
+++ /dev/null
@@ -1,12 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "globally" (global $i-collide f64))
- (global $b f64 (global.get $i-collide))
- (global $b-mut (mut f64) (global.get $i-collide))
- (global $g-collide f64 (global.get $i-collide))
- (global $g-collide-mut (mut f64) (global.get $i-collide))
-)
-
diff --git a/test/merge/main-lacks-segments.wast b/test/merge/main-lacks-segments.wast
deleted file mode 100644
index 7357e96e9..000000000
--- a/test/merge/main-lacks-segments.wast
+++ /dev/null
@@ -1,7 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
-)
-
diff --git a/test/merge/main-lacks-segments.wast.combined b/test/merge/main-lacks-segments.wast.combined
deleted file mode 100644
index d48a8f812..000000000
--- a/test/merge/main-lacks-segments.wast.combined
+++ /dev/null
@@ -1,23 +0,0 @@
-(module
- (type $0 (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "hello, this is some data!\00\00\00\00\00\00\00")
- (import "env" "table" (table $0 2 funcref))
- (elem (global.get $__table_base) $foo $foo)
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (func $foo (; 0 ;) (type $0)
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (global.get $memoryBase$0)
- )
- )
-)
diff --git a/test/merge/main-lacks-segments.wast.combined.finalized b/test/merge/main-lacks-segments.wast.combined.finalized
deleted file mode 100644
index 48ed4f341..000000000
--- a/test/merge/main-lacks-segments.wast.combined.finalized
+++ /dev/null
@@ -1,23 +0,0 @@
-(module
- (type $0 (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 1024) "hello, this is some data!\00\00\00\00\00\00\00")
- (import "env" "table" (table $0 10 funcref))
- (elem (i32.const 8) $foo $foo)
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (func $foo (; 0 ;) (type $0)
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (global.get $memoryBase$0)
- )
- )
-)
diff --git a/test/merge/main-lacks-segments.wast.combined.finalized.opt b/test/merge/main-lacks-segments.wast.combined.finalized.opt
deleted file mode 100644
index fa8af7d41..000000000
--- a/test/merge/main-lacks-segments.wast.combined.finalized.opt
+++ /dev/null
@@ -1,17 +0,0 @@
-(module
- (type $0 (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 1024) "hello, this is some data!")
- (import "env" "table" (table $0 10 funcref))
- (elem (i32.const 8) $foo $foo)
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (func $foo (; 0 ;) (type $0)
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (global.get $memoryBase$0)
- )
- )
-)
diff --git a/test/merge/main-lacks-segments.wast.combined.finalized.opt.stdout b/test/merge/main-lacks-segments.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 5e72852f9..000000000
--- a/test/merge/main-lacks-segments.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 2
-merged functions: 1
diff --git a/test/merge/main-lacks-segments.wast.combined.finalized.stdout b/test/merge/main-lacks-segments.wast.combined.finalized.stdout
deleted file mode 100644
index 5e72852f9..000000000
--- a/test/merge/main-lacks-segments.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 2
-merged functions: 1
diff --git a/test/merge/main-lacks-segments.wast.combined.opt b/test/merge/main-lacks-segments.wast.combined.opt
deleted file mode 100644
index c203b092a..000000000
--- a/test/merge/main-lacks-segments.wast.combined.opt
+++ /dev/null
@@ -1,19 +0,0 @@
-(module
- (type $0 (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "hello, this is some data!")
- (import "env" "table" (table $0 2 funcref))
- (elem (global.get $__table_base) $foo $foo)
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (func $foo (; 0 ;) (type $0)
- (drop
- (global.get $tableBase$0)
- )
- (drop
- (global.get $memoryBase$0)
- )
- )
-)
diff --git a/test/merge/main-lacks-segments.wast.combined.opt.stdout b/test/merge/main-lacks-segments.wast.combined.opt.stdout
deleted file mode 100644
index 5e72852f9..000000000
--- a/test/merge/main-lacks-segments.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 2
-merged functions: 1
diff --git a/test/merge/main-lacks-segments.wast.combined.stdout b/test/merge/main-lacks-segments.wast.combined.stdout
deleted file mode 100644
index 5e72852f9..000000000
--- a/test/merge/main-lacks-segments.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 32
-merged total table size: 2
-merged functions: 1
diff --git a/test/merge/main-lacks-segments.wast.toMerge b/test/merge/main-lacks-segments.wast.toMerge
deleted file mode 100644
index a35c605db..000000000
--- a/test/merge/main-lacks-segments.wast.toMerge
+++ /dev/null
@@ -1,13 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (elem (global.get $tableBase) $foo)
- (data (global.get $memoryBase) "hello, this is some data!")
- (func $foo
- (drop (global.get $tableBase))
- (drop (global.get $memoryBase))
- )
-)
-
diff --git a/test/merge/noBases.wast b/test/merge/noBases.wast
deleted file mode 100644
index 41d5694ef..000000000
--- a/test/merge/noBases.wast
+++ /dev/null
@@ -1,34 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 1000 funcref))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (data (i32.const 100) "hello, A!\n")
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a i32 (i32.const 1))
- (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a)
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (func $only-a
- (drop (i32.const 100))
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (drop (global.get $global-collide))
- (drop (global.get $global-a))
- (global.set $global-collide-mut (i32.const 1234))
- )
- (func $willCollide
- (drop (i32.const 200))
- (call $willCollide)
- )
-)
-
diff --git a/test/merge/noBases.wast.combined b/test/merge/noBases.wast.combined
deleted file mode 100644
index db9b546ce..000000000
--- a/test/merge/noBases.wast.combined
+++ /dev/null
@@ -1,88 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (type $ii$0 (func (param i32 i32)))
- (type $FUNCSIG$v$0 (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 100) "hello, A!\n")
- (data (global.get $__memory_base) "")
- (data (i32.const 200) "hello, B!\n")
- (import "env" "table" (table $0 1000 funcref))
- (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a)
- (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide)
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a i32 (i32.const 1))
- (global $global-collide$0 i32 (i32.const 0))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (global $global-b i32 (i32.const 1))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 100)
- )
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (drop
- (global.get $global-collide)
- )
- (drop
- (global.get $global-a)
- )
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 200)
- )
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 111)
- )
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii$0)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (drop
- (global.get $global-collide$0)
- )
- (drop
- (global.get $global-b)
- )
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 222)
- )
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/noBases.wast.combined.finalized b/test/merge/noBases.wast.combined.finalized
deleted file mode 100644
index 62ca6dc06..000000000
--- a/test/merge/noBases.wast.combined.finalized
+++ /dev/null
@@ -1,88 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (type $ii$0 (func (param i32 i32)))
- (type $FUNCSIG$v$0 (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 100) "hello, A!\n")
- (data (i32.const 1024) "")
- (data (i32.const 200) "hello, B!\n")
- (import "env" "table" (table $0 1000 funcref))
- (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a)
- (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide)
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-a i32 (i32.const 1))
- (global $global-collide$0 i32 (i32.const 0))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (global $global-b i32 (i32.const 1))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 100)
- )
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (drop
- (global.get $global-collide)
- )
- (drop
- (global.get $global-a)
- )
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (drop
- (i32.const 200)
- )
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 111)
- )
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii$0)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (drop
- (global.get $global-collide$0)
- )
- (drop
- (global.get $global-b)
- )
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v$0)
- (drop
- (i32.const 222)
- )
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/noBases.wast.combined.finalized.opt b/test/merge/noBases.wast.combined.finalized.opt
deleted file mode 100644
index b05e78310..000000000
--- a/test/merge/noBases.wast.combined.finalized.opt
+++ /dev/null
@@ -1,61 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 100) "hello, A!\n")
- (data (i32.const 200) "hello, B!\n")
- (import "env" "table" (table $0 1000 funcref))
- (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a)
- (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide)
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (nop)
- (nop)
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (nop)
- (nop)
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/noBases.wast.combined.finalized.opt.stdout b/test/merge/noBases.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 9227c4942..000000000
--- a/test/merge/noBases.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 10
-merged total table size: 5
-merged functions: 8
diff --git a/test/merge/noBases.wast.combined.finalized.stdout b/test/merge/noBases.wast.combined.finalized.stdout
deleted file mode 100644
index 9227c4942..000000000
--- a/test/merge/noBases.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 10
-merged total table size: 5
-merged functions: 8
diff --git a/test/merge/noBases.wast.combined.opt b/test/merge/noBases.wast.combined.opt
deleted file mode 100644
index f20b16336..000000000
--- a/test/merge/noBases.wast.combined.opt
+++ /dev/null
@@ -1,64 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (type $FUNCSIG$v (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 100) "hello, A!\n")
- (data (global.get $__memory_base) "")
- (data (i32.const 200) "hello, B!\n")
- (import "env" "table" (table $0 1000 funcref))
- (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a)
- (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide)
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "some-func" (func $some-func))
- (import "env" "some-collide" (func $some-collide))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide$0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-collide-mut$0 (mut i32) (i32.const 0))
- (export "exp-a" (func $only-a))
- (export "exp-collide" (func $only-a))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b" (func $only-b))
- (export "exp-b-nameCollided" (func $willCollide$0))
- (func $only-a (; 4 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-a)
- (call $some-func)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 123)
- (i32.const 456)
- (i32.const 789)
- )
- (nop)
- (nop)
- (global.set $global-collide-mut
- (i32.const 1234)
- )
- )
- (func $willCollide (; 5 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide)
- )
- (func $only-b (; 6 ;) (type $FUNCSIG$v)
- (nop)
- (call $only-b)
- (call $some-func-b)
- (call $some-collide$0)
- (call_indirect (type $ii)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (nop)
- (nop)
- (global.set $global-collide-mut$0
- (i32.const 5678)
- )
- )
- (func $willCollide$0 (; 7 ;) (type $FUNCSIG$v)
- (nop)
- (call $willCollide$0)
- )
-)
diff --git a/test/merge/noBases.wast.combined.opt.stdout b/test/merge/noBases.wast.combined.opt.stdout
deleted file mode 100644
index 9227c4942..000000000
--- a/test/merge/noBases.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 10
-merged total table size: 5
-merged functions: 8
diff --git a/test/merge/noBases.wast.combined.stdout b/test/merge/noBases.wast.combined.stdout
deleted file mode 100644
index 9227c4942..000000000
--- a/test/merge/noBases.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 10
-merged total table size: 5
-merged functions: 8
diff --git a/test/merge/noBases.wast.toMerge b/test/merge/noBases.wast.toMerge
deleted file mode 100644
index 6e6145a15..000000000
--- a/test/merge/noBases.wast.toMerge
+++ /dev/null
@@ -1,35 +0,0 @@
-(module
- (type $ii (func (param i32 i32)))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 1000 funcref))
- (import "env" "some-func-b" (func $some-func-b))
- (import "env" "some-collide" (func $some-collide))
- (data (i32.const 200) "hello, B!\n")
- (global $global-collide i32 (i32.const 0))
- (global $global-collide-mut (mut i32) (i32.const 0))
- (global $global-b i32 (i32.const 1))
- (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide)
- (export "exp-b" (func $only-b))
- (export "exp-collide" (func $only-b))
- (export "exp-collide2" (func $willCollide))
- (export "exp-b-nameCollided" (func $willCollide))
- (func $only-b
- (drop (i32.const 111))
- (call $only-b)
- (call $some-func-b)
- (call $some-collide)
- (call_indirect (type $ii)
- (i32.const 12)
- (i32.const 34)
- (i32.const 56)
- )
- (drop (global.get $global-collide))
- (drop (global.get $global-b))
- (global.set $global-collide-mut (i32.const 5678))
- )
- (func $willCollide
- (drop (i32.const 222))
- (call $willCollide)
- )
-)
-
diff --git a/test/merge/post-instantiate-a.wast b/test/merge/post-instantiate-a.wast
deleted file mode 100644
index 5099df574..000000000
--- a/test/merge/post-instantiate-a.wast
+++ /dev/null
@@ -1,9 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (export "__post_instantiate" (func $0))
- (func $0
- (drop (i32.const 1000))
- )
-)
-
diff --git a/test/merge/post-instantiate-a.wast.combined b/test/merge/post-instantiate-a.wast.combined
deleted file mode 100644
index 90a8a5d36..000000000
--- a/test/merge/post-instantiate-a.wast.combined
+++ /dev/null
@@ -1,21 +0,0 @@
-(module
- (type $0 (func))
- (type $0$0 (func))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (export "__post_instantiate" (func $0))
- (func $0 (; 0 ;) (type $0)
- (drop
- (i32.const 1000)
- )
- )
- (func $0$0 (; 1 ;) (type $0$0)
- (nop)
- )
-)
diff --git a/test/merge/post-instantiate-a.wast.combined.finalized b/test/merge/post-instantiate-a.wast.combined.finalized
deleted file mode 100644
index 90a8a5d36..000000000
--- a/test/merge/post-instantiate-a.wast.combined.finalized
+++ /dev/null
@@ -1,21 +0,0 @@
-(module
- (type $0 (func))
- (type $0$0 (func))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (export "__post_instantiate" (func $0))
- (func $0 (; 0 ;) (type $0)
- (drop
- (i32.const 1000)
- )
- )
- (func $0$0 (; 1 ;) (type $0$0)
- (nop)
- )
-)
diff --git a/test/merge/post-instantiate-a.wast.combined.finalized.opt b/test/merge/post-instantiate-a.wast.combined.finalized.opt
deleted file mode 100644
index 0fd96ee6e..000000000
--- a/test/merge/post-instantiate-a.wast.combined.finalized.opt
+++ /dev/null
@@ -1,7 +0,0 @@
-(module
- (type $0 (func))
- (export "__post_instantiate" (func $0))
- (func $0 (; 0 ;) (type $0)
- (nop)
- )
-)
diff --git a/test/merge/post-instantiate-a.wast.combined.finalized.opt.stdout b/test/merge/post-instantiate-a.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-a.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-a.wast.combined.finalized.stdout b/test/merge/post-instantiate-a.wast.combined.finalized.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-a.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-a.wast.combined.opt b/test/merge/post-instantiate-a.wast.combined.opt
deleted file mode 100644
index 8685b4066..000000000
--- a/test/merge/post-instantiate-a.wast.combined.opt
+++ /dev/null
@@ -1,9 +0,0 @@
-(module
- (type $0 (func))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (export "__post_instantiate" (func $0))
- (func $0 (; 0 ;) (type $0)
- (nop)
- )
-)
diff --git a/test/merge/post-instantiate-a.wast.combined.opt.stdout b/test/merge/post-instantiate-a.wast.combined.opt.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-a.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-a.wast.combined.stdout b/test/merge/post-instantiate-a.wast.combined.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-a.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-a.wast.toMerge b/test/merge/post-instantiate-a.wast.toMerge
deleted file mode 100644
index 3b62ceb9e..000000000
--- a/test/merge/post-instantiate-a.wast.toMerge
+++ /dev/null
@@ -1,6 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (func $0)
-)
-
diff --git a/test/merge/post-instantiate-b.wast b/test/merge/post-instantiate-b.wast
deleted file mode 100644
index 3b62ceb9e..000000000
--- a/test/merge/post-instantiate-b.wast
+++ /dev/null
@@ -1,6 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (func $0)
-)
-
diff --git a/test/merge/post-instantiate-b.wast.combined b/test/merge/post-instantiate-b.wast.combined
deleted file mode 100644
index 551f2da2b..000000000
--- a/test/merge/post-instantiate-b.wast.combined
+++ /dev/null
@@ -1,21 +0,0 @@
-(module
- (type $0 (func))
- (type $0$0 (func))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (export "__post_instantiate" (func $0$0))
- (func $0 (; 0 ;) (type $0)
- (nop)
- )
- (func $0$0 (; 1 ;) (type $0$0)
- (drop
- (i32.const 2000)
- )
- )
-)
diff --git a/test/merge/post-instantiate-b.wast.combined.finalized b/test/merge/post-instantiate-b.wast.combined.finalized
deleted file mode 100644
index 551f2da2b..000000000
--- a/test/merge/post-instantiate-b.wast.combined.finalized
+++ /dev/null
@@ -1,21 +0,0 @@
-(module
- (type $0 (func))
- (type $0$0 (func))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (export "__post_instantiate" (func $0$0))
- (func $0 (; 0 ;) (type $0)
- (nop)
- )
- (func $0$0 (; 1 ;) (type $0$0)
- (drop
- (i32.const 2000)
- )
- )
-)
diff --git a/test/merge/post-instantiate-b.wast.combined.finalized.opt b/test/merge/post-instantiate-b.wast.combined.finalized.opt
deleted file mode 100644
index 8c173a5b4..000000000
--- a/test/merge/post-instantiate-b.wast.combined.finalized.opt
+++ /dev/null
@@ -1,7 +0,0 @@
-(module
- (type $0$0 (func))
- (export "__post_instantiate" (func $0$0))
- (func $0$0 (; 0 ;) (type $0$0)
- (nop)
- )
-)
diff --git a/test/merge/post-instantiate-b.wast.combined.finalized.opt.stdout b/test/merge/post-instantiate-b.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-b.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-b.wast.combined.finalized.stdout b/test/merge/post-instantiate-b.wast.combined.finalized.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-b.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-b.wast.combined.opt b/test/merge/post-instantiate-b.wast.combined.opt
deleted file mode 100644
index 2fa79a98b..000000000
--- a/test/merge/post-instantiate-b.wast.combined.opt
+++ /dev/null
@@ -1,9 +0,0 @@
-(module
- (type $0$0 (func))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (export "__post_instantiate" (func $0$0))
- (func $0$0 (; 0 ;) (type $0$0)
- (nop)
- )
-)
diff --git a/test/merge/post-instantiate-b.wast.combined.opt.stdout b/test/merge/post-instantiate-b.wast.combined.opt.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-b.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-b.wast.combined.stdout b/test/merge/post-instantiate-b.wast.combined.stdout
deleted file mode 100644
index 3816869a7..000000000
--- a/test/merge/post-instantiate-b.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 2
diff --git a/test/merge/post-instantiate-b.wast.toMerge b/test/merge/post-instantiate-b.wast.toMerge
deleted file mode 100644
index 0b3678389..000000000
--- a/test/merge/post-instantiate-b.wast.toMerge
+++ /dev/null
@@ -1,9 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (export "__post_instantiate" (func $0))
- (func $0
- (drop (i32.const 2000))
- )
-)
-
diff --git a/test/merge/printf.wast b/test/merge/printf.wast
deleted file mode 100644
index c57eabe51..000000000
--- a/test/merge/printf.wast
+++ /dev/null
@@ -1,13 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "globally" (global $i-collide i32))
- (import "env" "foobar" (func $import$8 (param i32 i32) (result i32)))
- (export "_printf" (func $625))
- (func $625 (param $var$0 i32) (param $var$1 i32) (result i32)
- (i32.const 102030)
- )
-)
-
diff --git a/test/merge/printf.wast.combined b/test/merge/printf.wast.combined
deleted file mode 100644
index 0ae24b16c..000000000
--- a/test/merge/printf.wast.combined
+++ /dev/null
@@ -1,31 +0,0 @@
-(module
- (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
- (type $FUNCSIG$iii$0 (func (param i32 i32) (result i32)))
- (type $1 (func))
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "")
- (import "env" "table" (table $0 0 funcref))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "globally" (global $i-collide i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "globally" (global $i-collide$0 f64))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "foobar" (func $import$8 (param i32 i32) (result i32)))
- (export "_printf" (func $625))
- (func $625 (; 1 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32)
- (i32.const 102030)
- )
- (func $b (; 2 ;) (type $1)
- (drop
- (call $625
- (i32.const 11)
- (i32.const 22)
- )
- )
- )
-)
diff --git a/test/merge/printf.wast.combined.finalized b/test/merge/printf.wast.combined.finalized
deleted file mode 100644
index d70fc9c99..000000000
--- a/test/merge/printf.wast.combined.finalized
+++ /dev/null
@@ -1,31 +0,0 @@
-(module
- (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
- (type $FUNCSIG$iii$0 (func (param i32 i32) (result i32)))
- (type $1 (func))
- (import "env" "memory" (memory $0 256))
- (data (i32.const 1024) "")
- (import "env" "table" (table $0 8 funcref))
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "globally" (global $i-collide i32))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (import "env" "memoryBase" (global $memoryBase$0 i32))
- (import "env" "tableBase" (global $tableBase$0 i32))
- (import "env" "globally" (global $i-collide$0 f64))
- (import "env" "__memory_base" (global $__memory_base$0 i32))
- (import "env" "__table_base" (global $__table_base$0 i32))
- (import "env" "foobar" (func $import$8 (param i32 i32) (result i32)))
- (export "_printf" (func $625))
- (func $625 (; 1 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32)
- (i32.const 102030)
- )
- (func $b (; 2 ;) (type $1)
- (drop
- (call $625
- (i32.const 11)
- (i32.const 22)
- )
- )
- )
-)
diff --git a/test/merge/printf.wast.combined.finalized.opt b/test/merge/printf.wast.combined.finalized.opt
deleted file mode 100644
index 0a75c1ad9..000000000
--- a/test/merge/printf.wast.combined.finalized.opt
+++ /dev/null
@@ -1,9 +0,0 @@
-(module
- (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table $0 8 funcref))
- (export "_printf" (func $625))
- (func $625 (; 0 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32)
- (i32.const 102030)
- )
-)
diff --git a/test/merge/printf.wast.combined.finalized.opt.stdout b/test/merge/printf.wast.combined.finalized.opt.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/printf.wast.combined.finalized.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/printf.wast.combined.finalized.stdout b/test/merge/printf.wast.combined.finalized.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/printf.wast.combined.finalized.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/printf.wast.combined.opt b/test/merge/printf.wast.combined.opt
deleted file mode 100644
index 1ba164fc0..000000000
--- a/test/merge/printf.wast.combined.opt
+++ /dev/null
@@ -1,12 +0,0 @@
-(module
- (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
- (import "env" "memory" (memory $0 256))
- (data (global.get $__memory_base) "")
- (import "env" "table" (table $0 0 funcref))
- (import "env" "__memory_base" (global $__memory_base i32))
- (import "env" "__table_base" (global $__table_base i32))
- (export "_printf" (func $625))
- (func $625 (; 0 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32)
- (i32.const 102030)
- )
-)
diff --git a/test/merge/printf.wast.combined.opt.stdout b/test/merge/printf.wast.combined.opt.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/printf.wast.combined.opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/printf.wast.combined.stdout b/test/merge/printf.wast.combined.stdout
deleted file mode 100644
index 80b514d22..000000000
--- a/test/merge/printf.wast.combined.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-merged total memory size: 0
-merged total table size: 0
-merged functions: 3
diff --git a/test/merge/printf.wast.toMerge b/test/merge/printf.wast.toMerge
deleted file mode 100644
index c3e87eb73..000000000
--- a/test/merge/printf.wast.toMerge
+++ /dev/null
@@ -1,14 +0,0 @@
-(module
- (import "env" "memoryBase" (global $memoryBase i32))
- (import "env" "tableBase" (global $tableBase i32))
- (import "env" "memory" (memory $0 256))
- (import "env" "table" (table 0 funcref))
- (import "env" "globally" (global $i-collide f64))
- (import "env" "_printf" (func $import$8 (param i32 i32) (result i32)))
- (func $b
- (drop
- (call $import$8 (i32.const 11) (i32.const 22))
- )
- )
-)
-