Index: test/mjsunit/shift-for-integer-div.js |
diff --git a/test/mjsunit/shift-for-integer-div.js b/test/mjsunit/shift-for-integer-div.js |
index aaa67e97fe21ea4dffe94c38cea96794f4eb4a12..884202d3133893894a8283e6e9c1eb4f2c4e37e3 100644 |
--- a/test/mjsunit/shift-for-integer-div.js |
+++ b/test/mjsunit/shift-for-integer-div.js |
@@ -60,7 +60,7 @@ divn1(2); |
divn1(2); |
%OptimizeFunctionOnNextCall(divn1); |
assertEquals(-2, divn1(2)); |
-assertEquals(two_31, divn1(-two_31)); |
+assertEquals(-two_31, divn1(two_31)); |
//Check for truncating to int32 case |
@@ -85,3 +85,14 @@ divn4t(8); |
assertEquals(1, divn4t(-5)); |
assertEquals(-1, divn4t(5)); |
assertOptimized(divn4t); |
+ |
+// Check kMinInt case. |
+function div_by_two(x) { |
+ return (x / 2) | 0; |
+} |
+ |
+div_by_two(12); |
+div_by_two(34); |
+%OptimizeFunctionOnNextCall(div_by_two); |
+div_by_two(56); |
+assertEquals(-(1 << 30), div_by_two(1 << 31)); |