1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/parallel/Array-reducePar-mul.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,15 @@ 1.4 +load(libdir + "parallelarray-helpers.js"); 1.5 + 1.6 +function testReduce() { 1.7 + // This test is interesting because during warmup v*p remains an 1.8 + // integer but this ceases to be true once real execution proceeds. 1.9 + // By the end, it will just be infinity. Note that this is a case 1.10 + // where the non-commutative of floating point becomes relevant, 1.11 + // so we must use assertAlmostEq. 1.12 + function mul(v, p) { return v*p; } 1.13 + var array = range(1, 513); 1.14 + assertArraySeqParResultsEq(array, "reduce", mul, assertAlmostEq); 1.15 +} 1.16 + 1.17 +if (getBuildConfiguration().parallelJS) 1.18 + testReduce();