code wiki / (root) / nx_cube_inplace_test.nx

nx_cube_inplace_test.nx source

↩ module page · 15 lines · 439 B

1import "nx_syscalls.nx" 2import "nx_cube_inplace.nx" 3 4func main() -> nx_int { 5 let buf: *u8 = sys_mmap(80) 6 let arr: *nx_int = buf as *nx_int 7 arr[0] = 2 8 arr[1] = -3 9 arr[2] = 0 10 nx_cube_inplace(arr, 3) 11 if arr[0] != 8 { return __syscall(93, 1, 0, 0, 0, 0, 0) } 12 if arr[1] != -27 { return __syscall(93, 2, 0, 0, 0, 0, 0) } 13 if arr[2] != 0 { return __syscall(93, 3, 0, 0, 0, 0, 0) } 14 return 0 15}