summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-10-09 00:26:30 -0700
committerOri Bernstein <ori@eigenstate.org>2016-10-09 00:26:30 -0700
commit5d433bdf4af606e395b54aace8c0a27f745ae9ce (patch)
treeb8e3cd2a11cac4bae7880a61898a1a668c296a2a /test
parenta2352649c2a8f5937335a8c791f3581f52cd8d6f (diff)
downloadmc-5d433bdf4af606e395b54aace8c0a27f745ae9ce.tar.gz
Fix bug with postinc returns.
We were draining the postinc queue before the rval. Oops.
Diffstat (limited to 'test')
-rw-r--r--test/postinc-ret.myr12
-rw-r--r--test/tests1
2 files changed, 13 insertions, 0 deletions
diff --git a/test/postinc-ret.myr b/test/postinc-ret.myr
new file mode 100644
index 0000000..b552d2a
--- /dev/null
+++ b/test/postinc-ret.myr
@@ -0,0 +1,12 @@
+use std
+
+const main = {
+ std.put("{}\n", f())
+}
+
+const a = [1,2,3][:]
+const f = {
+ var i = 0
+ -> a[i++]
+}
+
diff --git a/test/tests b/test/tests
index 9e58d00..75a0c0e 100644
--- a/test/tests
+++ b/test/tests
@@ -33,6 +33,7 @@ B zwidencast E 99
B swidencast E 99
B derefassign E 123
B ptrpreinc E 9
+B postinc-ret P '1'
B incret E 1
B outparam E 42
B outparam-sl E 2