Index: test/mjsunit/wasm/asm-wasm.js |
diff --git a/test/mjsunit/wasm/asm-wasm.js b/test/mjsunit/wasm/asm-wasm.js |
index 91766eca5343143a00de9db31662a3a770be1c77..3f936f5f211db0fcc7a14d2b033a83f66969316a 100644 |
--- a/test/mjsunit/wasm/asm-wasm.js |
+++ b/test/mjsunit/wasm/asm-wasm.js |
@@ -1313,3 +1313,40 @@ TestForeignVariables(); |
var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
assertEquals(1, m.func()); |
})(); |
+ |
+ |
+(function TestIntishAssignment() { |
+ function Module(stdlib, foreign, heap) { |
+ "use asm"; |
+ var HEAP32 = new stdlib.Int32Array(heap); |
+ function func() { |
+ var a = 1; |
+ var b = 2; |
+ HEAP32[0] = a + b; |
+ return HEAP32[0] | 0; |
+ } |
+ return {func: func}; |
+ } |
+ |
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
+ assertEquals(3, m.func()); |
+})(); |
+ |
+ |
+(function TestFloatishAssignment() { |
+ function Module(stdlib, foreign, heap) { |
+ "use asm"; |
+ var HEAPF32 = new stdlib.Float32Array(heap); |
+ var fround = stdlib.Math.fround; |
+ function func() { |
+ var a = fround(1.0); |
+ var b = fround(2.0); |
+ HEAPF32[0] = a + b; |
+ return +HEAPF32[0]; |
+ } |
+ return {func: func}; |
+ } |
+ |
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
+ assertEquals(3, m.func()); |
+}) // TODO(bradnelson): Enable when Math.fround implementation lands. |