Index: test/mjsunit/wasm/asm-wasm.js |
diff --git a/test/mjsunit/wasm/asm-wasm.js b/test/mjsunit/wasm/asm-wasm.js |
index 165a55a8fa7b579c4638e943b2e15a790c831cb8..419fdf8a7658262fff89c211dab528107b77aba9 100644 |
--- a/test/mjsunit/wasm/asm-wasm.js |
+++ b/test/mjsunit/wasm/asm-wasm.js |
@@ -1472,3 +1472,54 @@ TestForeignVariables(); |
_WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
}); |
})(); |
+ |
+ |
+(function TestAndNegative() { |
+ function Module() { |
+ "use asm"; |
+ function func() { |
+ var x = 1; |
+ var y = 2; |
+ var z = 0; |
+ z = x + y & -1; |
+ return z | 0; |
+ } |
+ return {func: func}; |
+ } |
+ |
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
+ assertEquals(3, m.func()); |
+})(); |
+ |
+ |
+(function TestNegativeDouble() { |
+ function Module() { |
+ "use asm"; |
+ function func() { |
+ var x = -(34359738368.25); |
+ var y = -2.5; |
+ return +(x + y); |
+ } |
+ return {func: func}; |
+ } |
+ |
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
+ assertEquals(-34359738370.75, m.func()); |
+})(); |
+ |
+ |
+(function TestBadAndDouble() { |
+ function Module() { |
+ "use asm"; |
+ function func() { |
+ var x = 1.0; |
+ var y = 2.0; |
+ return (x & y) | 0; |
+ } |
+ return {func: func}; |
+ } |
+ |
+ assertThrows(function() { |
+ _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
+ }); |
+})(); |