nx_rw_elseif.nx source
↩ module page · 14 lines · 552 B
1// nx_rw_elseif.nx -- DELIBERATE TRAP WITNESS (pack-rules vet, see knowledge/forge/pack_rules_vet_v1.txt).
2// Tactic under test: `else if` chain. Exit 0 iff the tactic compiles AND behaves correctly.
3// While the rule is ACTIVE this file is EXPECTED TO FAIL THE LANE (parse error). Not a defect.
4// license_tier: ORIGINAL
5import "nx_syscalls.nx"
6
7func main(argc: i64, argv: *i64) -> i64 {
8 let a: i64 = 2
9 var r: i64 = 0
10 if a == 1 { r = 1 } else if a == 2 { r = 2 } else { r = 3 }
11 if r == 2 { sys_exit(0) }
12 sys_exit(1)
13 return 0
14}