code wiki / (root) / nx_smoke_exit42.nx

nx_smoke_exit42.nx source

↩ module page · 14 lines · 575 B

1// smoke_exit42.nx -- minimal RV64 sovereign smoke test. 2// 3// Compiles to a 'main' that immediately syscalls exit(42). 4// If the full nxc2 pipeline (lex -> parse -> opt -> regalloc -> 5// riscv) + cross-assemble + cross-link + qemu-riscv64 exec 6// chain works, this binary will exit 42 in any compliant runner. 7// 8// Used by the QEMU verification path documented in 9// docs/SELF_HOST_STATUS.md. The number 42 is recognisable in 10// `echo $?` so test scripts can assert without parsing stdout. 11 12func main() -> i64 { 13 return __syscall(93, 42, 0, 0, 0, 0, 0) 14}