2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gnat.dg / in_out_parameter2.adb
blob1b5cc7e6abf6634b2059f090d26a8f56d88367ba
1 -- { dg-do run }
2 -- { dg-options "-gnat12" }
4 procedure In_Out_Parameter2 is
6 function F (I : In Out Integer) return Boolean is
7 A : Integer := I;
8 begin
9 I := I + 1;
10 return (A > 0);
11 end;
13 I : Integer := 0;
14 B : Boolean;
16 begin
17 B := F (I);
18 if B then
19 raise Program_Error;
20 end if;
21 if I /= 1 then
22 raise Program_Error;
23 end if;
24 end;