]>
Commit | Line | Data |
---|---|---|
1 | function foo(o) { | |
2 | return o[0]; | |
3 | } | |
4 | ||
5 | function 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 | ||
15 | noInline(test); | |
16 | ||
17 | for (var i = 0; i < 100000; ++i) | |
18 | test(0, 1); | |
19 | ||
20 | test(0xFFFF0000, 0/0); |