]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/ftl-switch-string-slow-duplicate-cases.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / ftl-switch-string-slow-duplicate-cases.js
CommitLineData
ed1e77d3
A
1function foo(s) {
2 switch (s) {
3 case "ƑẦǏŁ":
4 case "ÌŅ":
5 case "ṤĻŐⱲ":
6 case "ṔÄȚĦ":
7 return 42;
8 case "due":
9 case "to":
10 case "16-bit":
11 case "strings":
12 return 43;
13 default:
14 return 44;
15 }
16}
17
18noInline(foo);
19
20function cat(a, b) {
21 return a + b;
22}
23
24for (var i = 0; i < 10000; ++i) {
25 var result = foo(cat("16-", "bit"));
26 if (result != 43)
27 throw "Error: bad result (1): " + result;
28 result = foo("ƑẦǏŁ");
29 if (result != 42)
30 throw "Error: bad result (2): " + result;
31}