add new and init to toolchain
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user