Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: test/mjsunit/regress/regress-2537.js

Issue 12217136: Fix NegateCompareOp and InvertCompareOp (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/token.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-2537.js
diff --git a/test/mjsunit/regress/regress-171641.js b/test/mjsunit/regress/regress-2537.js
similarity index 81%
copy from test/mjsunit/regress/regress-171641.js
copy to test/mjsunit/regress/regress-2537.js
index 8db6781821325f8f6253eb2df4abb2b362b001c0..c6b5af949055daefaabea64c1c11e775af324da3 100644
--- a/test/mjsunit/regress/regress-171641.js
+++ b/test/mjsunit/regress/regress-2537.js
@@ -27,14 +27,19 @@
// Flags: --allow-natives-syntax
-function foo(k, p) {
- for (var i = 0; i < 1; i++) {
- p = Math.min(p, i);
+var large_int = 0x40000000;
+
+function foo(x, expected) {
+ assertEquals(expected, x); // This succeeds.
+ x += 0; // Force int32 representation so that CompareIDAndBranch is used.
+ if (3 != x) {
+ x += 0; // Poor man's "iDef".
+ // Fails due to Smi-tagging without overflow check.
+ assertEquals(expected, x);
}
- m = Math.floor((k | 0) / p);
}
-foo(0, 1);
-foo(0, 1);
+foo(1, 1);
+foo(3, 3);
%OptimizeFunctionOnNextCall(foo);
-foo(0, 1);
+foo(large_int, large_int);
« no previous file with comments | « src/token.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698