Index: test/mjsunit/wasm/asm-wasm.js |
diff --git a/test/mjsunit/wasm/asm-wasm.js b/test/mjsunit/wasm/asm-wasm.js |
index 8a803cdcd4616982e15a82020199df9e03d1bcdf..adb37d1268a387410fa1b17582ceca2cbc0d826d 100644 |
--- a/test/mjsunit/wasm/asm-wasm.js |
+++ b/test/mjsunit/wasm/asm-wasm.js |
@@ -512,48 +512,42 @@ function TestModDoubleNegative() { |
assertEquals(28, WASM.asmCompileRun(TestModDoubleNegative.toString())); |
*/ |
-function TestGlobals() { |
+function TestNamedFunctions() { |
"use asm"; |
var a = 0.0; |
var b = 0.0; |
- var c = 0.0; |
function add() { |
- c = a + b; |
+ return +(a + b); |
} |
- function caller() { |
- a = 23.75; |
- b = 7.75; |
- add(); |
- return (~~c)|0; |
+ function init() { |
+ a = 43.25; |
+ b = 34.25; |
} |
- return {caller:caller}; |
+ return {init:init, |
+ add:add}; |
} |
-assertEquals(31, WASM.asmCompileRun(TestGlobals.toString())); |
+var module = WASM.instantiateModuleFromAsm(TestNamedFunctions.toString()); |
+module.init(); |
+assertEquals(77.5, module.add()); |
function TestGlobalsWithInit() { |
"use asm"; |
- var a = 0.0; |
- var b = 0.0; |
+ var a = 43.25; |
+ var b = 34.25; |
function add() { |
return +(a + b); |
} |
- function init() { |
- a = 43.25; |
- b = 34.25; |
- } |
- |
- return {init:init, |
- add:add}; |
+ return {add:add}; |
} |
var module = WASM.instantiateModuleFromAsm(TestGlobalsWithInit.toString()); |
-module.init(); |
+module.__init__(); |
assertEquals(77.5, module.add()); |