diff options
Diffstat (limited to 'js/src/jit-test/tests/ion/base-reg-sp.js')
-rw-r--r-- | js/src/jit-test/tests/ion/base-reg-sp.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/base-reg-sp.js b/js/src/jit-test/tests/ion/base-reg-sp.js new file mode 100644 index 0000000000..07c61aba11 --- /dev/null +++ b/js/src/jit-test/tests/ion/base-reg-sp.js @@ -0,0 +1,13 @@ +setJitCompilerOption("base-reg-for-locals", 0); // SP +function g(x) { + with (this) {} // Don't inline. + return x; +} +function f(x) { + var sum = 0; + for (var i = 0; i < x; i++) { + sum += g(i); + } + return sum; +} +assertEq(f(2000), 1999000); |