]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/phantom-inadequacy.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / phantom-inadequacy.js
CommitLineData
ed1e77d3
A
1function bar() {
2 return 42.5;
3}
4noInline(bar);
5
6function baz(value) {
7 if (value != 42.5)
8 throw "Error: bad value: " + value;
9}
10noInline(baz);
11
12var True = true;
13function foo(a) {
14 var x = bar();
15 var tmp = 0;
16 if (True) {
17 var tmp2 = x;
18 tmp = a + 1;
19 baz(tmp2);
20 }
21 return x + 1 + tmp;
22}
23noInline(foo);
24
25for (var i = 0; i < 10000; ++i) {
26 var result = foo(1);
27 if (result != 42.5 + 1 + 1 + 1)
28 throw "Error: bad result: " + result;
29}
30
31var result = foo(2147483647);
32if (result != 42.5 + 1 + 2147483647 + 1)
33 throw "Error: bad result at end: " + result;