ref: 64cab738d5b6c540182c0812eeb4a6046a2908de
parent: 48ba62d332c9b9ddf74ab71877d39242f493979b
author: Ori Bernstein <[email protected]>
date: Tue Jun 5 11:41:22 EDT 2012
Add a simplified struct test.
--- a/test/build.sh
+++ b/test/build.sh
@@ -1,14 +1,16 @@
#!/bin/bash
MC=../8/8m
+ASOPT="-g"
function build {
echo $MC $1.myr && \
$MC $1.myr && \
mv a.s $1.s && \
- cc -m32 -o $1 $1.s
+ cc $ASOPT -m32 -o $1 $1.s
}
build main
build add
+build struct_oneval
build struct
--- /dev/null
+++ b/test/struct_oneval.myr
@@ -1,0 +1,9 @@
+type val = struct
+ a : int
+;;
+
+const main = {
+ var s : val
+ s.a = 12
+ -> s.a
+}
--- a/test/test.sh
+++ b/test/test.sh
@@ -20,4 +20,5 @@
returns main 0
returns add 53
+returns struct_oneval 12
returns struct 42