summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/asm2wasm.h12
-rw-r--r--src/passes/Print.cpp6
-rw-r--r--src/wasm-binary.h9
-rw-r--r--src/wasm-s-parser.h3
-rw-r--r--src/wasm-validator.h2
-rw-r--r--test/emcc_O2_hello_world.fromasm66
-rw-r--r--test/emcc_O2_hello_world.fromasm.imprecise66
-rw-r--r--test/emcc_O2_hello_world.fromasm.imprecise.no-opts66
-rw-r--r--test/emcc_O2_hello_world.fromasm.no-opts66
-rw-r--r--test/emcc_hello_world.fromasm69
-rw-r--r--test/emcc_hello_world.fromasm.imprecise69
-rw-r--r--test/emcc_hello_world.fromasm.imprecise.no-opts69
-rw-r--r--test/emcc_hello_world.fromasm.no-opts69
-rw-r--r--test/memorygrowth.fromasm66
-rw-r--r--test/memorygrowth.fromasm.imprecise66
-rw-r--r--test/memorygrowth.fromasm.imprecise.no-opts66
-rw-r--r--test/memorygrowth.fromasm.no-opts66
-rw-r--r--test/min.fromasm5
-rw-r--r--test/min.fromasm.imprecise5
-rw-r--r--test/min.fromasm.imprecise.no-opts5
-rw-r--r--test/min.fromasm.no-opts5
-rw-r--r--test/unit.fromasm19
-rw-r--r--test/unit.fromasm.imprecise19
-rw-r--r--test/unit.fromasm.imprecise.no-opts19
-rw-r--r--test/unit.fromasm.no-opts19
25 files changed, 526 insertions, 406 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index bce67a582..1c528d7f3 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -177,6 +177,7 @@ private:
else if (type == f64) value = Literal(double(0));
else WASM_UNREACHABLE();
global->init = wasm.allocator.alloc<Const>()->set(value);
+ global->mutable_ = true;
wasm.addGlobal(global);
}
@@ -502,9 +503,20 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
type = WasmType::f64;
}
if (type != WasmType::none) {
+ // we need imported globals to be mutable, but wasm doesn't support that yet, so we must
+ // import an immutable and create a mutable global initialized to its value
+ import->name = Name(std::string(import->name.str) + "$asm2wasm$import");
import->kind = Import::Global;
import->globalType = type;
mappedGlobals.emplace(name, type);
+ {
+ auto global = new Global();
+ global->name = name;
+ global->type = type;
+ global->init = builder.makeGetGlobal(import->name, type);
+ global->mutable_ = true;
+ wasm.addGlobal(global);
+ }
} else {
import->kind = Import::Function;
}
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 4cb363e66..06a8758c5 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -563,7 +563,11 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
void visitGlobal(Global *curr) {
printOpening(o, "global ");
printName(curr->name) << ' ';
- o << printWasmType(curr->type) << ' ';
+ if (curr->mutable_) {
+ o << "(mut " << printWasmType(curr->type) << ") ";
+ } else {
+ o << printWasmType(curr->type) << ' ';
+ }
visit(curr->init);
o << ')';
}
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 147746c82..1bc18e687 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -1293,8 +1293,13 @@ public:
else if (match(BinaryConsts::Section::FunctionSignatures)) readFunctionSignatures();
else if (match(BinaryConsts::Section::Functions)) readFunctions();
else if (match(BinaryConsts::Section::ExportTable)) readExports();
- else if (match(BinaryConsts::Section::Globals)) readGlobals();
- else if (match(BinaryConsts::Section::DataSegments)) readDataSegments();
+ else if (match(BinaryConsts::Section::Globals)) {
+ readGlobals();
+ // imports can read global imports, so we run getGlobalName and create the mapping
+ // but after we read globals, we need to add the internal globals too, so do that here
+ mappedGlobals.clear(); // wipe the mapping
+ getGlobalName(0); // force rebuild
+ } else if (match(BinaryConsts::Section::DataSegments)) readDataSegments();
else if (match(BinaryConsts::Section::FunctionTable)) readFunctionTable();
else if (match(BinaryConsts::Section::Names)) readNames();
else {
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index b4fcd3466..6280de7d3 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -1517,8 +1517,7 @@ private:
ex->kind = Export::Table;
} else if (inner[0]->str() == GLOBAL) {
ex->kind = Export::Global;
- auto* global = wasm.getGlobal(ex->value);
- if (global->mutable_) throw ParseException("cannot export a mutable global", s.line, s.col);
+ if (wasm.checkGlobal(ex->value) && wasm.getGlobal(ex->value)->mutable_) throw ParseException("cannot export a mutable global", s.line, s.col);
} else {
WASM_UNREACHABLE();
}
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 1d3b5c41b..6c6792228 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -335,7 +335,7 @@ public:
}
void visitGlobal(Global* curr) {
- shouldBeTrue(curr->init->is<Const>(), curr->name, "global init must be valid");
+ shouldBeTrue(curr->init->is<Const>() || curr->init->is<GetGlobal>(), curr->name, "global init must be valid");
shouldBeEqual(curr->type, curr->init->type, nullptr, "global init must have correct type");
}
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm
index 072d9f97f..53a7cf917 100644
--- a/test/emcc_O2_hello_world.fromasm
+++ b/test/emcc_O2_hello_world.fromasm
@@ -8,12 +8,12 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort (param i32)))
(import "env" "_pthread_cleanup_pop" (func $_pthread_cleanup_pop (param i32)))
(import "env" "_pthread_self" (func $_pthread_self (result i32)))
@@ -52,30 +52,36 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2)
(func $_malloc (param $0 i32) (result i32)
diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise
index 233a485b8..603308902 100644
--- a/test/emcc_O2_hello_world.fromasm.imprecise
+++ b/test/emcc_O2_hello_world.fromasm.imprecise
@@ -7,12 +7,12 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort (param i32)))
(import "env" "_pthread_cleanup_pop" (func $_pthread_cleanup_pop (param i32)))
(import "env" "_pthread_self" (func $_pthread_self (result i32)))
@@ -50,30 +50,36 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2)
(func $_malloc (param $0 i32) (result i32)
diff --git a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts
index 8db740bfc..97d2e41d0 100644
--- a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts
+++ b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts
@@ -7,12 +7,12 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort (param i32)))
(import "env" "_pthread_cleanup_pop" (func $_pthread_cleanup_pop (param i32)))
(import "env" "_pthread_self" (func $_pthread_self (result i32)))
@@ -50,30 +50,36 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2)
(func $_malloc (param $i1 i32) (result i32)
diff --git a/test/emcc_O2_hello_world.fromasm.no-opts b/test/emcc_O2_hello_world.fromasm.no-opts
index bdc00ad43..48340942f 100644
--- a/test/emcc_O2_hello_world.fromasm.no-opts
+++ b/test/emcc_O2_hello_world.fromasm.no-opts
@@ -7,12 +7,12 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort (param i32)))
(import "env" "_pthread_cleanup_pop" (func $_pthread_cleanup_pop (param i32)))
(import "env" "_pthread_self" (func $_pthread_self (result i32)))
@@ -51,30 +51,36 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2)
(func $_malloc (param $i1 i32) (result i32)
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index a12c7fe56..26e13e794 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -9,13 +9,13 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "env" "cttz_i8" (global $cttz_i8 i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "env" "cttz_i8" (global $cttz_i8$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort))
(import "env" "nullFunc_ii" (func $nullFunc_ii (param i32)))
(import "env" "nullFunc_iiii" (func $nullFunc_iiii (param i32)))
@@ -66,30 +66,37 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $cttz_i8 (mut i32) (get_global $cttz_i8$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(func $stackAlloc (param $0 i32) (result i32)
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 75534025e..e78774569 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -7,13 +7,13 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "env" "cttz_i8" (global $cttz_i8 i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "env" "cttz_i8" (global $cttz_i8$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort))
(import "env" "nullFunc_ii" (func $nullFunc_ii (param i32)))
(import "env" "nullFunc_iiii" (func $nullFunc_iiii (param i32)))
@@ -59,30 +59,37 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $cttz_i8 (mut i32) (get_global $cttz_i8$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(func $stackAlloc (param $0 i32) (result i32)
diff --git a/test/emcc_hello_world.fromasm.imprecise.no-opts b/test/emcc_hello_world.fromasm.imprecise.no-opts
index a2e8496a5..e9335450b 100644
--- a/test/emcc_hello_world.fromasm.imprecise.no-opts
+++ b/test/emcc_hello_world.fromasm.imprecise.no-opts
@@ -7,13 +7,13 @@
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "env" "cttz_i8" (global $cttz_i8 i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "env" "cttz_i8" (global $cttz_i8$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort))
(import "env" "nullFunc_ii" (func $nullFunc_ii (param i32)))
(import "env" "nullFunc_iiii" (func $nullFunc_iiii (param i32)))
@@ -59,30 +59,37 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $cttz_i8 (mut i32) (get_global $cttz_i8$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(func $stackAlloc (param $size i32) (result i32)
diff --git a/test/emcc_hello_world.fromasm.no-opts b/test/emcc_hello_world.fromasm.no-opts
index 771e63313..9fa2a2895 100644
--- a/test/emcc_hello_world.fromasm.no-opts
+++ b/test/emcc_hello_world.fromasm.no-opts
@@ -8,13 +8,13 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $STACKTOP i32))
- (import "env" "STACK_MAX" (global $STACK_MAX i32))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "ABORT" (global $ABORT i32))
- (import "env" "cttz_i8" (global $cttz_i8 i32))
- (import "global" "NaN" (global $nan f64))
- (import "global" "Infinity" (global $inf f64))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
+ (import "env" "cttz_i8" (global $cttz_i8$asm2wasm$import i32))
+ (import "global" "NaN" (global $nan$asm2wasm$import f64))
+ (import "global" "Infinity" (global $inf$asm2wasm$import f64))
(import "env" "abort" (func $abort))
(import "env" "nullFunc_ii" (func $nullFunc_ii (param i32)))
(import "env" "nullFunc_iiii" (func $nullFunc_iiii (param i32)))
@@ -65,30 +65,37 @@
(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))
- (global $undef i32 (i32.const 0))
- (global $tempInt i32 (i32.const 0))
- (global $tempBigInt i32 (i32.const 0))
- (global $tempBigIntP i32 (i32.const 0))
- (global $tempBigIntS i32 (i32.const 0))
- (global $tempBigIntR f64 (f64.const 0))
- (global $tempBigIntI i32 (i32.const 0))
- (global $tempBigIntD i32 (i32.const 0))
- (global $tempValue i32 (i32.const 0))
- (global $tempDouble f64 (f64.const 0))
- (global $tempRet0 i32 (i32.const 0))
- (global $tempRet1 i32 (i32.const 0))
- (global $tempRet2 i32 (i32.const 0))
- (global $tempRet3 i32 (i32.const 0))
- (global $tempRet4 i32 (i32.const 0))
- (global $tempRet5 i32 (i32.const 0))
- (global $tempRet6 i32 (i32.const 0))
- (global $tempRet7 i32 (i32.const 0))
- (global $tempRet8 i32 (i32.const 0))
- (global $tempRet9 i32 (i32.const 0))
- (global $tempFloat f64 (f64.const 0))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
+ (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $ABORT (mut i32) (get_global $ABORT$asm2wasm$import))
+ (global $cttz_i8 (mut i32) (get_global $cttz_i8$asm2wasm$import))
+ (global $__THREW__ (mut i32) (i32.const 0))
+ (global $threwValue (mut i32) (i32.const 0))
+ (global $setjmpId (mut i32) (i32.const 0))
+ (global $undef (mut i32) (i32.const 0))
+ (global $nan (mut f64) (get_global $nan$asm2wasm$import))
+ (global $inf (mut f64) (get_global $inf$asm2wasm$import))
+ (global $tempInt (mut i32) (i32.const 0))
+ (global $tempBigInt (mut i32) (i32.const 0))
+ (global $tempBigIntP (mut i32) (i32.const 0))
+ (global $tempBigIntS (mut i32) (i32.const 0))
+ (global $tempBigIntR (mut f64) (f64.const 0))
+ (global $tempBigIntI (mut i32) (i32.const 0))
+ (global $tempBigIntD (mut i32) (i32.const 0))
+ (global $tempValue (mut i32) (i32.const 0))
+ (global $tempDouble (mut f64) (f64.const 0))
+ (global $tempRet0 (mut i32) (i32.const 0))
+ (global $tempRet1 (mut i32) (i32.const 0))
+ (global $tempRet2 (mut i32) (i32.const 0))
+ (global $tempRet3 (mut i32) (i32.const 0))
+ (global $tempRet4 (mut i32) (i32.const 0))
+ (global $tempRet5 (mut i32) (i32.const 0))
+ (global $tempRet6 (mut i32) (i32.const 0))
+ (global $tempRet7 (mut i32) (i32.const 0))
+ (global $tempRet8 (mut i32) (i32.const 0))
+ (global $tempRet9 (mut i32) (i32.const 0))
+ (global $tempFloat (mut f64) (f64.const 0))
(table 18 18 anyfunc)
(elem (i32.const 0) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2)
(func $stackAlloc (param $size i32) (result i32)
diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm
index 7efde4442..9c335557f 100644
--- a/test/memorygrowth.fromasm
+++ b/test/memorygrowth.fromasm
@@ -7,12 +7,12 @@
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $r i32))
- (import "env" "STACK_MAX" (global $s i32))
- (import "env" "tempDoublePtr" (global $t i32))
- (import "env" "ABORT" (global $u i32))
- (import "global" "NaN" (global $z f64))
- (import "global" "Infinity" (global $A f64))
+ (import "env" "STACKTOP" (global $r$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $s$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $t$asm2wasm$import i32))
+ (import "env" "ABORT" (global $u$asm2wasm$import i32))
+ (import "global" "NaN" (global $z$asm2wasm$import f64))
+ (import "global" "Infinity" (global $A$asm2wasm$import f64))
(import "env" "abort" (func $ja (param i32)))
(import "env" "_pthread_cleanup_pop" (func $oa (param i32)))
(import "env" "___lock" (func $pa (param i32)))
@@ -50,30 +50,36 @@
(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))
- (global $y i32 (i32.const 0))
- (global $B i32 (i32.const 0))
- (global $C i32 (i32.const 0))
- (global $D i32 (i32.const 0))
- (global $E i32 (i32.const 0))
- (global $F f64 (f64.const 0))
- (global $G i32 (i32.const 0))
- (global $H i32 (i32.const 0))
- (global $I i32 (i32.const 0))
- (global $J f64 (f64.const 0))
- (global $K i32 (i32.const 0))
- (global $L i32 (i32.const 0))
- (global $M i32 (i32.const 0))
- (global $N i32 (i32.const 0))
- (global $O i32 (i32.const 0))
- (global $P i32 (i32.const 0))
- (global $Q i32 (i32.const 0))
- (global $R i32 (i32.const 0))
- (global $S i32 (i32.const 0))
- (global $T i32 (i32.const 0))
- (global $za f64 (f64.const 0))
+ (global $r (mut i32) (get_global $r$asm2wasm$import))
+ (global $s (mut i32) (get_global $s$asm2wasm$import))
+ (global $t (mut i32) (get_global $t$asm2wasm$import))
+ (global $u (mut i32) (get_global $u$asm2wasm$import))
+ (global $v (mut i32) (i32.const 0))
+ (global $w (mut i32) (i32.const 0))
+ (global $x (mut i32) (i32.const 0))
+ (global $y (mut i32) (i32.const 0))
+ (global $z (mut f64) (get_global $z$asm2wasm$import))
+ (global $A (mut f64) (get_global $A$asm2wasm$import))
+ (global $B (mut i32) (i32.const 0))
+ (global $C (mut i32) (i32.const 0))
+ (global $D (mut i32) (i32.const 0))
+ (global $E (mut i32) (i32.const 0))
+ (global $F (mut f64) (f64.const 0))
+ (global $G (mut i32) (i32.const 0))
+ (global $H (mut i32) (i32.const 0))
+ (global $I (mut i32) (i32.const 0))
+ (global $J (mut f64) (f64.const 0))
+ (global $K (mut i32) (i32.const 0))
+ (global $L (mut i32) (i32.const 0))
+ (global $M (mut i32) (i32.const 0))
+ (global $N (mut i32) (i32.const 0))
+ (global $O (mut i32) (i32.const 0))
+ (global $P (mut i32) (i32.const 0))
+ (global $Q (mut i32) (i32.const 0))
+ (global $R (mut i32) (i32.const 0))
+ (global $S (mut i32) (i32.const 0))
+ (global $T (mut i32) (i32.const 0))
+ (global $za (mut f64) (f64.const 0))
(table 8 8 anyfunc)
(elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa)
(func $eb (param $0 i32) (result i32)
diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise
index 1a93b6e60..258fbd3ad 100644
--- a/test/memorygrowth.fromasm.imprecise
+++ b/test/memorygrowth.fromasm.imprecise
@@ -6,12 +6,12 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
- (import "env" "STACKTOP" (global $r i32))
- (import "env" "STACK_MAX" (global $s i32))
- (import "env" "tempDoublePtr" (global $t i32))
- (import "env" "ABORT" (global $u i32))
- (import "global" "NaN" (global $z f64))
- (import "global" "Infinity" (global $A f64))
+ (import "env" "STACKTOP" (global $r$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $s$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $t$asm2wasm$import i32))
+ (import "env" "ABORT" (global $u$asm2wasm$import i32))
+ (import "global" "NaN" (global $z$asm2wasm$import f64))
+ (import "global" "Infinity" (global $A$asm2wasm$import f64))
(import "env" "abort" (func $ja (param i32)))
(import "env" "_pthread_cleanup_pop" (func $oa (param i32)))
(import "env" "___lock" (func $pa (param i32)))
@@ -48,30 +48,36 @@
(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))
- (global $y i32 (i32.const 0))
- (global $B i32 (i32.const 0))
- (global $C i32 (i32.const 0))
- (global $D i32 (i32.const 0))
- (global $E i32 (i32.const 0))
- (global $F f64 (f64.const 0))
- (global $G i32 (i32.const 0))
- (global $H i32 (i32.const 0))
- (global $I i32 (i32.const 0))
- (global $J f64 (f64.const 0))
- (global $K i32 (i32.const 0))
- (global $L i32 (i32.const 0))
- (global $M i32 (i32.const 0))
- (global $N i32 (i32.const 0))
- (global $O i32 (i32.const 0))
- (global $P i32 (i32.const 0))
- (global $Q i32 (i32.const 0))
- (global $R i32 (i32.const 0))
- (global $S i32 (i32.const 0))
- (global $T i32 (i32.const 0))
- (global $za f64 (f64.const 0))
+ (global $r (mut i32) (get_global $r$asm2wasm$import))
+ (global $s (mut i32) (get_global $s$asm2wasm$import))
+ (global $t (mut i32) (get_global $t$asm2wasm$import))
+ (global $u (mut i32) (get_global $u$asm2wasm$import))
+ (global $v (mut i32) (i32.const 0))
+ (global $w (mut i32) (i32.const 0))
+ (global $x (mut i32) (i32.const 0))
+ (global $y (mut i32) (i32.const 0))
+ (global $z (mut f64) (get_global $z$asm2wasm$import))
+ (global $A (mut f64) (get_global $A$asm2wasm$import))
+ (global $B (mut i32) (i32.const 0))
+ (global $C (mut i32) (i32.const 0))
+ (global $D (mut i32) (i32.const 0))
+ (global $E (mut i32) (i32.const 0))
+ (global $F (mut f64) (f64.const 0))
+ (global $G (mut i32) (i32.const 0))
+ (global $H (mut i32) (i32.const 0))
+ (global $I (mut i32) (i32.const 0))
+ (global $J (mut f64) (f64.const 0))
+ (global $K (mut i32) (i32.const 0))
+ (global $L (mut i32) (i32.const 0))
+ (global $M (mut i32) (i32.const 0))
+ (global $N (mut i32) (i32.const 0))
+ (global $O (mut i32) (i32.const 0))
+ (global $P (mut i32) (i32.const 0))
+ (global $Q (mut i32) (i32.const 0))
+ (global $R (mut i32) (i32.const 0))
+ (global $S (mut i32) (i32.const 0))
+ (global $T (mut i32) (i32.const 0))
+ (global $za (mut f64) (f64.const 0))
(table 8 8 anyfunc)
(elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa)
(func $eb (param $0 i32) (result i32)
diff --git a/test/memorygrowth.fromasm.imprecise.no-opts b/test/memorygrowth.fromasm.imprecise.no-opts
index 8c5e6f8af..cd2c80cc0 100644
--- a/test/memorygrowth.fromasm.imprecise.no-opts
+++ b/test/memorygrowth.fromasm.imprecise.no-opts
@@ -6,12 +6,12 @@
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
- (import "env" "STACKTOP" (global $r i32))
- (import "env" "STACK_MAX" (global $s i32))
- (import "env" "tempDoublePtr" (global $t i32))
- (import "env" "ABORT" (global $u i32))
- (import "global" "NaN" (global $z f64))
- (import "global" "Infinity" (global $A f64))
+ (import "env" "STACKTOP" (global $r$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $s$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $t$asm2wasm$import i32))
+ (import "env" "ABORT" (global $u$asm2wasm$import i32))
+ (import "global" "NaN" (global $z$asm2wasm$import f64))
+ (import "global" "Infinity" (global $A$asm2wasm$import f64))
(import "env" "abort" (func $ja (param i32)))
(import "env" "_pthread_cleanup_pop" (func $oa (param i32)))
(import "env" "___lock" (func $pa (param i32)))
@@ -48,30 +48,36 @@
(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))
- (global $y i32 (i32.const 0))
- (global $B i32 (i32.const 0))
- (global $C i32 (i32.const 0))
- (global $D i32 (i32.const 0))
- (global $E i32 (i32.const 0))
- (global $F f64 (f64.const 0))
- (global $G i32 (i32.const 0))
- (global $H i32 (i32.const 0))
- (global $I i32 (i32.const 0))
- (global $J f64 (f64.const 0))
- (global $K i32 (i32.const 0))
- (global $L i32 (i32.const 0))
- (global $M i32 (i32.const 0))
- (global $N i32 (i32.const 0))
- (global $O i32 (i32.const 0))
- (global $P i32 (i32.const 0))
- (global $Q i32 (i32.const 0))
- (global $R i32 (i32.const 0))
- (global $S i32 (i32.const 0))
- (global $T i32 (i32.const 0))
- (global $za f64 (f64.const 0))
+ (global $r (mut i32) (get_global $r$asm2wasm$import))
+ (global $s (mut i32) (get_global $s$asm2wasm$import))
+ (global $t (mut i32) (get_global $t$asm2wasm$import))
+ (global $u (mut i32) (get_global $u$asm2wasm$import))
+ (global $v (mut i32) (i32.const 0))
+ (global $w (mut i32) (i32.const 0))
+ (global $x (mut i32) (i32.const 0))
+ (global $y (mut i32) (i32.const 0))
+ (global $z (mut f64) (get_global $z$asm2wasm$import))
+ (global $A (mut f64) (get_global $A$asm2wasm$import))
+ (global $B (mut i32) (i32.const 0))
+ (global $C (mut i32) (i32.const 0))
+ (global $D (mut i32) (i32.const 0))
+ (global $E (mut i32) (i32.const 0))
+ (global $F (mut f64) (f64.const 0))
+ (global $G (mut i32) (i32.const 0))
+ (global $H (mut i32) (i32.const 0))
+ (global $I (mut i32) (i32.const 0))
+ (global $J (mut f64) (f64.const 0))
+ (global $K (mut i32) (i32.const 0))
+ (global $L (mut i32) (i32.const 0))
+ (global $M (mut i32) (i32.const 0))
+ (global $N (mut i32) (i32.const 0))
+ (global $O (mut i32) (i32.const 0))
+ (global $P (mut i32) (i32.const 0))
+ (global $Q (mut i32) (i32.const 0))
+ (global $R (mut i32) (i32.const 0))
+ (global $S (mut i32) (i32.const 0))
+ (global $T (mut i32) (i32.const 0))
+ (global $za (mut f64) (f64.const 0))
(table 8 8 anyfunc)
(elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa)
(func $eb (param $a i32) (result i32)
diff --git a/test/memorygrowth.fromasm.no-opts b/test/memorygrowth.fromasm.no-opts
index 4bcafb28b..0b50f1248 100644
--- a/test/memorygrowth.fromasm.no-opts
+++ b/test/memorygrowth.fromasm.no-opts
@@ -6,12 +6,12 @@
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
- (import "env" "STACKTOP" (global $r i32))
- (import "env" "STACK_MAX" (global $s i32))
- (import "env" "tempDoublePtr" (global $t i32))
- (import "env" "ABORT" (global $u i32))
- (import "global" "NaN" (global $z f64))
- (import "global" "Infinity" (global $A f64))
+ (import "env" "STACKTOP" (global $r$asm2wasm$import i32))
+ (import "env" "STACK_MAX" (global $s$asm2wasm$import i32))
+ (import "env" "tempDoublePtr" (global $t$asm2wasm$import i32))
+ (import "env" "ABORT" (global $u$asm2wasm$import i32))
+ (import "global" "NaN" (global $z$asm2wasm$import f64))
+ (import "global" "Infinity" (global $A$asm2wasm$import f64))
(import "env" "abort" (func $ja (param i32)))
(import "env" "_pthread_cleanup_pop" (func $oa (param i32)))
(import "env" "___lock" (func $pa (param i32)))
@@ -49,30 +49,36 @@
(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))
- (global $y i32 (i32.const 0))
- (global $B i32 (i32.const 0))
- (global $C i32 (i32.const 0))
- (global $D i32 (i32.const 0))
- (global $E i32 (i32.const 0))
- (global $F f64 (f64.const 0))
- (global $G i32 (i32.const 0))
- (global $H i32 (i32.const 0))
- (global $I i32 (i32.const 0))
- (global $J f64 (f64.const 0))
- (global $K i32 (i32.const 0))
- (global $L i32 (i32.const 0))
- (global $M i32 (i32.const 0))
- (global $N i32 (i32.const 0))
- (global $O i32 (i32.const 0))
- (global $P i32 (i32.const 0))
- (global $Q i32 (i32.const 0))
- (global $R i32 (i32.const 0))
- (global $S i32 (i32.const 0))
- (global $T i32 (i32.const 0))
- (global $za f64 (f64.const 0))
+ (global $r (mut i32) (get_global $r$asm2wasm$import))
+ (global $s (mut i32) (get_global $s$asm2wasm$import))
+ (global $t (mut i32) (get_global $t$asm2wasm$import))
+ (global $u (mut i32) (get_global $u$asm2wasm$import))
+ (global $v (mut i32) (i32.const 0))
+ (global $w (mut i32) (i32.const 0))
+ (global $x (mut i32) (i32.const 0))
+ (global $y (mut i32) (i32.const 0))
+ (global $z (mut f64) (get_global $z$asm2wasm$import))
+ (global $A (mut f64) (get_global $A$asm2wasm$import))
+ (global $B (mut i32) (i32.const 0))
+ (global $C (mut i32) (i32.const 0))
+ (global $D (mut i32) (i32.const 0))
+ (global $E (mut i32) (i32.const 0))
+ (global $F (mut f64) (f64.const 0))
+ (global $G (mut i32) (i32.const 0))
+ (global $H (mut i32) (i32.const 0))
+ (global $I (mut i32) (i32.const 0))
+ (global $J (mut f64) (f64.const 0))
+ (global $K (mut i32) (i32.const 0))
+ (global $L (mut i32) (i32.const 0))
+ (global $M (mut i32) (i32.const 0))
+ (global $N (mut i32) (i32.const 0))
+ (global $O (mut i32) (i32.const 0))
+ (global $P (mut i32) (i32.const 0))
+ (global $Q (mut i32) (i32.const 0))
+ (global $R (mut i32) (i32.const 0))
+ (global $S (mut i32) (i32.const 0))
+ (global $T (mut i32) (i32.const 0))
+ (global $za (mut f64) (f64.const 0))
(table 8 8 anyfunc)
(elem (i32.const 0) $nb $Oa $ob $Va $Ua $Ra $pb $Sa)
(func $eb (param $a i32) (result i32)
diff --git a/test/min.fromasm b/test/min.fromasm
index a912c2dad..a52a6e876 100644
--- a/test/min.fromasm
+++ b/test/min.fromasm
@@ -1,14 +1,15 @@
(module
(memory 256 256)
(data (get_global $memoryBase) "min.asm.js")
- (import "env" "tempDoublePtr" (global $tDP i32))
+ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32))
(import "env" "memory" (memory $memory))
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(export "floats" (func $floats))
(export "getTempRet0" (func $ub))
- (global $M i32 (i32.const 0))
+ (global $tDP (mut i32) (get_global $tDP$asm2wasm$import))
+ (global $M (mut i32) (i32.const 0))
(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 a57298eef..495c600d1 100644
--- a/test/min.fromasm.imprecise
+++ b/test/min.fromasm.imprecise
@@ -1,13 +1,14 @@
(module
(memory 256 256)
- (import "env" "tempDoublePtr" (global $tDP i32))
+ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32))
(import "env" "memory" (memory $memory))
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(export "floats" (func $floats))
(export "getTempRet0" (func $ub))
- (global $M i32 (i32.const 0))
+ (global $tDP (mut i32) (get_global $tDP$asm2wasm$import))
+ (global $M (mut i32) (i32.const 0))
(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 fb30c334b..60303aa74 100644
--- a/test/min.fromasm.imprecise.no-opts
+++ b/test/min.fromasm.imprecise.no-opts
@@ -1,13 +1,14 @@
(module
(memory 256 256)
- (import "env" "tempDoublePtr" (global $tDP i32))
+ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32))
(import "env" "memory" (memory $memory))
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(export "floats" (func $floats))
(export "getTempRet0" (func $ub))
- (global $M i32 (i32.const 0))
+ (global $tDP (mut i32) (get_global $tDP$asm2wasm$import))
+ (global $M (mut i32) (i32.const 0))
(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 fb30c334b..60303aa74 100644
--- a/test/min.fromasm.no-opts
+++ b/test/min.fromasm.no-opts
@@ -1,13 +1,14 @@
(module
(memory 256 256)
- (import "env" "tempDoublePtr" (global $tDP i32))
+ (import "env" "tempDoublePtr" (global $tDP$asm2wasm$import i32))
(import "env" "memory" (memory $memory))
(import "env" "table" (table $table))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(export "floats" (func $floats))
(export "getTempRet0" (func $ub))
- (global $M i32 (i32.const 0))
+ (global $tDP (mut i32) (get_global $tDP$asm2wasm$import))
+ (global $M (mut i32) (i32.const 0))
(func $floats (param $f f32) (result f32)
(local $t f32)
(return
diff --git a/test/unit.fromasm b/test/unit.fromasm
index fe8b616f4..300ac4a5b 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -9,11 +9,11 @@
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
- (import "global" "NaN" (global $t f64))
- (import "global" "Infinity" (global $u f64))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "gb" (global $n i32))
- (import "env" "STACKTOP" (global $STACKTOP i32))
+ (import "global" "NaN" (global $t$asm2wasm$import f64))
+ (import "global" "Infinity" (global $u$asm2wasm$import f64))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "gb" (global $n$asm2wasm$import i32))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32)))
(import "env" "abort" (func $abort (param f64) (result f64)))
(import "env" "print" (func $print (param i32)))
@@ -28,8 +28,13 @@
(import "env" "tableBase" (global $tableBase i32))
(export "big_negative" (func $big_negative))
(export "pick" (func $big_negative))
- (global $Int i32 (i32.const 0))
- (global $Double f64 (f64.const 0))
+ (global $t (mut f64) (get_global $t$asm2wasm$import))
+ (global $u (mut f64) (get_global $u$asm2wasm$import))
+ (global $Int (mut i32) (i32.const 0))
+ (global $Double (mut f64) (f64.const 0))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $n (mut i32) (get_global $n$asm2wasm$import))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
(table 10 10 anyfunc)
(elem (i32.const 0) $big_negative $big_negative $big_negative $big_negative $big_negative $big_negative $importedDoubles $big_negative $big_negative $cneg)
(func $big_negative
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 8752f179a..3238ef902 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -6,11 +6,11 @@
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
- (import "global" "NaN" (global $t f64))
- (import "global" "Infinity" (global $u f64))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "gb" (global $n i32))
- (import "env" "STACKTOP" (global $STACKTOP i32))
+ (import "global" "NaN" (global $t$asm2wasm$import f64))
+ (import "global" "Infinity" (global $u$asm2wasm$import f64))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "gb" (global $n$asm2wasm$import i32))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32)))
(import "env" "abort" (func $abort (param f64) (result f64)))
(import "env" "print" (func $print (param i32)))
@@ -23,8 +23,13 @@
(import "env" "tableBase" (global $tableBase i32))
(export "big_negative" (func $big_negative))
(export "pick" (func $big_negative))
- (global $Int i32 (i32.const 0))
- (global $Double f64 (f64.const 0))
+ (global $t (mut f64) (get_global $t$asm2wasm$import))
+ (global $u (mut f64) (get_global $u$asm2wasm$import))
+ (global $Int (mut i32) (i32.const 0))
+ (global $Double (mut f64) (f64.const 0))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $n (mut i32) (get_global $n$asm2wasm$import))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
(table 10 10 anyfunc)
(elem (i32.const 0) $big_negative $big_negative $big_negative $big_negative $big_negative $big_negative $importedDoubles $big_negative $big_negative $cneg)
(func $big_negative
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index 91118673a..e8bb300b0 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -6,11 +6,11 @@
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
- (import "global" "NaN" (global $t f64))
- (import "global" "Infinity" (global $u f64))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "gb" (global $n i32))
- (import "env" "STACKTOP" (global $STACKTOP i32))
+ (import "global" "NaN" (global $t$asm2wasm$import f64))
+ (import "global" "Infinity" (global $u$asm2wasm$import f64))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "gb" (global $n$asm2wasm$import i32))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32)))
(import "env" "abort" (func $abort (param f64) (result f64)))
(import "env" "print" (func $print (param i32)))
@@ -23,8 +23,13 @@
(import "env" "tableBase" (global $tableBase i32))
(export "big_negative" (func $big_negative))
(export "pick" (func $exportMe))
- (global $Int i32 (i32.const 0))
- (global $Double f64 (f64.const 0))
+ (global $t (mut f64) (get_global $t$asm2wasm$import))
+ (global $u (mut f64) (get_global $u$asm2wasm$import))
+ (global $Int (mut i32) (i32.const 0))
+ (global $Double (mut f64) (f64.const 0))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $n (mut i32) (get_global $n$asm2wasm$import))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
(table 10 10 anyfunc)
(elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(func $big_negative
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index aeece2db3..09fb6fc6f 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -8,11 +8,11 @@
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$i (func (result i32)))
- (import "global" "NaN" (global $t f64))
- (import "global" "Infinity" (global $u f64))
- (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
- (import "env" "gb" (global $n i32))
- (import "env" "STACKTOP" (global $STACKTOP i32))
+ (import "global" "NaN" (global $t$asm2wasm$import f64))
+ (import "global" "Infinity" (global $u$asm2wasm$import f64))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
+ (import "env" "gb" (global $n$asm2wasm$import i32))
+ (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32))
(import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32)))
(import "env" "abort" (func $abort (param f64) (result f64)))
(import "env" "print" (func $print (param i32)))
@@ -27,8 +27,13 @@
(import "env" "tableBase" (global $tableBase i32))
(export "big_negative" (func $big_negative))
(export "pick" (func $exportMe))
- (global $Int i32 (i32.const 0))
- (global $Double f64 (f64.const 0))
+ (global $t (mut f64) (get_global $t$asm2wasm$import))
+ (global $u (mut f64) (get_global $u$asm2wasm$import))
+ (global $Int (mut i32) (i32.const 0))
+ (global $Double (mut f64) (f64.const 0))
+ (global $tempDoublePtr (mut i32) (get_global $tempDoublePtr$asm2wasm$import))
+ (global $n (mut i32) (get_global $n$asm2wasm$import))
+ (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import))
(table 10 10 anyfunc)
(elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(func $big_negative