summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2012-06-07 15:35:44 -0400
committerOri Bernstein <orib@google.com>2012-06-07 15:35:44 -0400
commit53d4b23c3f4dc40f8f3d78343b35b12495193fcf (patch)
treeae3139f3a6c22015362bf162da70bd4fef2cde8c
parentb0bb18ea0c30216319410faf536cb09bc0f31e99 (diff)
downloadmc-53d4b23c3f4dc40f8f3d78343b35b12495193fcf.tar.gz
Add test for struct assignment.
-rw-r--r--Makefile2
-rw-r--r--test/structasn.myr13
-rw-r--r--test/tests1
3 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 381f7ab..44083ab 100644
--- a/Makefile
+++ b/Makefile
@@ -4,5 +4,5 @@ SUB = parse \
-include config.mk
include mk/c.mk
-check:
+check: all
make -C test check
diff --git a/test/structasn.myr b/test/structasn.myr
new file mode 100644
index 0000000..6940b50
--- /dev/null
+++ b/test/structasn.myr
@@ -0,0 +1,13 @@
+type pair = struct
+ a : int
+ b : int
+;;
+
+const main = {
+ var x : pair
+ var y : pair
+ x.a = 12
+ x.b = 30
+ y = x
+ -> y.a + y.b
+}
diff --git a/test/tests b/test/tests
index a9d9b92..fea7d72 100644
--- a/test/tests
+++ b/test/tests
@@ -12,3 +12,4 @@ loop E 45
fib E 21
slice E 7
float E 1
+structasn E 42