Index: test/mjsunit/regress/regress-compare-constant-doubles.js |
diff --git a/test/mjsunit/constant-compare-nil-value.js b/test/mjsunit/regress/regress-compare-constant-doubles.js |
similarity index 78% |
copy from test/mjsunit/constant-compare-nil-value.js |
copy to test/mjsunit/regress/regress-compare-constant-doubles.js |
index 9f5b2adb063abc0c7920d8dee30edb7ee6eb1ff9..0f8ffe307d154178993da4db370c7201552504a7 100644 |
--- a/test/mjsunit/constant-compare-nil-value.js |
+++ b/test/mjsunit/regress/regress-compare-constant-doubles.js |
@@ -27,16 +27,32 @@ |
// Flags: --allow-natives-syntax |
-function inlined() { |
- return 1; |
-} |
+var left = 1.5; |
+var right; |
+ |
+var keepalive; |
function foo() { |
- if ((inlined() + 0.5) == null) return "null"; |
- return "non-null"; |
+ // Fill XMM registers with cruft. |
+ var a1 = Math.sin(1) + 10; |
+ var a2 = a1 + 1; |
+ var a3 = a2 + 1; |
+ var a4 = a3 + 1; |
+ var a5 = a4 + 1; |
+ var a6 = a5 + 1; |
+ keepalive = [a1, a2, a3, a4, a5, a6]; |
+ |
+ // Actual test. |
+ if (left < right) return "ok"; |
+ return "bad"; |
+} |
+ |
+function prepare(base) { |
+ right = 0.5 * base; |
} |
-assertEquals("non-null", foo()); |
-assertEquals("non-null", foo()); |
+prepare(21); |
+assertEquals("ok", foo()); |
+assertEquals("ok", foo()); |
%OptimizeFunctionOnNextCall(foo); |
-assertEquals("non-null", foo()); |
+assertEquals("ok", foo()); |