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

Unified Diff: test/mjsunit/switch.js

Issue 13290: Fixed bug in large switch tables on arm. (Closed)
Patch Set: Addressed review comments Created 12 years 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/macro-assembler-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/switch.js
diff --git a/test/mjsunit/switch.js b/test/mjsunit/switch.js
index 821a4f30f721f3446bcedf30d8b5825cccb142ab..e2b14d14d7750125e53f14a56661c96fe52fc03b 100644
--- a/test/mjsunit/switch.js
+++ b/test/mjsunit/switch.js
@@ -267,3 +267,23 @@ assertEquals("default", f7(1<<30), "0-1-switch.maxsmi++");
assertEquals("default", f7(-(1<<30)-1), "0-1-switch.minsmi--");
assertEquals("A", f7((170/16)-(170%16/16)), "0-1-switch.heapnum");
+
+function makeVeryLong(length) {
+ var res = "function() {\n" +
+ " var res = 0;\n" +
+ " for (var i = 0; i <= " + length + "; i++) {\n" +
+ " switch(i) {\n";
+ for (var i = 0; i < length; i++) {
+ res += " case " + i + ": res += 2; break;\n";
+ }
+ res += " default: res += 1;\n" +
+ " }\n" +
+ " }\n" +
+ " return res;\n" +
+ "}";
+ return eval(res);
+}
+var verylong_size = 1000;
+var verylong = makeVeryLong(verylong_size);
+
+assertEquals(verylong_size * 2 + 1, verylong());
« no previous file with comments | « src/macro-assembler-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698