1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/bug870356.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +function f1(x) { 1.5 + return Math.round(x); 1.6 +} 1.7 +assertEq(f1(3.3), 3); 1.8 +assertEq(f1(-2.842170943040401e-14), -0); 1.9 + 1.10 +function f2(x) { 1.11 + return Math.round(x); 1.12 +} 1.13 +assertEq(f2(3.3), 3); 1.14 +assertEq(f2(-1.3), -1); 1.15 +assertEq(f2(-1.8), -2); 1.16 +assertEq(f2(-0.9), -1); 1.17 +assertEq(f2(-0.6), -1); 1.18 +assertEq(f2(-0.4), -0); 1.19 + 1.20 +function f3(x) { 1.21 + return Math.round(x); 1.22 +} 1.23 +assertEq(f3(0.1), 0); 1.24 +assertEq(f3(-0.5), -0); 1.25 + 1.26 +function f4(x) { 1.27 + return Math.round(x); 1.28 +} 1.29 +assertEq(f4(0.1), 0); 1.30 +assertEq(f4(-0), -0); 1.31 + 1.32 +function f5(x) { 1.33 + return Math.round(x); 1.34 +} 1.35 +assertEq(f5(2.9), 3); 1.36 +assertEq(f5(NaN), NaN);