Index: test/mjsunit/div-mul-minus-one.js |
diff --git a/test/mjsunit/regress/regress-2132.js b/test/mjsunit/div-mul-minus-one.js |
similarity index 79% |
copy from test/mjsunit/regress/regress-2132.js |
copy to test/mjsunit/div-mul-minus-one.js |
index 9eb2dc5b073e6e3c2ce46362903d07d727de3d27..f05bf0f54c68faf8f5e5cb5f35d7a8dcbc3fb02f 100644 |
--- a/test/mjsunit/regress/regress-2132.js |
+++ b/test/mjsunit/div-mul-minus-one.js |
@@ -27,22 +27,27 @@ |
// Flags: --allow-natives-syntax |
-function mul(x, y) { |
- return (x * y) | 0; |
+function div(g) { |
+ return (g/-1) ^ 1 |
} |
-mul(0, 0); |
-mul(0, 0); |
-%OptimizeFunctionOnNextCall(mul); |
-assertEquals(0, mul(0, -1)); |
-assertOptimized(mul); |
+var kMinInt = 1 << 31; |
+var expected_MinInt = div(kMinInt); |
+var expected_minus_zero = div(0); |
+%OptimizeFunctionOnNextCall(div); |
+assertEquals(expected_MinInt, div(kMinInt)); |
+assertOptimized(div); |
+assertEquals(expected_minus_zero , div(0)); |
+assertOptimized(div); |
-function div(x, y) { |
- return (x / y) | 0; |
+function mul(g) { |
+ return (g * -1) ^ 1 |
} |
-div(4, 2); |
-div(4, 2); |
-%OptimizeFunctionOnNextCall(div); |
-assertEquals(1, div(5, 3)); |
-assertOptimized(div); |
+expected_MinInt = mul(kMinInt); |
+expected_minus_zero = mul(0); |
+%OptimizeFunctionOnNextCall(mul); |
+assertEquals(expected_MinInt, mul(kMinInt)); |
+assertOptimized(mul); |
+assertEquals(expected_minus_zero , mul(0)); |
+assertOptimized(mul); |