aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/1.cff13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/1.cff b/test/1.cff
index cdda6b9..3854aa8 100644
--- a/test/1.cff
+++ b/test/1.cff
@@ -1,6 +1,6 @@
import "libc.hff";
-extern fn main(argc int) int {
+extern fn main(argc int, argv **u8) int {
switch argc - 1 {
case 0, 1;
printf("zero or one\n");
@@ -14,4 +14,15 @@ extern fn main(argc int) int {
case else
printf("its %d\n", argc);
}
+
+ switch {
+ case argv[1] != #null and strcmp(argv[1], "hello") == 0;
+ printf("world\n");
+
+ case argv[1] != #null and strcmp(argv[1], "42") == 0;
+ printf("forty two\n");
+
+ case else
+ printf("- %s\n", argv[1]);
+ }
}