aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/test.cff
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/test.cff')
-rw-r--r--bootstrap/test.cff11
1 files changed, 11 insertions, 0 deletions
diff --git a/bootstrap/test.cff b/bootstrap/test.cff
index 95ee7bf..e466bba 100644
--- a/bootstrap/test.cff
+++ b/bootstrap/test.cff
@@ -48,6 +48,11 @@ struct Vec2f {
}
}
+fn spanz(cstr *const u8) [#]const u8 {
+ extern fn strlen(s *const u8) usize;
+ return cstr[0::strlen(cstr)];
+}
+
extern fn main (argc int, argv **u8) int {
let colors [3]Color = { :Red, :Green, :Blue } ;
@@ -63,6 +68,12 @@ extern fn main (argc int, argv **u8) int {
each(i, x, is,
printf("%d\n", x);
)
+ let slice [#]int = is[3::5];
+
+ printf("sl %d\n", slice[0]);
+ slice = slice[1::4];
+ printf("sl %d\n", slice[0]);
+ slice.#len;
printf("sizeof(is) = %zu\n", sizeof(is));
printf("sizeof *void = %zu\n", sizeof *void);