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