Bug 678106: Add tests for local increment/decrement, r=dvander
authorHannes Verschore <hverschore@mozilla.com>
Thu, 11 Aug 2011 11:24:07 -0700
changeset 108712 e4815c23236d76d1294d1529201341539f8cd507
parent 108711 73b80b0c344a2c6716def0fe420da6e707954643
child 108713 a0f88cdad5c95128ec109a840ee31852592e197d
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs678106
milestone8.0a1
Bug 678106: Add tests for local increment/decrement, r=dvander
js/src/jit-test/tests/ion/bug678106.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug678106.js
@@ -0,0 +1,32 @@
+function f_localinc(x) {
+    var a = x;
+    var b = a++;
+
+    var c = b+b+b+b+b+b+b+b+b+b;
+    return a + c;
+}
+assertEq(f_localinc(1), 12)
+function f_localdec(x) {
+    var a = x;
+    var b = a--;
+
+    var c = b+b+b+b+b+b+b+b+b+b;
+    return a + c;
+}
+assertEq(f_localdec(1), 10)
+function f_inclocal(x) {
+    var a = x;
+    var b = ++a;
+
+    var c = b+b+b+b+b+b+b+b+b+b;
+    return a + c;
+}
+assertEq(f_inclocal(1), 22)
+function f_declocal(x) {
+    var a = x;
+    var b = --a;
+
+    var c = b+b+b+b+b+b+b+b+b+b;
+    return a + c;
+}
+assertEq(f_declocal(1), 0)