Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gnat.dg / discr45.adb
blob5e276c9df6d9325cfec7c7549805144248667fab
1 -- { dg-do compile }
2 -- { dg-options "-O2 -gnatws" }
4 procedure Discr45 is
6 function Ident_Int (I : Integer) return Integer is
7 begin
8 return I;
9 end;
11 procedure Proc (Signal : Boolean) is
13 subtype Index is Integer range 1..10;
15 type My_Arr is array (Index range <>) OF Integer;
17 type Rec (D3 : Integer := Ident_Int(1)) is record
18 case D3 is
19 when -5..10 => C1 : My_Arr(D3..Ident_Int(11));
20 when Others => C2 : Integer := Ident_Int(5);
21 end case;
22 end record;
24 X : Rec;
26 function Value return Rec;
27 pragma No_Inline (Value);
29 function Value return Rec is
30 begin
31 return X;
32 end;
34 begin
35 if X /= Value then
36 raise Constraint_Error;
37 elsif Signal then
38 raise Program_Error;
39 end if;
40 end;
42 begin
43 Proc (True);
44 end;