Index: test/mjsunit/regress/regress-convert-hole.js |
diff --git a/test/mjsunit/regress/regress-2671-1.js b/test/mjsunit/regress/regress-convert-hole.js |
similarity index 83% |
copy from test/mjsunit/regress/regress-2671-1.js |
copy to test/mjsunit/regress/regress-convert-hole.js |
index 042a501e5adb86cd7d868ec721edef8edde27274..14242219262e5aaa5f9591ecc7a36d3bfbdae451 100644 |
--- a/test/mjsunit/regress/regress-2671-1.js |
+++ b/test/mjsunit/regress/regress-convert-hole.js |
@@ -27,19 +27,26 @@ |
// Flags: --allow-natives-syntax |
-var y; |
-function f() { |
- var a = []; |
- a[20] = 0; |
- y = 3; |
- var i = 7 * (y + -0); |
- a[i]++; |
- assertTrue(isNaN(a[i])); |
+function f(test, test2, a, i) { |
+ var o = [0.5,1,,3]; |
+ var d; |
+ if (test) { |
+ d = 1.5; |
+ } else { |
+ d = o[i]; |
+ } |
+ if (test2) { |
+ d += 1; |
+ } |
+ a[i] = d; |
+ return d; |
} |
-f(); |
-f(); |
-f(); |
+var a = [0, 0, 0, {}]; |
+f(true, false, a, 0); |
+f(true, true, a, 0); |
+f(false, false, a, 1); |
+f(false, true, a, 1); |
%OptimizeFunctionOnNextCall(f); |
-f(); |
- |
+f(false, false, a, 2); |
+assertEquals(undefined, a[2]); |