(* An if that ends a procedure, its body ending in return: the jump past the if lands at the procedure's return, not beyond it. *) module IfReturnEnds; import Sys; var keys: [1]INT; proc f(on: BOOL); begin if on and (keys[0] > 0) then keys[0] := 2; return; end; end; proc main*; begin f(false); keys[0] := 1; f(true); if keys[0] # 2 then Sys.exit(1); end; _ := Sys.write(Sys.stdout, "ok\n"); end; end IfReturnEnds.