code wiki / (root) / _arg9_delegate_probe.nx

_arg9_delegate_probe.nx source

↩ module page · 27 lines · 840 B

1// _arg9_delegate_probe.nx -- does a 9-arg TAIL-CALL delegation drop args? 2// Mirrors tls13_server_hello_emit -> emit2 (the B4 server-side shape). 3// expect_exit: 0 4// license_tier: ORIGINAL 5import "nx_syscalls.nx" 6 7func sink9(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64, h: i64, k: i64) -> i64 { 8 if a != 1 { return 1 } 9 if b != 2 { return 2 } 10 if c != 3 { return 3 } 11 if d != 4 { return 4 } 12 if e != 5 { return 5 } 13 if f != 6 { return 6 } 14 if g != 7 { return 7 } 15 if h != 8 { return 8 } 16 if k != 9 { return 9 } 17 return 0 18} 19 20// Tail-call delegation with arg reordering/insertion (the emit->emit2 shape). 21func delegate(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64) -> i64 { 22 return sink9(a, b, c, d, 5, e, 6 + 1, f, g) 23} 24 25func main() -> i64 { 26 return delegate(1, 2, 3, 4, 6, 8, 9) 27}