summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/SIMD/check.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/SIMD/check.js')
-rw-r--r--js/src/jit-test/tests/SIMD/check.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/SIMD/check.js b/js/src/jit-test/tests/SIMD/check.js
new file mode 100644
index 000000000..bef0b6c68
--- /dev/null
+++ b/js/src/jit-test/tests/SIMD/check.js
@@ -0,0 +1,25 @@
+load(libdir + 'simd.js');
+
+setJitCompilerOption("ion.warmup.trigger", 50);
+
+function f() {
+ var f1 = SIMD.Float32x4(1, 2, 3, 4);
+ var i1 = SIMD.Int32x4(1, 2, -3, 4);
+ var b1 = SIMD.Bool32x4(true, true, false, true);
+ var i = 0;
+ try {
+ for (; i < 150; i++) {
+ if (i > 148)
+ i1 = f1;
+ assertEqVec(SIMD.Int32x4.check(i1), i1);
+ assertEqVec(SIMD.Float32x4.check(f1), f1);
+ assertEqVec(SIMD.Bool32x4.check(b1), b1);
+ }
+ } catch (ex) {
+ assertEq(i, 149);
+ assertEq(ex instanceof TypeError, true);
+ }
+}
+
+f();
+