]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/get-local-elimination.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / get-local-elimination.js
diff --git a/tests/stress/get-local-elimination.js b/tests/stress/get-local-elimination.js
new file mode 100644 (file)
index 0000000..612f9d5
--- /dev/null
@@ -0,0 +1,15 @@
+var True = true;
+
+function foo(a) {
+    var x = a;
+    if (True)
+        return a + x;
+}
+
+noInline(foo);
+
+for (var i = 0; i < 10000; ++i) {
+    var result = foo(42);
+    if (result != 84)
+        throw "Error: bad result: " + result;
+}