raz / test / run / KeptCheck.raz

22 lines · 461 B · raw · history · last change 88e6b860

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