summaryrefslogtreecommitdiff
path: root/test/structptr.myr
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2012-07-23 13:33:49 -0400
committerOri Bernstein <orib@google.com>2012-07-23 13:33:49 -0400
commit5e4f828e9c606506708012a606d5fee50269a2c5 (patch)
treee1b374e0113ad51dae3346bd1d9f2f5a4ab7ccc1 /test/structptr.myr
parentc7b3a74d208bd3f4eddf767eec60fd19eeebd593 (diff)
downloadmc-5e4f828e9c606506708012a606d5fee50269a2c5.tar.gz
Add test for writing through struct pointers.
Diffstat (limited to 'test/structptr.myr')
-rw-r--r--test/structptr.myr15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/structptr.myr b/test/structptr.myr
new file mode 100644
index 0000000..c6a94e3
--- /dev/null
+++ b/test/structptr.myr
@@ -0,0 +1,15 @@
+type pair = struct
+ a : int
+ b : int
+;;
+
+const frob = {s
+ s.a = 12
+ s.b = 30
+}
+
+const main = {
+ var s : pair
+ frob(&s)
+ -> s.a + s.b
+}