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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 function f (x) {
     2     return x >> 0;
     3 }
     5 var table = [
     6     [NaN, 0],
     8     [Infinity, 0],
     9     [-Infinity, 0],
    10     [0, 0],
    11     [-0, 0],
    13     [15, 15],
    14     [-15, -15],
    16     [0x80000000, -0x80000000],
    17     [-0x80000000, -0x80000000],
    19     [0xffffffff, -1],
    20     [-0xffffffff, 1],
    22     [0x7fffffff, 0x7fffffff],
    23     [-0x7fffffff, -0x7fffffff]
    24 ]
    26 for (var i = 0; i < table.length; i++) {    
    27     assertEq(f(table[i][0]), table[i][1]);
    28 }

mercurial