]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/inverted-additive-subsumption.js
JavaScriptCore-7600.1.4.16.1.tar.gz
[apple/javascriptcore.git] / tests / stress / inverted-additive-subsumption.js
1 function foo(x) {
2 return ((x + 1) | 0) + (x + 1);
3 }
4
5 noInline(foo);
6
7 for (var i = 0; i < 100000; ++i) {
8 var result = foo(i);
9 if (result != (i + 1) * 2)
10 throw "Error: bad result for i = " + i + ": " + result;
11 }
12
13 var result = foo(2147483647);
14 if (result != ((2147483647 + 1) | 0) + (2147483647 + 1))
15 throw "Error: bad result for 2147483647: " + result;