js/src/jit-test/tests/parallel/Array-reducePar-mul-short.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/parallel/Array-reducePar-mul-short.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     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 some double value.
    1.10 +
    1.11 +  function mul(v, p) { return v*p; }
    1.12 +
    1.13 +  // Ensure that the array only contains values between 1 and 4.
    1.14 +  var array = range(1, 513).map(function(v) { return (v % 4) + 1; });
    1.15 +  assertArraySeqParResultsEq(array, "reduce", mul, assertAlmostEq);
    1.16 +}
    1.17 +
    1.18 +if (getBuildConfiguration().parallelJS)
    1.19 +  testReduce();

mercurial