Index: test/mjsunit/compiler/phi-representations.js |
diff --git a/test/mjsunit/regress/regress-crbug-245424.js b/test/mjsunit/compiler/phi-representations.js |
similarity index 77% |
copy from test/mjsunit/regress/regress-crbug-245424.js |
copy to test/mjsunit/compiler/phi-representations.js |
index 005c8baba9492dd339b4fbdc3b48f7577b9c308a..6d11bb0d8ea714daae5e5942b750fa9d3601439b 100644 |
--- a/test/mjsunit/regress/regress-crbug-245424.js |
+++ b/test/mjsunit/compiler/phi-representations.js |
@@ -27,15 +27,30 @@ |
// Flags: --allow-natives-syntax |
-function boom() { |
- var a = { |
- foo: "bar", |
- foo: "baz" |
+function ar() { |
+ var r = undefined; |
+ var f = 1; |
+ while (f--) { |
+ r = (typeof r === 'undefined') ? 0.1 : r; |
}; |
- return a; |
+ return (r - r); |
} |
-assertEquals("baz", boom().foo); |
-assertEquals("baz", boom().foo); |
-%OptimizeFunctionOnNextCall(boom); |
-assertEquals("baz", boom().foo); |
+assertEquals(0, ar()); |
+assertEquals(0, ar()); |
+%OptimizeFunctionOnNextCall(ar); |
+assertEquals(0, ar()); |
+ |
+function ar2() { |
+ var r = undefined; |
+ var f = 1; |
+ while (f--) { |
+ r = r === undefined ? 0.1 : r; |
+ }; |
+ return (r - r); |
+} |
+ |
+assertEquals(0, ar2()); |
+assertEquals(0, ar2()); |
+%OptimizeFunctionOnNextCall(ar2); |
+assertEquals(0, ar2()); |