shithub: mc

Download patch

ref: 5e4f828e9c606506708012a606d5fee50269a2c5
parent: c7b3a74d208bd3f4eddf767eec60fd19eeebd593
author: Ori Bernstein <[email protected]>
date: Mon Jul 23 09:33:49 EDT 2012

Add test for writing through struct pointers.

--- /dev/null
+++ b/test/structptr.myr
@@ -1,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
+}
--- a/test/tests
+++ b/test/tests
@@ -21,6 +21,7 @@
 B bsr		E	5
 B struct1	E	12
 B struct	E	42
+B structptr	E	42
 B structasn	E	42
 B structret	E	42
 B array		E	7