js/src/jit-test/tests/ion/truncateToInt32-ool.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:1922e4c4afe7
1 function f (x) {
2 return x >> 0;
3 }
4
5 var table = [
6 [NaN, 0],
7
8 [Infinity, 0],
9 [-Infinity, 0],
10 [0, 0],
11 [-0, 0],
12
13 [15, 15],
14 [-15, -15],
15
16 [0x80000000, -0x80000000],
17 [-0x80000000, -0x80000000],
18
19 [0xffffffff, -1],
20 [-0xffffffff, 1],
21
22 [0x7fffffff, 0x7fffffff],
23 [-0x7fffffff, -0x7fffffff]
24 ]
25
26 for (var i = 0; i < table.length; i++) {
27 assertEq(f(table[i][0]), table[i][1]);
28 }

mercurial