code wiki / (root) / _self_host_pack4_oneline.nx

_self_host_pack4_oneline.nx source

↩ module page · 13 lines · 398 B

1// Same pack4 but body on ONE line. If this passes but multiline 2// expect_exit: 4 3// fails, the bug is statement-boundary mis-detection. 4import "nx_syscalls.nx" 5 6func pack4(a: i64, b: i64, c: i64, d: i64) -> i64 { 7 return (a & 0xFFFF) | ((b & 0xFFFF) << 16) | ((c & 0xFFFF) << 32) | ((d & 0xFFFF) << 48) 8} 9 10func main() -> i64 { 11 let v: i64 = pack4(1, 2, 3, 4) 12 return (v >> 48) & 0xFF 13}