summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testTypedArrayInit.js
blob: b06e3f9fa9242218bf9f7ef7d0401d5884bfb801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// |jit-test| skip-if: getBuildConfiguration()["arm64-simulator"] === true
//
// The ARM64 Simulator can take upwards of 6 minutes to execute this test,
// which fails intermittently with timeouts.
//
// Arrays should be initialized to zero.

function f() {
  for (var ctor of [ Int8Array,
                     Uint8Array,
                     Uint8ClampedArray,
                     Int16Array,
                     Uint16Array,
                     Int32Array,
                     Uint32Array,
                     Float32Array,
                     Float64Array ])
  {
    for (var len of [ 3, 30, 300, 3000, 30000 ]) {
      var arr = new ctor(len);
      for (var i = 0; i < arr.length; i++)
        assertEq(arr[i], 0, "index " + i + " of " + ctor.name + " len " + len);
    }
  }
}

f();
f();
gc()
f();