]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/uint32-to-number-fold-constant-with-do-overflow.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / uint32-to-number-fold-constant-with-do-overflow.js
1 function foo(a, b) {
2 return a >>> b;
3 }
4
5 function bar(a, b) {
6 return foo(a, b);
7 }
8
9 noInline(bar);
10
11 for (var i = 0; i < 1000000; ++i) {
12 var result = bar(-1, 0);
13 if (result != 4294967295)
14 throw "Error: bad result: " + result;
15 }
16
17 function baz(a) {
18 return foo(a, 1);
19 }
20
21 noInline(baz);
22
23 for (var i = 0; i < 1000000; ++i) {
24 var result = baz(-1);
25 if (result != 2147483647)
26 throw "Error: bad result: " + result;
27 }