summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2012-08-03 17:21:32 -0400
committerOri Bernstein <orib@google.com>2012-08-03 17:21:32 -0400
commit214bcaf52e9d77347338eab5d84240abb7dc104d (patch)
treec383f5953bf9305119d1609112fc58ba05d9b8eb
parent9b2d009acc6761a5b9328a69773e20f5ee530b15 (diff)
downloadmc-214bcaf52e9d77347338eab5d84240abb7dc104d.tar.gz
Test more stuff.
-rw-r--r--test/outparam-sl.myr11
-rw-r--r--test/outparam.myr11
-rw-r--r--test/tests6
3 files changed, 26 insertions, 2 deletions
diff --git a/test/outparam-sl.myr b/test/outparam-sl.myr
new file mode 100644
index 0000000..37bddbf
--- /dev/null
+++ b/test/outparam-sl.myr
@@ -0,0 +1,11 @@
+const arr = [1,2,3,4]
+const f = {out
+ *out = arr[1,3]
+}
+
+const main = {
+ var v
+
+ f(&v)
+ -> v[0]
+}
diff --git a/test/outparam.myr b/test/outparam.myr
new file mode 100644
index 0000000..61019b9
--- /dev/null
+++ b/test/outparam.myr
@@ -0,0 +1,11 @@
+const f = {out
+ *out = 42
+}
+
+const main = {
+ var v
+
+ v = 16
+ f(&v)
+ -> v
+}
diff --git a/test/tests b/test/tests
index b074073..2378e79 100644
--- a/test/tests
+++ b/test/tests
@@ -22,8 +22,10 @@ B bsr E 5
B trunccast E 15
B zwidencast E 99
B swidencast E 99
-B derefassign E 123
-B ptrpreinc E 9
+B derefassign E 123
+B ptrpreinc E 9
+B outparam E 42
+B outparam-sl E 2
B struct1 E 12
B struct E 42
B structptr E 42