diff options
Diffstat (limited to 'test')
251 files changed, 773 insertions, 801 deletions
diff --git a/test/bad_params.fromasm b/test/bad_params.fromasm index 1862f5ffe..ba2754d76 100644 --- a/test/bad_params.fromasm +++ b/test/bad_params.fromasm @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "bad_params.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "ex" (func $ex)) (func $ex (; 0 ;) (; has Stack IR ;) (nop) diff --git a/test/bad_params.fromasm.clamp b/test/bad_params.fromasm.clamp index 1862f5ffe..ba2754d76 100644 --- a/test/bad_params.fromasm.clamp +++ b/test/bad_params.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "bad_params.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "ex" (func $ex)) (func $ex (; 0 ;) (; has Stack IR ;) (nop) diff --git a/test/bad_params.fromasm.clamp.no-opts b/test/bad_params.fromasm.clamp.no-opts index 07440e82d..f54f08eb4 100644 --- a/test/bad_params.fromasm.clamp.no-opts +++ b/test/bad_params.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/bad_params.fromasm.imprecise.no-opts b/test/bad_params.fromasm.imprecise.no-opts index 07440e82d..f54f08eb4 100644 --- a/test/bad_params.fromasm.imprecise.no-opts +++ b/test/bad_params.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/bad_params.fromasm.no-opts b/test/bad_params.fromasm.no-opts index 07440e82d..f54f08eb4 100644 --- a/test/bad_params.fromasm.no-opts +++ b/test/bad_params.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/badvartype.wasm.fromBinary b/test/badvartype.wasm.fromBinary index e994ce2a9..43e0541f1 100644 --- a/test/badvartype.wasm.fromBinary +++ b/test/badvartype.wasm.fromBinary @@ -8,16 +8,16 @@ (type $6 (func (param i32 i32))) (type $7 (func (param f32) (result f32))) (type $8 (func (param f64) (result f64))) + (memory $0 (shared 1 1)) + (data (i32.const 0) "\00\00\00\00\00\00\00\00X\00\00\00U\00\00\0b\00\00\00\00\00\00\00k\00\00") + (table 2 anyfunc) + (elem (i32.const 0) $1 $5) (global $global$0 (mut i32) (i32.const 255)) (global $global$1 (mut i32) (i32.const -7045592)) (global $global$2 (mut i64) (i64.const -9223372036854775808)) (global $global$3 (mut f32) (f32.const -268435456)) (global $global$4 (mut f64) (f64.const -2251799813685248)) (global $global$5 (mut i32) (i32.const 10)) - (table 2 anyfunc) - (elem (i32.const 0) $1 $5) - (memory $0 (shared 1 1)) - (data (i32.const 0) "\00\00\00\00\00\00\00\00X\00\00\00U\00\00\0b\00\00\00\00\00\00\00k\00\00") (export "func_0" (func $0)) (export "func_2_invoker" (func $3)) (export "hangLimitInitializer" (func $7)) diff --git a/test/binaryen.js/call_import_error.js b/test/binaryen.js/call_import_error.js deleted file mode 100644 index 22d1c38dd..000000000 --- a/test/binaryen.js/call_import_error.js +++ /dev/null @@ -1,13 +0,0 @@ -var module = new Binaryen.Module(); - -var signature = module.addFunctionType("v", Binaryen.none, []); -module.addFunctionImport("fn", "env", "fn", signature); - -module.addFunction("main", signature, [], module.block("", [ - module.call("fn", [], Binaryen.none) // should be callImport -])); -module.addFunctionExport("main", "main"); - -console.log(module.emitText()); - -module.validate(); // fails diff --git a/test/binaryen.js/call_import_error.js.txt b/test/binaryen.js/call_import_error.js.txt deleted file mode 100644 index 752f17b49..000000000 --- a/test/binaryen.js/call_import_error.js.txt +++ /dev/null @@ -1,12 +0,0 @@ -(module - (type $v (func)) - (import "env" "fn" (func $fn)) - (export "main" (func $main)) - (func $main (; 1 ;) (type $v) - (call $fn) - ) -) - -[wasm-validator error in function $main] unexpected false: call target must exist, on -[none] (call $fn) -(perhaps it should be a CallImport instead of Call?) diff --git a/test/binaryen.js/functions.js.txt b/test/binaryen.js/functions.js.txt index 4d1015d15..58558bcd5 100644 --- a/test/binaryen.js/functions.js.txt +++ b/test/binaryen.js/functions.js.txt @@ -1,7 +1,7 @@ GetFunction is equal: true getFunctionTypeInfo={"params":[],"result":1} -getFunctionInfo={"params":[],"result":1,"vars":[]} -getExpressionInfo(body)={"id":15,"value":3} +getFunctionInfo={"module":"","base":"","params":[],"result":1,"vars":[]} +getExpressionInfo(body)={"id":14,"value":3} (i32.const 3) (module diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 1e1d29033..82b041926 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -63,7 +63,6 @@ function test_ids() { console.log("BinaryenBreakId: " + Binaryen.BreakId); console.log("BinaryenSwitchId: " + Binaryen.SwitchId); console.log("BinaryenCallId: " + Binaryen.CallId); - console.log("BinaryenCallImportId: " + Binaryen.CallImportId); console.log("BinaryenCallIndirectId: " + Binaryen.CallIndirectId); console.log("BinaryenGetLocalId: " + Binaryen.GetLocalId); console.log("BinaryenSetLocalId: " + Binaryen.SetLocalId); @@ -199,7 +198,7 @@ function test_core() { ), module.i32.eqz( // check the output type of the call node module.i32.trunc_s.f32( - module.callImport("an-imported", [ makeInt32(13), makeFloat64(3.7) ], Binaryen.f32) + module.call("an-imported", [ makeInt32(13), makeFloat64(3.7) ], Binaryen.f32) ) ), module.i32.eqz( // check the output type of the call node @@ -283,7 +282,7 @@ function test_core() { } function makeCallCheck(x) { - return module.callImport("check", [ makeInt32(x) ], Binaryen.None); + return module.call("check", [ makeInt32(x) ], Binaryen.None); } function test_relooper() { @@ -518,7 +517,7 @@ function test_interpret() { module.addFunctionImport("print-i32", "spectest", "print", vi); var v = module.addFunctionType("v", Binaryen.None, []); - call = module.callImport("print-i32", [ makeInt32(1234) ], Binaryen.None); + call = module.call("print-i32", [ makeInt32(1234) ], Binaryen.None); var starter = module.addFunction("starter", v, [], call); module.setStart(starter); diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 2bec81e91..c90994613 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -12,46 +12,45 @@ BinaryenLoopId: 3 BinaryenBreakId: 4 BinaryenSwitchId: 5 BinaryenCallId: 6 -BinaryenCallImportId: 7 -BinaryenCallIndirectId: 8 -BinaryenGetLocalId: 9 -BinaryenSetLocalId: 10 -BinaryenGetGlobalId: 11 -BinaryenSetGlobalId: 12 -BinaryenLoadId: 13 -BinaryenStoreId: 14 -BinaryenConstId: 15 -BinaryenUnaryId: 16 -BinaryenBinaryId: 17 -BinaryenSelectId: 18 -BinaryenDropId: 19 -BinaryenReturnId: 20 -BinaryenHostId: 21 -BinaryenNopId: 22 -BinaryenUnreachableId: 23 -BinaryenAtomicCmpxchgId: 25 -BinaryenAtomicRMWId: 24 -BinaryenAtomicWaitId: 26 -BinaryenAtomicWakeId: 27 -getExpressionInfo={"id":16,"type":3,"op":6} +BinaryenCallIndirectId: 7 +BinaryenGetLocalId: 8 +BinaryenSetLocalId: 9 +BinaryenGetGlobalId: 10 +BinaryenSetGlobalId: 11 +BinaryenLoadId: 12 +BinaryenStoreId: 13 +BinaryenConstId: 14 +BinaryenUnaryId: 15 +BinaryenBinaryId: 16 +BinaryenSelectId: 17 +BinaryenDropId: 18 +BinaryenReturnId: 19 +BinaryenHostId: 20 +BinaryenNopId: 21 +BinaryenUnreachableId: 22 +BinaryenAtomicCmpxchgId: 24 +BinaryenAtomicRMWId: 23 +BinaryenAtomicWaitId: 25 +BinaryenAtomicWakeId: 26 +getExpressionInfo={"id":15,"type":3,"op":6} (f32.neg (f32.const -33.61199951171875) ) -getExpressionInfo(i32.const)={"id":15,"type":1,"value":5} -getExpressionInfo(i64.const)={"id":15,"type":2,"value":{"low":6,"high":7}} -getExpressionInfo(f32.const)={"id":15,"type":3,"value":8.5} -getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} +getExpressionInfo(i32.const)={"id":14,"type":1,"value":5} +getExpressionInfo(i64.const)={"id":14,"type":2,"value":{"low":6,"high":7}} +getExpressionInfo(f32.const)={"id":14,"type":3,"value":8.5} +getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} (module (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) - (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") (memory $0 1 256) (data (i32.const 10) "hello, world") + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") + (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (export "kitchen_sinker" (func "$kitchen()sinker")) (export "mem" (memory $0)) (start $starter) @@ -1111,7 +1110,7 @@ int main() { std::map<size_t, BinaryenFunctionTypeRef> functionTypes; std::map<size_t, BinaryenExpressionRef> expressions; std::map<size_t, BinaryenFunctionRef> functions; - std::map<size_t, BinaryenImportRef> imports; + std::map<size_t, BinaryenGlobalRef> globals; std::map<size_t, BinaryenExportRef> exports; std::map<size_t, RelooperBlockRef> relooperBlocks; BinaryenModuleRef the_module = NULL; @@ -1350,7 +1349,7 @@ int main() { expressions[214] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); { BinaryenExpressionRef operands[] = { expressions[213], expressions[214] }; - expressions[215] = BinaryenCallImport(the_module, "an-imported", operands, 2, 3); + expressions[215] = BinaryenCall(the_module, "an-imported", operands, 2, 3); } expressions[216] = BinaryenUnary(the_module, 25, expressions[215]); expressions[217] = BinaryenUnary(the_module, 20, expressions[216]); @@ -1390,7 +1389,7 @@ int main() { BinaryenExpressionGetType(expressions[30]); BinaryenUnaryGetOp(expressions[30]); BinaryenUnaryGetValue(expressions[30]); -getExpressionInfo={"id":16,"type":3,"op":6} +getExpressionInfo={"id":15,"type":3,"op":6} BinaryenExpressionPrint(expressions[30]); (f32.neg (f32.const -33.61199951171875) @@ -1400,23 +1399,23 @@ getExpressionInfo={"id":16,"type":3,"op":6} BinaryenExpressionGetId(expressions[247]); BinaryenExpressionGetType(expressions[247]); BinaryenConstGetValueI32(expressions[247]); -getExpressionInfo(i32.const)={"id":15,"type":1,"value":5} +getExpressionInfo(i32.const)={"id":14,"type":1,"value":5} expressions[248] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078)); BinaryenExpressionGetId(expressions[248]); BinaryenExpressionGetType(expressions[248]); BinaryenConstGetValueI64Low(expressions[248]); BinaryenConstGetValueI64High(expressions[248]); -getExpressionInfo(i64.const)={"id":15,"type":2,"value":{"low":6,"high":7}} +getExpressionInfo(i64.const)={"id":14,"type":2,"value":{"low":6,"high":7}} expressions[249] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5)); BinaryenExpressionGetId(expressions[249]); BinaryenExpressionGetType(expressions[249]); BinaryenConstGetValueF32(expressions[249]); -getExpressionInfo(f32.const)={"id":15,"type":3,"value":8.5} +getExpressionInfo(f32.const)={"id":14,"type":3,"value":8.5} expressions[250] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5)); BinaryenExpressionGetId(expressions[250]); BinaryenExpressionGetType(expressions[250]); BinaryenConstGetValueF64(expressions[250]); -getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} +getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} { BinaryenExpressionRef children[] = { expressions[24], expressions[26], expressions[28], expressions[30], expressions[32], expressions[34], expressions[36], expressions[38], expressions[40], expressions[42], expressions[44], @@ -1454,9 +1453,11 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} BinaryenType paramTypes[] = { 1, 4 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2); } - imports[0] = BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]); + BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]); exports[0] = BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker"); BinaryenFunctionGetName(functions[0]); + BinaryenFunctionImportGetModule(functions[0]); + BinaryenFunctionImportGetBase(functions[0]); BinaryenFunctionGetType(functions[0]); BinaryenFunctionGetNumParams(functions[0]); BinaryenFunctionGetParam(functions[0], 0); @@ -1501,11 +1502,11 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) - (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") (memory $0 1 256) (data (i32.const 10) "hello, world") + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") + (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (export "kitchen_sinker" (func "$kitchen()sinker")) (export "mem" (memory $0)) (start $starter) @@ -2031,7 +2032,7 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} functionTypes.clear(); expressions.clear(); functions.clear(); - imports.clear(); + globals.clear(); exports.clear(); relooperBlocks.clear(); the_module = BinaryenModuleCreate(); @@ -2044,12 +2045,12 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} BinaryenType paramTypes[] = { 1 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1); } - imports[0] = BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]); + BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]); the_relooper = RelooperCreate(); expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); { BinaryenExpressionRef operands[] = { expressions[1] }; - expressions[2] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[2] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[2]); expressions[3] = RelooperRenderAndDispose(the_relooper, relooperBlocks[0], 0, the_module); @@ -2061,13 +2062,13 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[4] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[4] }; - expressions[5] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[5] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[5]); expressions[6] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[6] }; - expressions[7] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[7] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[7]); RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); @@ -2080,13 +2081,13 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[9] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[9] }; - expressions[10] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[10] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[10]); expressions[11] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[11] }; - expressions[12] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[12] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[12]); expressions[13] = BinaryenConst(the_module, BinaryenLiteralInt32(77)); @@ -2101,13 +2102,13 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[16] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[16] }; - expressions[17] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[17] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[17]); expressions[18] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[18] }; - expressions[19] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[19] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[19]); RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); @@ -2121,13 +2122,13 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[21] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[21] }; - expressions[22] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[22] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[22]); expressions[23] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[23] }; - expressions[24] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[24] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[24]); expressions[25] = BinaryenConst(the_module, BinaryenLiteralInt32(33)); @@ -2145,19 +2146,19 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[30] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[30] }; - expressions[31] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[31] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[31]); expressions[32] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[32] }; - expressions[33] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[33] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[33]); expressions[34] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[34] }; - expressions[35] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[35] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[35]); expressions[36] = BinaryenConst(the_module, BinaryenLiteralInt32(55)); @@ -2172,19 +2173,19 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[38] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[38] }; - expressions[39] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[39] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[39]); expressions[40] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[40] }; - expressions[41] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[41] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[41]); expressions[42] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[42] }; - expressions[43] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[43] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[43]); expressions[44] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); @@ -2203,19 +2204,19 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[50] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[50] }; - expressions[51] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[51] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[51]); expressions[52] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[52] }; - expressions[53] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[53] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[53]); expressions[54] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[54] }; - expressions[55] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[55] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[55]); expressions[56] = BinaryenConst(the_module, BinaryenLiteralInt32(55)); @@ -2231,19 +2232,19 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[58] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[58] }; - expressions[59] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[59] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[59]); expressions[60] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[60] }; - expressions[61] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[61] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[61]); expressions[62] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[62] }; - expressions[63] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[63] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[63]); expressions[64] = BinaryenConst(the_module, BinaryenLiteralInt32(-1)); @@ -2265,25 +2266,25 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[72] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[72] }; - expressions[73] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[73] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[73]); expressions[74] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[74] }; - expressions[75] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[75] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[75]); expressions[76] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[76] }; - expressions[77] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[77] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[77]); expressions[78] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); { BinaryenExpressionRef operands[] = { expressions[78] }; - expressions[79] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[79] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[79]); expressions[80] = BinaryenConst(the_module, BinaryenLiteralInt32(55)); @@ -2300,19 +2301,19 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[82] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[82] }; - expressions[83] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[83] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[83]); expressions[84] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[84] }; - expressions[85] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[85] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[85]); expressions[86] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[86] }; - expressions[87] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[87] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[87]); RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); @@ -2328,43 +2329,43 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[90] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[90] }; - expressions[91] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[91] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[91]); expressions[92] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[92] }; - expressions[93] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[93] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[93]); expressions[94] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[94] }; - expressions[95] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[95] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[95]); expressions[96] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); { BinaryenExpressionRef operands[] = { expressions[96] }; - expressions[97] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[97] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[97]); expressions[98] = BinaryenConst(the_module, BinaryenLiteralInt32(4)); { BinaryenExpressionRef operands[] = { expressions[98] }; - expressions[99] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[99] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[4] = RelooperAddBlock(the_relooper, expressions[99]); expressions[100] = BinaryenConst(the_module, BinaryenLiteralInt32(5)); { BinaryenExpressionRef operands[] = { expressions[100] }; - expressions[101] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[101] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[5] = RelooperAddBlock(the_relooper, expressions[101]); expressions[102] = BinaryenConst(the_module, BinaryenLiteralInt32(6)); { BinaryenExpressionRef operands[] = { expressions[102] }; - expressions[103] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[103] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[6] = RelooperAddBlock(the_relooper, expressions[103]); expressions[104] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); @@ -2397,25 +2398,25 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[117] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[117] }; - expressions[118] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[118] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlockWithSwitch(the_relooper, expressions[118], expressions[116]); expressions[119] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[119] }; - expressions[120] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[120] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[120]); expressions[121] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[121] }; - expressions[122] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[122] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[122]); expressions[123] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); { BinaryenExpressionRef operands[] = { expressions[123] }; - expressions[124] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[124] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[124]); { @@ -2441,19 +2442,19 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[128] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[128] }; - expressions[129] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[129] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[129]); expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[130] }; - expressions[131] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[131] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[131]); expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[132] }; - expressions[133] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[133] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[133]); expressions[134] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); @@ -2474,7 +2475,7 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5} expressions[136] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { BinaryenExpressionRef operands[] = { expressions[136] }; - expressions[137] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[137] = BinaryenCall(the_module, "check", operands, 1, 0); } expressions[138] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); expressions[139] = BinaryenReturn(the_module, expressions[138]); @@ -2993,7 +2994,7 @@ optimized: functionTypes.clear(); expressions.clear(); functions.clear(); - imports.clear(); + globals.clear(); exports.clear(); relooperBlocks.clear(); return 0; diff --git a/test/ctor-eval/bad-indirect-call.wast.out b/test/ctor-eval/bad-indirect-call.wast.out index 9c9897731..33ca25915 100644 --- a/test/ctor-eval/bad-indirect-call.wast.out +++ b/test/ctor-eval/bad-indirect-call.wast.out @@ -1,9 +1,9 @@ (module (type $v (func)) - (table 1 1 anyfunc) - (elem (i32.const 0) $call-indirect) (memory $0 256 256) (data (i32.const 10) "waka waka waka waka waka") + (table 1 1 anyfunc) + (elem (i32.const 0) $call-indirect) (export "test1" (func $test1)) (func $test1 (; 0 ;) (type $v) (call_indirect (type $v) diff --git a/test/ctor-eval/bad-indirect-call2.wast.out b/test/ctor-eval/bad-indirect-call2.wast.out index 5efde23ed..f302fb143 100644 --- a/test/ctor-eval/bad-indirect-call2.wast.out +++ b/test/ctor-eval/bad-indirect-call2.wast.out @@ -1,10 +1,10 @@ (module (type $FUNCSIG$v (func)) - (import "env" "_abort" (func $_abort)) - (table 2 2 anyfunc) - (elem (i32.const 0) $_abort $call-indirect) (memory $0 256 256) (data (i32.const 10) "waka waka waka waka waka") + (table 2 2 anyfunc) + (elem (i32.const 0) $_abort $call-indirect) + (import "env" "_abort" (func $_abort)) (export "test1" (func $test1)) (func $test1 (; 1 ;) (type $FUNCSIG$v) (call_indirect (type $FUNCSIG$v) diff --git a/test/ctor-eval/imported-min.wast b/test/ctor-eval/imported-min.wast index 80f2cbde2..d735a5a41 100644 --- a/test/ctor-eval/imported-min.wast +++ b/test/ctor-eval/imported-min.wast @@ -39,7 +39,6 @@ (i32.store8 (i32.const 12) (i32.const 115)) ) (func $test2 - (set_global $tempDoublePtrMut (i32.const 1)) ;; bad! (i32.store8 (i32.const 13) (i32.const 115)) ) (func $test3 diff --git a/test/ctor-eval/imported-min.wast.out b/test/ctor-eval/imported-min.wast.out index 7b5c069ec..4427f36e0 100644 --- a/test/ctor-eval/imported-min.wast.out +++ b/test/ctor-eval/imported-min.wast.out @@ -1,24 +1,2 @@ (module - (type $0 (func)) - (import "env" "tempDoublePtr" (global $tempDoublePtr i32)) - (global $tempDoublePtrMut (mut i32) (get_global $tempDoublePtr)) - (memory $0 256 256) - (data (i32.const 10) "wasa waka waka waka waka") - (export "test2" (func $test2)) - (export "test3" (func $test3)) - (func $test2 (; 0 ;) (type $0) - (set_global $tempDoublePtrMut - (i32.const 1) - ) - (i32.store8 - (i32.const 13) - (i32.const 115) - ) - ) - (func $test3 (; 1 ;) (type $0) - (i32.store8 - (i32.const 14) - (i32.const 115) - ) - ) ) diff --git a/test/ctor-eval/imported.wast b/test/ctor-eval/imported.wast index 982beacbe..d385afac2 100644 --- a/test/ctor-eval/imported.wast +++ b/test/ctor-eval/imported.wast @@ -37,7 +37,6 @@ (i32.store8 (i32.const 12) (i32.const 115)) ) (func $test2 - (set_global $tempDoublePtrMut (i32.const 1)) ;; bad! (i32.store8 (i32.const 13) (i32.const 115)) ) (func $test3 diff --git a/test/ctor-eval/imported.wast.out b/test/ctor-eval/imported.wast.out index 7b5c069ec..4427f36e0 100644 --- a/test/ctor-eval/imported.wast.out +++ b/test/ctor-eval/imported.wast.out @@ -1,24 +1,2 @@ (module - (type $0 (func)) - (import "env" "tempDoublePtr" (global $tempDoublePtr i32)) - (global $tempDoublePtrMut (mut i32) (get_global $tempDoublePtr)) - (memory $0 256 256) - (data (i32.const 10) "wasa waka waka waka waka") - (export "test2" (func $test2)) - (export "test3" (func $test3)) - (func $test2 (; 0 ;) (type $0) - (set_global $tempDoublePtrMut - (i32.const 1) - ) - (i32.store8 - (i32.const 13) - (i32.const 115) - ) - ) - (func $test3 (; 1 ;) (type $0) - (i32.store8 - (i32.const 14) - (i32.const 115) - ) - ) ) diff --git a/test/ctor-eval/imported2.wast.out b/test/ctor-eval/imported2.wast.out index e86317071..453f00c32 100644 --- a/test/ctor-eval/imported2.wast.out +++ b/test/ctor-eval/imported2.wast.out @@ -1,8 +1,8 @@ (module (type $0 (func)) - (global $mine (mut i32) (i32.const 1)) (memory $0 256 256) (data (i32.const 10) "wasa waka waka waka waka") + (global $mine (mut i32) (i32.const 1)) (export "test2" (func $test2)) (export "test3" (func $test3)) (func $test2 (; 0 ;) (type $0) diff --git a/test/ctor-eval/indirect-call3.wast.out b/test/ctor-eval/indirect-call3.wast.out index 27351bcce..561f17976 100644 --- a/test/ctor-eval/indirect-call3.wast.out +++ b/test/ctor-eval/indirect-call3.wast.out @@ -1,9 +1,9 @@ (module (type $FUNCSIG$v (func)) - (import "env" "tableBase" (global $tableBase i32)) - (import "env" "_abort" (func $_abort)) (memory $0 256 256) (data (i32.const 10) "waka waka xaka waka waka\00\00\00\00\00\00C") + (import "env" "tableBase" (global $tableBase i32)) + (import "env" "_abort" (func $_abort)) (func $call-indirect (; 1 ;) (type $FUNCSIG$v) (i32.store8 (i32.const 40) diff --git a/test/debugInfo.fromasm b/test/debugInfo.fromasm index 5bedd5bdf..366ffb4d8 100644 --- a/test/debugInfo.fromasm +++ b/test/debugInfo.fromasm @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "debugInfo.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "add" (func $add)) (export "ret" (func $ret)) (export "opts" (func $opts)) diff --git a/test/debugInfo.fromasm.clamp b/test/debugInfo.fromasm.clamp index 5bedd5bdf..366ffb4d8 100644 --- a/test/debugInfo.fromasm.clamp +++ b/test/debugInfo.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "debugInfo.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "add" (func $add)) (export "ret" (func $ret)) (export "opts" (func $opts)) diff --git a/test/debugInfo.fromasm.clamp.no-opts b/test/debugInfo.fromasm.clamp.no-opts index 83e1c4ec0..33309199e 100644 --- a/test/debugInfo.fromasm.clamp.no-opts +++ b/test/debugInfo.fromasm.clamp.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/debugInfo.fromasm.imprecise.no-opts b/test/debugInfo.fromasm.imprecise.no-opts index 22e2df1b0..1985349b6 100644 --- a/test/debugInfo.fromasm.imprecise.no-opts +++ b/test/debugInfo.fromasm.imprecise.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/debugInfo.fromasm.no-opts b/test/debugInfo.fromasm.no-opts index 83e1c4ec0..33309199e 100644 --- a/test/debugInfo.fromasm.no-opts +++ b/test/debugInfo.fromasm.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/debugInfo.fromasm.read-written b/test/debugInfo.fromasm.read-written index cd7402cb1..707c705bf 100644 --- a/test/debugInfo.fromasm.read-written +++ b/test/debugInfo.fromasm.read-written @@ -2,9 +2,9 @@ (type $0 (func (param i32 i32) (result i32))) (type $1 (func (param i32) (result i32))) (type $2 (func)) - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $gimport$1 i32)) - (data (get_global $gimport$1) "debugInfo.asm.js") + (import "env" "memory" (memory $1 256 256)) + (data (get_global $gimport$0) "debugInfo.asm.js") + (import "env" "memoryBase" (global $gimport$0 i32)) (export "add" (func $add)) (export "ret" (func $ret)) (export "opts" (func $opts)) diff --git a/test/dylib.wasm.fromBinary b/test/dylib.wasm.fromBinary index 37dcab84f..7c518b28f 100644 --- a/test/dylib.wasm.fromBinary +++ b/test/dylib.wasm.fromBinary @@ -2,15 +2,15 @@ (type $0 (func (param i32) (result i32))) (type $1 (func (result i32))) (type $2 (func)) - (import "env" "memoryBase" (global $gimport$0 i32)) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $2 256)) + (data (get_global $gimport$0) "hello, world!") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $gimport$0 i32)) (import "env" "tableBase" (global $gimport$4 i32)) (import "env" "_puts" (func $fimport$1 (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 0)) (global $global$1 (mut i32) (i32.const 0)) (global $global$2 i32 (i32.const 0)) - (data (get_global $gimport$0) "hello, world!") (export "__post_instantiate" (func $2)) (export "_main" (func $0)) (export "runPostSets" (func $1)) diff --git a/test/dynamicLibrary.fromasm b/test/dynamicLibrary.fromasm index edd7a60d0..813f7334a 100644 --- a/test/dynamicLibrary.fromasm +++ b/test/dynamicLibrary.fromasm @@ -1,14 +1,14 @@ (module (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "dynamicLibrary.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "abortStackOverflow" (func $abortStackOverflow (param i32))) (import "env" "_puts" (func $_puts (param i32) (result i32))) (global $STACKTOP (mut i32) (i32.const 0)) (global $STACK_MAX (mut i32) (i32.const 0)) (global $_global i32 (i32.const 5242912)) - (data (get_global $memoryBase) "dynamicLibrary.asm.js") (export "__ZN3FooC2Ev" (func $__ZN3FooC2Ev)) (export "__post_instantiate" (func $__post_instantiate)) (export "runPostSets" (func $runPostSets)) diff --git a/test/dynamicLibrary.fromasm.clamp b/test/dynamicLibrary.fromasm.clamp index edd7a60d0..813f7334a 100644 --- a/test/dynamicLibrary.fromasm.clamp +++ b/test/dynamicLibrary.fromasm.clamp @@ -1,14 +1,14 @@ (module (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "dynamicLibrary.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "abortStackOverflow" (func $abortStackOverflow (param i32))) (import "env" "_puts" (func $_puts (param i32) (result i32))) (global $STACKTOP (mut i32) (i32.const 0)) (global $STACK_MAX (mut i32) (i32.const 0)) (global $_global i32 (i32.const 5242912)) - (data (get_global $memoryBase) "dynamicLibrary.asm.js") (export "__ZN3FooC2Ev" (func $__ZN3FooC2Ev)) (export "__post_instantiate" (func $__post_instantiate)) (export "runPostSets" (func $runPostSets)) diff --git a/test/dynamicLibrary.fromasm.clamp.no-opts b/test/dynamicLibrary.fromasm.clamp.no-opts index 4068732c0..f2a0c5b5c 100644 --- a/test/dynamicLibrary.fromasm.clamp.no-opts +++ b/test/dynamicLibrary.fromasm.clamp.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/dynamicLibrary.fromasm.imprecise.no-opts b/test/dynamicLibrary.fromasm.imprecise.no-opts index 4068732c0..f2a0c5b5c 100644 --- a/test/dynamicLibrary.fromasm.imprecise.no-opts +++ b/test/dynamicLibrary.fromasm.imprecise.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/dynamicLibrary.fromasm.no-opts b/test/dynamicLibrary.fromasm.no-opts index 4068732c0..f2a0c5b5c 100644 --- a/test/dynamicLibrary.fromasm.no-opts +++ b/test/dynamicLibrary.fromasm.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm index 5bc940d9f..3573e6bfa 100644 --- a/test/emcc_O2_hello_world.fromasm +++ b/test/emcc_O2_hello_world.fromasm @@ -6,8 +6,10 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (i32.const 1024) "emcc_O2_hello_world.asm.js") (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) @@ -31,8 +33,6 @@ (global $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) - (data (i32.const 1024) "emcc_O2_hello_world.asm.js") (export "_free" (func $_free)) (export "_main" (func $_main)) (export "_memset" (func $_memset)) diff --git a/test/emcc_O2_hello_world.fromasm.clamp b/test/emcc_O2_hello_world.fromasm.clamp index 5bc940d9f..3573e6bfa 100644 --- a/test/emcc_O2_hello_world.fromasm.clamp +++ b/test/emcc_O2_hello_world.fromasm.clamp @@ -6,8 +6,10 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (i32.const 1024) "emcc_O2_hello_world.asm.js") (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) @@ -31,8 +33,6 @@ (global $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) - (data (i32.const 1024) "emcc_O2_hello_world.asm.js") (export "_free" (func $_free)) (export "_main" (func $_main)) (export "_memset" (func $_memset)) diff --git a/test/emcc_O2_hello_world.fromasm.clamp.no-opts b/test/emcc_O2_hello_world.fromasm.clamp.no-opts index 1592aabd2..e7d760219 100644 --- a/test/emcc_O2_hello_world.fromasm.clamp.no-opts +++ b/test/emcc_O2_hello_world.fromasm.clamp.no-opts @@ -6,8 +6,9 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -61,7 +62,6 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (export "_free" (func $_free)) (export "_main" (func $_main)) (export "_memset" (func $_memset)) diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise index bbc3b3373..e8b1de0b1 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise +++ b/test/emcc_O2_hello_world.fromasm.imprecise @@ -6,8 +6,9 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) @@ -31,7 +32,6 @@ (global $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (export "_free" (func $_free)) (export "_main" (func $_main)) (export "_memset" (func $_memset)) diff --git a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts index 6c44953e3..ffc9cec45 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise.no-opts +++ b/test/emcc_O2_hello_world.fromasm.imprecise.no-opts @@ -6,8 +6,9 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -61,7 +62,6 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (export "_free" (func $_free)) (export "_main" (func $_main)) (export "_memset" (func $_memset)) diff --git a/test/emcc_O2_hello_world.fromasm.no-opts b/test/emcc_O2_hello_world.fromasm.no-opts index 1592aabd2..e7d760219 100644 --- a/test/emcc_O2_hello_world.fromasm.no-opts +++ b/test/emcc_O2_hello_world.fromasm.no-opts @@ -6,8 +6,9 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -61,7 +62,6 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $b1 $___stdio_write $b1 $b1 $b2 $b2 $b2 $b2 $_cleanup_418 $b2 $b2 $b2) (export "_free" (func $_free)) (export "_main" (func $_main)) (export "_memset" (func $_memset)) diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm index cffc2ad79..9c2281f57 100644 --- a/test/emcc_hello_world.fromasm +++ b/test/emcc_hello_world.fromasm @@ -7,8 +7,10 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (i32.const 1024) "emcc_hello_world.asm.js") (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) @@ -38,8 +40,6 @@ (global $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) - (data (i32.const 1024) "emcc_hello_world.asm.js") (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/emcc_hello_world.fromasm.clamp b/test/emcc_hello_world.fromasm.clamp index 17c1a9336..e036feffe 100644 --- a/test/emcc_hello_world.fromasm.clamp +++ b/test/emcc_hello_world.fromasm.clamp @@ -6,8 +6,10 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (i32.const 1024) "emcc_hello_world.asm.js") (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) @@ -36,8 +38,6 @@ (global $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) - (data (i32.const 1024) "emcc_hello_world.asm.js") (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/emcc_hello_world.fromasm.clamp.no-opts b/test/emcc_hello_world.fromasm.clamp.no-opts index ccb416d02..c4fbe1ec5 100644 --- a/test/emcc_hello_world.fromasm.clamp.no-opts +++ b/test/emcc_hello_world.fromasm.clamp.no-opts @@ -6,8 +6,9 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -66,7 +67,6 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise index 46a1c48c4..023d58c10 100644 --- a/test/emcc_hello_world.fromasm.imprecise +++ b/test/emcc_hello_world.fromasm.imprecise @@ -6,8 +6,9 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) @@ -36,7 +37,6 @@ (global $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/emcc_hello_world.fromasm.imprecise.no-opts b/test/emcc_hello_world.fromasm.imprecise.no-opts index 8663575ff..1d580f542 100644 --- a/test/emcc_hello_world.fromasm.imprecise.no-opts +++ b/test/emcc_hello_world.fromasm.imprecise.no-opts @@ -6,8 +6,9 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -66,7 +67,6 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/emcc_hello_world.fromasm.no-opts b/test/emcc_hello_world.fromasm.no-opts index 2d7a706ae..352b5fce1 100644 --- a/test/emcc_hello_world.fromasm.no-opts +++ b/test/emcc_hello_world.fromasm.no-opts @@ -7,8 +7,9 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -68,7 +69,6 @@ (global $tempRet8 (mut i32) (i32.const 0)) (global $tempRet9 (mut i32) (i32.const 0)) (global $tempFloat (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/empty.fromasm b/test/empty.fromasm index 968902e3a..5ba9dd2b8 100644 --- a/test/empty.fromasm +++ b/test/empty.fromasm @@ -1,4 +1,4 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (data (i32.const 1024) "empty.asm.js") ) diff --git a/test/empty.fromasm.clamp b/test/empty.fromasm.clamp index 968902e3a..5ba9dd2b8 100644 --- a/test/empty.fromasm.clamp +++ b/test/empty.fromasm.clamp @@ -1,4 +1,4 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (data (i32.const 1024) "empty.asm.js") ) diff --git a/test/empty.fromasm.clamp.no-opts b/test/empty.fromasm.clamp.no-opts index ddb433043..e8a74bc65 100644 --- a/test/empty.fromasm.clamp.no-opts +++ b/test/empty.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/empty.fromasm.imprecise.no-opts b/test/empty.fromasm.imprecise.no-opts index ddb433043..e8a74bc65 100644 --- a/test/empty.fromasm.imprecise.no-opts +++ b/test/empty.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/empty.fromasm.no-opts b/test/empty.fromasm.no-opts index ddb433043..e8a74bc65 100644 --- a/test/empty.fromasm.no-opts +++ b/test/empty.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/empty_imported_table.wast.from-wast b/test/empty_imported_table.wast.from-wast index 1ad108fde..3abcf2a50 100644 --- a/test/empty_imported_table.wast.from-wast +++ b/test/empty_imported_table.wast.from-wast @@ -1,4 +1,4 @@ (module - (import "env" "table" (table 0 0 anyfunc)) (memory $0 0) + (import "env" "table" (table 0 0 anyfunc)) ) diff --git a/test/empty_imported_table.wast.fromBinary b/test/empty_imported_table.wast.fromBinary index 9e0c240cd..e8bc8835d 100644 --- a/test/empty_imported_table.wast.fromBinary +++ b/test/empty_imported_table.wast.fromBinary @@ -1,5 +1,5 @@ (module - (import "env" "table" (table 0 0 anyfunc)) (memory $0 0) + (import "env" "table" (table 0 0 anyfunc)) ) diff --git a/test/empty_imported_table.wast.fromBinary.noDebugInfo b/test/empty_imported_table.wast.fromBinary.noDebugInfo index 9e0c240cd..e8bc8835d 100644 --- a/test/empty_imported_table.wast.fromBinary.noDebugInfo +++ b/test/empty_imported_table.wast.fromBinary.noDebugInfo @@ -1,5 +1,5 @@ (module - (import "env" "table" (table 0 0 anyfunc)) (memory $0 0) + (import "env" "table" (table 0 0 anyfunc)) ) diff --git a/test/empty_table.wast.from-wast b/test/empty_table.wast.from-wast index 7254336c5..59a78fb19 100644 --- a/test/empty_table.wast.from-wast +++ b/test/empty_table.wast.from-wast @@ -1,4 +1,4 @@ (module - (table 0 0 anyfunc) (memory $0 0) + (table 0 0 anyfunc) ) diff --git a/test/empty_table.wast.fromBinary b/test/empty_table.wast.fromBinary index 07bab7efa..9d7d65c26 100644 --- a/test/empty_table.wast.fromBinary +++ b/test/empty_table.wast.fromBinary @@ -1,5 +1,5 @@ (module - (table 0 0 anyfunc) (memory $0 0) + (table 0 0 anyfunc) ) diff --git a/test/empty_table.wast.fromBinary.noDebugInfo b/test/empty_table.wast.fromBinary.noDebugInfo index 07bab7efa..9d7d65c26 100644 --- a/test/empty_table.wast.fromBinary.noDebugInfo +++ b/test/empty_table.wast.fromBinary.noDebugInfo @@ -1,5 +1,5 @@ (module - (table 0 0 anyfunc) (memory $0 0) + (table 0 0 anyfunc) ) diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 8248dea52..4e4944cda 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -202,7 +202,7 @@ void test_core() { BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node BinaryenUnary(module, BinaryenTruncSFloat32ToInt32(), - BinaryenCallImport(module, "an-imported", callOperands2, 2, BinaryenTypeFloat32()) + BinaryenCall(module, "an-imported", callOperands2, 2, BinaryenTypeFloat32()) ) ), BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node @@ -301,7 +301,7 @@ void test_unreachable() { BinaryenExpressionRef makeCallCheck(BinaryenModuleRef module, int x) { BinaryenExpressionRef callOperands[] = { makeInt32(module, x) }; - return BinaryenCallImport(module, "check", callOperands, 1, BinaryenTypeNone()); + return BinaryenCall(module, "check", callOperands, 1, BinaryenTypeNone()); } void test_relooper() { @@ -543,7 +543,7 @@ void test_interpret() { BinaryenFunctionTypeRef v = BinaryenAddFunctionType(module, "v", BinaryenTypeNone(), NULL, 0); BinaryenExpressionRef callOperands[] = { makeInt32(module, 1234) }; - BinaryenExpressionRef call = BinaryenCallImport(module, "print-i32", callOperands, 1, BinaryenTypeNone()); + BinaryenExpressionRef call = BinaryenCall(module, "print-i32", callOperands, 1, BinaryenTypeNone()); BinaryenFunctionRef starter = BinaryenAddFunction(module, "starter", v, NULL, 0, call); BinaryenSetStart(module, starter); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 7fa1b4ea7..5dc884d2b 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -13,13 +13,13 @@ BinaryenTypeAuto: -1 (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (global $a-global i32 (i32.const 7)) (global $a-mutable-global (mut f32) (f32.const 7.5)) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") - (memory $0 1 256) - (data (i32.const 10) "hello, world") (export "kitchen_sinker" (func "$kitchen()sinker")) (export "mem" (memory $0)) (start $starter) @@ -1078,7 +1078,7 @@ int main() { std::map<size_t, BinaryenFunctionTypeRef> functionTypes; std::map<size_t, BinaryenExpressionRef> expressions; std::map<size_t, BinaryenFunctionRef> functions; - std::map<size_t, BinaryenImportRef> imports; + std::map<size_t, BinaryenGlobalRef> globals; std::map<size_t, BinaryenExportRef> exports; std::map<size_t, RelooperBlockRef> relooperBlocks; BinaryenModuleRef the_module = NULL; @@ -1321,7 +1321,7 @@ int main() { expressions[218] = BinaryenUnary(the_module, 20, expressions[217]); { BinaryenExpressionRef operands[] = { expressions[7], expressions[8] }; - expressions[219] = BinaryenCallImport(the_module, "an-imported", operands, 2, 3); + expressions[219] = BinaryenCall(the_module, "an-imported", operands, 2, 3); } expressions[220] = BinaryenUnary(the_module, 25, expressions[219]); expressions[221] = BinaryenUnary(the_module, 20, expressions[220]); @@ -1398,7 +1398,7 @@ int main() { BinaryenType paramTypes[] = { 1, 4 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2); } - imports[0] = BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]); + BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]); exports[0] = BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker"); BinaryenFunctionGetName(functions[0]); { @@ -1435,13 +1435,13 @@ int main() { (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (global $a-global i32 (i32.const 7)) (global $a-mutable-global (mut f32) (f32.const 7.5)) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") - (memory $0 1 256) - (data (i32.const 10) "hello, world") (export "kitchen_sinker" (func "$kitchen()sinker")) (export "mem" (memory $0)) (start $starter) @@ -1966,7 +1966,7 @@ int main() { functionTypes.clear(); expressions.clear(); functions.clear(); - imports.clear(); + globals.clear(); exports.clear(); relooperBlocks.clear(); the_module = BinaryenModuleCreate(); @@ -1979,12 +1979,12 @@ int main() { BinaryenType paramTypes[] = { 1 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1); } - imports[0] = BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]); + BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]); the_relooper = RelooperCreate(); expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); { BinaryenExpressionRef operands[] = { expressions[1] }; - expressions[2] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[2] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[2]); expressions[3] = RelooperRenderAndDispose(the_relooper, relooperBlocks[0], 0, the_module); @@ -1996,13 +1996,13 @@ int main() { expressions[4] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[4] }; - expressions[5] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[5] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[5]); expressions[6] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[6] }; - expressions[7] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[7] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[7]); RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); @@ -2015,13 +2015,13 @@ int main() { expressions[9] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[9] }; - expressions[10] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[10] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[10]); expressions[11] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[11] }; - expressions[12] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[12] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[12]); expressions[13] = BinaryenConst(the_module, BinaryenLiteralInt32(77)); @@ -2036,13 +2036,13 @@ int main() { expressions[16] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[16] }; - expressions[17] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[17] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[17]); expressions[18] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[18] }; - expressions[19] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[19] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[19]); RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); @@ -2056,13 +2056,13 @@ int main() { expressions[21] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[21] }; - expressions[22] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[22] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[22]); expressions[23] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[23] }; - expressions[24] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[24] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[24]); expressions[25] = BinaryenConst(the_module, BinaryenLiteralInt32(33)); @@ -2080,19 +2080,19 @@ int main() { expressions[30] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[30] }; - expressions[31] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[31] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[31]); expressions[32] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[32] }; - expressions[33] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[33] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[33]); expressions[34] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[34] }; - expressions[35] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[35] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[35]); expressions[36] = BinaryenConst(the_module, BinaryenLiteralInt32(55)); @@ -2107,19 +2107,19 @@ int main() { expressions[38] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[38] }; - expressions[39] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[39] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[39]); expressions[40] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[40] }; - expressions[41] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[41] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[41]); expressions[42] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[42] }; - expressions[43] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[43] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[43]); expressions[44] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); @@ -2138,19 +2138,19 @@ int main() { expressions[50] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[50] }; - expressions[51] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[51] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[51]); expressions[52] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[52] }; - expressions[53] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[53] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[53]); expressions[54] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[54] }; - expressions[55] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[55] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[55]); expressions[56] = BinaryenConst(the_module, BinaryenLiteralInt32(55)); @@ -2166,19 +2166,19 @@ int main() { expressions[58] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[58] }; - expressions[59] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[59] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[59]); expressions[60] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[60] }; - expressions[61] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[61] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[61]); expressions[62] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[62] }; - expressions[63] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[63] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[63]); expressions[64] = BinaryenConst(the_module, BinaryenLiteralInt32(-1)); @@ -2200,25 +2200,25 @@ int main() { expressions[72] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[72] }; - expressions[73] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[73] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[73]); expressions[74] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[74] }; - expressions[75] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[75] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[75]); expressions[76] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[76] }; - expressions[77] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[77] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[77]); expressions[78] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); { BinaryenExpressionRef operands[] = { expressions[78] }; - expressions[79] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[79] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[79]); expressions[80] = BinaryenConst(the_module, BinaryenLiteralInt32(55)); @@ -2235,19 +2235,19 @@ int main() { expressions[82] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[82] }; - expressions[83] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[83] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[83]); expressions[84] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[84] }; - expressions[85] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[85] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[85]); expressions[86] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[86] }; - expressions[87] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[87] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[87]); RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]); @@ -2263,43 +2263,43 @@ int main() { expressions[90] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[90] }; - expressions[91] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[91] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[91]); expressions[92] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[92] }; - expressions[93] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[93] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[93]); expressions[94] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[94] }; - expressions[95] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[95] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[95]); expressions[96] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); { BinaryenExpressionRef operands[] = { expressions[96] }; - expressions[97] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[97] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[97]); expressions[98] = BinaryenConst(the_module, BinaryenLiteralInt32(4)); { BinaryenExpressionRef operands[] = { expressions[98] }; - expressions[99] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[99] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[4] = RelooperAddBlock(the_relooper, expressions[99]); expressions[100] = BinaryenConst(the_module, BinaryenLiteralInt32(5)); { BinaryenExpressionRef operands[] = { expressions[100] }; - expressions[101] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[101] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[5] = RelooperAddBlock(the_relooper, expressions[101]); expressions[102] = BinaryenConst(the_module, BinaryenLiteralInt32(6)); { BinaryenExpressionRef operands[] = { expressions[102] }; - expressions[103] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[103] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[6] = RelooperAddBlock(the_relooper, expressions[103]); expressions[104] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); @@ -2332,25 +2332,25 @@ int main() { expressions[117] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[117] }; - expressions[118] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[118] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlockWithSwitch(the_relooper, expressions[118], expressions[116]); expressions[119] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[119] }; - expressions[120] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[120] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[120]); expressions[121] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[121] }; - expressions[122] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[122] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[122]); expressions[123] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); { BinaryenExpressionRef operands[] = { expressions[123] }; - expressions[124] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[124] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[3] = RelooperAddBlock(the_relooper, expressions[124]); { @@ -2376,19 +2376,19 @@ int main() { expressions[128] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[128] }; - expressions[129] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[129] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[129]); expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); { BinaryenExpressionRef operands[] = { expressions[130] }; - expressions[131] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[131] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[131]); expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { BinaryenExpressionRef operands[] = { expressions[132] }; - expressions[133] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[133] = BinaryenCall(the_module, "check", operands, 1, 0); } relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[133]); expressions[134] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); @@ -2409,7 +2409,7 @@ int main() { expressions[136] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { BinaryenExpressionRef operands[] = { expressions[136] }; - expressions[137] = BinaryenCallImport(the_module, "check", operands, 1, 0); + expressions[137] = BinaryenCall(the_module, "check", operands, 1, 0); } expressions[138] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); expressions[139] = BinaryenReturn(the_module, expressions[138]); @@ -2921,7 +2921,7 @@ optimized: functionTypes.clear(); expressions.clear(); functions.clear(); - imports.clear(); + globals.clear(); exports.clear(); relooperBlocks.clear(); return 0; diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index 986c21bf6..1d2fcfdda 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -6,13 +6,13 @@ (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) (type $3 (func)) + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (global $a-global i32 (i32.const 7)) (global $a-mutable-global (mut f32) (f32.const 7.5)) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") - (memory $0 1 256) - (data (i32.const 10) "hello, world") (export "kitchen_sinker" (func "$kitchen()sinker")) (export "mem" (memory $0)) (start $starter) diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp index 2fafa88d1..dbd50d116 100644 --- a/test/example/c-api-relooper-unreachable-if.cpp +++ b/test/example/c-api-relooper-unreachable-if.cpp @@ -147,7 +147,7 @@ int main() { expressions[47] = BinaryenGetLocal(the_module, 2, 1); { BinaryenExpressionRef operands[] = { expressions[47] }; - expressions[48] = BinaryenCallImport(the_module, "print_i32", operands, 1, 0); + expressions[48] = BinaryenCall(the_module, "print_i32", operands, 1, 0); } { BinaryenExpressionRef children[] = { expressions[44], expressions[46], expressions[48] }; diff --git a/test/example/relooper-fuzz.c b/test/example/relooper-fuzz.c index 28be4bd90..529014139 100644 --- a/test/example/relooper-fuzz.c +++ b/test/example/relooper-fuzz.c @@ -47,7 +47,7 @@ int main() { ) }; BinaryenExpressionRef debugger; - if (1) debugger = BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()); + if (1) debugger = BinaryenCall(module, "print", args, 1, BinaryenTypeNone()); else debugger = BinaryenNop(module); // return the decision. need to subtract 4 that we just added, and add 8 since that's where we start, so overall offset 4 @@ -69,7 +69,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(0)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b0 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -79,7 +79,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(1)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b1 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -89,7 +89,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(2)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b2 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -99,7 +99,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(3)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b3 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -109,7 +109,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(4)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b4 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -119,7 +119,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(5)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b5 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -129,7 +129,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(6)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b6 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -139,7 +139,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(7)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b7 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); @@ -149,7 +149,7 @@ int main() { { BinaryenExpressionRef args[] = { BinaryenConst(module, BinaryenLiteralInt32(8)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; b8 = RelooperAddBlock(relooper, BinaryenBlock(module, NULL, list, 2, BinaryenTypeAuto())); diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt index bde48af8c..47ebcfbb0 100644 --- a/test/example/relooper-fuzz.txt +++ b/test/example/relooper-fuzz.txt @@ -2,8 +2,8 @@ (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) + (import "spectest" "print" (func $print (param i32))) (export "mem" (memory $0)) (start $main) (func $check (; 1 ;) (type $i) (result i32) @@ -295,8 +295,8 @@ (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) + (import "spectest" "print" (func $print (param i32))) (export "mem" (memory $0)) (start $main) (func $check (; 1 ;) (; has Stack IR ;) (type $i) (result i32) diff --git a/test/example/relooper-fuzz1.c b/test/example/relooper-fuzz1.c index 9be2daa10..4aef34fde 100644 --- a/test/example/relooper-fuzz1.c +++ b/test/example/relooper-fuzz1.c @@ -50,7 +50,7 @@ int main() { ) }; BinaryenExpressionRef debugger; - if (1) debugger = BinaryenCallImport(module, "print", args, 1, + if (1) debugger = BinaryenCall(module, "print", args, 1, BinaryenTypeNone()); else debugger = BinaryenNop(module); @@ -83,7 +83,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(0)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -99,7 +99,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(1)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -115,7 +115,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(2)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -131,7 +131,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(3)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -147,7 +147,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(4)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -163,7 +163,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(5)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -179,7 +179,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(6)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -195,7 +195,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(7)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -211,7 +211,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(8)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; @@ -227,7 +227,7 @@ int main() { BinaryenConst(module, BinaryenLiteralInt32(9)) }; BinaryenExpressionRef list[] = { - BinaryenCallImport(module, "print", args, 1, BinaryenTypeNone()), + BinaryenCall(module, "print", args, 1, BinaryenTypeNone()), BinaryenSetLocal(module, 0, BinaryenCall(module, "check", NULL, 0, BinaryenTypeInt32())) }; diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt index af3140f9c..b05da62c5 100644 --- a/test/example/relooper-fuzz1.txt +++ b/test/example/relooper-fuzz1.txt @@ -2,8 +2,8 @@ (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) + (import "spectest" "print" (func $print (param i32))) (export "mem" (memory $0)) (start $main) (func $check (; 1 ;) (type $i) (result i32) @@ -271,8 +271,8 @@ (type $i (func (result i32))) (type $v (func)) (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) (memory $0 1 1) + (import "spectest" "print" (func $print (param i32))) (export "mem" (memory $0)) (start $main) (func $check (; 1 ;) (; has Stack IR ;) (type $i) (result i32) diff --git a/test/export-import.wast.from-wast b/test/export-import.wast.from-wast index 174101e7c..6615cead6 100644 --- a/test/export-import.wast.from-wast +++ b/test/export-import.wast.from-wast @@ -1,8 +1,8 @@ (module (type $v (func)) (type $FUNCSIG$v (func)) - (import "env" "test1" (func $test1)) (import "env" "test2" (global $test2 i32)) + (import "env" "test1" (func $test1)) (export "test1" (func $test1)) (export "test2" (global $test2)) ) diff --git a/test/fib-dbg.wasm.fromBinary b/test/fib-dbg.wasm.fromBinary index 9e1bf0d53..af51fc5a8 100644 --- a/test/fib-dbg.wasm.fromBinary +++ b/test/fib-dbg.wasm.fromBinary @@ -4,6 +4,8 @@ (type $2 (func (result i32))) (type $3 (func (param i32))) (type $4 (func)) + (import "env" "memory" (memory $9 256 256)) + (import "env" "table" (table 0 0 anyfunc)) (import "env" "DYNAMICTOP_PTR" (global $gimport$0 i32)) (import "env" "tempDoublePtr" (global $gimport$1 i32)) (import "env" "ABORT" (global $gimport$2 i32)) @@ -13,8 +15,6 @@ (import "env" "fb" (global $gimport$6 i32)) (import "global" "NaN" (global $gimport$7 f64)) (import "global" "Infinity" (global $gimport$8 f64)) - (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $gimport$11 i32)) (import "env" "tableBase" (global $gimport$12 i32)) (global $global$0 (mut i32) (get_global $gimport$0)) diff --git a/test/hello_world.fromasm b/test/hello_world.fromasm index 16f132114..426989111 100644 --- a/test/hello_world.fromasm +++ b/test/hello_world.fromasm @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "hello_world.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "add" (func $add)) (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (i32.add diff --git a/test/hello_world.fromasm.clamp b/test/hello_world.fromasm.clamp index 16f132114..426989111 100644 --- a/test/hello_world.fromasm.clamp +++ b/test/hello_world.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "hello_world.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "add" (func $add)) (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (i32.add diff --git a/test/hello_world.fromasm.clamp.no-opts b/test/hello_world.fromasm.clamp.no-opts index 90861e289..fa40c6e56 100644 --- a/test/hello_world.fromasm.clamp.no-opts +++ b/test/hello_world.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/hello_world.fromasm.imprecise.no-opts b/test/hello_world.fromasm.imprecise.no-opts index 90861e289..fa40c6e56 100644 --- a/test/hello_world.fromasm.imprecise.no-opts +++ b/test/hello_world.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/hello_world.fromasm.no-opts b/test/hello_world.fromasm.no-opts index 90861e289..fa40c6e56 100644 --- a/test/hello_world.fromasm.no-opts +++ b/test/hello_world.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/i64-setTempRet0.fromasm b/test/i64-setTempRet0.fromasm index bb834c144..74c231fd9 100644 --- a/test/i64-setTempRet0.fromasm +++ b/test/i64-setTempRet0.fromasm @@ -1,10 +1,10 @@ (module (type $legaltype$illegalImportResult (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "i64-setTempRet0.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) (global $tempRet0 (mut i32) (i32.const 0)) - (data (get_global $memoryBase) "i64-setTempRet0.asm.js") (export "illegalResult" (func $legalstub$illegalResult)) (export "imports" (func $imports)) (func $imports (; 1 ;) (; has Stack IR ;) (result i32) diff --git a/test/i64-setTempRet0.fromasm.clamp b/test/i64-setTempRet0.fromasm.clamp index bb834c144..74c231fd9 100644 --- a/test/i64-setTempRet0.fromasm.clamp +++ b/test/i64-setTempRet0.fromasm.clamp @@ -1,10 +1,10 @@ (module (type $legaltype$illegalImportResult (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "i64-setTempRet0.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) (global $tempRet0 (mut i32) (i32.const 0)) - (data (get_global $memoryBase) "i64-setTempRet0.asm.js") (export "illegalResult" (func $legalstub$illegalResult)) (export "imports" (func $imports)) (func $imports (; 1 ;) (; has Stack IR ;) (result i32) diff --git a/test/i64-setTempRet0.fromasm.clamp.no-opts b/test/i64-setTempRet0.fromasm.clamp.no-opts index 8a8dc9a8f..104195277 100644 --- a/test/i64-setTempRet0.fromasm.clamp.no-opts +++ b/test/i64-setTempRet0.fromasm.clamp.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$j (func (result i64))) (type $legaltype$illegalImportResult (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/i64-setTempRet0.fromasm.imprecise.no-opts b/test/i64-setTempRet0.fromasm.imprecise.no-opts index 8a8dc9a8f..104195277 100644 --- a/test/i64-setTempRet0.fromasm.imprecise.no-opts +++ b/test/i64-setTempRet0.fromasm.imprecise.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$j (func (result i64))) (type $legaltype$illegalImportResult (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/i64-setTempRet0.fromasm.no-opts b/test/i64-setTempRet0.fromasm.no-opts index 8a8dc9a8f..104195277 100644 --- a/test/i64-setTempRet0.fromasm.no-opts +++ b/test/i64-setTempRet0.fromasm.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$j (func (result i64))) (type $legaltype$illegalImportResult (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/importedSignCast.fromasm b/test/importedSignCast.fromasm index 81652875a..a1bdcc607 100644 --- a/test/importedSignCast.fromasm +++ b/test/importedSignCast.fromasm @@ -1,12 +1,12 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "importedSignCast.asm.js") (import "env" "table" (table 1 1 anyfunc)) + (elem (get_global $tableBase) $gm) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32))) - (elem (get_global $tableBase) $gm) - (data (get_global $memoryBase) "importedSignCast.asm.js") (export "func" (func $func)) (func $func (; 1 ;) (; has Stack IR ;) (drop diff --git a/test/importedSignCast.fromasm.clamp b/test/importedSignCast.fromasm.clamp index 81652875a..a1bdcc607 100644 --- a/test/importedSignCast.fromasm.clamp +++ b/test/importedSignCast.fromasm.clamp @@ -1,12 +1,12 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "importedSignCast.asm.js") (import "env" "table" (table 1 1 anyfunc)) + (elem (get_global $tableBase) $gm) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32))) - (elem (get_global $tableBase) $gm) - (data (get_global $memoryBase) "importedSignCast.asm.js") (export "func" (func $func)) (func $func (; 1 ;) (; has Stack IR ;) (drop diff --git a/test/importedSignCast.fromasm.clamp.no-opts b/test/importedSignCast.fromasm.clamp.no-opts index 0637c7517..edf90ac9d 100644 --- a/test/importedSignCast.fromasm.clamp.no-opts +++ b/test/importedSignCast.fromasm.clamp.no-opts @@ -1,11 +1,11 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 1 1 anyfunc)) + (elem (get_global $tableBase) $gm) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32))) - (elem (get_global $tableBase) $gm) (export "func" (func $func)) (func $func (; 1 ;) (drop diff --git a/test/importedSignCast.fromasm.imprecise b/test/importedSignCast.fromasm.imprecise index d31be8dc4..9ffe55510 100644 --- a/test/importedSignCast.fromasm.imprecise +++ b/test/importedSignCast.fromasm.imprecise @@ -1,9 +1,9 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "table" (table 1 1 anyfunc)) + (elem (get_global $tableBase) $gm) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32))) - (elem (get_global $tableBase) $gm) (export "func" (func $func)) (func $func (; 1 ;) (; has Stack IR ;) (drop diff --git a/test/importedSignCast.fromasm.imprecise.no-opts b/test/importedSignCast.fromasm.imprecise.no-opts index 0637c7517..edf90ac9d 100644 --- a/test/importedSignCast.fromasm.imprecise.no-opts +++ b/test/importedSignCast.fromasm.imprecise.no-opts @@ -1,11 +1,11 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 1 1 anyfunc)) + (elem (get_global $tableBase) $gm) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32))) - (elem (get_global $tableBase) $gm) (export "func" (func $func)) (func $func (; 1 ;) (drop diff --git a/test/importedSignCast.fromasm.no-opts b/test/importedSignCast.fromasm.no-opts index 0637c7517..edf90ac9d 100644 --- a/test/importedSignCast.fromasm.no-opts +++ b/test/importedSignCast.fromasm.no-opts @@ -1,11 +1,11 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 1 1 anyfunc)) + (elem (get_global $tableBase) $gm) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32))) - (elem (get_global $tableBase) $gm) (export "func" (func $func)) (func $func (; 1 ;) (drop diff --git a/test/lld/duplicate_imports.wast.out b/test/lld/duplicate_imports.wast.out index e6e3a175b..ccdb0b631 100644 --- a/test/lld/duplicate_imports.wast.out +++ b/test/lld/duplicate_imports.wast.out @@ -9,6 +9,9 @@ (type $legaltype$puts2 (func (param i32 i32) (result i32))) (type $legaltype$invoke_ffd (func (param i32 f64 f64) (result f64))) (type $legaltype$invoke_ffd2 (func (param i32 f64 f64) (result f64))) + (memory $0 2) + (data (i32.const 568) "Hello, world\00") + (table 1 1 anyfunc) (import "env" "puts" (func $puts1 (param i32) (result i32))) (import "env" "puts" (func $legalimport$puts2 (param i32 i32) (result i32))) (import "env" "invoke_ffd" (func $legalimport$invoke_ffd (param i32 f64 f64) (result f64))) @@ -16,9 +19,6 @@ (global $global$0 (mut i32) (i32.const 66128)) (global $global$1 i32 (i32.const 66128)) (global $global$2 i32 (i32.const 581)) - (table 1 1 anyfunc) - (memory $0 2) - (data (i32.const 568) "Hello, world\00") (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/em_asm.wast.out b/test/lld/em_asm.wast.out index 487551ee6..a0ab74381 100644 --- a/test/lld/em_asm.wast.out +++ b/test/lld/em_asm.wast.out @@ -7,15 +7,15 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (memory $0 2) + (data (i32.const 568) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") + (table 1 1 anyfunc) (import "env" "emscripten_asm_const_i" (func $emscripten_asm_const_i (param i32) (result i32))) (import "env" "emscripten_asm_const_iii" (func $emscripten_asm_const_iii (param i32 i32 i32) (result i32))) (import "env" "emscripten_asm_const_ii" (func $emscripten_asm_const_ii (param i32 i32) (result i32))) (global $global$0 (mut i32) (i32.const 66192)) (global $global$1 i32 (i32.const 66192)) (global $global$2 i32 (i32.const 652)) - (table 1 1 anyfunc) - (memory $0 2) - (data (i32.const 568) "{ Module.print(\"Hello world\"); }\00{ return $0 + $1; }\00{ Module.print(\"Got \" + $0); }\00") (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/hello_world.wast.out b/test/lld/hello_world.wast.out index 86d75ff3a..6c67188f1 100644 --- a/test/lld/hello_world.wast.out +++ b/test/lld/hello_world.wast.out @@ -3,13 +3,13 @@ (type $1 (func (result i32))) (type $2 (func)) (type $FUNCSIG$ii (func (param i32) (result i32))) + (memory $0 2) + (data (i32.const 568) "Hello, world\00") + (table 1 1 anyfunc) (import "env" "puts" (func $puts (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 66128)) (global $global$1 i32 (i32.const 66128)) (global $global$2 i32 (i32.const 581)) - (table 1 1 anyfunc) - (memory $0 2) - (data (i32.const 568) "Hello, world\00") (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/init.wast.out b/test/lld/init.wast.out index b0c97195a..27c69a006 100644 --- a/test/lld/init.wast.out +++ b/test/lld/init.wast.out @@ -1,12 +1,12 @@ (module (type $0 (func)) (type $1 (func (result i32))) + (memory $0 2) + (data (i32.const 568) "\00\00\00\00\00\00\00\00") + (table 1 1 anyfunc) (global $global$0 (mut i32) (i32.const 66112)) (global $global$1 i32 (i32.const 66112)) (global $global$2 i32 (i32.const 576)) - (table 1 1 anyfunc) - (memory $0 2) - (data (i32.const 568) "\00\00\00\00\00\00\00\00") (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/recursive.wast.out b/test/lld/recursive.wast.out index 47527d058..b250072b0 100644 --- a/test/lld/recursive.wast.out +++ b/test/lld/recursive.wast.out @@ -3,13 +3,13 @@ (type $1 (func (result i32))) (type $2 (func)) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (memory $0 2) + (data (i32.const 568) "%d:%d\n\00Result: %d\n\00") + (table 1 1 anyfunc) (import "env" "printf" (func $printf (param i32 i32) (result i32))) (global $global$0 (mut i32) (i32.const 66128)) (global $global$1 i32 (i32.const 66128)) (global $global$2 i32 (i32.const 587)) - (table 1 1 anyfunc) - (memory $0 2) - (data (i32.const 568) "%d:%d\n\00Result: %d\n\00") (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/reserved_func_ptr.wast.jscall.out b/test/lld/reserved_func_ptr.wast.jscall.out index 44f2e888f..c261d2732 100644 --- a/test/lld/reserved_func_ptr.wast.jscall.out +++ b/test/lld/reserved_func_ptr.wast.jscall.out @@ -18,6 +18,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (memory $0 2) + (table 21 21 anyfunc) + (elem (i32.const 1) $_Z18address_taken_funciii $_Z19address_taken_func2iii $jsCall_ddi_0 $jsCall_ddi_1 $jsCall_ddi_2 $jsCall_fffi_0 $jsCall_fffi_1 $jsCall_fffi_2 $jsCall_iii_0 $jsCall_iii_1 $jsCall_iii_2 $jsCall_v_0 $jsCall_v_1 $jsCall_v_2 $jsCall_vi_0 $jsCall_vi_1 $jsCall_vi_2 $jsCall_viii_0 $jsCall_viii_1 $jsCall_viii_2) (import "env" "_Z4atoiPKc" (func $_Z4atoiPKc (param i32) (result i32))) (import "env" "jsCall_ddi" (func $jsCall_ddi (param i32 f64 i32) (result f64))) (import "env" "jsCall_fffi" (func $jsCall_fffi (param i32 f32 f32 i32) (result f32))) @@ -28,9 +31,6 @@ (global $global$0 (mut i32) (i32.const 66112)) (global $global$1 i32 (i32.const 66112)) (global $global$2 i32 (i32.const 568)) - (table 21 21 anyfunc) - (elem (i32.const 1) $_Z18address_taken_funciii $_Z19address_taken_func2iii $jsCall_ddi_0 $jsCall_ddi_1 $jsCall_ddi_2 $jsCall_fffi_0 $jsCall_fffi_1 $jsCall_fffi_2 $jsCall_iii_0 $jsCall_iii_1 $jsCall_iii_2 $jsCall_v_0 $jsCall_v_1 $jsCall_v_2 $jsCall_vi_0 $jsCall_vi_1 $jsCall_vi_2 $jsCall_viii_0 $jsCall_viii_1 $jsCall_viii_2) - (memory $0 2) (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/lld/reserved_func_ptr.wast.out b/test/lld/reserved_func_ptr.wast.out index c94b4fdd6..ca1704825 100644 --- a/test/lld/reserved_func_ptr.wast.out +++ b/test/lld/reserved_func_ptr.wast.out @@ -8,13 +8,13 @@ (type $6 (func (param i32) (result i32))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (memory $0 2) + (table 3 3 anyfunc) + (elem (i32.const 1) $_Z18address_taken_funciii $_Z19address_taken_func2iii) (import "env" "_Z4atoiPKc" (func $_Z4atoiPKc (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 66112)) (global $global$1 i32 (i32.const 66112)) (global $global$2 i32 (i32.const 568)) - (table 3 3 anyfunc) - (elem (i32.const 1) $_Z18address_taken_funciii $_Z19address_taken_func2iii) - (memory $0 2) (export "memory" (memory $0)) (export "__wasm_call_ctors" (func $__wasm_call_ctors)) (export "main" (func $main)) diff --git a/test/memorygrowth-minimal.fromasm b/test/memorygrowth-minimal.fromasm index 021d7fca2..64bf2cd4c 100644 --- a/test/memorygrowth-minimal.fromasm +++ b/test/memorygrowth-minimal.fromasm @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256)) (data (get_global $memoryBase) "memorygrowth-minimal.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "__growWasmMemory" (func $__growWasmMemory)) (func $__growWasmMemory (; 0 ;) (; has Stack IR ;) (param $0 i32) (result i32) (grow_memory diff --git a/test/memorygrowth-minimal.fromasm.clamp b/test/memorygrowth-minimal.fromasm.clamp index 021d7fca2..64bf2cd4c 100644 --- a/test/memorygrowth-minimal.fromasm.clamp +++ b/test/memorygrowth-minimal.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256)) (data (get_global $memoryBase) "memorygrowth-minimal.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "__growWasmMemory" (func $__growWasmMemory)) (func $__growWasmMemory (; 0 ;) (; has Stack IR ;) (param $0 i32) (result i32) (grow_memory diff --git a/test/memorygrowth-minimal.fromasm.clamp.no-opts b/test/memorygrowth-minimal.fromasm.clamp.no-opts index 74edd247b..1a2ac576c 100644 --- a/test/memorygrowth-minimal.fromasm.clamp.no-opts +++ b/test/memorygrowth-minimal.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/memorygrowth-minimal.fromasm.imprecise b/test/memorygrowth-minimal.fromasm.imprecise index 7a8ef1065..e41d1851a 100644 --- a/test/memorygrowth-minimal.fromasm.imprecise +++ b/test/memorygrowth-minimal.fromasm.imprecise @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (export "__growWasmMemory" (func $__growWasmMemory)) (func $__growWasmMemory (; 0 ;) (; has Stack IR ;) (param $0 i32) (result i32) (grow_memory diff --git a/test/memorygrowth-minimal.fromasm.imprecise.no-opts b/test/memorygrowth-minimal.fromasm.imprecise.no-opts index 74edd247b..1a2ac576c 100644 --- a/test/memorygrowth-minimal.fromasm.imprecise.no-opts +++ b/test/memorygrowth-minimal.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/memorygrowth-minimal.fromasm.no-opts b/test/memorygrowth-minimal.fromasm.no-opts index 74edd247b..1a2ac576c 100644 --- a/test/memorygrowth-minimal.fromasm.no-opts +++ b/test/memorygrowth-minimal.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm index 8c400ab68..96c2def4b 100644 --- a/test/memorygrowth.fromasm +++ b/test/memorygrowth.fromasm @@ -5,8 +5,10 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) + (data (get_global $memoryBase) "memorygrowth.asm.js") (import "env" "table" (table 8 8 anyfunc)) + (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $r$asm2wasm$import i32)) @@ -28,8 +30,6 @@ (global $v (mut i32) (i32.const 0)) (global $w (mut i32) (i32.const 0)) (global $K (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) - (data (get_global $memoryBase) "memorygrowth.asm.js") (export "__growWasmMemory" (func $__growWasmMemory)) (export "_free" (func $fb)) (export "_main" (func $Na)) diff --git a/test/memorygrowth.fromasm.clamp b/test/memorygrowth.fromasm.clamp index 8c400ab68..96c2def4b 100644 --- a/test/memorygrowth.fromasm.clamp +++ b/test/memorygrowth.fromasm.clamp @@ -5,8 +5,10 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) + (data (get_global $memoryBase) "memorygrowth.asm.js") (import "env" "table" (table 8 8 anyfunc)) + (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $r$asm2wasm$import i32)) @@ -28,8 +30,6 @@ (global $v (mut i32) (i32.const 0)) (global $w (mut i32) (i32.const 0)) (global $K (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) - (data (get_global $memoryBase) "memorygrowth.asm.js") (export "__growWasmMemory" (func $__growWasmMemory)) (export "_free" (func $fb)) (export "_main" (func $Na)) diff --git a/test/memorygrowth.fromasm.clamp.no-opts b/test/memorygrowth.fromasm.clamp.no-opts index 3c25e569e..991edc5d1 100644 --- a/test/memorygrowth.fromasm.clamp.no-opts +++ b/test/memorygrowth.fromasm.clamp.no-opts @@ -5,8 +5,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 8 8 anyfunc)) + (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $r$asm2wasm$import i32)) @@ -57,7 +58,6 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (export "__growWasmMemory" (func $__growWasmMemory)) (export "_free" (func $fb)) (export "_main" (func $Na)) diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise index 4f52c23de..f7c2a6987 100644 --- a/test/memorygrowth.fromasm.imprecise +++ b/test/memorygrowth.fromasm.imprecise @@ -5,8 +5,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 8 8 anyfunc)) + (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $r$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $s$asm2wasm$import i32)) @@ -27,7 +28,6 @@ (global $v (mut i32) (i32.const 0)) (global $w (mut i32) (i32.const 0)) (global $K (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (export "__growWasmMemory" (func $__growWasmMemory)) (export "_free" (func $fb)) (export "_main" (func $Na)) diff --git a/test/memorygrowth.fromasm.imprecise.no-opts b/test/memorygrowth.fromasm.imprecise.no-opts index 2c75f349f..59aaab6f1 100644 --- a/test/memorygrowth.fromasm.imprecise.no-opts +++ b/test/memorygrowth.fromasm.imprecise.no-opts @@ -5,8 +5,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 8 8 anyfunc)) + (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $r$asm2wasm$import i32)) @@ -57,7 +58,6 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (export "__growWasmMemory" (func $__growWasmMemory)) (export "_free" (func $fb)) (export "_main" (func $Na)) diff --git a/test/memorygrowth.fromasm.no-opts b/test/memorygrowth.fromasm.no-opts index 3c25e569e..991edc5d1 100644 --- a/test/memorygrowth.fromasm.no-opts +++ b/test/memorygrowth.fromasm.no-opts @@ -5,8 +5,9 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $memory 256)) (import "env" "table" (table 8 8 anyfunc)) + (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $r$asm2wasm$import i32)) @@ -57,7 +58,6 @@ (global $S (mut i32) (i32.const 0)) (global $T (mut i32) (i32.const 0)) (global $za (mut f64) (f64.const 0)) - (elem (get_global $tableBase) $nb $Oa $ob $Va $Ua $Ra $pb $Sa) (export "__growWasmMemory" (func $__growWasmMemory)) (export "_free" (func $fb)) (export "_main" (func $Na)) diff --git a/test/merge/basics.wast b/test/merge/basics.wast index 920c1e977..06063e64c 100644 --- a/test/merge/basics.wast +++ b/test/merge/basics.wast @@ -18,8 +18,8 @@ (func $only-a (drop (i32.const 100)) (call $only-a) - (call_import $some-func) - (call_import $some-collide) + (call $some-func) + (call $some-collide) (call_indirect (type $ii) (i32.const 123) (i32.const 456) diff --git a/test/merge/basics.wast.combined b/test/merge/basics.wast.combined index a0d1ea7db..11ba04715 100644 --- a/test/merge/basics.wast.combined +++ b/test/merge/basics.wast.combined @@ -3,14 +3,16 @@ (type $FUNCSIG$v (func)) (type $ii$0 (func (param i32 i32))) (type $FUNCSIG$v$0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n\00\00\00\00\00\00") (import "env" "table" (table 10 anyfunc)) - (import "env" "some-func" (func $some-func)) - (import "env" "some-collide" (func $some-collide)) + (elem (get_global $tableBase) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) + (import "env" "some-func" (func $some-func)) + (import "env" "some-collide" (func $some-collide)) (import "env" "some-func-b" (func $some-func-b)) (import "env" "some-collide" (func $some-collide$0)) (global $global-collide i32 (i32.const 0)) @@ -21,8 +23,6 @@ (global $global-collide-mut$0 (mut i32) (i32.const 0)) (global $global-b i32 (i32.const 1)) (global $global-b-mut (mut i32) (i32.const 1)) - (elem (get_global $tableBase) $only-a $willCollide $some-func $some-collide $only-a $only-a $only-b $willCollide$0 $some-func-b $some-collide$0) - (data (get_global $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n\00\00\00\00\00\00") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/basics.wast.combined.finalized b/test/merge/basics.wast.combined.finalized index f68e8c808..899df6d61 100644 --- a/test/merge/basics.wast.combined.finalized +++ b/test/merge/basics.wast.combined.finalized @@ -3,14 +3,16 @@ (type $FUNCSIG$v (func)) (type $ii$0 (func (param i32 i32))) (type $FUNCSIG$v$0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "hello, A!\n\00\00\00\00\00\00hello, B!\n\00\00\00\00\00\00") (import "env" "table" (table 18 anyfunc)) - (import "env" "some-func" (func $some-func)) - (import "env" "some-collide" (func $some-collide)) + (elem (i32.const 8) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) + (import "env" "some-func" (func $some-func)) + (import "env" "some-collide" (func $some-collide)) (import "env" "some-func-b" (func $some-func-b)) (import "env" "some-collide" (func $some-collide$0)) (global $global-collide i32 (i32.const 0)) @@ -21,8 +23,6 @@ (global $global-collide-mut$0 (mut i32) (i32.const 0)) (global $global-b i32 (i32.const 1)) (global $global-b-mut (mut i32) (i32.const 1)) - (elem (i32.const 8) $only-a $willCollide $some-func $some-collide $only-a $only-a $only-b $willCollide$0 $some-func-b $some-collide$0) - (data (i32.const 1024) "hello, A!\n\00\00\00\00\00\00hello, B!\n\00\00\00\00\00\00") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/basics.wast.combined.finalized.opt b/test/merge/basics.wast.combined.finalized.opt index a117042bb..7f11954ae 100644 --- a/test/merge/basics.wast.combined.finalized.opt +++ b/test/merge/basics.wast.combined.finalized.opt @@ -2,7 +2,9 @@ (type $ii (func (param i32 i32))) (type $FUNCSIG$v (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "hello, A!\n\00\00\00\00\00\00hello, B!\n") (import "env" "table" (table 18 anyfunc)) + (elem (i32.const 8) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0) (import "env" "some-func" (func $some-func)) (import "env" "some-collide" (func $some-collide)) (import "env" "some-func-b" (func $some-func-b)) @@ -11,8 +13,6 @@ (global $global-a-mut (mut i32) (i32.const 1)) (global $global-collide-mut$0 (mut i32) (i32.const 0)) (global $global-b-mut (mut i32) (i32.const 1)) - (elem (i32.const 8) $only-a $willCollide $some-func $some-collide $only-a $only-a $only-b $willCollide$0 $some-func-b $some-collide$0) - (data (i32.const 1024) "hello, A!\n\00\00\00\00\00\00hello, B!\n") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/basics.wast.combined.finalized.opt.stdout b/test/merge/basics.wast.combined.finalized.opt.stdout index 18fbdb05e..9795060ae 100644 --- a/test/merge/basics.wast.combined.finalized.opt.stdout +++ b/test/merge/basics.wast.combined.finalized.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 32 merged total table size: 10 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/basics.wast.combined.finalized.stdout b/test/merge/basics.wast.combined.finalized.stdout index 18fbdb05e..9795060ae 100644 --- a/test/merge/basics.wast.combined.finalized.stdout +++ b/test/merge/basics.wast.combined.finalized.stdout @@ -1,3 +1,3 @@ merged total memory size: 32 merged total table size: 10 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/basics.wast.combined.opt b/test/merge/basics.wast.combined.opt index d940ad38e..b533d4d2f 100644 --- a/test/merge/basics.wast.combined.opt +++ b/test/merge/basics.wast.combined.opt @@ -1,22 +1,22 @@ (module (type $ii (func (param i32 i32))) (type $FUNCSIG$v (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n") (import "env" "table" (table 10 anyfunc)) - (import "env" "some-func" (func $some-func)) - (import "env" "some-collide" (func $some-collide)) + (elem (get_global $tableBase) $only-a $willCollide $some-func $some-collide $only-a $some-func $only-b $willCollide$0 $some-func-b $some-collide$0) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) + (import "env" "some-func" (func $some-func)) + (import "env" "some-collide" (func $some-collide)) (import "env" "some-func-b" (func $some-func-b)) (import "env" "some-collide" (func $some-collide$0)) (global $global-collide-mut (mut i32) (i32.const 0)) (global $global-a-mut (mut i32) (i32.const 1)) (global $global-collide-mut$0 (mut i32) (i32.const 0)) (global $global-b-mut (mut i32) (i32.const 1)) - (elem (get_global $tableBase) $only-a $willCollide $some-func $some-collide $only-a $only-a $only-b $willCollide$0 $some-func-b $some-collide$0) - (data (get_global $memoryBase) "hello, A!\n\00\00\00\00\00\00hello, B!\n") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/basics.wast.combined.opt.stdout b/test/merge/basics.wast.combined.opt.stdout index 18fbdb05e..9795060ae 100644 --- a/test/merge/basics.wast.combined.opt.stdout +++ b/test/merge/basics.wast.combined.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 32 merged total table size: 10 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/basics.wast.combined.stdout b/test/merge/basics.wast.combined.stdout index 18fbdb05e..9795060ae 100644 --- a/test/merge/basics.wast.combined.stdout +++ b/test/merge/basics.wast.combined.stdout @@ -1,3 +1,3 @@ merged total memory size: 32 merged total table size: 10 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/basics.wast.toMerge b/test/merge/basics.wast.toMerge index 97d4a73a3..352aae888 100644 --- a/test/merge/basics.wast.toMerge +++ b/test/merge/basics.wast.toMerge @@ -20,7 +20,7 @@ (drop (i32.const 111)) (call $only-b) (call $some-func-b) - (call_import $some-collide) + (call $some-collide) (call_indirect (type $ii) (i32.const 12) (i32.const 34) diff --git a/test/merge/dylib.wasm.combined b/test/merge/dylib.wasm.combined index 1b2dbf7cc..32c886d34 100644 --- a/test/merge/dylib.wasm.combined +++ b/test/merge/dylib.wasm.combined @@ -6,19 +6,19 @@ (type $0$0 (func (param i32 i32))) (type $1$0 (func (result i32))) (type $2$0 (func)) - (import "env" "memoryBase" (global $gimport$0 i32)) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $2 256)) + (data (get_global $gimport$0) "hello, world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $gimport$0 i32)) (import "env" "tableBase" (global $gimport$4 i32)) - (import "env" "_puts" (func $import$1 (param i32) (result i32))) (import "env" "memoryBase" (global $gimport$0$0 i32)) (import "env" "tableBase" (global $gimport$4$0 i32)) + (import "env" "_puts" (func $import$1 (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 0)) (global $global$1 (mut i32) (i32.const 0)) (global $global$2 i32 (i32.const 0)) (global $global$0$0 (mut i32) (i32.const 0)) (global $global$1$0 (mut i32) (i32.const 0)) - (data (get_global $gimport$0) "hello, world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (export "__post_instantiate" (func $__post_instantiate)) (export "_main" (func $_main)) (export "runPostSets" (func $runPostSets)) diff --git a/test/merge/dylib.wasm.combined.finalized b/test/merge/dylib.wasm.combined.finalized index 2015bb7f0..e52c5b849 100644 --- a/test/merge/dylib.wasm.combined.finalized +++ b/test/merge/dylib.wasm.combined.finalized @@ -6,19 +6,19 @@ (type $0$0 (func (param i32 i32))) (type $1$0 (func (result i32))) (type $2$0 (func)) - (import "env" "memoryBase" (global $gimport$0 i32)) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $2 256)) + (data (i32.const 1024) "hello, world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (import "env" "table" (table 8 anyfunc)) + (import "env" "memoryBase" (global $gimport$0 i32)) (import "env" "tableBase" (global $gimport$4 i32)) - (import "env" "_puts" (func $import$1 (param i32) (result i32))) (import "env" "memoryBase" (global $gimport$0$0 i32)) (import "env" "tableBase" (global $gimport$4$0 i32)) + (import "env" "_puts" (func $import$1 (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 0)) (global $global$1 (mut i32) (i32.const 0)) (global $global$2 i32 (i32.const 0)) (global $global$0$0 (mut i32) (i32.const 0)) (global $global$1$0 (mut i32) (i32.const 0)) - (data (i32.const 1024) "hello, world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (export "__post_instantiate" (func $__post_instantiate)) (export "_main" (func $_main)) (export "runPostSets" (func $runPostSets)) diff --git a/test/merge/dylib.wasm.combined.finalized.opt b/test/merge/dylib.wasm.combined.finalized.opt index 57d60021f..bac5abbc6 100644 --- a/test/merge/dylib.wasm.combined.finalized.opt +++ b/test/merge/dylib.wasm.combined.finalized.opt @@ -2,7 +2,8 @@ (type $1 (func (param i32) (result i32))) (type $2 (func (result i32))) (type $3 (func)) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $2 256)) + (data (i32.const 1024) "hello, world!") (import "env" "table" (table 8 anyfunc)) (import "env" "_puts" (func $import$1 (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 0)) @@ -10,7 +11,6 @@ (global $global$2 i32 (i32.const 0)) (global $global$0$0 (mut i32) (i32.const 0)) (global $global$1$0 (mut i32) (i32.const 0)) - (data (i32.const 1024) "hello, world!") (export "__post_instantiate" (func $__post_instantiate)) (export "_main" (func $_main)) (export "runPostSets" (func $runPostSets)) diff --git a/test/merge/dylib.wasm.combined.finalized.opt.stdout b/test/merge/dylib.wasm.combined.finalized.opt.stdout index fb480861a..ce210156f 100644 --- a/test/merge/dylib.wasm.combined.finalized.opt.stdout +++ b/test/merge/dylib.wasm.combined.finalized.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 64 merged total table size: 0 -merged functions: 6 +merged functions: 7 diff --git a/test/merge/dylib.wasm.combined.finalized.stdout b/test/merge/dylib.wasm.combined.finalized.stdout index fb480861a..ce210156f 100644 --- a/test/merge/dylib.wasm.combined.finalized.stdout +++ b/test/merge/dylib.wasm.combined.finalized.stdout @@ -1,3 +1,3 @@ merged total memory size: 64 merged total table size: 0 -merged functions: 6 +merged functions: 7 diff --git a/test/merge/dylib.wasm.combined.opt b/test/merge/dylib.wasm.combined.opt index 8d1ddfbb4..2aa6075be 100644 --- a/test/merge/dylib.wasm.combined.opt +++ b/test/merge/dylib.wasm.combined.opt @@ -2,18 +2,18 @@ (type $1 (func (param i32) (result i32))) (type $2 (func (result i32))) (type $3 (func)) - (import "env" "memoryBase" (global $gimport$0 i32)) - (import "env" "memory" (memory $0 256)) + (import "env" "memory" (memory $2 256)) + (data (get_global $gimport$0) "hello, world!") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $gimport$0 i32)) (import "env" "tableBase" (global $gimport$4 i32)) - (import "env" "_puts" (func $import$1 (param i32) (result i32))) (import "env" "memoryBase" (global $gimport$0$0 i32)) + (import "env" "_puts" (func $import$1 (param i32) (result i32))) (global $global$0 (mut i32) (i32.const 0)) (global $global$1 (mut i32) (i32.const 0)) (global $global$2 i32 (i32.const 0)) (global $global$0$0 (mut i32) (i32.const 0)) (global $global$1$0 (mut i32) (i32.const 0)) - (data (get_global $gimport$0) "hello, world!") (export "__post_instantiate" (func $__post_instantiate)) (export "_main" (func $_main)) (export "runPostSets" (func $runPostSets)) diff --git a/test/merge/dylib.wasm.combined.opt.stdout b/test/merge/dylib.wasm.combined.opt.stdout index fb480861a..ce210156f 100644 --- a/test/merge/dylib.wasm.combined.opt.stdout +++ b/test/merge/dylib.wasm.combined.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 64 merged total table size: 0 -merged functions: 6 +merged functions: 7 diff --git a/test/merge/dylib.wasm.combined.stdout b/test/merge/dylib.wasm.combined.stdout index fb480861a..ce210156f 100644 --- a/test/merge/dylib.wasm.combined.stdout +++ b/test/merge/dylib.wasm.combined.stdout @@ -1,3 +1,3 @@ merged total memory size: 64 merged total table size: 0 -merged functions: 6 +merged functions: 7 diff --git a/test/merge/fusing.wast b/test/merge/fusing.wast index 588647e35..0c537936f 100644 --- a/test/merge/fusing.wast +++ b/test/merge/fusing.wast @@ -10,7 +10,7 @@ (import "env" "bglobal" (global $b-global f64)) (func $foo-func (drop (i32.const 1337)) - (call_import $bar-func) + (call $bar-func) (drop (get_global $a-global)) (drop (get_global $b-global)) ) diff --git a/test/merge/fusing.wast.combined b/test/merge/fusing.wast.combined index d3d0bbed3..9510bb02e 100644 --- a/test/merge/fusing.wast.combined +++ b/test/merge/fusing.wast.combined @@ -1,35 +1,35 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$v$0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) (global $a-global i32 (i32.const 0)) - (global $b-global f64 (f64.const 2.14281428)) - (data (get_global $memoryBase) "") + (global $b-global$0 f64 (f64.const 2.14281428)) (export "foo" (func $foo-func)) (export "aglobal" (global $a-global)) - (export "bar" (func $bar-func)) - (export "bglobal" (global $b-global)) + (export "bar" (func $bar-func$0)) + (export "bglobal" (global $b-global$0)) (func $foo-func (; 0 ;) (type $FUNCSIG$v) (drop (i32.const 1337) ) - (call $bar-func) + (call $bar-func$0) (drop (get_global $a-global) ) (drop - (get_global $b-global) + (get_global $b-global$0) ) ) (func $b (; 1 ;) (type $FUNCSIG$v$0) (call $foo-func) ) - (func $bar-func (; 2 ;) (type $FUNCSIG$v$0) + (func $bar-func$0 (; 2 ;) (type $FUNCSIG$v$0) (drop (f64.const 3.14159) ) @@ -37,7 +37,7 @@ (get_global $a-global) ) (drop - (get_global $b-global) + (get_global $b-global$0) ) ) ) diff --git a/test/merge/fusing.wast.combined.finalized b/test/merge/fusing.wast.combined.finalized index 0473302d3..658fdd716 100644 --- a/test/merge/fusing.wast.combined.finalized +++ b/test/merge/fusing.wast.combined.finalized @@ -1,35 +1,35 @@ (module (type $FUNCSIG$v (func)) (type $FUNCSIG$v$0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "") (import "env" "table" (table 8 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) (global $a-global i32 (i32.const 0)) - (global $b-global f64 (f64.const 2.14281428)) - (data (i32.const 1024) "") + (global $b-global$0 f64 (f64.const 2.14281428)) (export "foo" (func $foo-func)) (export "aglobal" (global $a-global)) - (export "bar" (func $bar-func)) - (export "bglobal" (global $b-global)) + (export "bar" (func $bar-func$0)) + (export "bglobal" (global $b-global$0)) (func $foo-func (; 0 ;) (type $FUNCSIG$v) (drop (i32.const 1337) ) - (call $bar-func) + (call $bar-func$0) (drop (get_global $a-global) ) (drop - (get_global $b-global) + (get_global $b-global$0) ) ) (func $b (; 1 ;) (type $FUNCSIG$v$0) (call $foo-func) ) - (func $bar-func (; 2 ;) (type $FUNCSIG$v$0) + (func $bar-func$0 (; 2 ;) (type $FUNCSIG$v$0) (drop (f64.const 3.14159) ) @@ -37,7 +37,7 @@ (get_global $a-global) ) (drop - (get_global $b-global) + (get_global $b-global$0) ) ) ) diff --git a/test/merge/fusing.wast.combined.finalized.opt b/test/merge/fusing.wast.combined.finalized.opt index 9a07b683c..4d96b29fe 100644 --- a/test/merge/fusing.wast.combined.finalized.opt +++ b/test/merge/fusing.wast.combined.finalized.opt @@ -3,18 +3,18 @@ (import "env" "memory" (memory $0 256)) (import "env" "table" (table 8 anyfunc)) (global $a-global i32 (i32.const 0)) - (global $b-global f64 (f64.const 2.14281428)) + (global $b-global$0 f64 (f64.const 2.14281428)) (export "foo" (func $foo-func)) (export "aglobal" (global $a-global)) - (export "bar" (func $bar-func)) - (export "bglobal" (global $b-global)) + (export "bar" (func $bar-func$0)) + (export "bglobal" (global $b-global$0)) (func $foo-func (; 0 ;) (type $FUNCSIG$v) (nop) - (call $bar-func) + (call $bar-func$0) (nop) (nop) ) - (func $bar-func (; 1 ;) (type $FUNCSIG$v) + (func $bar-func$0 (; 1 ;) (type $FUNCSIG$v) (nop) ) ) diff --git a/test/merge/fusing.wast.combined.opt b/test/merge/fusing.wast.combined.opt index c27ab0228..903fd65e0 100644 --- a/test/merge/fusing.wast.combined.opt +++ b/test/merge/fusing.wast.combined.opt @@ -1,23 +1,23 @@ (module (type $FUNCSIG$v (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (global $a-global i32 (i32.const 0)) - (global $b-global f64 (f64.const 2.14281428)) - (data (get_global $memoryBase) "") + (global $b-global$0 f64 (f64.const 2.14281428)) (export "foo" (func $foo-func)) (export "aglobal" (global $a-global)) - (export "bar" (func $bar-func)) - (export "bglobal" (global $b-global)) + (export "bar" (func $bar-func$0)) + (export "bglobal" (global $b-global$0)) (func $foo-func (; 0 ;) (type $FUNCSIG$v) (nop) - (call $bar-func) + (call $bar-func$0) (nop) (nop) ) - (func $bar-func (; 1 ;) (type $FUNCSIG$v) + (func $bar-func$0 (; 1 ;) (type $FUNCSIG$v) (nop) ) ) diff --git a/test/merge/global-init.wast.combined b/test/merge/global-init.wast.combined index 095d6056b..b45babeef 100644 --- a/test/merge/global-init.wast.combined +++ b/test/merge/global-init.wast.combined @@ -1,8 +1,9 @@ (module - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "globally" (global $i-collide i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) @@ -15,5 +16,4 @@ (global $b-mut (mut f64) (get_global $i-collide$0)) (global $g-collide$0 f64 (get_global $i-collide$0)) (global $g-collide-mut$0 (mut f64) (get_global $i-collide$0)) - (data (get_global $memoryBase) "") ) diff --git a/test/merge/global-init.wast.combined.finalized b/test/merge/global-init.wast.combined.finalized index 832e86457..87e21a05e 100644 --- a/test/merge/global-init.wast.combined.finalized +++ b/test/merge/global-init.wast.combined.finalized @@ -1,8 +1,9 @@ (module - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "") (import "env" "table" (table 8 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "globally" (global $i-collide i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) @@ -15,5 +16,4 @@ (global $b-mut (mut f64) (get_global $i-collide$0)) (global $g-collide$0 f64 (get_global $i-collide$0)) (global $g-collide-mut$0 (mut f64) (get_global $i-collide$0)) - (data (i32.const 1024) "") ) diff --git a/test/merge/global-init.wast.combined.opt b/test/merge/global-init.wast.combined.opt index 604f3ede8..3f91f9bc9 100644 --- a/test/merge/global-init.wast.combined.opt +++ b/test/merge/global-init.wast.combined.opt @@ -1,7 +1,7 @@ (module - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) - (import "env" "table" (table 0 anyfunc)) (data (get_global $memoryBase) "") + (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) ) diff --git a/test/merge/main-lacks-segments.wast.combined b/test/merge/main-lacks-segments.wast.combined index 91fcde27d..0bd5d2d4f 100644 --- a/test/merge/main-lacks-segments.wast.combined +++ b/test/merge/main-lacks-segments.wast.combined @@ -1,13 +1,13 @@ (module (type $0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "hello, this is some data!\00\00\00\00\00\00\00") (import "env" "table" (table 2 anyfunc)) + (elem (get_global $tableBase) $foo $foo) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) - (elem (get_global $tableBase) $foo $foo) - (data (get_global $memoryBase) "hello, this is some data!\00\00\00\00\00\00\00") (func $foo (; 0 ;) (type $0) (drop (i32.add diff --git a/test/merge/main-lacks-segments.wast.combined.finalized b/test/merge/main-lacks-segments.wast.combined.finalized index dd180662d..65bc5f1ad 100644 --- a/test/merge/main-lacks-segments.wast.combined.finalized +++ b/test/merge/main-lacks-segments.wast.combined.finalized @@ -1,13 +1,13 @@ (module (type $0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "hello, this is some data!\00\00\00\00\00\00\00") (import "env" "table" (table 10 anyfunc)) + (elem (i32.const 8) $foo $foo) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) - (elem (i32.const 8) $foo $foo) - (data (i32.const 1024) "hello, this is some data!\00\00\00\00\00\00\00") (func $foo (; 0 ;) (type $0) (drop (i32.add diff --git a/test/merge/main-lacks-segments.wast.combined.finalized.opt b/test/merge/main-lacks-segments.wast.combined.finalized.opt index d37e26438..e3ceb0ce1 100644 --- a/test/merge/main-lacks-segments.wast.combined.finalized.opt +++ b/test/merge/main-lacks-segments.wast.combined.finalized.opt @@ -1,9 +1,9 @@ (module (type $0 (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "hello, this is some data!") (import "env" "table" (table 10 anyfunc)) (elem (i32.const 8) $foo $foo) - (data (i32.const 1024) "hello, this is some data!") (func $foo (; 0 ;) (type $0) (nop) ) diff --git a/test/merge/main-lacks-segments.wast.combined.opt b/test/merge/main-lacks-segments.wast.combined.opt index 6fb489574..fe652d9cd 100644 --- a/test/merge/main-lacks-segments.wast.combined.opt +++ b/test/merge/main-lacks-segments.wast.combined.opt @@ -1,13 +1,13 @@ (module (type $0 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "hello, this is some data!") (import "env" "table" (table 2 anyfunc)) + (elem (get_global $tableBase) $foo $foo) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) - (elem (get_global $tableBase) $foo $foo) - (data (get_global $memoryBase) "hello, this is some data!") (func $foo (; 0 ;) (type $0) (drop (get_global $tableBase$0) diff --git a/test/merge/noBases.wast b/test/merge/noBases.wast index 8616c64e7..e6a8d1f14 100644 --- a/test/merge/noBases.wast +++ b/test/merge/noBases.wast @@ -15,8 +15,8 @@ (func $only-a (drop (i32.const 100)) (call $only-a) - (call_import $some-func) - (call_import $some-collide) + (call $some-func) + (call $some-collide) (call_indirect (type $ii) (i32.const 123) (i32.const 456) diff --git a/test/merge/noBases.wast.combined b/test/merge/noBases.wast.combined index c25a5ca19..a7753043a 100644 --- a/test/merge/noBases.wast.combined +++ b/test/merge/noBases.wast.combined @@ -4,26 +4,26 @@ (type $ii$0 (func (param i32 i32))) (type $FUNCSIG$v$0 (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 100) "hello, A!\n") + (data (get_global $memoryBase) "") + (data (i32.const 200) "hello, B!\n") (import "env" "table" (table 1000 anyfunc)) - (import "env" "some-func" (func $some-func)) - (import "env" "some-collide" (func $some-collide)) + (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) + (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (import "env" "some-func-b" (func $some-func-b)) - (import "env" "some-collide" (func $some-collide$0)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) + (import "env" "some-func" (func $some-func)) + (import "env" "some-collide" (func $some-collide)) + (import "env" "some-func-b" (func $some-func-b)) + (import "env" "some-collide" (func $some-collide$0)) (global $global-collide i32 (i32.const 0)) (global $global-collide-mut (mut i32) (i32.const 0)) (global $global-a i32 (i32.const 1)) (global $global-collide$0 i32 (i32.const 0)) (global $global-collide-mut$0 (mut i32) (i32.const 0)) (global $global-b i32 (i32.const 1)) - (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) - (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) - (data (i32.const 100) "hello, A!\n") - (data (get_global $memoryBase) "") - (data (i32.const 200) "hello, B!\n") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/noBases.wast.combined.finalized b/test/merge/noBases.wast.combined.finalized index b9f066f44..b31aa6909 100644 --- a/test/merge/noBases.wast.combined.finalized +++ b/test/merge/noBases.wast.combined.finalized @@ -4,26 +4,26 @@ (type $ii$0 (func (param i32 i32))) (type $FUNCSIG$v$0 (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 100) "hello, A!\n") + (data (i32.const 1024) "") + (data (i32.const 200) "hello, B!\n") (import "env" "table" (table 1000 anyfunc)) - (import "env" "some-func" (func $some-func)) - (import "env" "some-collide" (func $some-collide)) + (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) + (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (import "env" "some-func-b" (func $some-func-b)) - (import "env" "some-collide" (func $some-collide$0)) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) + (import "env" "some-func" (func $some-func)) + (import "env" "some-collide" (func $some-collide)) + (import "env" "some-func-b" (func $some-func-b)) + (import "env" "some-collide" (func $some-collide$0)) (global $global-collide i32 (i32.const 0)) (global $global-collide-mut (mut i32) (i32.const 0)) (global $global-a i32 (i32.const 1)) (global $global-collide$0 i32 (i32.const 0)) (global $global-collide-mut$0 (mut i32) (i32.const 0)) (global $global-b i32 (i32.const 1)) - (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) - (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) - (data (i32.const 100) "hello, A!\n") - (data (i32.const 1024) "") - (data (i32.const 200) "hello, B!\n") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/noBases.wast.combined.finalized.opt b/test/merge/noBases.wast.combined.finalized.opt index 8f8433211..935a8f326 100644 --- a/test/merge/noBases.wast.combined.finalized.opt +++ b/test/merge/noBases.wast.combined.finalized.opt @@ -2,17 +2,17 @@ (type $ii (func (param i32 i32))) (type $FUNCSIG$v (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 100) "hello, A!\n") + (data (i32.const 200) "hello, B!\n") (import "env" "table" (table 1000 anyfunc)) + (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) + (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) (import "env" "some-func" (func $some-func)) (import "env" "some-collide" (func $some-collide)) (import "env" "some-func-b" (func $some-func-b)) (import "env" "some-collide" (func $some-collide$0)) (global $global-collide-mut (mut i32) (i32.const 0)) (global $global-collide-mut$0 (mut i32) (i32.const 0)) - (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) - (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) - (data (i32.const 100) "hello, A!\n") - (data (i32.const 200) "hello, B!\n") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/noBases.wast.combined.finalized.opt.stdout b/test/merge/noBases.wast.combined.finalized.opt.stdout index 793188b23..9227c4942 100644 --- a/test/merge/noBases.wast.combined.finalized.opt.stdout +++ b/test/merge/noBases.wast.combined.finalized.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 10 merged total table size: 5 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/noBases.wast.combined.finalized.stdout b/test/merge/noBases.wast.combined.finalized.stdout index 793188b23..9227c4942 100644 --- a/test/merge/noBases.wast.combined.finalized.stdout +++ b/test/merge/noBases.wast.combined.finalized.stdout @@ -1,3 +1,3 @@ merged total memory size: 10 merged total table size: 5 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/noBases.wast.combined.opt b/test/merge/noBases.wast.combined.opt index 921cf5f9b..106ba475e 100644 --- a/test/merge/noBases.wast.combined.opt +++ b/test/merge/noBases.wast.combined.opt @@ -2,20 +2,20 @@ (type $ii (func (param i32 i32))) (type $FUNCSIG$v (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 100) "hello, A!\n") + (data (get_global $memoryBase) "") + (data (i32.const 200) "hello, B!\n") (import "env" "table" (table 1000 anyfunc)) - (import "env" "some-func" (func $some-func)) - (import "env" "some-collide" (func $some-collide)) + (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) + (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) + (import "env" "some-func" (func $some-func)) + (import "env" "some-collide" (func $some-collide)) (import "env" "some-func-b" (func $some-func-b)) (import "env" "some-collide" (func $some-collide$0)) (global $global-collide-mut (mut i32) (i32.const 0)) (global $global-collide-mut$0 (mut i32) (i32.const 0)) - (elem (i32.const 10) $only-a $willCollide $some-func $some-collide $only-a) - (elem (i32.const 20) $only-b $willCollide $some-func-b $some-collide) - (data (i32.const 100) "hello, A!\n") - (data (get_global $memoryBase) "") - (data (i32.const 200) "hello, B!\n") (export "exp-a" (func $only-a)) (export "exp-collide" (func $only-a)) (export "exp-collide2" (func $willCollide)) diff --git a/test/merge/noBases.wast.combined.opt.stdout b/test/merge/noBases.wast.combined.opt.stdout index 793188b23..9227c4942 100644 --- a/test/merge/noBases.wast.combined.opt.stdout +++ b/test/merge/noBases.wast.combined.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 10 merged total table size: 5 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/noBases.wast.combined.stdout b/test/merge/noBases.wast.combined.stdout index 793188b23..9227c4942 100644 --- a/test/merge/noBases.wast.combined.stdout +++ b/test/merge/noBases.wast.combined.stdout @@ -1,3 +1,3 @@ merged total memory size: 10 merged total table size: 5 -merged functions: 4 +merged functions: 8 diff --git a/test/merge/noBases.wast.toMerge b/test/merge/noBases.wast.toMerge index 313b5fb73..59f96c043 100644 --- a/test/merge/noBases.wast.toMerge +++ b/test/merge/noBases.wast.toMerge @@ -17,7 +17,7 @@ (drop (i32.const 111)) (call $only-b) (call $some-func-b) - (call_import $some-collide) + (call $some-collide) (call_indirect (type $ii) (i32.const 12) (i32.const 34) diff --git a/test/merge/printf.wast.combined b/test/merge/printf.wast.combined index dfaa49d8a..5183cd442 100644 --- a/test/merge/printf.wast.combined +++ b/test/merge/printf.wast.combined @@ -2,16 +2,16 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iii$0 (func (param i32 i32) (result i32))) (type $1 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "") (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "globally" (global $i-collide i32)) - (import "env" "foobar" (func $import$8 (param i32 i32) (result i32))) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) (import "env" "globally" (global $i-collide$0 f64)) - (data (get_global $memoryBase) "") + (import "env" "foobar" (func $import$8 (param i32 i32) (result i32))) (export "_printf" (func $625)) (func $625 (; 1 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.const 102030) diff --git a/test/merge/printf.wast.combined.finalized b/test/merge/printf.wast.combined.finalized index 364da8b95..99751c51c 100644 --- a/test/merge/printf.wast.combined.finalized +++ b/test/merge/printf.wast.combined.finalized @@ -2,16 +2,16 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iii$0 (func (param i32 i32) (result i32))) (type $1 (func)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1024) "") (import "env" "table" (table 8 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "globally" (global $i-collide i32)) - (import "env" "foobar" (func $import$8 (param i32 i32) (result i32))) (import "env" "memoryBase" (global $memoryBase$0 i32)) (import "env" "tableBase" (global $tableBase$0 i32)) (import "env" "globally" (global $i-collide$0 f64)) - (data (i32.const 1024) "") + (import "env" "foobar" (func $import$8 (param i32 i32) (result i32))) (export "_printf" (func $625)) (func $625 (; 1 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.const 102030) diff --git a/test/merge/printf.wast.combined.finalized.opt.stdout b/test/merge/printf.wast.combined.finalized.opt.stdout index 3816869a7..80b514d22 100644 --- a/test/merge/printf.wast.combined.finalized.opt.stdout +++ b/test/merge/printf.wast.combined.finalized.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 0 merged total table size: 0 -merged functions: 2 +merged functions: 3 diff --git a/test/merge/printf.wast.combined.finalized.stdout b/test/merge/printf.wast.combined.finalized.stdout index 3816869a7..80b514d22 100644 --- a/test/merge/printf.wast.combined.finalized.stdout +++ b/test/merge/printf.wast.combined.finalized.stdout @@ -1,3 +1,3 @@ merged total memory size: 0 merged total table size: 0 -merged functions: 2 +merged functions: 3 diff --git a/test/merge/printf.wast.combined.opt b/test/merge/printf.wast.combined.opt index a6ebd316e..da8b8fd29 100644 --- a/test/merge/printf.wast.combined.opt +++ b/test/merge/printf.wast.combined.opt @@ -1,10 +1,10 @@ (module (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (import "env" "memory" (memory $0 256)) - (import "env" "table" (table 0 anyfunc)) (data (get_global $memoryBase) "") + (import "env" "table" (table 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (export "_printf" (func $625)) (func $625 (; 0 ;) (type $FUNCSIG$iii) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.const 102030) diff --git a/test/merge/printf.wast.combined.opt.stdout b/test/merge/printf.wast.combined.opt.stdout index 3816869a7..80b514d22 100644 --- a/test/merge/printf.wast.combined.opt.stdout +++ b/test/merge/printf.wast.combined.opt.stdout @@ -1,3 +1,3 @@ merged total memory size: 0 merged total table size: 0 -merged functions: 2 +merged functions: 3 diff --git a/test/merge/printf.wast.combined.stdout b/test/merge/printf.wast.combined.stdout index 3816869a7..80b514d22 100644 --- a/test/merge/printf.wast.combined.stdout +++ b/test/merge/printf.wast.combined.stdout @@ -1,3 +1,3 @@ merged total memory size: 0 merged total table size: 0 -merged functions: 2 +merged functions: 3 diff --git a/test/metadce/corners.wast.dced b/test/metadce/corners.wast.dced index 772b38653..5c3f4f7c2 100644 --- a/test/metadce/corners.wast.dced +++ b/test/metadce/corners.wast.dced @@ -1,11 +1,11 @@ (module (type $FUNCSIG$v (func)) + (import "env" "table" (table 10 10 anyfunc)) + (elem (i32.const 0) $imported_table_func) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "imported_twice" (func $imported_twice_a)) (import "env" "an-imported-table-func" (func $imported_table_func)) - (import "env" "table" (table 10 10 anyfunc)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) - (elem (i32.const 0) $imported_table_func) (export "stackAlloc" (func $stackAlloc)) (func $stackAlloc (; 2 ;) (type $FUNCSIG$v) (drop diff --git a/test/metadce/no-outside.wast b/test/metadce/no-outside.wast index 038a693de..77a496f5f 100644 --- a/test/metadce/no-outside.wast +++ b/test/metadce/no-outside.wast @@ -4,7 +4,7 @@ (export "wasm_func" (func $a_wasm_func)) (export "wasm_func_unused" (func $an_unused_wasm_func)) (func $a_wasm_func - (call_import $a_js_func) + (call $a_js_func) ) (func $an_unused_wasm_func ) diff --git a/test/metadce/outside.wast b/test/metadce/outside.wast index dc5aeaabc..048af4764 100644 --- a/test/metadce/outside.wast +++ b/test/metadce/outside.wast @@ -20,7 +20,7 @@ (elem (get_global $from_segment_2) $table_func) (func $a_wasm_func - (call_import $a_js_func) + (call $a_js_func) (drop (get_global $DYNAMICTOP_PTR$asm2wasm$import)) (drop (get_global $__THREW__)) ) diff --git a/test/metadce/outside.wast.dced b/test/metadce/outside.wast.dced index 087906b58..986a8f9ac 100644 --- a/test/metadce/outside.wast.dced +++ b/test/metadce/outside.wast.dced @@ -1,15 +1,15 @@ (module (type $FUNCSIG$v (func)) - (import "env" "js_func" (func $a_js_func)) - (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR$asm2wasm$import i32)) (import "env" "memory" (memory $0 256 256)) + (data (i32.const 1024) "abcd") + (data (get_global $from_segment) "abcd") (import "env" "table" (table 10 10 anyfunc)) + (elem (get_global $from_segment_2) $table_func) + (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR$asm2wasm$import i32)) + (import "env" "js_func" (func $a_js_func)) (global $__THREW__ (mut i32) (i32.const 0)) (global $from_segment (mut i32) (i32.const 0)) (global $from_segment_2 (mut i32) (i32.const 0)) - (elem (get_global $from_segment_2) $table_func) - (data (i32.const 1024) "abcd") - (data (get_global $from_segment) "abcd") (export "wasm_func" (func $a_wasm_func)) (func $table_func (; 1 ;) (type $FUNCSIG$v) (nop) diff --git a/test/metadce/threaded.wast.dced b/test/metadce/threaded.wast.dced index 1ee6158a5..e5a00da35 100644 --- a/test/metadce/threaded.wast.dced +++ b/test/metadce/threaded.wast.dced @@ -1,8 +1,8 @@ (module (type $FUNCSIG$v (func)) - (import "env" "js_func2" (func $js_func_2)) - (import "env" "js_func3" (func $js_func_3)) (import "env" "js_func4" (func $js_func_4)) + (import "env" "js_func3" (func $js_func_3)) + (import "env" "js_func2" (func $js_func_2)) (export "wasm_func1" (func $wasm_func_1)) (export "wasm_func2" (func $wasm_func_2)) (export "wasm_func3" (func $wasm_func_3)) diff --git a/test/metadce/threaded_cycle.wast.dced b/test/metadce/threaded_cycle.wast.dced index 34e299b8c..6a4d3450e 100644 --- a/test/metadce/threaded_cycle.wast.dced +++ b/test/metadce/threaded_cycle.wast.dced @@ -1,9 +1,9 @@ (module (type $FUNCSIG$v (func)) - (import "env" "js_func1" (func $js_func_1)) - (import "env" "js_func2" (func $js_func_2)) - (import "env" "js_func3" (func $js_func_3)) (import "env" "js_func4" (func $js_func_4)) + (import "env" "js_func3" (func $js_func_3)) + (import "env" "js_func2" (func $js_func_2)) + (import "env" "js_func1" (func $js_func_1)) (export "wasm_func1" (func $wasm_func_1)) (export "wasm_func2" (func $wasm_func_2)) (export "wasm_func3" (func $wasm_func_3)) diff --git a/test/min.fromasm b/test/min.fromasm index d46362b92..215244c44 100644 --- a/test/min.fromasm +++ b/test/min.fromasm @@ -1,8 +1,8 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "min.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (global $M (mut i32) (i32.const 0)) - (data (get_global $memoryBase) "min.asm.js") (export "floats" (func $legalstub$floats)) (export "getTempRet0" (func $ub)) (export "neg" (func $legalstub$neg)) diff --git a/test/min.fromasm.clamp b/test/min.fromasm.clamp index d46362b92..215244c44 100644 --- a/test/min.fromasm.clamp +++ b/test/min.fromasm.clamp @@ -1,8 +1,8 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "min.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (global $M (mut i32) (i32.const 0)) - (data (get_global $memoryBase) "min.asm.js") (export "floats" (func $legalstub$floats)) (export "getTempRet0" (func $ub)) (export "neg" (func $legalstub$neg)) diff --git a/test/min.fromasm.clamp.no-opts b/test/min.fromasm.clamp.no-opts index 7586e5fc2..6e5139079 100644 --- a/test/min.fromasm.clamp.no-opts +++ b/test/min.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise index 997d2fbf0..d4c2314ce 100644 --- a/test/min.fromasm.imprecise +++ b/test/min.fromasm.imprecise @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (global $M (mut i32) (i32.const 0)) (export "floats" (func $legalstub$floats)) (export "getTempRet0" (func $ub)) diff --git a/test/min.fromasm.imprecise.no-opts b/test/min.fromasm.imprecise.no-opts index 7586e5fc2..6e5139079 100644 --- a/test/min.fromasm.imprecise.no-opts +++ b/test/min.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/min.fromasm.no-opts b/test/min.fromasm.no-opts index 7586e5fc2..6e5139079 100644 --- a/test/min.fromasm.no-opts +++ b/test/min.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/noffi_f32.fromasm b/test/noffi_f32.fromasm index ae0b26a6d..311de68e3 100644 --- a/test/noffi_f32.fromasm +++ b/test/noffi_f32.fromasm @@ -1,9 +1,9 @@ (module (type $FUNCSIG$ff (func (param f32) (result f32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "noffi_f32.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "_importf" (func $importf (param f32) (result f32))) - (data (get_global $memoryBase) "noffi_f32.asm.js") (export "main" (func $main)) (export "exportf" (func $exportf)) (func $exportf (; 1 ;) (; has Stack IR ;) (param $0 f32) (result f32) diff --git a/test/noffi_f32.fromasm.clamp b/test/noffi_f32.fromasm.clamp index ae0b26a6d..311de68e3 100644 --- a/test/noffi_f32.fromasm.clamp +++ b/test/noffi_f32.fromasm.clamp @@ -1,9 +1,9 @@ (module (type $FUNCSIG$ff (func (param f32) (result f32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "noffi_f32.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "_importf" (func $importf (param f32) (result f32))) - (data (get_global $memoryBase) "noffi_f32.asm.js") (export "main" (func $main)) (export "exportf" (func $exportf)) (func $exportf (; 1 ;) (; has Stack IR ;) (param $0 f32) (result f32) diff --git a/test/noffi_f32.fromasm.clamp.no-opts b/test/noffi_f32.fromasm.clamp.no-opts index 1e600b0f0..68440b33b 100644 --- a/test/noffi_f32.fromasm.clamp.no-opts +++ b/test/noffi_f32.fromasm.clamp.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$ff (func (param f32) (result f32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/noffi_f32.fromasm.imprecise.no-opts b/test/noffi_f32.fromasm.imprecise.no-opts index 1e600b0f0..68440b33b 100644 --- a/test/noffi_f32.fromasm.imprecise.no-opts +++ b/test/noffi_f32.fromasm.imprecise.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$ff (func (param f32) (result f32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/noffi_f32.fromasm.no-opts b/test/noffi_f32.fromasm.no-opts index 1e600b0f0..68440b33b 100644 --- a/test/noffi_f32.fromasm.no-opts +++ b/test/noffi_f32.fromasm.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$ff (func (param f32) (result f32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/noffi_i64.fromasm b/test/noffi_i64.fromasm index 69fbe532b..fef586b7b 100644 --- a/test/noffi_i64.fromasm +++ b/test/noffi_i64.fromasm @@ -1,9 +1,9 @@ (module (type $FUNCSIG$jj (func (param i64) (result i64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "noffi_i64.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "_importll" (func $importll (param i64) (result i64))) - (data (get_global $memoryBase) "noffi_i64.asm.js") (export "_add" (func $add)) (export "_main" (func $main)) (func $add (; 1 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64) diff --git a/test/noffi_i64.fromasm.clamp b/test/noffi_i64.fromasm.clamp index 69fbe532b..fef586b7b 100644 --- a/test/noffi_i64.fromasm.clamp +++ b/test/noffi_i64.fromasm.clamp @@ -1,9 +1,9 @@ (module (type $FUNCSIG$jj (func (param i64) (result i64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "noffi_i64.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "_importll" (func $importll (param i64) (result i64))) - (data (get_global $memoryBase) "noffi_i64.asm.js") (export "_add" (func $add)) (export "_main" (func $main)) (func $add (; 1 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64) diff --git a/test/noffi_i64.fromasm.clamp.no-opts b/test/noffi_i64.fromasm.clamp.no-opts index 905c2727d..ba2faad13 100644 --- a/test/noffi_i64.fromasm.clamp.no-opts +++ b/test/noffi_i64.fromasm.clamp.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$jj (func (param i64) (result i64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/noffi_i64.fromasm.imprecise.no-opts b/test/noffi_i64.fromasm.imprecise.no-opts index 905c2727d..ba2faad13 100644 --- a/test/noffi_i64.fromasm.imprecise.no-opts +++ b/test/noffi_i64.fromasm.imprecise.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$jj (func (param i64) (result i64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/noffi_i64.fromasm.no-opts b/test/noffi_i64.fromasm.no-opts index 905c2727d..ba2faad13 100644 --- a/test/noffi_i64.fromasm.no-opts +++ b/test/noffi_i64.fromasm.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$jj (func (param i64) (result i64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/passes/O3_inlining.txt b/test/passes/O3_inlining.txt index 67c7931ef..8710a0bef 100644 --- a/test/passes/O3_inlining.txt +++ b/test/passes/O3_inlining.txt @@ -1,7 +1,7 @@ (module (type $1 (func (param i32))) - (global $global$1 (mut i32) (i32.const 100)) (memory $0 1 1) + (global $global$1 (mut i32) (i32.const 100)) (export "func_217" (func $1)) (func $1 (; 0 ;) (type $1) (param $0 i32) (if diff --git a/test/passes/coalesce-locals-learning.txt b/test/passes/coalesce-locals-learning.txt index ecf2f4cd7..95eb36729 100644 --- a/test/passes/coalesce-locals-learning.txt +++ b/test/passes/coalesce-locals-learning.txt @@ -4,8 +4,8 @@ (type $2 (func)) (type $3 (func (param i32 f32))) (type $4 (func (param i32))) - (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) (memory $0 10) + (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) (func $nothing-to-do (; 1 ;) (type $2) (local $0 i32) (nop) diff --git a/test/passes/coalesce-locals.txt b/test/passes/coalesce-locals.txt index 4f856d0dc..e286135a3 100644 --- a/test/passes/coalesce-locals.txt +++ b/test/passes/coalesce-locals.txt @@ -10,10 +10,10 @@ (type $8 (func (param f64 i32) (result i64))) (type $9 (func (param i32 i32))) (type $10 (func (result f64))) + (memory $0 10) (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) (import "env" "get" (func $get (result i32))) (import "env" "set" (func $set (param i32))) - (memory $0 10) (func $nothing-to-do (; 3 ;) (type $2) (local $0 i32) (nop) diff --git a/test/passes/code-folding.txt b/test/passes/code-folding.txt index 054e58104..e7eeb55e3 100644 --- a/test/passes/code-folding.txt +++ b/test/passes/code-folding.txt @@ -2,8 +2,8 @@ (type $13 (func (param f32))) (type $1 (func)) (type $2 (func (result f32))) - (table 282 282 anyfunc) (memory $0 1 1) + (table 282 282 anyfunc) (func $0 (; 0 ;) (type $1) (block $label$1 (if diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt index 637a9522f..8751bccf4 100644 --- a/test/passes/converge_O3_metrics.bin.txt +++ b/test/passes/converge_O3_metrics.bin.txt @@ -1,5 +1,6 @@ total [funcs] : 8 + [imports] : 3 [memory-data] : 28 [table-data] : 429 [total] : 132 @@ -7,8 +8,7 @@ total binary : 12 block : 8 break : 3 - call : 2 - call_import : 1 + call : 3 call_indirect : 4 const : 47 drop : 3 @@ -26,11 +26,7 @@ total (type $2 (func (param i32) (result i32))) (type $6 (func (param i32 i32 i32 i32 i32 i32 i32) (result i32))) (type $7 (func (result i32))) - (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 478 478 anyfunc)) - (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) - (global $global$0 (mut i32) (i32.const 1)) - (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi) + (import "env" "memory" (memory $1 256 256)) (data (i32.const 2948) "\03") (data (i32.const 6828) "\04") (data (i32.const 7028) "\0d\00\00\00\06") @@ -39,6 +35,10 @@ total (data (i32.const 18128) ",I") (data (i32.const 18732) "D\1b") (data (i32.const 18764) "`\0b") + (import "env" "table" (table 478 478 anyfunc)) + (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi) + (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) + (global $global$0 (mut i32) (i32.const 1)) (export "_main" (func $_main)) (export "_malloc" (func $_malloc)) (func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32) @@ -241,6 +241,7 @@ total ) total [funcs] : 8 + [imports] : 3 [memory-data] : 28 [table-data] : 429 [total] : 132 @@ -248,8 +249,7 @@ total binary : 12 block : 8 break : 3 - call : 2 - call_import : 1 + call : 3 call_indirect : 4 const : 47 drop : 3 @@ -268,11 +268,7 @@ total (type $6 (func (param i32 i32 i32 i32 i32 i32 i32) (result i32))) (type $7 (func (result i32))) (type $FUNCSIG$v (func)) - (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 478 478 anyfunc)) - (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) - (global $global$0 (mut i32) (i32.const 1)) - (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi) + (import "env" "memory" (memory $1 256 256)) (data (i32.const 2948) "\03") (data (i32.const 6828) "\04") (data (i32.const 7028) "\0d\00\00\00\06") @@ -281,6 +277,10 @@ total (data (i32.const 18128) ",I") (data (i32.const 18732) "D\1b") (data (i32.const 18764) "`\0b") + (import "env" "table" (table 478 478 anyfunc)) + (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi) + (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) + (global $global$0 (mut i32) (i32.const 1)) (export "_main" (func $_main)) (export "_malloc" (func $_malloc)) (func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32) @@ -483,6 +483,7 @@ total ) total [funcs] : 8 + [imports] : 3 [memory-data] : 28 [table-data] : 429 [total] : 132 @@ -490,8 +491,7 @@ total binary : 12 block : 8 break : 3 - call : 2 - call_import : 1 + call : 3 call_indirect : 4 const : 47 drop : 3 @@ -510,11 +510,7 @@ total (type $6 (func (param i32 i32 i32 i32 i32 i32 i32) (result i32))) (type $7 (func (result i32))) (type $FUNCSIG$v (func)) - (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 478 478 anyfunc)) - (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) - (global $global$0 (mut i32) (i32.const 1)) - (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi) + (import "env" "memory" (memory $1 256 256)) (data (i32.const 2948) "\03") (data (i32.const 6828) "\04") (data (i32.const 7028) "\0d\00\00\00\06") @@ -523,6 +519,10 @@ total (data (i32.const 18128) ",I") (data (i32.const 18732) "D\1b") (data (i32.const 18764) "`\0b") + (import "env" "table" (table 478 478 anyfunc)) + (elem (i32.const 0) $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $___stdout_write $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE6xsputnEPKci $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $b0 $__ZNSt3__211__stdoutbufIcE8overflowEi) + (import "env" "___syscall146" (func $import$0 (param i32 i32) (result i32))) + (global $global$0 (mut i32) (i32.const 1)) (export "_main" (func $_main)) (export "_malloc" (func $_malloc)) (func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32) diff --git a/test/passes/dce.txt b/test/passes/dce.txt index b2976432b..6931ef038 100644 --- a/test/passes/dce.txt +++ b/test/passes/dce.txt @@ -6,10 +6,10 @@ (type $4 (func (param i64 i64) (result i64))) (type $5 (func (param f32 i64))) (type $6 (func (param f32 i64) (result i32))) - (global $x (mut i32) (i32.const 0)) + (memory $0 10) (table 1 1 anyfunc) (elem (i32.const 0) $call-me) - (memory $0 10) + (global $x (mut i32) (i32.const 0)) (func $call-me (; 0 ;) (type $ii) (param $0 i32) (param $1 i32) (nop) ) diff --git a/test/passes/duplicate-function-elimination_optimize-level=1.txt b/test/passes/duplicate-function-elimination_optimize-level=1.txt index c44b4cc28..276debca1 100644 --- a/test/passes/duplicate-function-elimination_optimize-level=1.txt +++ b/test/passes/duplicate-function-elimination_optimize-level=1.txt @@ -42,9 +42,9 @@ ) (module (type $0 (func)) + (memory $0 0) (table 3 3 anyfunc) (elem (i32.const 0) $keep2 $keep2 $caller) - (memory $0 0) (export "keep2" (func $keep2)) (export "other" (func $keep2)) (start $keep2) @@ -369,18 +369,18 @@ ) (module (type $FUNCSIG$v (func)) + (memory $0 0) (import "env" "i" (func $i)) (import "env" "j" (func $j)) - (memory $0 0) (func $erase (; 2 ;) (type $FUNCSIG$v) (call $i) ) ) (module (type $FUNCSIG$v (func)) + (memory $0 0) (import "env" "i" (func $i)) (import "env" "j" (func $j)) - (memory $0 0) (func $keep2 (; 2 ;) (type $FUNCSIG$v) (call $i) ) @@ -390,9 +390,9 @@ ) (module (type $T (func)) + (memory $0 0) (table 2 2 anyfunc) (elem (i32.const 0) $erase $erase) - (memory $0 0) (func $erase (; 0 ;) (type $T) (call_indirect (type $T) (i32.const 0) @@ -401,9 +401,9 @@ ) (module (type $T (func)) + (memory $0 0) (table 2 2 anyfunc) (elem (i32.const 0) $keep2 $other) - (memory $0 0) (func $keep2 (; 0 ;) (type $T) (call_indirect (type $T) (i32.const 0) @@ -418,9 +418,9 @@ (module (type $T (func)) (type $S (func)) + (memory $0 0) (table 2 2 anyfunc) (elem (i32.const 0) $keep2 $other) - (memory $0 0) (func $keep2 (; 0 ;) (type $T) (call_indirect (type $T) (i32.const 0) diff --git a/test/passes/duplicate-function-elimination_optimize-level=2.txt b/test/passes/duplicate-function-elimination_optimize-level=2.txt index baf4fedf2..4294b28c4 100644 --- a/test/passes/duplicate-function-elimination_optimize-level=2.txt +++ b/test/passes/duplicate-function-elimination_optimize-level=2.txt @@ -42,9 +42,9 @@ ) (module (type $0 (func)) + (memory $0 0) (table 3 3 anyfunc) (elem (i32.const 0) $keep2 $keep2 $caller) - (memory $0 0) (export "keep2" (func $keep2)) (export "other" (func $keep2)) (start $keep2) @@ -366,18 +366,18 @@ ) (module (type $FUNCSIG$v (func)) + (memory $0 0) (import "env" "i" (func $i)) (import "env" "j" (func $j)) - (memory $0 0) (func $erase (; 2 ;) (type $FUNCSIG$v) (call $i) ) ) (module (type $FUNCSIG$v (func)) + (memory $0 0) (import "env" "i" (func $i)) (import "env" "j" (func $j)) - (memory $0 0) (func $keep2 (; 2 ;) (type $FUNCSIG$v) (call $i) ) @@ -387,9 +387,9 @@ ) (module (type $T (func)) + (memory $0 0) (table 2 2 anyfunc) (elem (i32.const 0) $erase $erase) - (memory $0 0) (func $erase (; 0 ;) (type $T) (call_indirect (type $T) (i32.const 0) @@ -398,9 +398,9 @@ ) (module (type $T (func)) + (memory $0 0) (table 2 2 anyfunc) (elem (i32.const 0) $keep2 $other) - (memory $0 0) (func $keep2 (; 0 ;) (type $T) (call_indirect (type $T) (i32.const 0) @@ -415,9 +415,9 @@ (module (type $T (func)) (type $S (func)) + (memory $0 0) (table 2 2 anyfunc) (elem (i32.const 0) $keep2 $other) - (memory $0 0) (func $keep2 (; 0 ;) (type $T) (call_indirect (type $T) (i32.const 0) diff --git a/test/passes/flatten.txt b/test/passes/flatten.txt index 201cad478..90d0ab269 100644 --- a/test/passes/flatten.txt +++ b/test/passes/flatten.txt @@ -5,10 +5,10 @@ (type $3 (func (param i32) (result i32))) (type $4 (func (param i64 i64) (result i64))) (type $5 (func (result f32))) - (global $x (mut i32) (i32.const 0)) + (memory $0 10) (table 1 1 anyfunc) (elem (i32.const 0) $call-me) - (memory $0 10) + (global $x (mut i32) (i32.const 0)) (func $a1 (; 0 ;) (type $1) (local $0 i32) (set_local $0 diff --git a/test/passes/flatten_local-cse.txt b/test/passes/flatten_local-cse.txt index defa27c92..d8dd852b5 100644 --- a/test/passes/flatten_local-cse.txt +++ b/test/passes/flatten_local-cse.txt @@ -637,8 +637,8 @@ (type $0 (func)) (type $1 (func (param i32 f64) (result i32))) (type $2 (func (param i64 f32 i32))) - (global $global$0 (mut i32) (i32.const 10)) (table 23 23 anyfunc) + (global $global$0 (mut i32) (i32.const 10)) (export "func_1_invoker" (func $1)) (export "func_6" (func $2)) (func $0 (; 0 ;) (type $2) (param $var$0 i64) (param $var$1 f32) (param $var$2 i32) diff --git a/test/passes/fpcast-emu.txt b/test/passes/fpcast-emu.txt index b1560517c..8349a04f6 100644 --- a/test/passes/fpcast-emu.txt +++ b/test/passes/fpcast-emu.txt @@ -11,9 +11,9 @@ (type $FUNCSIG$fjj (func (param i64 i64) (result f32))) (type $FUNCSIG$dff (func (param f32 f32) (result f64))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) - (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32))) (table 10 10 anyfunc) (elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b $byn$fpcast-emu$c $byn$fpcast-emu$d $byn$fpcast-emu$e $byn$fpcast-emu$e $byn$fpcast-emu$imported-func) + (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32))) (export "dynCall_dff" (func $dynCall_dff)) (export "dynCall_idd" (func $dynCall_idd)) (func $a (; 1 ;) (type $vijfd) (param $x i32) (param $y i64) (param $z f32) (param $w f64) @@ -296,8 +296,8 @@ (type $0 (func (param i64))) (type $1 (func (param f32) (result i64))) (type $FUNCSIG$jjjjjjjjjjjjjjjj (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64))) - (global $global$0 (mut i32) (i32.const 10)) (table 42 42 anyfunc) + (global $global$0 (mut i32) (i32.const 10)) (export "func_106" (func $0)) (func $0 (; 0 ;) (type $1) (param $0 f32) (result i64) (block $label$1 (result i64) diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt index b778962a1..19ba9ba24 100644 --- a/test/passes/func-metrics.txt +++ b/test/passes/func-metrics.txt @@ -28,11 +28,11 @@ func: ifs (module (type $0 (func (param i32))) (type $1 (func)) - (global $glob i32 (i32.const 1337)) - (table 256 256 anyfunc) - (elem (i32.const 0) $ifs $ifs $ifs) (memory $0 256 256) (data (i32.const 0) "\ff\ef\0f\1f 0@P\99") + (table 256 256 anyfunc) + (elem (i32.const 0) $ifs $ifs $ifs) + (global $glob i32 (i32.const 1337)) (func $empty (; 0 ;) (type $1) (nop) ) @@ -88,22 +88,22 @@ global ) global [funcs] : 3 + [imports] : 1 func: func_a [binary-bytes] : 16 [total] : 8 block : 1 - call : 2 - call_import : 5 + call : 7 func: func_b [binary-bytes] : 22 [total] : 11 block : 1 - call_import : 10 + call : 10 func: func_c [binary-bytes] : 32 [total] : 16 block : 1 - call_import : 15 + call : 15 export: a (func_a) [removable-bytes-without-it]: 72 export: b (func_b) @@ -154,11 +154,12 @@ export: b (func_b) ) global [funcs] : 1 + [imports] : 1 func: func_a [binary-bytes] : 12 [total] : 6 block : 1 - call_import : 5 + call : 5 export: a (func_a) [removable-bytes-without-it]: 7 start: func_a @@ -178,11 +179,12 @@ start: func_a ) global [funcs] : 1 + [imports] : 1 func: func_a [binary-bytes] : 12 [total] : 6 block : 1 - call_import : 5 + call : 5 start: func_a [removable-bytes-without-it]: 67 (module diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt index 627f5bd19..043d0deef 100644 --- a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt +++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt @@ -9,13 +9,13 @@ (type $7 (func (param f64) (result f64))) (type $8 (func (result i64))) (type $9 (func (param i32 i64))) + (memory $0 4096 4096) + (data (i32.const 1026) "\14\00") + (table 10 anyfunc) + (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (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))) - (table 10 anyfunc) - (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (export "big_negative" (func $big_negative)) (func $big_negative (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$v) (local $temp f64) @@ -639,13 +639,13 @@ (type $7 (func (param f64) (result f64))) (type $8 (func (result i64))) (type $9 (func (param i32 i64))) + (memory $0 4096 4096) + (data (i32.const 1026) "\14\00") + (table 10 anyfunc) + (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (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))) - (table 10 anyfunc) - (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (export "big_negative" (func $big_negative)) (func $big_negative (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$v) (local $temp f64) diff --git a/test/passes/inlining-optimizing.txt b/test/passes/inlining-optimizing.txt index 8b55459c2..036835614 100644 --- a/test/passes/inlining-optimizing.txt +++ b/test/passes/inlining-optimizing.txt @@ -78,8 +78,8 @@ (module (type $0 (func)) (type $1 (func (param i32 i32) (result i32))) - (table 89 89 anyfunc) (memory $0 17) + (table 89 89 anyfunc) (start $1) (func $1 (; 0 ;) (type $0) (i32.store diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt index 9636e0467..6a34ac454 100644 --- a/test/passes/inlining-optimizing_optimize-level=3.txt +++ b/test/passes/inlining-optimizing_optimize-level=3.txt @@ -12,9 +12,15 @@ (type $10 (func (param i32 i32 i32))) (type $11 (func (param i32 i32 i32 i32 i32))) (type $12 (func (param i32 i32 i32 i32) (result i32))) + (import "env" "memory" (memory $0 256 256)) + (data (i32.const 1024) "emcc_hello_world.asm.js") + (import "env" "table" (table 18 18 anyfunc)) + (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) (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" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "abort" (func $abort)) (import "env" "nullFunc_ii" (func $nullFunc_ii (param i32))) (import "env" "nullFunc_iiii" (func $nullFunc_iiii (param i32))) @@ -33,18 +39,12 @@ (import "env" "_pthread_cleanup_push" (func $_pthread_cleanup_push (param i32 i32))) (import "env" "_sysconf" (func $_sysconf (param i32) (result i32))) (import "env" "___syscall146" (func $___syscall146 (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 18 18 anyfunc)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (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 $__THREW__ (mut i32) (i32.const 0)) (global $threwValue (mut i32) (i32.const 0)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $b0 $___stdio_close $b1 $b1 $___stdout_write $___stdio_seek $___stdio_write $b1 $b1 $b1 $b2 $b2 $b2 $b2 $b2 $_cleanup $b2 $b2) - (data (i32.const 1024) "emcc_hello_world.asm.js") (export "_i64Subtract" (func $_i64Subtract)) (export "_free" (func $_free)) (export "_main" (func $_main)) diff --git a/test/passes/inlining.txt b/test/passes/inlining.txt index 2076d078f..9271de34a 100644 --- a/test/passes/inlining.txt +++ b/test/passes/inlining.txt @@ -170,8 +170,8 @@ (type $0 (func (result i32))) (type $1 (func (param f32 i32) (result i32))) (type $2 (func)) - (global $hangLimit (mut i32) (i32.const 25)) (memory $0 1 1) + (global $hangLimit (mut i32) (i32.const 25)) (export "hangLimitInitializer" (func $hangLimitInitializer)) (func $func_4 (; 0 ;) (type $1) (param $0 f32) (param $1 i32) (result i32) (local $2 i64) diff --git a/test/passes/instrument-memory.txt b/test/passes/instrument-memory.txt index fc5221c3e..3e2f674b2 100644 --- a/test/passes/instrument-memory.txt +++ b/test/passes/instrument-memory.txt @@ -1,9 +1,9 @@ (module (type $1 (func)) (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) + (memory $0 256 256) (import "instrument" "load" (func $load (param i32 i32 i32 i32) (result i32))) (import "instrument" "store" (func $store (param i32 i32 i32 i32) (result i32))) - (memory $0 256 256) (func $A (; 2 ;) (type $1) (drop (i32.load8_s diff --git a/test/passes/legalize-js-interface.txt b/test/passes/legalize-js-interface.txt index 8f833de87..5d232778f 100644 --- a/test/passes/legalize-js-interface.txt +++ b/test/passes/legalize-js-interface.txt @@ -1,13 +1,20 @@ (module - (type $0 (func (result i64))) + (type $FUNCSIG$j (func (result i64))) + (type $legaltype$imported (func (result i32))) + (import "env" "imported" (func $legalimport$imported (result i32))) (global $tempRet0 (mut i32) (i32.const 0)) (export "func" (func $legalstub$func)) + (export "imported" (func $legalstub$imported)) + (export "imported_again" (func $legalstub$imported)) (export "getTempRet0" (func $getTempRet0)) (export "setTempRet0" (func $setTempRet0)) - (func $func (; 0 ;) (type $0) (result i64) + (func $func (; 1 ;) (type $FUNCSIG$j) (result i64) + (drop + (call $legalfunc$imported) + ) (unreachable) ) - (func $legalstub$func (; 1 ;) (result i32) + (func $legalstub$func (; 2 ;) (result i32) (local $0 i64) (set_local $0 (call $func) @@ -24,10 +31,40 @@ (get_local $0) ) ) - (func $getTempRet0 (; 2 ;) (result i32) + (func $legalstub$imported (; 3 ;) (result i32) + (local $0 i64) + (set_local $0 + (call $legalfunc$imported) + ) + (set_global $tempRet0 + (i32.wrap/i64 + (i64.shr_u + (get_local $0) + (i64.const 32) + ) + ) + ) + (i32.wrap/i64 + (get_local $0) + ) + ) + (func $legalfunc$imported (; 4 ;) (result i64) + (i64.or + (i64.extend_u/i32 + (call $legalimport$imported) + ) + (i64.shl + (i64.extend_u/i32 + (get_global $tempRet0) + ) + (i64.const 32) + ) + ) + ) + (func $getTempRet0 (; 5 ;) (result i32) (get_global $tempRet0) ) - (func $setTempRet0 (; 3 ;) (param $0 i32) + (func $setTempRet0 (; 6 ;) (param $0 i32) (set_global $tempRet0 (get_local $0) ) diff --git a/test/passes/legalize-js-interface.wast b/test/passes/legalize-js-interface.wast index bae2a8c75..5e1341653 100644 --- a/test/passes/legalize-js-interface.wast +++ b/test/passes/legalize-js-interface.wast @@ -1,6 +1,10 @@ (module + (import "env" "imported" (func $imported (result i64))) (export "func" (func $func)) + (export "imported" (func $imported)) + (export "imported_again" (func $imported)) (func $func (result i64) + (drop (call $imported)) (unreachable) ) ) diff --git a/test/passes/memory-packing.txt b/test/passes/memory-packing.txt index 6f67f9dcb..e60f716c0 100644 --- a/test/passes/memory-packing.txt +++ b/test/passes/memory-packing.txt @@ -1,6 +1,5 @@ (module (import "env" "memory" (memory $0 2048 2048)) - (import "env" "memoryBase" (global $memoryBase i32)) (data (get_global $memoryBase) "waka this cannot be optimized\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00we don\'t know where it will go") (data (i32.const 1024) "waka this CAN be optimized") (data (i32.const 1107) "we DO know where it will go") @@ -9,6 +8,7 @@ (data (i32.const 4000) "zeros\00in\00the\00middle") (data (i32.const 4035) "nice skip here") (data (i32.const 4066) "another\00but no") + (import "env" "memoryBase" (global $memoryBase i32)) ) (module (import "env" "memory" (memory $0 2048 2048)) diff --git a/test/passes/metrics.txt b/test/passes/metrics.txt index 9cc5d03ec..a3765585f 100644 --- a/test/passes/metrics.txt +++ b/test/passes/metrics.txt @@ -11,11 +11,11 @@ total if : 4 (module (type $0 (func (param i32))) - (global $glob i32 (i32.const 1337)) - (table 256 256 anyfunc) - (elem (i32.const 0) $ifs $ifs $ifs) (memory $0 256 256) (data (i32.const 0) "\ff\ef\0f\1f 0@P\99") + (table 256 256 anyfunc) + (elem (i32.const 0) $ifs $ifs $ifs) + (global $glob i32 (i32.const 1337)) (func $ifs (; 0 ;) (type $0) (param $x i32) (local $y f32) (block $block0 diff --git a/test/passes/post-emscripten.txt b/test/passes/post-emscripten.txt index a1bac030a..c938d8174 100644 --- a/test/passes/post-emscripten.txt +++ b/test/passes/post-emscripten.txt @@ -3,8 +3,8 @@ (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $2 (func (param i32) (result i32))) (type $3 (func)) - (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64))) (memory $0 256 256) + (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64))) (export "load-off-2" (func $load-off-2)) (func $b0 (; 1 ;) (type $0) (param $x i32) (drop diff --git a/test/passes/precompute.txt b/test/passes/precompute.txt index 166d0b575..11bd93fc4 100644 --- a/test/passes/precompute.txt +++ b/test/passes/precompute.txt @@ -3,9 +3,9 @@ (type $1 (func (result i32))) (type $2 (func)) (type $3 (func (result f64))) + (memory $0 0) (global $global i32 (i32.const 1)) (global $global-mut (mut i32) (i32.const 2)) - (memory $0 0) (func $x (; 0 ;) (type $0) (param $x i32) (call $x (i32.const 2300) diff --git a/test/passes/print-call-graph.txt b/test/passes/print-call-graph.txt index 50c67d9d7..fc3927ed6 100644 --- a/test/passes/print-call-graph.txt +++ b/test/passes/print-call-graph.txt @@ -75,32 +75,32 @@ digraph call { "$dynCall_vi" [style="filled", fillcolor="gray"]; "$dynCall_v" [style="filled", fillcolor="gray"]; "$_main" -> "$__Znwj"; // call - "$___stdio_close" -> "$___syscall6"; // callImport + "$___stdio_close" -> "$___syscall6"; // call "$___stdio_close" -> "$___syscall_ret"; // call - "$___stdio_write" -> "$_pthread_cleanup_push"; // callImport - "$___stdio_write" -> "$___syscall146"; // callImport + "$___stdio_write" -> "$_pthread_cleanup_push"; // call + "$___stdio_write" -> "$___syscall146"; // call "$___stdio_write" -> "$___syscall_ret"; // call - "$___stdio_write" -> "$_pthread_cleanup_pop"; // callImport - "$___stdio_seek" -> "$___syscall140"; // callImport + "$___stdio_write" -> "$_pthread_cleanup_pop"; // call + "$___stdio_seek" -> "$___syscall140"; // call "$___stdio_seek" -> "$___syscall_ret"; // call "$___syscall_ret" -> "$___errno_location"; // call "$___errno_location" -> "$_pthread_self"; // call "$_cleanup_387" -> "$_free"; // call - "$___stdout_write" -> "$___syscall54"; // callImport + "$___stdout_write" -> "$___syscall54"; // call "$___stdout_write" -> "$___stdio_write"; // call "$_fflush" -> "$___fflush_unlocked"; // call "$_fflush" -> "$_malloc"; // call "$_fflush" -> "$_free"; // call "$_fflush" -> "$_fflush"; // call - "$_fflush" -> "$___lock"; // callImport - "$_fflush" -> "$___unlock"; // callImport + "$_fflush" -> "$___lock"; // call + "$_fflush" -> "$___unlock"; // call "$__Znwj" -> "$_malloc"; // call "$__Znwj" -> "$__ZSt15get_new_handlerv"; // call - "$_memcpy" -> "$_emscripten_memcpy_big"; // callImport - "$b0" -> "$abort"; // callImport - "$b1" -> "$abort"; // callImport - "$b2" -> "$abort"; // callImport - "$b3" -> "$abort"; // callImport + "$_memcpy" -> "$_emscripten_memcpy_big"; // call + "$b0" -> "$abort"; // call + "$b1" -> "$abort"; // call + "$b2" -> "$abort"; // call + "$b3" -> "$abort"; // call "$b0" [style="filled, rounded"]; "$___stdio_close" [style="filled, rounded"]; "$b1" [style="filled, rounded"]; @@ -120,6 +120,10 @@ digraph call { (type $FUNCSIG$vii (func (param i32 i32))) (type $6 (func (result i32))) (type $7 (func (param i32 i32 i32 i32) (result i32))) + (import "env" "memory" (memory $0 256 256)) + (data (get_global $memoryBase) "\05\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\b0\04\00\00\00\04\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\n\ff\ff\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04") + (import "env" "table" (table 9 9 anyfunc)) + (elem (i32.const 0) $b0 $___stdio_close $b1 $___stdout_write $___stdio_seek $___stdio_write $b2 $_cleanup_387 $b3) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "STACK_MAX" (global $STACK_MAX$asm2wasm$import i32)) (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR$asm2wasm$import i32)) @@ -127,6 +131,8 @@ digraph call { (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" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) (import "env" "abort" (func $abort (param i32))) (import "env" "_pthread_cleanup_pop" (func $_pthread_cleanup_pop (param i32))) (import "env" "___lock" (func $___lock (param i32))) @@ -137,10 +143,6 @@ digraph call { (import "env" "___syscall54" (func $___syscall54 (param i32 i32) (result i32))) (import "env" "___unlock" (func $___unlock (param i32))) (import "env" "___syscall146" (func $___syscall146 (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256 256)) - (import "env" "table" (table 9 9 anyfunc)) - (import "env" "memoryBase" (global $memoryBase i32)) - (import "env" "tableBase" (global $tableBase i32)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $STACK_MAX (mut i32) (get_global $STACK_MAX$asm2wasm$import)) (global $DYNAMICTOP_PTR (mut i32) (get_global $DYNAMICTOP_PTR$asm2wasm$import)) @@ -164,8 +166,6 @@ digraph call { (global $tempRet0 (mut i32) (i32.const 0)) (global $tempFloat (mut f32) (f32.const 0)) (global $f0 (mut f32) (f32.const 0)) - (elem (i32.const 0) $b0 $___stdio_close $b1 $___stdout_write $___stdio_seek $___stdio_write $b2 $_cleanup_387 $b3) - (data (get_global $memoryBase) "\05\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\b0\04\00\00\00\04\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\n\ff\ff\ff\ff\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04") (export "_fflush" (func $_fflush)) (export "_main" (func $_main)) (export "_pthread_self" (func $_pthread_self)) diff --git a/test/passes/remove-imports.txt b/test/passes/remove-imports.txt index 9c7444b8d..05ec5bae2 100644 --- a/test/passes/remove-imports.txt +++ b/test/passes/remove-imports.txt @@ -2,8 +2,8 @@ (type $FUNCSIG$v (func)) (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$d (func (result f64))) - (import "env" "memBase" (global $import$global0 i32)) (memory $0 1024 1024) + (import "env" "memBase" (global $import$global0 i32)) (func $nada (; 0 ;) (type $FUNCSIG$v) (nop) (drop diff --git a/test/passes/remove-unused-module-elements.txt b/test/passes/remove-unused-module-elements.txt index 7c85eec58..077ed0b0c 100644 --- a/test/passes/remove-unused-module-elements.txt +++ b/test/passes/remove-unused-module-elements.txt @@ -2,9 +2,9 @@ (type $0 (func)) (type $1 (func (param i32))) (type $2 (func (param i32) (result i32))) + (memory $0 0) (table 1 1 anyfunc) (elem (i32.const 0) $called_indirect) - (memory $0 0) (export "memory" (memory $0)) (export "exported" (func $exported)) (export "other1" (func $other1)) @@ -92,9 +92,9 @@ (module (type $0 (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1) "hello, world!") (import "env" "table" (table 1 anyfunc)) (elem (i32.const 0) $waka) - (data (i32.const 1) "hello, world!") (func $waka (; 0 ;) (type $0) (nop) ) @@ -207,11 +207,11 @@ (module (type $0 (func)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "hello, world!") (import "env" "table" (table 0 anyfunc)) + (elem (get_global $tableBase) $waka) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (elem (get_global $tableBase) $waka) - (data (get_global $memoryBase) "hello, world!") (func $waka (; 0 ;) (type $0) (nop) ) diff --git a/test/passes/remove-unused-names_merge-blocks.txt b/test/passes/remove-unused-names_merge-blocks.txt index 410febead..c38ab7429 100644 --- a/test/passes/remove-unused-names_merge-blocks.txt +++ b/test/passes/remove-unused-names_merge-blocks.txt @@ -5,9 +5,9 @@ (type $3 (func)) (type $4 (func (result i32))) (type $5 (func (result f64))) + (memory $0 (shared 256 256)) (table 1 1 anyfunc) (elem (i32.const 0) $call-i) - (memory $0 (shared 256 256)) (func $call-i (; 0 ;) (type $i) (param $0 i32) (nop) ) diff --git a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt index e6b01cc11..fc975a788 100644 --- a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt +++ b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt @@ -23,6 +23,8 @@ (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$id (func (param f64) (result i32))) (type $23 (func (param i32) (result i64))) + (import "env" "memory" (memory $0 256)) + (import "env" "table" (table 18 18 anyfunc)) (import "env" "DYNAMICTOP_PTR" (global $import$0 i32)) (import "env" "tempDoublePtr" (global $import$1 i32)) (import "env" "ABORT" (global $import$2 i32)) @@ -30,6 +32,8 @@ (import "env" "STACK_MAX" (global $import$4 i32)) (import "global" "NaN" (global $import$5 f64)) (import "global" "Infinity" (global $import$6 f64)) + (import "env" "memoryBase" (global $import$32 i32)) + (import "env" "tableBase" (global $import$33 i32)) (import "env" "enlargeMemory" (func $import$7 (result i32))) (import "env" "getTotalMemory" (func $import$8 (result i32))) (import "env" "abortOnCannotGrowMemory" (func $import$9 (result i32))) @@ -53,10 +57,6 @@ (import "asm2wasm" "i32s-rem" (func $import$27 (param i32 i32) (result i32))) (import "asm2wasm" "i32u-rem" (func $import$28 (param i32 i32) (result i32))) (import "asm2wasm" "i32u-div" (func $import$29 (param i32 i32) (result i32))) - (import "env" "memory" (memory $0 256)) - (import "env" "table" (table 18 18 anyfunc)) - (import "env" "memoryBase" (global $import$32 i32)) - (import "env" "tableBase" (global $import$33 i32)) (global $global$0 (mut i32) (get_global $import$0)) (global $global$1 (mut i32) (get_global $import$1)) (global $global$2 (mut i32) (get_global $import$2)) diff --git a/test/passes/remove-unused-nonfunction-module-elements.txt b/test/passes/remove-unused-nonfunction-module-elements.txt index bd4a8c7d4..2eb4aebba 100644 --- a/test/passes/remove-unused-nonfunction-module-elements.txt +++ b/test/passes/remove-unused-nonfunction-module-elements.txt @@ -2,9 +2,9 @@ (type $0 (func)) (type $1 (func (param i32))) (type $2 (func (param i32) (result i32))) + (memory $0 0) (table 1 1 anyfunc) (elem (i32.const 0) $called_indirect) - (memory $0 0) (export "memory" (memory $0)) (export "exported" (func $exported)) (export "other1" (func $other1)) @@ -107,9 +107,9 @@ (module (type $0 (func)) (import "env" "memory" (memory $0 256)) + (data (i32.const 1) "hello, world!") (import "env" "table" (table 1 anyfunc)) (elem (i32.const 0) $waka) - (data (i32.const 1) "hello, world!") (func $waka (; 0 ;) (type $0) (nop) ) @@ -222,11 +222,11 @@ (module (type $0 (func)) (import "env" "memory" (memory $0 256)) + (data (get_global $memoryBase) "hello, world!") (import "env" "table" (table 0 anyfunc)) + (elem (get_global $tableBase) $waka) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) - (elem (get_global $tableBase) $waka) - (data (get_global $memoryBase) "hello, world!") (func $waka (; 0 ;) (type $0) (nop) ) diff --git a/test/passes/safe-heap.txt b/test/passes/safe-heap.txt index 74920cc7f..4e0fe6f43 100644 --- a/test/passes/safe-heap.txt +++ b/test/passes/safe-heap.txt @@ -1,10 +1,10 @@ (module (type $0 (func)) (type $FUNCSIG$v (func)) + (memory $0 (shared 100 100)) (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR i32)) (import "env" "segfault" (func $segfault)) (import "env" "alignfault" (func $alignfault)) - (memory $0 (shared 100 100)) (func $loads (; 2 ;) (type $0) (drop (call $SAFE_HEAP_LOAD_i32_4_U_4 @@ -4183,10 +4183,10 @@ (module (type $0 (func)) (type $FUNCSIG$v (func)) + (memory $0 100 100) (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR i32)) (import "env" "segfault" (func $segfault)) (import "env" "alignfault" (func $alignfault)) - (memory $0 100 100) (func $loads (; 2 ;) (type $0) (drop (call $SAFE_HEAP_LOAD_i32_4_U_4 @@ -6945,10 +6945,10 @@ ) (module (type $FUNCSIG$v (func)) + (memory $0 (shared 100 100)) (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR i32)) (import "env" "segfault" (func $segfault)) (import "env" "alignfault" (func $alignfault)) - (memory $0 (shared 100 100)) (func $actions (; 2 ;) (type $FUNCSIG$v) (drop (call $SAFE_HEAP_LOAD_i32_4_U_4 diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt index 2e380049f..d170315de 100644 --- a/test/passes/simplify-locals.txt +++ b/test/passes/simplify-locals.txt @@ -10,12 +10,12 @@ (type $8 (func (param i32 i32))) (type $9 (func (param i32 i32 i32) (result i32))) (type $10 (func (param i64))) + (memory $0 256 256) (import "env" "waka" (func $waka)) (import "env" "waka_int" (func $waka_int (result i32))) (import "env" "i64sub" (func $_i64Subtract (param i32 i32 i32 i32) (result i32))) (import "env" "moddi" (func $___udivmoddi4 (param i32 i32 i32 i32 i32) (result i32))) (import "env" "lp" (func $lp (param i32 i32) (result i32))) - (memory $0 256 256) (func $contrast (; 5 ;) (type $FUNCSIG$v) (local $x i32) (local $y i32) diff --git a/test/passes/spill-pointers.txt b/test/passes/spill-pointers.txt index 30febbec6..d8c8d96f4 100644 --- a/test/passes/spill-pointers.txt +++ b/test/passes/spill-pointers.txt @@ -5,11 +5,11 @@ (type $3 (func (result i32))) (type $4 (func (param i32) (result i32))) (type $5 (func (param f64))) + (memory $0 10) + (table 1 1 anyfunc) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) (import "env" "segfault" (func $segfault (param i32))) (global $stack_ptr (mut i32) (get_global $STACKTOP$asm2wasm$import)) - (table 1 1 anyfunc) - (memory $0 10) (func $nothing (; 1 ;) (type $2) (nop) ) diff --git a/test/passes/spill-pointers.wast b/test/passes/spill-pointers.wast index c9bccd3b5..ca7f12518 100644 --- a/test/passes/spill-pointers.wast +++ b/test/passes/spill-pointers.wast @@ -159,7 +159,7 @@ ) (func $spill-call_import (local $x i32) - (call_import $segfault + (call $segfault (i32.const 200) ) (drop (get_local $x)) diff --git a/test/passes/ssa_fuzz-exec.txt b/test/passes/ssa_fuzz-exec.txt index ad5724351..6c00c81a9 100644 --- a/test/passes/ssa_fuzz-exec.txt +++ b/test/passes/ssa_fuzz-exec.txt @@ -3,8 +3,8 @@ (module (type $0 (func (result i32))) (type $1 (func)) - (table 0 0 anyfunc) (memory $0 (shared 1 1)) + (table 0 0 anyfunc) (export "func_0" (func $0)) (func $0 (; 0 ;) (type $0) (result i32) (local $var$0 i32) diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt index 7edb06934..618096286 100644 --- a/test/passes/translate-to-fuzz.txt +++ b/test/passes/translate-to-fuzz.txt @@ -2,15 +2,15 @@ (type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$ifj (func (param f32 i64) (result i32))) + (memory $0 (shared 1 1)) + (data (i32.const 0) "n\00\05E\00\00\00\00") + (table 4 anyfunc) + (elem (i32.const 0) $func_2 $func_4 $func_5 $func_8) (global $global$0 (mut f32) (f32.const 536870912)) (global $global$1 (mut f32) (f32.const 2147483648)) (global $global$2 (mut f64) (f64.const -1048576)) (global $global$3 (mut f64) (f64.const 23643)) (global $hangLimit (mut i32) (i32.const 10)) - (table 4 anyfunc) - (elem (i32.const 0) $func_2 $func_4 $func_5 $func_8) - (memory $0 (shared 1 1)) - (data (i32.const 0) "n\00\05E\00\00\00\00") (export "func_0" (func $func_0)) (export "func_2_invoker" (func $func_2_invoker)) (export "func_4" (func $func_4)) diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt index d3b972129..85c4625bc 100644 --- a/test/passes/vacuum.txt +++ b/test/passes/vacuum.txt @@ -6,9 +6,9 @@ (type $4 (func (param i32 f64 i32 i32))) (type $FUNCSIG$i (func (result i32))) (type $6 (func (result f64))) + (memory $0 256 256) (import "env" "int" (func $int (result i32))) (global $Int i32 (i32.const 0)) - (memory $0 256 256) (func $b (; 1 ;) (type $0) (nop) ) diff --git a/test/reduce/memory_table.wast.txt b/test/reduce/memory_table.wast.txt index a44e5b81e..cb1d9d6bc 100644 --- a/test/reduce/memory_table.wast.txt +++ b/test/reduce/memory_table.wast.txt @@ -1,9 +1,9 @@ (module (type $0 (func (result i32))) (type $1 (func)) + (memory $0 256 256) (table 481 481 anyfunc) (elem (i32.const 0) $0 $0 $0 $2) - (memory $0 256 256) (export "f1" (func $1)) (export "f2" (func $2)) (export "f4" (func $3)) diff --git a/test/table-import.wast.from-wast b/test/table-import.wast.from-wast index 2c9ee3ea1..19483094a 100644 --- a/test/table-import.wast.from-wast +++ b/test/table-import.wast.from-wast @@ -1,8 +1,8 @@ (module (type $0 (func)) + (memory $0 0) (import "env" "table" (table 1 1 anyfunc)) (elem (i32.const 0) $foo) - (memory $0 0) (func $foo (; 0 ;) (type $0) (nop) ) diff --git a/test/table-import.wast.fromBinary b/test/table-import.wast.fromBinary index a8ffec5c7..45b74a109 100644 --- a/test/table-import.wast.fromBinary +++ b/test/table-import.wast.fromBinary @@ -1,8 +1,8 @@ (module (type $0 (func)) + (memory $0 0) (import "env" "table" (table 1 1 anyfunc)) (elem (i32.const 0) $foo) - (memory $0 0) (func $foo (; 0 ;) (type $0) (nop) ) diff --git a/test/table-import.wast.fromBinary.noDebugInfo b/test/table-import.wast.fromBinary.noDebugInfo index 5750f845b..40159e6a3 100644 --- a/test/table-import.wast.fromBinary.noDebugInfo +++ b/test/table-import.wast.fromBinary.noDebugInfo @@ -1,8 +1,8 @@ (module (type $0 (func)) + (memory $0 0) (import "env" "table" (table 1 1 anyfunc)) (elem (i32.const 0) $0) - (memory $0 0) (func $0 (; 0 ;) (type $0) (nop) ) diff --git a/test/threads.fromasm b/test/threads.fromasm index 2c1059dcc..47112c8f5 100644 --- a/test/threads.fromasm +++ b/test/threads.fromasm @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory (shared 256 256))) (data (get_global $memoryBase) "threads.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "test" (func $test)) (func $test (; 0 ;) (; has Stack IR ;) (local $0 i32) diff --git a/test/threads.fromasm.clamp b/test/threads.fromasm.clamp index 2c1059dcc..47112c8f5 100644 --- a/test/threads.fromasm.clamp +++ b/test/threads.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory (shared 256 256))) (data (get_global $memoryBase) "threads.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "test" (func $test)) (func $test (; 0 ;) (; has Stack IR ;) (local $0 i32) diff --git a/test/threads.fromasm.clamp.no-opts b/test/threads.fromasm.clamp.no-opts index dc353d039..630617846 100644 --- a/test/threads.fromasm.clamp.no-opts +++ b/test/threads.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/threads.fromasm.imprecise b/test/threads.fromasm.imprecise index a35be0f7d..66c558ffe 100644 --- a/test/threads.fromasm.imprecise +++ b/test/threads.fromasm.imprecise @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (export "test" (func $test)) (func $test (; 0 ;) (; has Stack IR ;) (local $0 i32) diff --git a/test/threads.fromasm.imprecise.no-opts b/test/threads.fromasm.imprecise.no-opts index dc353d039..630617846 100644 --- a/test/threads.fromasm.imprecise.no-opts +++ b/test/threads.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/threads.fromasm.no-opts b/test/threads.fromasm.no-opts index dc353d039..630617846 100644 --- a/test/threads.fromasm.no-opts +++ b/test/threads.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/threads.wasm-only.fromasm b/test/threads.wasm-only.fromasm index 4a692c18c..37316cc00 100644 --- a/test/threads.wasm-only.fromasm +++ b/test/threads.wasm-only.fromasm @@ -1,8 +1,8 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) + (data (get_global $memoryBase) "threads.wasm-only.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (global $tempRet0 (mut i32) (i32.const 0)) - (data (get_global $memoryBase) "threads.wasm-only.asm.js") (export "test64" (func $legalstub$test64)) (export "getTempRet0" (func $getTempRet0)) (export "setTempRet0" (func $setTempRet0)) diff --git a/test/threads.wasm-only.fromasm.clamp b/test/threads.wasm-only.fromasm.clamp index 4a692c18c..37316cc00 100644 --- a/test/threads.wasm-only.fromasm.clamp +++ b/test/threads.wasm-only.fromasm.clamp @@ -1,8 +1,8 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) + (data (get_global $memoryBase) "threads.wasm-only.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (global $tempRet0 (mut i32) (i32.const 0)) - (data (get_global $memoryBase) "threads.wasm-only.asm.js") (export "test64" (func $legalstub$test64)) (export "getTempRet0" (func $getTempRet0)) (export "setTempRet0" (func $setTempRet0)) diff --git a/test/threads.wasm-only.fromasm.clamp.no-opts b/test/threads.wasm-only.fromasm.clamp.no-opts index 971d690f4..38ce629eb 100644 --- a/test/threads.wasm-only.fromasm.clamp.no-opts +++ b/test/threads.wasm-only.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/threads.wasm-only.fromasm.imprecise b/test/threads.wasm-only.fromasm.imprecise index 446dc7f7a..b4457c51f 100644 --- a/test/threads.wasm-only.fromasm.imprecise +++ b/test/threads.wasm-only.fromasm.imprecise @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (global $tempRet0 (mut i32) (i32.const 0)) (export "test64" (func $legalstub$test64)) (export "getTempRet0" (func $getTempRet0)) diff --git a/test/threads.wasm-only.fromasm.imprecise.no-opts b/test/threads.wasm-only.fromasm.imprecise.no-opts index 971d690f4..38ce629eb 100644 --- a/test/threads.wasm-only.fromasm.imprecise.no-opts +++ b/test/threads.wasm-only.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/threads.wasm-only.fromasm.no-opts b/test/threads.wasm-only.fromasm.no-opts index 971d690f4..38ce629eb 100644 --- a/test/threads.wasm-only.fromasm.no-opts +++ b/test/threads.wasm-only.fromasm.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 (shared 256 256))) + (import "env" "memory" (memory $memory (shared 256 256))) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/two_sides.fromasm b/test/two_sides.fromasm index af5ff5386..0a60da254 100644 --- a/test/two_sides.fromasm +++ b/test/two_sides.fromasm @@ -1,9 +1,9 @@ (module (type $FUNCSIG$id (func (param f64) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "two_sides.asm.js") (import "env" "memoryBase" (global $memoryBase i32)) (import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32))) - (data (get_global $memoryBase) "two_sides.asm.js") (export "_test" (func $_test)) (func $_test (; 1 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 f64) diff --git a/test/two_sides.fromasm.clamp b/test/two_sides.fromasm.clamp index c21a6b868..86143eeba 100644 --- a/test/two_sides.fromasm.clamp +++ b/test/two_sides.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "two_sides.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "_test" (func $_test)) (func $f64-to-int (; 0 ;) (; has Stack IR ;) (param $0 f64) (result i32) (if (result i32) diff --git a/test/two_sides.fromasm.clamp.no-opts b/test/two_sides.fromasm.clamp.no-opts index ca9c34386..1a53ba025 100644 --- a/test/two_sides.fromasm.clamp.no-opts +++ b/test/two_sides.fromasm.clamp.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/two_sides.fromasm.imprecise.no-opts b/test/two_sides.fromasm.imprecise.no-opts index 40a5f6a95..ebae808bb 100644 --- a/test/two_sides.fromasm.imprecise.no-opts +++ b/test/two_sides.fromasm.imprecise.no-opts @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/two_sides.fromasm.no-opts b/test/two_sides.fromasm.no-opts index 9def57a12..62a29ac00 100644 --- a/test/two_sides.fromasm.no-opts +++ b/test/two_sides.fromasm.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$id (func (param f64) (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/unit.fromasm b/test/unit.fromasm index 858ed8268..5f2f516c7 100644 --- a/test/unit.fromasm +++ b/test/unit.fromasm @@ -8,8 +8,10 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "unit.asm.js") (import "env" "table" (table 25 25 anyfunc)) + (elem (get_global $tableBase) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "gb" (global $n$asm2wasm$import i32)) @@ -25,8 +27,6 @@ (global $Double (mut f64) (f64.const 0)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $exportedNumber i32 (i32.const 42)) - (elem (get_global $tableBase) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) - (data (get_global $memoryBase) "unit.asm.js") (export "big_negative" (func $big_negative)) (export "pick" (func $big_negative)) (export "doubleCompares" (func $doubleCompares)) diff --git a/test/unit.fromasm.clamp b/test/unit.fromasm.clamp index 2a759ff01..48c27a6d4 100644 --- a/test/unit.fromasm.clamp +++ b/test/unit.fromasm.clamp @@ -7,8 +7,10 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "unit.asm.js") (import "env" "table" (table 25 25 anyfunc)) + (elem (get_global $tableBase) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "gb" (global $n$asm2wasm$import i32)) @@ -23,8 +25,6 @@ (global $Double (mut f64) (f64.const 0)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $exportedNumber i32 (i32.const 42)) - (elem (get_global $tableBase) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) - (data (get_global $memoryBase) "unit.asm.js") (export "big_negative" (func $big_negative)) (export "pick" (func $big_negative)) (export "doubleCompares" (func $doubleCompares)) diff --git a/test/unit.fromasm.clamp.no-opts b/test/unit.fromasm.clamp.no-opts index 76e27ee2f..be13fb2ac 100644 --- a/test/unit.fromasm.clamp.no-opts +++ b/test/unit.fromasm.clamp.no-opts @@ -7,8 +7,9 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 25 25 anyfunc)) + (elem (get_global $tableBase) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "global" "NaN" (global $t$asm2wasm$import f64)) @@ -31,7 +32,6 @@ (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $exportedNumber i32 (i32.const 42)) - (elem (get_global $tableBase) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (export "big_negative" (func $big_negative)) (export "pick" (func $exportMe)) (export "doubleCompares" (func $doubleCompares)) diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index d9854f9d6..26a96c5cc 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -7,8 +7,9 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 25 25 anyfunc)) + (elem (get_global $tableBase) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "tableBase" (global $tableBase i32)) (import "env" "gb" (global $n$asm2wasm$import i32)) (import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32))) @@ -22,7 +23,6 @@ (global $Double (mut f64) (f64.const 0)) (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $exportedNumber i32 (i32.const 42)) - (elem (get_global $tableBase) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (export "big_negative" (func $big_negative)) (export "pick" (func $big_negative)) (export "doubleCompares" (func $doubleCompares)) diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts index bb0ffb996..391e4a852 100644 --- a/test/unit.fromasm.imprecise.no-opts +++ b/test/unit.fromasm.imprecise.no-opts @@ -7,8 +7,9 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 25 25 anyfunc)) + (elem (get_global $tableBase) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "global" "NaN" (global $t$asm2wasm$import f64)) @@ -31,7 +32,6 @@ (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $exportedNumber i32 (i32.const 42)) - (elem (get_global $tableBase) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (export "big_negative" (func $big_negative)) (export "pick" (func $exportMe)) (export "doubleCompares" (func $doubleCompares)) diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts index 07bada359..1b403e258 100644 --- a/test/unit.fromasm.no-opts +++ b/test/unit.fromasm.no-opts @@ -8,8 +8,9 @@ (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$i (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 25 25 anyfunc)) + (elem (get_global $tableBase) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "global" "NaN" (global $t$asm2wasm$import f64)) @@ -33,7 +34,6 @@ (global $n (mut i32) (get_global $n$asm2wasm$import)) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $exportedNumber i32 (i32.const 42)) - (elem (get_global $tableBase) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) (export "big_negative" (func $big_negative)) (export "pick" (func $exportMe)) (export "doubleCompares" (func $doubleCompares)) diff --git a/test/unit.wast.from-wast b/test/unit.wast.from-wast index 2ae39e64b..01cf56c26 100644 --- a/test/unit.wast.from-wast +++ b/test/unit.wast.from-wast @@ -9,13 +9,13 @@ (type $7 (func (param f64) (result f64))) (type $8 (func (result i64))) (type $9 (func (param i32 i64))) + (memory $0 4096 4096) + (data (i32.const 1026) "\14\00") + (table 10 anyfunc) + (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (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))) - (table 10 anyfunc) - (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (export "big_negative" (func $big_negative)) (func $big_negative (; 3 ;) (type $FUNCSIG$v) (local $temp f64) diff --git a/test/unit.wast.fromBinary b/test/unit.wast.fromBinary index cbd81cc81..c5f0f3009 100644 --- a/test/unit.wast.fromBinary +++ b/test/unit.wast.fromBinary @@ -9,13 +9,13 @@ (type $7 (func (param f64) (result f64))) (type $8 (func (result i64))) (type $9 (func (param i32 i64))) + (memory $0 4096 4096) + (data (i32.const 1026) "\14\00") + (table 10 anyfunc) + (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) (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))) - (table 10 anyfunc) - (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg) - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (export "big_negative" (func $big_negative)) (func $big_negative (; 3 ;) (type $1) (local $0 f64) diff --git a/test/unit.wast.fromBinary.noDebugInfo b/test/unit.wast.fromBinary.noDebugInfo index c9f71dc1c..649eb39c9 100644 --- a/test/unit.wast.fromBinary.noDebugInfo +++ b/test/unit.wast.fromBinary.noDebugInfo @@ -9,13 +9,13 @@ (type $7 (func (param f64) (result f64))) (type $8 (func (result i64))) (type $9 (func (param i32 i64))) + (memory $0 4096 4096) + (data (i32.const 1026) "\14\00") + (table 10 anyfunc) + (elem (i32.const 0) $17 $0 $17 $17 $18 $18 $1 $18 $17 $15) (import "env" "_emscripten_asm_const_vi" (func $fimport$0)) (import "asm2wasm" "f64-to-int" (func $fimport$1 (param f64) (result i32))) (import "asm2wasm" "f64-rem" (func $fimport$2 (param f64 f64) (result f64))) - (table 10 anyfunc) - (elem (i32.const 0) $17 $0 $17 $17 $18 $18 $1 $18 $17 $15) - (memory $0 4096 4096) - (data (i32.const 1026) "\14\00") (export "big_negative" (func $0)) (func $0 (; 3 ;) (type $1) (local $0 f64) diff --git a/test/unreachable-import_wasm-only.fromasm b/test/unreachable-import_wasm-only.fromasm index ab59d9b8b..659768b48 100644 --- a/test/unreachable-import_wasm-only.fromasm +++ b/test/unreachable-import_wasm-only.fromasm @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "unreachable-import_wasm-only.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "__ZN10WasmAssertC2Ev__async_cb" (func $__ZN10WasmAssertC2Ev__async_cb)) (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (; has Stack IR ;) (param $0 i32) (i32.store diff --git a/test/unreachable-import_wasm-only.fromasm.clamp b/test/unreachable-import_wasm-only.fromasm.clamp index ab59d9b8b..659768b48 100644 --- a/test/unreachable-import_wasm-only.fromasm.clamp +++ b/test/unreachable-import_wasm-only.fromasm.clamp @@ -1,7 +1,7 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "unreachable-import_wasm-only.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) (export "__ZN10WasmAssertC2Ev__async_cb" (func $__ZN10WasmAssertC2Ev__async_cb)) (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (; has Stack IR ;) (param $0 i32) (i32.store diff --git a/test/unreachable-import_wasm-only.fromasm.clamp.no-opts b/test/unreachable-import_wasm-only.fromasm.clamp.no-opts index 763eaebde..707a65eb3 100644 --- a/test/unreachable-import_wasm-only.fromasm.clamp.no-opts +++ b/test/unreachable-import_wasm-only.fromasm.clamp.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/unreachable-import_wasm-only.fromasm.imprecise b/test/unreachable-import_wasm-only.fromasm.imprecise index 1f079f7c1..27b05f2f1 100644 --- a/test/unreachable-import_wasm-only.fromasm.imprecise +++ b/test/unreachable-import_wasm-only.fromasm.imprecise @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (export "__ZN10WasmAssertC2Ev__async_cb" (func $__ZN10WasmAssertC2Ev__async_cb)) (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (; has Stack IR ;) (param $0 i32) (i32.store diff --git a/test/unreachable-import_wasm-only.fromasm.imprecise.no-opts b/test/unreachable-import_wasm-only.fromasm.imprecise.no-opts index 763eaebde..707a65eb3 100644 --- a/test/unreachable-import_wasm-only.fromasm.imprecise.no-opts +++ b/test/unreachable-import_wasm-only.fromasm.imprecise.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/unreachable-import_wasm-only.fromasm.no-opts b/test/unreachable-import_wasm-only.fromasm.no-opts index 763eaebde..707a65eb3 100644 --- a/test/unreachable-import_wasm-only.fromasm.no-opts +++ b/test/unreachable-import_wasm-only.fromasm.no-opts @@ -1,7 +1,7 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/use-import-and-drop.fromasm b/test/use-import-and-drop.fromasm index 52de22895..14c3ff06e 100644 --- a/test/use-import-and-drop.fromasm +++ b/test/use-import-and-drop.fromasm @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "use-import-and-drop.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) ) diff --git a/test/use-import-and-drop.fromasm.clamp b/test/use-import-and-drop.fromasm.clamp index 52de22895..14c3ff06e 100644 --- a/test/use-import-and-drop.fromasm.clamp +++ b/test/use-import-and-drop.fromasm.clamp @@ -1,5 +1,5 @@ (module - (import "env" "memory" (memory $0 256 256)) - (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "memory" (memory $memory 256 256)) (data (get_global $memoryBase) "use-import-and-drop.asm.js") + (import "env" "memoryBase" (global $memoryBase i32)) ) diff --git a/test/use-import-and-drop.fromasm.clamp.no-opts b/test/use-import-and-drop.fromasm.clamp.no-opts index 90d0cc9f1..50b56a83e 100644 --- a/test/use-import-and-drop.fromasm.clamp.no-opts +++ b/test/use-import-and-drop.fromasm.clamp.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$vi (func (param i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/use-import-and-drop.fromasm.imprecise.no-opts b/test/use-import-and-drop.fromasm.imprecise.no-opts index 90d0cc9f1..50b56a83e 100644 --- a/test/use-import-and-drop.fromasm.imprecise.no-opts +++ b/test/use-import-and-drop.fromasm.imprecise.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$vi (func (param i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/use-import-and-drop.fromasm.no-opts b/test/use-import-and-drop.fromasm.no-opts index 90d0cc9f1..50b56a83e 100644 --- a/test/use-import-and-drop.fromasm.no-opts +++ b/test/use-import-and-drop.fromasm.no-opts @@ -1,6 +1,6 @@ (module (type $FUNCSIG$vi (func (param i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 0 0 anyfunc)) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index f64f13f59..59033b98d 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -2,8 +2,10 @@ (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) (type $legaltype$_fabsf (func (param f64) (result f64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "wasm-only.asm.js") (import "env" "table" (table 3 3 anyfunc)) + (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) @@ -11,8 +13,6 @@ (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) - (data (get_global $memoryBase) "wasm-only.asm.js") (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) diff --git a/test/wasm-only.fromasm.clamp b/test/wasm-only.fromasm.clamp index f64f13f59..59033b98d 100644 --- a/test/wasm-only.fromasm.clamp +++ b/test/wasm-only.fromasm.clamp @@ -2,8 +2,10 @@ (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) (type $legaltype$_fabsf (func (param f64) (result f64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) + (data (get_global $memoryBase) "wasm-only.asm.js") (import "env" "table" (table 3 3 anyfunc)) + (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) @@ -11,8 +13,6 @@ (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) - (data (get_global $memoryBase) "wasm-only.asm.js") (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) diff --git a/test/wasm-only.fromasm.clamp.no-opts b/test/wasm-only.fromasm.clamp.no-opts index 786bef708..038aedb92 100644 --- a/test/wasm-only.fromasm.clamp.no-opts +++ b/test/wasm-only.fromasm.clamp.no-opts @@ -7,8 +7,9 @@ (type $legaltype$illegalImportResult (func (result i32))) (type $legaltype$_fabsf (func (param f64) (result f64))) (type $legaltype$do_i64 (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 3 3 anyfunc)) + (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -19,7 +20,6 @@ (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise index e9522a7c3..a9e7688de 100644 --- a/test/wasm-only.fromasm.imprecise +++ b/test/wasm-only.fromasm.imprecise @@ -2,15 +2,15 @@ (type $legaltype$illegalImport (func (param f64 i32 i32 i32))) (type $legaltype$illegalImportResult (func (result i32))) (type $legaltype$_fabsf (func (param f64) (result f64))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 3 3 anyfunc)) + (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (import "env" "tableBase" (global $tableBase i32)) (import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32))) (import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32))) (import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64))) (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) diff --git a/test/wasm-only.fromasm.imprecise.no-opts b/test/wasm-only.fromasm.imprecise.no-opts index 484a69fa6..66cb9e070 100644 --- a/test/wasm-only.fromasm.imprecise.no-opts +++ b/test/wasm-only.fromasm.imprecise.no-opts @@ -7,8 +7,9 @@ (type $legaltype$illegalImportResult (func (result i32))) (type $legaltype$_fabsf (func (param f64) (result f64))) (type $legaltype$do_i64 (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 3 3 anyfunc)) + (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -19,7 +20,6 @@ (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) diff --git a/test/wasm-only.fromasm.no-opts b/test/wasm-only.fromasm.no-opts index 786bef708..038aedb92 100644 --- a/test/wasm-only.fromasm.no-opts +++ b/test/wasm-only.fromasm.no-opts @@ -7,8 +7,9 @@ (type $legaltype$illegalImportResult (func (result i32))) (type $legaltype$_fabsf (func (param f64) (result f64))) (type $legaltype$do_i64 (func (result i32))) - (import "env" "memory" (memory $0 256 256)) + (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table 3 3 anyfunc)) + (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (import "env" "STACKTOP" (global $STACKTOP$asm2wasm$import i32)) @@ -19,7 +20,6 @@ (import "env" "do_i64" (func $legalimport$do_i64 (result i32))) (global $STACKTOP (mut i32) (get_global $STACKTOP$asm2wasm$import)) (global $tempRet0 (mut i32) (i32.const 0)) - (elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$illegalResult)) |