PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gnat.dg / boolean_subtype1.adb
blob60e2199dba13eaeceac26765152e7ff506cb9367
1 -- { dg-do compile }
2 -- { dg-options "-O2" }
4 procedure Boolean_Subtype1 is
6 subtype Component_T is Boolean;
8 function Condition return Boolean is
9 begin
10 return True;
11 end;
13 V : Integer := 0;
15 function Component_Value return Integer is
16 begin
17 V := V + 1;
18 return V;
19 end;
21 Most_Significant : Component_T := False;
22 Least_Significant : Component_T := True;
24 begin
26 if Condition then
27 Most_Significant := True;
28 end if;
30 if Condition then
31 Least_Significant := Component_T'Val (Component_Value);
32 end if;
34 if Least_Significant < Most_Significant then
35 Least_Significant := Most_Significant;
36 end if;
38 if Least_Significant /= True then
39 raise Program_Error;
40 end if;
42 end;