aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/test.cff
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/test.cff')
-rw-r--r--bootstrap/test.cff25
1 files changed, 20 insertions, 5 deletions
diff --git a/bootstrap/test.cff b/bootstrap/test.cff
index 4d1393b..14d489e 100644
--- a/bootstrap/test.cff
+++ b/bootstrap/test.cff
@@ -1,5 +1,4 @@
import "libc.hff";
-import "libc.hff";
union Val {
u u32,
@@ -18,10 +17,9 @@ defmacro each(i, x, arr, ...body) [
}
]
-static xs *void = {},
- ok = 6;
+static xs *void = {};
-fn isort(xs *int, n usize) void {
+fn isort(xs *int, n usize) void {
fn icmp(lhs *const void, rhs *const void, _ *void) int {
let lhs = *as(*int)lhs,
rhs = *as(*int)rhs;
@@ -34,6 +32,23 @@ fn isort(xs *int, n usize) void {
x();
}
+struct List;
+struct List {
+ next *List,
+ val int,
+
+ fn ok(l List) void;
+
+ fn length(l *List) usize {
+ let n = 0z;
+ ok(*l);
+ for ; l; l = l.next { ++n; }
+ return n;
+ }
+
+ fn ok(l List) void {}
+}
+
struct Vec2f;
struct Vec2f {
x f32,
@@ -51,7 +66,7 @@ struct Vec2f {
fn spanz(cstr *const u8) [#]const u8 {
extern fn strlen(s *const u8) usize;
- return cstr[0::strlen(cstr) + 1];
+ return cstr[0 :: strlen(cstr)];
}
defmacro transmute(Type, x) [