1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/truncateDouble.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,10 @@ 1.4 + 1.5 +// check correctness of truncation of doubles slightly outside the int32_t range. 1.6 + 1.7 +function truncate(x) { 1.8 + return x | 0; 1.9 +} 1.10 + 1.11 +assertEq(truncate(0xffffffff), -1); 1.12 +assertEq(truncate(0xffffffff + 5000.5), 4999); 1.13 +assertEq(truncate(-0xffffffff - 5000.5), -4999);