Index: test/mjsunit/regress/post-increment-close-context.js |
diff --git a/test/mjsunit/compare-nil.js b/test/mjsunit/regress/post-increment-close-context.js |
similarity index 84% |
copy from test/mjsunit/compare-nil.js |
copy to test/mjsunit/regress/post-increment-close-context.js |
index 0895a31fb80cbe697b678eaa1005926d7d65829f..08ade10f1d80df022324eb77b7991ed130569d76 100644 |
--- a/test/mjsunit/compare-nil.js |
+++ b/test/mjsunit/regress/post-increment-close-context.js |
@@ -27,10 +27,16 @@ |
// Flags: --allow-natives-syntax |
-function test(v) { |
- return (v == null); |
+var foo = {bar: -2}; |
+function crash() { |
+ return !(foo.bar++); |
} |
-assertFalse(test(true)); |
-assertFalse(test(true)); |
-assertTrue(test(null)); |
-assertTrue(test(null)); |
+assertFalse(crash()); |
+assertEquals(-1, foo.bar); |
+%OptimizeFunctionOnNextCall(crash); |
+assertFalse(crash()); |
+assertEquals(0, foo.bar); |
+assertTrue(crash()); |
+assertEquals(1, foo.bar); |
+assertFalse(crash()); |
+assertEquals(2, foo.bar); |