code wiki / _hdl_build / nx_fwdref_probe.nx
nx_fwdref_probe.nx source
↩ module page · 11 lines · 539 B
1// Does nx_cc accept a FORWARD REFERENCE (caller defined BEFORE callee)? This decides whether the
2// gzip wiring can be ONE atomic edit (wrapper placed before the renamed body) or must be two edits
3// with a window where the tree does not compile. Cheap experiment, throwaway target.
4import "nx_syscalls.nx"
5func fr_caller(x: i64) -> i64 { return fr_callee(x) + 1 }
6func fr_callee(x: i64) -> i64 { return x * 2 }
7func main(argc: i64, argv: *i64) -> i64 {
8 if fr_caller(20) != 41 { sys_exit(1); return 1 }
9 sys_exit(0)
10 return 0
11}