]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/fiat-value-to-int52-then-exit-not-int52.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / fiat-value-to-int52-then-exit-not-int52.js
1 function foo() {
2 return fiatInt52(bar(DFGTrue())) + 1;
3 }
4
5 var thingy = false;
6 function bar(p) {
7 if (thingy)
8 return 5.5;
9 return p ? 42 : 5.5;
10 }
11
12 noInline(foo);
13 noInline(bar);
14
15 for (var i = 0; i < 1000000; ++i) {
16 var result = foo();
17 if (result != 43 && result != 6.5)
18 throw "Error: bad result: " + result;
19 }
20
21 thingy = true;
22 var result = foo();
23 if (result != 6.5)
24 throw "Error: bad result at end: " + result;