]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/float32-array-nan-inlined.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / float32-array-nan-inlined.js
CommitLineData
81345200
A
1function foo(o) {
2 return o[0];
3}
4
5function test(a, x) {
6 var intArray = new Int32Array(1);
7 intArray[0] = a;
8 var floatArray = new Float32Array(intArray.buffer);
9 var element = foo(floatArray);
10 var result = element + 1;
11 if (("" + result) != ("" + x))
12 throw "Error: bad result for " + a + ": " + result + ", but expected: " + x + "; loaded " + element + " from the array";
13}
14
15noInline(test);
16
17for (var i = 0; i < 100000; ++i)
18 test(0, 1);
19
20test(0xFFFF0000, 0/0);