summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/optimize-spread.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/jit-test/tests/cacheir/optimize-spread.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/cacheir/optimize-spread.js b/js/src/jit-test/tests/cacheir/optimize-spread.js
new file mode 100644
index 0000000000..accd56ea13
--- /dev/null
+++ b/js/src/jit-test/tests/cacheir/optimize-spread.js
@@ -0,0 +1,16 @@
+setJitCompilerOption("ion.forceinlineCaches", 1);
+
+function testOptimizeSpread() {
+ function f(a, b) {
+ return a + b;
+ }
+ function g(...rest) {
+ return f(...rest);
+ }
+
+ for (var i = 0; i < 20; ++i) {
+ var v = g(1, 2);
+ assertEq(v, 3);
+ }
+}
+for (var i = 0; i < 2; ++i) testOptimizeSpread();