1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/jaeger/inline/mathPow.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 + 1.5 +assertEq(Math.pow(100, 2), 10000); 1.6 +assertEq(Math.pow(-Infinity, -0.5), 0); 1.7 +assertEq(Math.pow(-Infinity, 0.5), Infinity); 1.8 +assertEq(Math.pow(Infinity, -0.5), 0); 1.9 +assertEq(Math.pow(Infinity, 0.5), Infinity); 1.10 +assertEq(Math.pow(NaN, -0.5), NaN); 1.11 +assertEq(Math.pow(NaN, 0.5), NaN); 1.12 +assertEq(Math.pow(-3.14, -0.5), NaN); 1.13 +assertEq(Math.pow(-1.23, 0.5), NaN); 1.14 +assertEq(Math.pow(-0, -0.5), Infinity); 1.15 +assertEq(Math.pow(-0, 0.5), 0); 1.16 +assertEq(Math.pow(-1, -0.5), NaN); 1.17 +assertEq(Math.pow(-1, 0.5), NaN); 1.18 +assertEq(Math.pow(0, -0.5), Infinity); 1.19 +assertEq(Math.pow(0, 0.5), 0); 1.20 +assertEq(Math.pow(1, -0.5), 1); 1.21 +assertEq(Math.pow(1, 0.5), 1); 1.22 +assertEq(Math.pow(100, -0.5), 0.1); 1.23 +assertEq(Math.pow(100, 0.5), 10); 1.24 + 1.25 +/* Inferred as pow(double, double). */ 1.26 +function pow1(x) { 1.27 + return Math.pow(x, 0.5); 1.28 +} 1.29 +assertEq(pow1(100), 10); 1.30 +assertEq(pow1(144), 12); 1.31 +assertEq(pow1(-0), 0); 1.32 +assertEq(pow1(0), 0); 1.33 +assertEq(pow1(1), 1); 1.34 +assertEq(pow1(-1), NaN); 1.35 +assertEq(pow1(NaN), NaN); 1.36 +assertEq(pow1(-Infinity), Infinity); 1.37 +assertEq(pow1(Infinity), Infinity); 1.38 +