From e5ed3b20351a2715fe88d9a5dbcc8e6757fe96aa Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 24 Aug 2022 06:46:23 +0200 Subject: llvm defer and more --- examples/defer.cff | 2 +- examples/hello-world.cff | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/defer.cff b/examples/defer.cff index 7833717..f6ddabd 100644 --- a/examples/defer.cff +++ b/examples/defer.cff @@ -2,7 +2,7 @@ import "libc.hff"; extern fn main() void { let p = malloc(1); - defer free(p); + defer (do printf("freeing"); free(p);); if p == #null { if #f { return; diff --git a/examples/hello-world.cff b/examples/hello-world.cff index 998b5c2..8b81c17 100644 --- a/examples/hello-world.cff +++ b/examples/hello-world.cff @@ -1,7 +1,6 @@ import "libc.hff"; extern fn main(argc int, argv **u8) int { - argc += 1; - printf("hello %d %s\n", argc, *((argv + 2) - 1)); + printf("hello world\n"); } -- cgit v1.2.3