add new and init to toolchain

This commit is contained in:
2026-07-04 17:38:45 +02:00
parent cdde49e68b
commit e7f69ffb5a
17 changed files with 711 additions and 63 deletions
-7
View File
@@ -1,7 +1,5 @@
heap :: import "@std/mem/heap"
#printf c_func(fmt *c_char, ...) c_int
main func() i32 {
memory ?*mut u8 = heap.alloc(4)
defer heap.free(memory)
@@ -11,11 +9,6 @@ main func() i32 {
bytes[1] = 20
bytes[2] = bytes[0] + bytes[1]
_ = printf("bytes[0]: %d\n", bytes[0])
_ = printf("bytes[1]: %d\n", bytes[1])
_ = printf("bytes[2]: %d\n", bytes[2])
_ = printf("bytes[3]: %d\n", bytes[3])
if (bytes[2] != 30) {
return 2
}