summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1556571.js
blob: b1d69788ca22ec5c881787e2e52d1f8ebad1649c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Ensure that convertDoubleToInt32 allows the -0 case.

// If convertDoubleToInt32 fails on the -0 case, then 0 !== -0 below,
// so it will fall through to the default case.
function test(v) {
  switch(v) {
    case 0: return;
    default: assertEq(true, false); break;
  }
}

for (var i = 0; i < 10000; i++) {
  test(i % 2 === 0 ? 0 : -0);
}