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