shithub: mc

Download patch

ref: 7194d93071002efaa90260999cc6530949e2b046
parent: a20f753e2585ef887f7242e7bd8863836df65715
author: Ori Bernstein <[email protected]>
date: Tue Jun 19 16:33:13 EDT 2012

Add new tests.

--- /dev/null
+++ b/test/structret.myr
@@ -1,0 +1,19 @@
+type pair = struct
+	a : int
+	b : int
+;;
+
+const f = {
+	var s
+
+	s.a = 12
+	s.b = 30
+	-> s
+}
+
+const main = {
+	var s : pair
+
+	s = f()
+	-> s.a + s.b
+}
--- a/test/tests
+++ b/test/tests
@@ -21,15 +21,17 @@
 B bsr     	E       5
 B struct1	E	12
 B struct	E	42
+B structasn	E       42
+B structret	E	42
 B array		E	7
 B arraylen	E	12
 B call		E	42
+B voidcall	E	12
 B callbig	E	42
 B loop		E	45
 B fib		E	21
 B slice		E	7
 B float   	E       1
-B structasn	E       42
 B log-and 	E       0
 B log-or  	E       1
 B str   	E       102
--- /dev/null
+++ b/test/voidcall.myr
@@ -1,0 +1,10 @@
+const f = {
+	var a
+
+	a = a + 1
+}
+
+const main = {
+	f()
+	-> 12
+}