1 // |jit-test| TMFLAGS: full,fragprofile,treevis; valgrind
3 /* Test the proper operation of the left shift operator. This is especially
4 * important on ARM as an explicit mask is required at the native instruction
7 load(libdir + 'range.js');
9 function testShiftLeft()
15 var shifts = [0,1,7,8,15,16,23,24,31];
17 /* Samples from the simple shift range. */
18 for (i = 0; i < shifts.length; i++)
19 r[j++] = 1 << shifts[i];
21 /* Samples outside the normal shift range. */
22 for (i = 0; i < shifts.length; i++)
23 r[j++] = 1 << (shifts[i] + 32);
25 /* Samples far outside the normal shift range. */
26 for (i = 0; i < shifts.length; i++)
27 r[j++] = 1 << (shifts[i] + 224);
28 for (i = 0; i < shifts.length; i++)
29 r[j++] = 1 << (shifts[i] + 256);
34 assertEq(testShiftLeft(),
35 "1,2,128,256,32768,65536,8388608,16777216,-2147483648,"+
36 "1,2,128,256,32768,65536,8388608,16777216,-2147483648,"+
37 "1,2,128,256,32768,65536,8388608,16777216,-2147483648,"+
38 "1,2,128,256,32768,65536,8388608,16777216,-2147483648");