PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / in_out_parameter4.adb
blob4f5cc2181983c99df7209bc7b3c137ac1ef47160
1 -- { dg-do run }
2 -- { dg-options "-gnat12 -gnatVa" }
4 procedure In_Out_Parameter4 is
6 type Enum is (E_Undetermined, E_Down, E_Up);
7 subtype Status_T is Enum range E_Down .. E_Up;
9 function Recurse (Val : in out Integer) return Status_T is
11 Result : Status_T;
13 procedure Dummy (I : in out Integer) is begin null; end;
15 begin
16 if Val > 500 then
17 Val := Val - 1;
18 Result := Recurse (Val);
19 return Result;
20 else
21 return E_UP;
22 end if;
23 end;
25 Val : Integer := 501;
26 S : Status_T;
28 begin
29 S := Recurse (Val);
30 end;