code wiki / _attic / _offc_micro_narr.nx

_offc_micro_narr.nx source

↩ module page · 21 lines · 842 B

1// Micro-test for the off-C runtime crash diagnosis. 2// 3// Imports nx_narr, calls narr_func_enter directly with no Tier-3 4// weaving on top. Goal: isolate whether the crash in nxc_self.elf 5// is in narr_func_enter itself, OR in some other code path. 6// 7// Compile with anchor A: exits 42 ✓ (gcc-built compiler) 8// Compile with anchor B: if exits 42 → narr_func_enter is fine, 9// crash is elsewhere 10// if crashes → narr_func_enter codegen is 11// broken in nxc.elf 12 13import "syscalls.nx" 14import "nx_narr.nx" 15 16func main() -> i64 { 17 sys_write(2, "[micro] before narr_func_enter\n" as *u8, 31) 18 narr_func_enter("micro_test" as *u8) 19 sys_write(2, "[micro] after narr_func_enter\n" as *u8, 30) 20 return 42 21}