Index: test/mjsunit/regress/regress-2843.js |
diff --git a/test/mjsunit/regress/regress-2813.js b/test/mjsunit/regress/regress-2843.js |
similarity index 82% |
copy from test/mjsunit/regress/regress-2813.js |
copy to test/mjsunit/regress/regress-2843.js |
index 97ae43b316a2177596927cf5465fa2214cc11c61..5b28c2d7948ee5b71f2cc072aea326057f8156db 100644 |
--- a/test/mjsunit/regress/regress-2813.js |
+++ b/test/mjsunit/regress/regress-2843.js |
@@ -27,18 +27,19 @@ |
// Flags: --allow-natives-syntax |
-function foo(x) { |
+function bailout() { throw "bailout"; } |
+var global; |
+ |
+function foo(x, fun) { |
var a = x + 1; |
- var b = x + 2; |
- if (x != 0) { |
- if (x > 0 & x < 100) { |
- return a; |
- } |
- } |
- return 0; |
+ var b = x + 2; // Need another Simulate to fold the first one into. |
+ global = true; // Need a side effect to deopt to. |
+ fun(); |
+ return a; |
} |
-assertEquals(0, foo(0)); |
-assertEquals(0, foo(0)); |
+assertThrows("foo(1, bailout)"); |
+assertThrows("foo(1, bailout)"); |
%OptimizeFunctionOnNextCall(foo); |
-assertEquals(3, foo(2)); |
+assertThrows("foo(1, bailout)"); |
+assertEquals(2, foo(1, function() {})); |