aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/nested_structs.ek17
-rw-r--r--tests/structs.ek6
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/nested_structs.ek b/tests/nested_structs.ek
new file mode 100644
index 0000000..1429a77
--- /dev/null
+++ b/tests/nested_structs.ek
@@ -0,0 +1,17 @@
+typedef i27 {}
+typedef i9 {}
+
+typedef a {
+ i27 a;
+ i27 b;
+}
+
+typedef b {
+ a a;
+ i27 b;
+}
+
+main()
+{
+ mut p = b!{.a = a!{.a = 1, .b = 2}, .b = 3};
+}
diff --git a/tests/structs.ek b/tests/structs.ek
index 22cce71..3e64b94 100644
--- a/tests/structs.ek
+++ b/tests/structs.ek
@@ -11,8 +11,12 @@ typedef int_pair {
}
}
+extern _putchar(i9 c);
+
main()
{
- mut p = int_pair!{.a = 9, .b = 10};
+ mut p = int_pair!{.a = 1, .b = 2};
i27 s = p.sum();
+ _putchar('0' + s as i9);
+ _putchar('\n');
}