]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/array-pop-int32.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / array-pop-int32.js
diff --git a/tests/stress/array-pop-int32.js b/tests/stress/array-pop-int32.js
new file mode 100644 (file)
index 0000000..14075f3
--- /dev/null
@@ -0,0 +1,11 @@
+function foo(array) {
+    return [array.pop(), array.pop(), array.pop(), array.pop()];
+}
+
+noInline(foo);
+
+for (var i = 0; i < 100000; ++i) {
+    var result = foo([1, 2, 3]);
+    if (result.toString() != "3,2,1,")
+        throw "Error: bad result: " + result;
+}