]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/fiat-double-to-int52-then-exit-not-int52.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / fiat-double-to-int52-then-exit-not-int52.js
1 var array = new Float64Array(1);
2 array[0] = 42;
3
4 function foo() {
5 return fiatInt52(array[0]) + 1;
6 }
7
8 noInline(foo);
9
10 for (var i = 0; i < 1000000; ++i) {
11 var result = foo();
12 if (result != 43)
13 throw "Error: bad result: " + result;
14 }
15
16 array[0] = 5.5;
17 var result = foo();
18 if (result != 6.5)
19 throw "Error: bad result at end: " + result;