code wiki / (root) / nx_test_many_params.nx

nx_test_many_params.nx source

↩ module page · 24 lines · 855 B

1// nx_test_many_params.nx -- proves nxc2 now handles >8 function params. 2// 3// Calls a 10-arg function: first 8 in a0-a7, last 2 on the stack. 4// Expected: sum_10(1,2,3,4,5,6,7,8,9,10) = 55. 5 6// nx_safety_envelope: 7// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 8// sil_target: SIL1 9// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 10// verdict: NOT_YET_EVALUATED 11 12import "nx_syscalls.nx" 13import "nx_tier.nx" 14 15func sum_10(a: nx_int, b: nx_int, c: nx_int, d: nx_int, e: nx_int, 16 f: nx_int, g: nx_int, h: nx_int, i: nx_int, j: nx_int) -> nx_int { 17 return a + b + c + d + e + f + g + h + i + j 18} 19 20func main() -> nx_exit { 21 let r: nx_int = sum_10(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) 22 if r != 55 { return r } // returns the wrong value as exit code 23 return 0 24}