PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gnat.dg / discr44.adb
blobea9f5b139eb74888bf73907ea271fbbc436672b4
1 -- { dg-do run }
2 -- { dg-options "-gnatws" }
4 procedure Discr44 is
6 function Ident (I : Integer) return Integer is
7 begin
8 return I;
9 end;
11 type Int is range 1 .. 10;
13 type Str is array (Int range <>) of Character;
15 type Parent (D1, D2 : Int; B : Boolean) is record
16 S : Str (D1 .. D2);
17 end record;
19 type Derived (D : Int) is new Parent (D1 => D, D2 => D, B => False);
21 X1 : Derived (D => Int (Ident (7)));
23 begin
24 if X1.D /= 7 then
25 raise Program_Error;
26 end if;
27 end;