Index: test/mjsunit/wasm/test-wasm-module-builder.js |
diff --git a/test/mjsunit/wasm/test-wasm-module-builder.js b/test/mjsunit/wasm/test-wasm-module-builder.js |
index e68e375f54fb66470122b6b56f61facf46779e4e..8103d7b9bad457a8d0fccca5d39dd56d71096878 100644 |
--- a/test/mjsunit/wasm/test-wasm-module-builder.js |
+++ b/test/mjsunit/wasm/test-wasm-module-builder.js |
@@ -138,3 +138,16 @@ var debug = false; |
var instance = Wasm.instantiateModule(array2); |
assertEquals(17, instance.exports.blarg()); |
})(); |
+ |
+(function ImportTestTwoLevel() { |
+ var module = new WasmModuleBuilder(); |
+ var index = module.addImportWithModule("mod", "print", [kAstStmt, kAstI32]); |
+ module.addFunction("foo", [kAstStmt]) |
+ .addBody([kExprCallImport, index, kExprI8Const, 19]) |
+ .exportAs("main"); |
+ |
+ var buffer = module.toBuffer(debug); |
+ var instance = Wasm.instantiateModule(buffer, {mod: {print: print}}); |
+ print("should print 19! "); |
+ instance.exports.main(); |
+})(); |