X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/217a6308cd6a1dc049a0bb69263bd4c91f91c4d0..4be4e30906bcb8ee30b4d189205cb70bad6707ce:/tests/stress/make-large-string-jit-strcat.js diff --git a/tests/stress/make-large-string-jit-strcat.js b/tests/stress/make-large-string-jit-strcat.js new file mode 100644 index 0000000..a6aeb1d --- /dev/null +++ b/tests/stress/make-large-string-jit-strcat.js @@ -0,0 +1,24 @@ +// Like make-large-string-jit.js, but tests MakeRope with three arguments and op_strcat +// in the DFG and FTL JITs. + +var s = "s"; + +function foo(a, b) { + return "t" + a + b; +} + +noInline(foo); + +for (var i = 0; i < 100000; ++i) + foo("a", "b"); + +try { + for (var i = 0; i < 31; ++i) + s = foo(s, s); + print("Should not have gotten here."); + print("String length: " + s.length); + throw "Should not have gotten here."; +} catch (e) { + if (e.message != "Out of memory") + throw "Wrong error: " + e; +}