summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/Print.cpp39
-rw-r--r--src/wasm-s-parser.h23
-rw-r--r--src/wasm.h14
-rw-r--r--test/emcc_O2_hello_world.fromasm36
-rw-r--r--test/emcc_O2_hello_world.fromasm.imprecise36
-rw-r--r--test/emcc_O2_hello_world.fromasm.imprecise.no-opts36
-rw-r--r--test/emcc_O2_hello_world.fromasm.no-opts36
-rw-r--r--test/emcc_hello_world.fromasm46
-rw-r--r--test/emcc_hello_world.fromasm.imprecise46
-rw-r--r--test/emcc_hello_world.fromasm.imprecise.no-opts46
-rw-r--r--test/emcc_hello_world.fromasm.no-opts46
-rw-r--r--test/example/c-api-kitchen-sink.txt8
-rw-r--r--test/example/c-api-kitchen-sink.txt.txt4
-rw-r--r--test/example/relooper-fuzz.txt4
-rw-r--r--test/example/relooper-fuzz1.txt4
-rw-r--r--test/hello_world.fromasm2
-rw-r--r--test/hello_world.fromasm.imprecise2
-rw-r--r--test/hello_world.fromasm.imprecise.no-opts2
-rw-r--r--test/hello_world.fromasm.no-opts2
-rw-r--r--test/hello_world.wast2
-rw-r--r--test/hello_world.wast.fromBinary2
-rw-r--r--test/memorygrowth.fromasm40
-rw-r--r--test/memorygrowth.fromasm.imprecise40
-rw-r--r--test/memorygrowth.fromasm.imprecise.no-opts40
-rw-r--r--test/memorygrowth.fromasm.no-opts40
-rw-r--r--test/min.fromasm2
-rw-r--r--test/min.fromasm.imprecise2
-rw-r--r--test/min.fromasm.imprecise.no-opts2
-rw-r--r--test/min.fromasm.no-opts2
-rw-r--r--test/min.wast2
-rw-r--r--test/min.wast.fromBinary2
-rw-r--r--test/passes/duplicate-function-elimination.txt4
-rw-r--r--test/passes/remove-unused-functions.txt2
-rw-r--r--test/two_sides.fromasm2
-rw-r--r--test/two_sides.fromasm.imprecise2
-rw-r--r--test/two_sides.fromasm.imprecise.no-opts2
-rw-r--r--test/two_sides.fromasm.no-opts2
-rw-r--r--test/unit.fromasm4
-rw-r--r--test/unit.fromasm.imprecise4
-rw-r--r--test/unit.fromasm.imprecise.no-opts4
-rw-r--r--test/unit.fromasm.no-opts4
-rw-r--r--test/unit.wast2
-rw-r--r--test/unit.wast.fromBinary2
43 files changed, 336 insertions, 306 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index d25b64886..43ddc954c 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -546,19 +546,21 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void visitExport(Export *curr) {
printOpening(o, "export ");
- printText(o, curr->name.str) << ' ';
+ printText(o, curr->name.str) << " (";
switch (curr->kind) {
- case Export::Function: printName(curr->value); break;
- case Export::Table: o << "table"; break;
- case Export::Memory: o << "memory"; break;
- case Export::Global: o << "global "; printName(curr->value); break;
+ case Export::Function: o << "func"; break;
+ case Export::Table: o << "table"; break;
+ case Export::Memory: o << "memory"; break;
+ case Export::Global: o << "global"; break;
default: WASM_UNREACHABLE();
}
- o << ')';
+ o << ' ';
+ printName(curr->value) << "))";
}
void visitGlobal(Global *curr) {
printOpening(o, "global ");
- printName(curr->name) << ' ' << printWasmType(curr->type) << ' ';
+ printName(curr->name) << ' ';
+ o << printWasmType(curr->type) << ' ';
visit(curr->init);
o << ')';
}
@@ -598,7 +600,8 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
decIndent();
}
void visitTable(Table *curr) {
- printOpening(o, "table") << ' ' << curr->initial;
+ printOpening(o, "table") << ' ';
+ o << curr->initial;
if (curr->max && curr->max != Table::kMaxSize) o << ' ' << curr->max;
o << " anyfunc)\n";
doIndent(o, indent);
@@ -612,15 +615,12 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
o << ')';
}
}
- void visitModule(Module *curr) {
- currModule = curr;
- printOpening(o, "module", true);
- incIndent();
- doIndent(o, indent);
- printOpening(o, "memory") << ' ' << curr->memory.initial;
- if (curr->memory.max && curr->memory.max != Memory::kMaxSize) o << ' ' << curr->memory.max;
+ void visitMemory(Memory* curr) {
+ printOpening(o, "memory") << ' ';
+ o << curr->initial;
+ if (curr->max && curr->max != Memory::kMaxSize) o << ' ' << curr->max;
o << ")\n";
- for (auto segment : curr->memory.segments) {
+ for (auto segment : curr->segments) {
doIndent(o, indent);
printOpening(o, "data ", true);
visit(segment.offset);
@@ -647,6 +647,13 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
o << "\")\n";
}
+ }
+ void visitModule(Module *curr) {
+ currModule = curr;
+ printOpening(o, "module", true);
+ incIndent();
+ doIndent(o, indent);
+ visitMemory(&curr->memory);
if (curr->start.is()) {
doIndent(o, indent);
printOpening(o, "start") << ' ' << curr->start << ')';
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 3ac900213..c328f3e29 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -1402,8 +1402,26 @@ private:
void parseExport(Element& s) {
std::unique_ptr<Export> ex = make_unique<Export>();
- if (!s[2]->dollared() && !std::isdigit(s[2]->str()[0])) {
- ex->name = s[1]->str();
+ ex->name = s[1]->str();
+ if (s[2]->isList()) {
+ auto& inner = *s[2];
+ if (inner[0]->str() == FUNC) {
+ ex->value = inner[1]->str();
+ ex->kind = Export::Function;
+ } else if (inner[0]->str() == MEMORY) {
+ if (!hasMemory) throw ParseException("memory exported but no memory");
+ ex->value = Name::fromInt(0);
+ ex->kind = Export::Memory;
+ } else if (inner[0]->str() == TABLE) {
+ ex->value = Name::fromInt(0);
+ ex->kind = Export::Table;
+ } else if (inner[0]->str() == GLOBAL) {
+ ex->value = inner[1]->str();
+ ex->kind = Export::Table;
+ } else {
+ WASM_UNREACHABLE();
+ }
+ } else if (!s[2]->dollared() && !std::isdigit(s[2]->str()[0])) {
if (s[2]->str() == MEMORY) {
if (!hasMemory) throw ParseException("memory exported but no memory");
ex->value = Name::fromInt(0);
@@ -1419,7 +1437,6 @@ private:
}
} else {
// function
- ex->name = s[1]->str();
ex->value = s[2]->str();
ex->kind = Export::Function;
}
diff --git a/src/wasm.h b/src/wasm.h
index 1cf00cc36..d6bdfe91f 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1454,7 +1454,7 @@ public:
Global = 3,
};
- Name name; // exported name
+ Name name; // exported name - note that this is the key, as the internal name is non-unique (can have multiple exports for an internal, also over kinds)
Name value; // internal name
Kind kind;
};
@@ -1474,10 +1474,13 @@ public:
}
};
+ Name name;
Address initial, max;
std::vector<Segment> segments;
- Table() : initial(0), max(kMaxSize) {}
+ Table() : initial(0), max(kMaxSize) {
+ name = Name::fromInt(0);
+ }
};
class Memory {
@@ -1499,10 +1502,13 @@ public:
}
};
+ Name name;
Address initial, max; // sizes are in pages
std::vector<Segment> segments;
- Memory() : initial(0), max(kMaxSize) {}
+ Memory() : initial(0), max(kMaxSize) {
+ name = Name::fromInt(0);
+ }
};
class Global {
@@ -1531,7 +1537,7 @@ private:
// TODO: add a build option where Names are just indices, and then these methods are not needed
std::map<Name, FunctionType*> functionTypesMap;
std::map<Name, Import*> importsMap;
- std::map<Name, Export*> exportsMap;
+ std::map<Name, Export*> exportsMap; // exports map is by the *exported* name, which is unique
std::map<Name, Function*> functionsMap;
std::map<Name, Global*> globalsMap;
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm
index 853b1c229..c3ebe3d64 100644
--- a/test/emcc_O2_hello_world.fromasm
+++ b/test/emcc_O2_hello_world.fromasm
@@ -34,24 +34,24 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise
index 07ca5226e..fbcc3c46e 100644
--- a/test/emcc_O2_hello_world.fromasm.imprecise
+++ b/test/emcc_O2_hello_world.fromasm.imprecise
@@ -32,24 +32,24 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts
index a57637426..b125481a7 100644
--- a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts
+++ b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts
@@ -32,24 +32,24 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_O2_hello_world.fromasm.no-opts b/test/emcc_O2_hello_world.fromasm.no-opts
index 47aee9101..4acb5bc87 100644
--- a/test/emcc_O2_hello_world.fromasm.no-opts
+++ b/test/emcc_O2_hello_world.fromasm.no-opts
@@ -33,24 +33,24 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index f9f94a67c..7cb00db19 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -43,29 +43,29 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_i64Subtract" $_i64Subtract)
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_i64Add" $_i64Add)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_bitshift64Lshr" $_bitshift64Lshr)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "_bitshift64Shl" $_bitshift64Shl)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
- (export "___udivmoddi4" $___udivmoddi4)
+ (export "_i64Subtract" (func $_i64Subtract))
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_i64Add" (func $_i64Add))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_bitshift64Lshr" (func $_bitshift64Lshr))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "_bitshift64Shl" (func $_bitshift64Shl))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
+ (export "___udivmoddi4" (func $___udivmoddi4))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 9a76257c6..c97524f7b 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -36,29 +36,29 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_i64Subtract" $_i64Subtract)
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_i64Add" $_i64Add)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_bitshift64Lshr" $_bitshift64Lshr)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "_bitshift64Shl" $_bitshift64Shl)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
- (export "___udivmoddi4" $___udivmoddi4)
+ (export "_i64Subtract" (func $_i64Subtract))
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_i64Add" (func $_i64Add))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_bitshift64Lshr" (func $_bitshift64Lshr))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "_bitshift64Shl" (func $_bitshift64Shl))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
+ (export "___udivmoddi4" (func $___udivmoddi4))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_hello_world.fromasm.imprecise.no-opts b/test/emcc_hello_world.fromasm.imprecise.no-opts
index 4fa91d0de..45f19f21c 100644
--- a/test/emcc_hello_world.fromasm.imprecise.no-opts
+++ b/test/emcc_hello_world.fromasm.imprecise.no-opts
@@ -36,29 +36,29 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_i64Subtract" $_i64Subtract)
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_i64Add" $_i64Add)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_bitshift64Lshr" $_bitshift64Lshr)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "_bitshift64Shl" $_bitshift64Shl)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
- (export "___udivmoddi4" $___udivmoddi4)
+ (export "_i64Subtract" (func $_i64Subtract))
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_i64Add" (func $_i64Add))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_bitshift64Lshr" (func $_bitshift64Lshr))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "_bitshift64Shl" (func $_bitshift64Shl))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
+ (export "___udivmoddi4" (func $___udivmoddi4))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/emcc_hello_world.fromasm.no-opts b/test/emcc_hello_world.fromasm.no-opts
index 7cde2410e..ea2bb8801 100644
--- a/test/emcc_hello_world.fromasm.no-opts
+++ b/test/emcc_hello_world.fromasm.no-opts
@@ -42,29 +42,29 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_i64Subtract" $_i64Subtract)
- (export "_free" $_free)
- (export "_main" $_main)
- (export "_i64Add" $_i64Add)
- (export "_memset" $_memset)
- (export "_malloc" $_malloc)
- (export "_memcpy" $_memcpy)
- (export "_bitshift64Lshr" $_bitshift64Lshr)
- (export "_fflush" $_fflush)
- (export "___errno_location" $___errno_location)
- (export "_bitshift64Shl" $_bitshift64Shl)
- (export "runPostSets" $runPostSets)
- (export "stackAlloc" $stackAlloc)
- (export "stackSave" $stackSave)
- (export "stackRestore" $stackRestore)
- (export "establishStackSpace" $establishStackSpace)
- (export "setThrew" $setThrew)
- (export "setTempRet0" $setTempRet0)
- (export "getTempRet0" $getTempRet0)
- (export "dynCall_ii" $dynCall_ii)
- (export "dynCall_iiii" $dynCall_iiii)
- (export "dynCall_vi" $dynCall_vi)
- (export "___udivmoddi4" $___udivmoddi4)
+ (export "_i64Subtract" (func $_i64Subtract))
+ (export "_free" (func $_free))
+ (export "_main" (func $_main))
+ (export "_i64Add" (func $_i64Add))
+ (export "_memset" (func $_memset))
+ (export "_malloc" (func $_malloc))
+ (export "_memcpy" (func $_memcpy))
+ (export "_bitshift64Lshr" (func $_bitshift64Lshr))
+ (export "_fflush" (func $_fflush))
+ (export "___errno_location" (func $___errno_location))
+ (export "_bitshift64Shl" (func $_bitshift64Shl))
+ (export "runPostSets" (func $runPostSets))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackSave" (func $stackSave))
+ (export "stackRestore" (func $stackRestore))
+ (export "establishStackSpace" (func $establishStackSpace))
+ (export "setThrew" (func $setThrew))
+ (export "setTempRet0" (func $setTempRet0))
+ (export "getTempRet0" (func $getTempRet0))
+ (export "dynCall_ii" (func $dynCall_ii))
+ (export "dynCall_iiii" (func $dynCall_iiii))
+ (export "dynCall_vi" (func $dynCall_vi))
+ (export "___udivmoddi4" (func $___udivmoddi4))
(global $__THREW__ i32 (i32.const 0))
(global $threwValue i32 (i32.const 0))
(global $setjmpId i32 (i32.const 0))
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index d272301a9..f4bfa19e7 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -15,8 +15,8 @@ BinaryenFloat64: 4
(type $v (func))
(type $3 (func))
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
- (export "kitchen_sinker" "$kitchen()sinker")
- (export "mem" memory)
+ (export "kitchen_sinker" (func "$kitchen()sinker"))
+ (export "mem" (memory $0))
(table 1 1 anyfunc)
(elem (i32.const 0) "$kitchen()sinker")
(func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
@@ -1606,8 +1606,8 @@ int main() {
(type $v (func))
(type $3 (func))
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
- (export "kitchen_sinker" "$kitchen()sinker")
- (export "mem" memory)
+ (export "kitchen_sinker" (func "$kitchen()sinker"))
+ (export "mem" (memory $0))
(table 1 1 anyfunc)
(elem (i32.const 0) "$kitchen()sinker")
(func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt
index 5acac8e51..d564ce7ca 100644
--- a/test/example/c-api-kitchen-sink.txt.txt
+++ b/test/example/c-api-kitchen-sink.txt.txt
@@ -10,8 +10,8 @@
(type $v (func))
(type $3 (func))
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
- (export "kitchen_sinker" "$kitchen()sinker")
- (export "mem" memory)
+ (export "kitchen_sinker" (func "$kitchen()sinker"))
+ (export "mem" (memory $0))
(table 1 1 anyfunc)
(elem (i32.const 0) "$kitchen()sinker")
(func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt
index 09b6ef8cb..151360306 100644
--- a/test/example/relooper-fuzz.txt
+++ b/test/example/relooper-fuzz.txt
@@ -5,7 +5,7 @@
(type $v (func))
(type $vi (func (param i32)))
(import "spectest" "print" (func $print (param i32)))
- (export "mem" memory)
+ (export "mem" (memory $0))
(func $check (type $i) (result i32)
(if
(i32.eq
@@ -298,7 +298,7 @@
(type $v (func))
(type $vi (func (param i32)))
(import "spectest" "print" (func $print (param i32)))
- (export "mem" memory)
+ (export "mem" (memory $0))
(func $check (type $i) (result i32)
(if
(i32.eq
diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt
index 9fbaae5f0..be8130228 100644
--- a/test/example/relooper-fuzz1.txt
+++ b/test/example/relooper-fuzz1.txt
@@ -5,7 +5,7 @@
(type $v (func))
(type $vi (func (param i32)))
(import "spectest" "print" (func $print (param i32)))
- (export "mem" memory)
+ (export "mem" (memory $0))
(func $check (type $i) (result i32)
(if
(i32.eq
@@ -274,7 +274,7 @@
(type $v (func))
(type $vi (func (param i32)))
(import "spectest" "print" (func $print (param i32)))
- (export "mem" memory)
+ (export "mem" (memory $0))
(func $check (type $i) (result i32)
(if
(i32.eq
diff --git a/test/hello_world.fromasm b/test/hello_world.fromasm
index 9c3c21bd6..23aba7d9d 100644
--- a/test/hello_world.fromasm
+++ b/test/hello_world.fromasm
@@ -5,7 +5,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "add" $add)
+ (export "add" (func $add))
(func $add (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
diff --git a/test/hello_world.fromasm.imprecise b/test/hello_world.fromasm.imprecise
index 8c81998c0..6bfc4bf68 100644
--- a/test/hello_world.fromasm.imprecise
+++ b/test/hello_world.fromasm.imprecise
@@ -4,7 +4,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "add" $add)
+ (export "add" (func $add))
(func $add (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
diff --git a/test/hello_world.fromasm.imprecise.no-opts b/test/hello_world.fromasm.imprecise.no-opts
index 8ee9fb664..31ce2e573 100644
--- a/test/hello_world.fromasm.imprecise.no-opts
+++ b/test/hello_world.fromasm.imprecise.no-opts
@@ -4,7 +4,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "add" $add)
+ (export "add" (func $add))
(func $add (param $x i32) (param $y i32) (result i32)
(return
(i32.add
diff --git a/test/hello_world.fromasm.no-opts b/test/hello_world.fromasm.no-opts
index 8ee9fb664..31ce2e573 100644
--- a/test/hello_world.fromasm.no-opts
+++ b/test/hello_world.fromasm.no-opts
@@ -4,7 +4,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "add" $add)
+ (export "add" (func $add))
(func $add (param $x i32) (param $y i32) (result i32)
(return
(i32.add
diff --git a/test/hello_world.wast b/test/hello_world.wast
index 915c4a99a..16f0ddc3a 100644
--- a/test/hello_world.wast
+++ b/test/hello_world.wast
@@ -1,7 +1,7 @@
(module
(memory 256 256)
(type $0 (func (param i32 i32) (result i32)))
- (export "add" $add)
+ (export "add" (func $add))
(func $add (type $0) (param $x i32) (param $y i32) (result i32)
(i32.add
(get_local $x)
diff --git a/test/hello_world.wast.fromBinary b/test/hello_world.wast.fromBinary
index 77a0fee04..0f9f42902 100644
--- a/test/hello_world.wast.fromBinary
+++ b/test/hello_world.wast.fromBinary
@@ -1,7 +1,7 @@
(module
(memory 256 256)
(type $0 (func (param i32 i32) (result i32)))
- (export "add" $add)
+ (export "add" (func $add))
(func $add (type $0) (param $var$0 i32) (param $var$1 i32) (result i32)
(i32.add
(get_local $var$0)
diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm
index eedace359..c0cce359a 100644
--- a/test/memorygrowth.fromasm
+++ b/test/memorygrowth.fromasm
@@ -30,26 +30,26 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $fb)
- (export "_main" $Na)
- (export "_pthread_self" $ib)
- (export "_memset" $hb)
- (export "_malloc" $eb)
- (export "_memcpy" $jb)
- (export "_fflush" $_a)
- (export "___errno_location" $Qa)
- (export "runPostSets" $gb)
- (export "stackAlloc" $Ea)
- (export "stackSave" $Fa)
- (export "stackRestore" $Ga)
- (export "establishStackSpace" $Ha)
- (export "setThrew" $Ia)
- (export "setTempRet0" $La)
- (export "getTempRet0" $Ma)
- (export "dynCall_ii" $kb)
- (export "dynCall_iiii" $lb)
- (export "dynCall_vi" $mb)
- (export "__growWasmMemory" $__growWasmMemory)
+ (export "_free" (func $fb))
+ (export "_main" (func $Na))
+ (export "_pthread_self" (func $ib))
+ (export "_memset" (func $hb))
+ (export "_malloc" (func $eb))
+ (export "_memcpy" (func $jb))
+ (export "_fflush" (func $_a))
+ (export "___errno_location" (func $Qa))
+ (export "runPostSets" (func $gb))
+ (export "stackAlloc" (func $Ea))
+ (export "stackSave" (func $Fa))
+ (export "stackRestore" (func $Ga))
+ (export "establishStackSpace" (func $Ha))
+ (export "setThrew" (func $Ia))
+ (export "setTempRet0" (func $La))
+ (export "getTempRet0" (func $Ma))
+ (export "dynCall_ii" (func $kb))
+ (export "dynCall_iiii" (func $lb))
+ (export "dynCall_vi" (func $mb))
+ (export "__growWasmMemory" (func $__growWasmMemory))
(global $v i32 (i32.const 0))
(global $w i32 (i32.const 0))
(global $x i32 (i32.const 0))
diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise
index 14911b9c2..aea127692 100644
--- a/test/memorygrowth.fromasm.imprecise
+++ b/test/memorygrowth.fromasm.imprecise
@@ -28,26 +28,26 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $fb)
- (export "_main" $Na)
- (export "_pthread_self" $ib)
- (export "_memset" $hb)
- (export "_malloc" $eb)
- (export "_memcpy" $jb)
- (export "_fflush" $_a)
- (export "___errno_location" $Qa)
- (export "runPostSets" $gb)
- (export "stackAlloc" $Ea)
- (export "stackSave" $Fa)
- (export "stackRestore" $Ga)
- (export "establishStackSpace" $Ha)
- (export "setThrew" $Ia)
- (export "setTempRet0" $La)
- (export "getTempRet0" $Ma)
- (export "dynCall_ii" $kb)
- (export "dynCall_iiii" $lb)
- (export "dynCall_vi" $mb)
- (export "__growWasmMemory" $__growWasmMemory)
+ (export "_free" (func $fb))
+ (export "_main" (func $Na))
+ (export "_pthread_self" (func $ib))
+ (export "_memset" (func $hb))
+ (export "_malloc" (func $eb))
+ (export "_memcpy" (func $jb))
+ (export "_fflush" (func $_a))
+ (export "___errno_location" (func $Qa))
+ (export "runPostSets" (func $gb))
+ (export "stackAlloc" (func $Ea))
+ (export "stackSave" (func $Fa))
+ (export "stackRestore" (func $Ga))
+ (export "establishStackSpace" (func $Ha))
+ (export "setThrew" (func $Ia))
+ (export "setTempRet0" (func $La))
+ (export "getTempRet0" (func $Ma))
+ (export "dynCall_ii" (func $kb))
+ (export "dynCall_iiii" (func $lb))
+ (export "dynCall_vi" (func $mb))
+ (export "__growWasmMemory" (func $__growWasmMemory))
(global $v i32 (i32.const 0))
(global $w i32 (i32.const 0))
(global $x i32 (i32.const 0))
diff --git a/test/memorygrowth.fromasm.imprecise.no-opts b/test/memorygrowth.fromasm.imprecise.no-opts
index 8ee5fc20d..347eb4392 100644
--- a/test/memorygrowth.fromasm.imprecise.no-opts
+++ b/test/memorygrowth.fromasm.imprecise.no-opts
@@ -28,26 +28,26 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $fb)
- (export "_main" $Na)
- (export "_pthread_self" $ib)
- (export "_memset" $hb)
- (export "_malloc" $eb)
- (export "_memcpy" $jb)
- (export "_fflush" $_a)
- (export "___errno_location" $Qa)
- (export "runPostSets" $gb)
- (export "stackAlloc" $Ea)
- (export "stackSave" $Fa)
- (export "stackRestore" $Ga)
- (export "establishStackSpace" $Ha)
- (export "setThrew" $Ia)
- (export "setTempRet0" $La)
- (export "getTempRet0" $Ma)
- (export "dynCall_ii" $kb)
- (export "dynCall_iiii" $lb)
- (export "dynCall_vi" $mb)
- (export "__growWasmMemory" $__growWasmMemory)
+ (export "_free" (func $fb))
+ (export "_main" (func $Na))
+ (export "_pthread_self" (func $ib))
+ (export "_memset" (func $hb))
+ (export "_malloc" (func $eb))
+ (export "_memcpy" (func $jb))
+ (export "_fflush" (func $_a))
+ (export "___errno_location" (func $Qa))
+ (export "runPostSets" (func $gb))
+ (export "stackAlloc" (func $Ea))
+ (export "stackSave" (func $Fa))
+ (export "stackRestore" (func $Ga))
+ (export "establishStackSpace" (func $Ha))
+ (export "setThrew" (func $Ia))
+ (export "setTempRet0" (func $La))
+ (export "getTempRet0" (func $Ma))
+ (export "dynCall_ii" (func $kb))
+ (export "dynCall_iiii" (func $lb))
+ (export "dynCall_vi" (func $mb))
+ (export "__growWasmMemory" (func $__growWasmMemory))
(global $v i32 (i32.const 0))
(global $w i32 (i32.const 0))
(global $x i32 (i32.const 0))
diff --git a/test/memorygrowth.fromasm.no-opts b/test/memorygrowth.fromasm.no-opts
index 91fae3ccf..9415b19e5 100644
--- a/test/memorygrowth.fromasm.no-opts
+++ b/test/memorygrowth.fromasm.no-opts
@@ -29,26 +29,26 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_free" $fb)
- (export "_main" $Na)
- (export "_pthread_self" $ib)
- (export "_memset" $hb)
- (export "_malloc" $eb)
- (export "_memcpy" $jb)
- (export "_fflush" $_a)
- (export "___errno_location" $Qa)
- (export "runPostSets" $gb)
- (export "stackAlloc" $Ea)
- (export "stackSave" $Fa)
- (export "stackRestore" $Ga)
- (export "establishStackSpace" $Ha)
- (export "setThrew" $Ia)
- (export "setTempRet0" $La)
- (export "getTempRet0" $Ma)
- (export "dynCall_ii" $kb)
- (export "dynCall_iiii" $lb)
- (export "dynCall_vi" $mb)
- (export "__growWasmMemory" $__growWasmMemory)
+ (export "_free" (func $fb))
+ (export "_main" (func $Na))
+ (export "_pthread_self" (func $ib))
+ (export "_memset" (func $hb))
+ (export "_malloc" (func $eb))
+ (export "_memcpy" (func $jb))
+ (export "_fflush" (func $_a))
+ (export "___errno_location" (func $Qa))
+ (export "runPostSets" (func $gb))
+ (export "stackAlloc" (func $Ea))
+ (export "stackSave" (func $Fa))
+ (export "stackRestore" (func $Ga))
+ (export "establishStackSpace" (func $Ha))
+ (export "setThrew" (func $Ia))
+ (export "setTempRet0" (func $La))
+ (export "getTempRet0" (func $Ma))
+ (export "dynCall_ii" (func $kb))
+ (export "dynCall_iiii" (func $lb))
+ (export "dynCall_vi" (func $mb))
+ (export "__growWasmMemory" (func $__growWasmMemory))
(global $v i32 (i32.const 0))
(global $w i32 (i32.const 0))
(global $x i32 (i32.const 0))
diff --git a/test/min.fromasm b/test/min.fromasm
index 1aa1e9405..54380a4ec 100644
--- a/test/min.fromasm
+++ b/test/min.fromasm
@@ -6,7 +6,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "floats" $floats)
+ (export "floats" (func $floats))
(func $floats (param $0 f32) (result f32)
(local $1 f32)
(f32.add
diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise
index 094a713a7..b07aba04e 100644
--- a/test/min.fromasm.imprecise
+++ b/test/min.fromasm.imprecise
@@ -5,7 +5,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "floats" $floats)
+ (export "floats" (func $floats))
(func $floats (param $0 f32) (result f32)
(local $1 f32)
(f32.add
diff --git a/test/min.fromasm.imprecise.no-opts b/test/min.fromasm.imprecise.no-opts
index 2bc20abbb..dd89a9eed 100644
--- a/test/min.fromasm.imprecise.no-opts
+++ b/test/min.fromasm.imprecise.no-opts
@@ -5,7 +5,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "floats" $floats)
+ (export "floats" (func $floats))
(func $floats (param $f f32) (result f32)
(local $t f32)
(return
diff --git a/test/min.fromasm.no-opts b/test/min.fromasm.no-opts
index 2bc20abbb..dd89a9eed 100644
--- a/test/min.fromasm.no-opts
+++ b/test/min.fromasm.no-opts
@@ -5,7 +5,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "floats" $floats)
+ (export "floats" (func $floats))
(func $floats (param $f f32) (result f32)
(local $t f32)
(return
diff --git a/test/min.wast b/test/min.wast
index 4702215a9..e5472fb77 100644
--- a/test/min.wast
+++ b/test/min.wast
@@ -4,7 +4,7 @@
(type $1 (func (param i32 i32) (result f32)))
(type $2 (func (param i32) (result i32)))
(type $3 (func (param i32 i32 i32) (result i32)))
- (export "floats" $floats)
+ (export "floats" (func $floats))
(func $floats (type $0) (param $f f32) (result f32)
(local $t f32)
(f32.add
diff --git a/test/min.wast.fromBinary b/test/min.wast.fromBinary
index 7750086aa..33515c61c 100644
--- a/test/min.wast.fromBinary
+++ b/test/min.wast.fromBinary
@@ -4,7 +4,7 @@
(type $1 (func (param i32 i32) (result f32)))
(type $2 (func (param i32) (result i32)))
(type $3 (func (param i32 i32 i32) (result i32)))
- (export "floats" $floats)
+ (export "floats" (func $floats))
(func $floats (type $0) (param $var$0 f32) (result f32)
(local $var$1 f32)
(f32.add
diff --git a/test/passes/duplicate-function-elimination.txt b/test/passes/duplicate-function-elimination.txt
index 881a265e9..e043300c4 100644
--- a/test/passes/duplicate-function-elimination.txt
+++ b/test/passes/duplicate-function-elimination.txt
@@ -44,8 +44,8 @@
(memory 0)
(start $keep2)
(type $0 (func))
- (export "keep2" $keep2)
- (export "other" $keep2)
+ (export "keep2" (func $keep2))
+ (export "other" (func $keep2))
(table 3 3 anyfunc)
(elem (i32.const 0) $keep2 $keep2 $caller)
(func $keep2 (type $0)
diff --git a/test/passes/remove-unused-functions.txt b/test/passes/remove-unused-functions.txt
index cd819d347..1bd30e866 100644
--- a/test/passes/remove-unused-functions.txt
+++ b/test/passes/remove-unused-functions.txt
@@ -2,7 +2,7 @@
(memory 0)
(start $start)
(type $0 (func))
- (export "exported" $exported)
+ (export "exported" (func $exported))
(table 1 1 anyfunc)
(elem (i32.const 0) $called_indirect)
(func $start (type $0)
diff --git a/test/two_sides.fromasm b/test/two_sides.fromasm
index d53021c11..6d8e2a14b 100644
--- a/test/two_sides.fromasm
+++ b/test/two_sides.fromasm
@@ -7,7 +7,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_test" $_test)
+ (export "_test" (func $_test))
(func $_test (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 f64)
(if
diff --git a/test/two_sides.fromasm.imprecise b/test/two_sides.fromasm.imprecise
index d664567b4..1578c86da 100644
--- a/test/two_sides.fromasm.imprecise
+++ b/test/two_sides.fromasm.imprecise
@@ -4,7 +4,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_test" $_test)
+ (export "_test" (func $_test))
(func $_test (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 f64)
(if
diff --git a/test/two_sides.fromasm.imprecise.no-opts b/test/two_sides.fromasm.imprecise.no-opts
index d6ada31f6..a8a338489 100644
--- a/test/two_sides.fromasm.imprecise.no-opts
+++ b/test/two_sides.fromasm.imprecise.no-opts
@@ -4,7 +4,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_test" $_test)
+ (export "_test" (func $_test))
(func $_test (param $i1 i32) (param $i2 i32) (param $i3 i32) (param $i4 i32) (param $i5 i32) (result i32)
(local $d6 f64)
(if
diff --git a/test/two_sides.fromasm.no-opts b/test/two_sides.fromasm.no-opts
index b10f96c69..1011976b6 100644
--- a/test/two_sides.fromasm.no-opts
+++ b/test/two_sides.fromasm.no-opts
@@ -6,7 +6,7 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "_test" $_test)
+ (export "_test" (func $_test))
(func $_test (param $i1 i32) (param $i2 i32) (param $i3 i32) (param $i4 i32) (param $i5 i32) (result i32)
(local $d6 f64)
(if
diff --git a/test/unit.fromasm b/test/unit.fromasm
index 0a051cf5a..33dd153af 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -23,8 +23,8 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "big_negative" $big_negative)
- (export "pick" $big_negative)
+ (export "big_negative" (func $big_negative))
+ (export "pick" (func $big_negative))
(global $Int i32 (i32.const 0))
(global $Double f64 (f64.const 0))
(table 10 10 anyfunc)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 2240135c3..35b8b1768 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -18,8 +18,8 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "big_negative" $big_negative)
- (export "pick" $big_negative)
+ (export "big_negative" (func $big_negative))
+ (export "pick" (func $big_negative))
(global $Int i32 (i32.const 0))
(global $Double f64 (f64.const 0))
(table 10 10 anyfunc)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index f78c96637..c41075df0 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -18,8 +18,8 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "big_negative" $big_negative)
- (export "pick" $exportMe)
+ (export "big_negative" (func $big_negative))
+ (export "pick" (func $exportMe))
(global $Int i32 (i32.const 0))
(global $Double f64 (f64.const 0))
(table 10 10 anyfunc)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index e1e0c5e02..2162d9ed7 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -22,8 +22,8 @@
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
- (export "big_negative" $big_negative)
- (export "pick" $exportMe)
+ (export "big_negative" (func $big_negative))
+ (export "pick" (func $exportMe))
(global $Int i32 (i32.const 0))
(global $Double f64 (f64.const 0))
(table 10 10 anyfunc)
diff --git a/test/unit.wast b/test/unit.wast
index 748b62dab..2df02df44 100644
--- a/test/unit.wast
+++ b/test/unit.wast
@@ -12,7 +12,7 @@
(import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi))
(import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32)))
(import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64)))
- (export "big_negative" $big_negative)
+ (export "big_negative" (func $big_negative))
(table 10 anyfunc)
(elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(func $big_negative (type $FUNCSIG$v)
diff --git a/test/unit.wast.fromBinary b/test/unit.wast.fromBinary
index ad0f0786a..4a311f41a 100644
--- a/test/unit.wast.fromBinary
+++ b/test/unit.wast.fromBinary
@@ -12,7 +12,7 @@
(import "env" "_emscripten_asm_const_vi" (func $import$0))
(import "asm2wasm" "f64-to-int" (func $import$1 (param f64) (result i32)))
(import "asm2wasm" "f64-rem" (func $import$2 (param f64 f64) (result f64)))
- (export "big_negative" $big_negative)
+ (export "big_negative" (func $big_negative))
(table 10 anyfunc)
(elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(func $big_negative (type $1)