Index: test/mjsunit/math-floor-of-div.js |
diff --git a/test/mjsunit/math-floor-of-div.js b/test/mjsunit/math-floor-of-div.js |
index d528b85101baa7274d02a7de9e249cb248c40072..707f65714ed16b549c4cf0677d12b07600a6815a 100644 |
--- a/test/mjsunit/math-floor-of-div.js |
+++ b/test/mjsunit/math-floor-of-div.js |
@@ -286,3 +286,14 @@ test_div_deopt_div_by_zero_v(); |
test_div_deopt_minus_zero_v(); |
test_div_deopt_overflow_v(); |
test_div_deopt_div_by_zero_v(); |
+ |
+ |
+// Test for flooring division with negative dividend. |
+function flooring_div_by_3(y) { |
+ return Math.floor(y / 3); |
+} |
+ |
+assertEquals(-1, flooring_div_by_3(-2)); |
+assertEquals(-1, flooring_div_by_3(-2)); |
+%OptimizeFunctionOnNextCall(flooring_div_by_3); |
+assertEquals(-1, flooring_div_by_3(-2)); |