Debian Codegraph @

js/src/jit-test/tests/basic/testTypedArrayInit.js

raw
1 // |jit-test| skip-if: getBuildConfiguration("arm64-simulator") === true
2 //
3 // The ARM64 Simulator can take upwards of 6 minutes to execute this test,
4 // which fails intermittently with timeouts.
5 //
6 // Arrays should be initialized to zero.
7
8 function f() {
9 for (var ctor of [ Int8Array,
10 Uint8Array,
11 Uint8ClampedArray,
12 Int16Array,
13 Uint16Array,
14 Int32Array,
15 Uint32Array,
16 Float32Array,
17 Float64Array ])
18 {
19 for (var len of [ 3, 30, 300, 3000, 30000 ]) {
20 var arr = new ctor(len);
21 for (var i = 0; i < arr.length; i++)
22 assertEq(arr[i], 0, "index " + i + " of " + ctor.name + " len " + len);
23 }
24 }
25 }
26
27 f();
28 f();
29 gc()
30 f();