| 1 | (* A procedure that calls nothing keeps its first parameters in rdi and |
| 2 | rsi; a failed check in it still says their values. *) |
| 3 | module KeptCheck; |
| 4 | import Out; |
| 5 | |
| 6 | var a: [4]I64; |
| 7 | |
| 8 | proc at(i: INT; b: U8): I64; |
| 9 | begin |
| 10 | return a[i] + I64(b); |
| 11 | end; |
| 12 | |
| 13 | (* called through a procedure value, so that at isn't made in place *) |
| 14 | proc main*; |
| 15 | var f: proc(i: INT; b: U8): I64; |
| 16 | begin |
| 17 | f := at; |
| 18 | Out.int(f(3, 1)); Out.ln; |
| 19 | Out.int(f(4, 200)); Out.ln; |
| 20 | end; |
| 21 | |
| 22 | end KeptCheck. |