Index: test/mjsunit/lithium/DivI.js |
diff --git a/test/mjsunit/constant-compare-nil-value.js b/test/mjsunit/lithium/DivI.js |
similarity index 73% |
copy from test/mjsunit/constant-compare-nil-value.js |
copy to test/mjsunit/lithium/DivI.js |
index 9f5b2adb063abc0c7920d8dee30edb7ee6eb1ff9..5420d8c8d0ab0adc715683fd95f41a34e9373fc0 100644 |
--- a/test/mjsunit/constant-compare-nil-value.js |
+++ b/test/mjsunit/lithium/DivI.js |
@@ -25,18 +25,33 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Flags: --allow-natives-syntax --no-use-osr |
-function inlined() { |
- return 1; |
+function foo(a, b) { |
+ var result = a / 35; |
+ result += 50 / b; |
+ result += a / b; |
+ result += a / -1; |
+ result += a / 1; |
+ result += a / 4; |
+ result += a / -4; |
+ return result / b; |
} |
-function foo() { |
- if ((inlined() + 0.5) == null) return "null"; |
- return "non-null"; |
+foo(700, 5); |
+var r1 = foo(700, 5); |
+%OptimizeFunctionOnNextCall(foo); |
+var r2 = foo(700, 5); |
+ |
+assertEquals(r1, r2); |
+ |
+function boo(value) { |
+ return value / -1; |
} |
-assertEquals("non-null", foo()); |
-assertEquals("non-null", foo()); |
-%OptimizeFunctionOnNextCall(foo); |
-assertEquals("non-null", foo()); |
+// Test deoptimization of MinInt / -1. |
+assertEquals(2147483600, boo(-2147483600)); |
+assertEquals(2147483600, boo(-2147483600)); |
+%OptimizeFunctionOnNextCall(boo); |
+assertEquals(2147483600, boo(-2147483600)); |
+assertEquals(2147483648, boo(-2147483648)); |