* c-common.c (get_priority): Add check for
[official-gcc.git] / gcc / testsuite / gnat.dg / boolean_subtype.adb
blob3976d7992333c421ec50685f4f56584c1106024a
1 -- { dg-do compile }
2 -- { dg-options "-O2" }
4 procedure boolean_subtype 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;