summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/large-arraybuffers/jit-alloc-big.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/large-arraybuffers/jit-alloc-big.js')
-rw-r--r--js/src/jit-test/tests/large-arraybuffers/jit-alloc-big.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/large-arraybuffers/jit-alloc-big.js b/js/src/jit-test/tests/large-arraybuffers/jit-alloc-big.js
new file mode 100644
index 0000000000..2d2706f903
--- /dev/null
+++ b/js/src/jit-test/tests/large-arraybuffers/jit-alloc-big.js
@@ -0,0 +1,23 @@
+// |jit-test| slow
+
+// Ensure Warp JIT code handles |new Int32Array(INT32_MAX)| correctly.
+
+function test(len) {
+ var ta;
+ for (var i = 0; i < 2149; i++) {
+ if (i % 1024 === 100) {
+ // Constant length.
+ ta = new Int32Array(0x7fff_ffff);
+ assertEq(ta.length, 0x7fff_ffff);
+ ta[0x7fff_fffe] = i;
+ assertEq(ta[0x7fff_fffe], i);
+
+ // Variable length.
+ ta = new Int32Array(len - i);
+ assertEq(ta.length, len - i);
+ ta[ta.length - 1] = i;
+ assertEq(ta[ta.length - 1], i);
+ }
+ }
+}
+test(0x7fff_ffff);