_offc_strlit.nx source
↩ module page · 11 lines · 428 B
1// Reduced repro for T#selfhost-003: uses a string literal so the
2// compiler must emit `la <reg>, .Lg<id>` and a `.Lg<id>: .asciz`.
3// If nxc.elf compiles this correctly, basic VK_GLOBAL machinery works
4// and the self-host crash is scale-related (asm buffer overflow,
5// many-globals interaction with another pass, etc.).
6import "syscalls.nx"
7
8func main() -> i64 {
9 sys_write(1, "hi\n" as *u8, 3)
10 return 0
11}