2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / discr6.adb
blob441b19bdf294d021131d09dae225344e250134a5
1 -- { dg-do compile }
2 -- { dg-options "-gnatdm -gnatws" }
4 with Discr6_Pkg;
6 procedure Discr6 is
8 type T_Bit is range 0..1;
9 type T_Entier_16 is range -2**15 .. 2**15-1;
11 package My_Q is new Discr6_Pkg(T_Entier_16);
13 type T_Valeur is (BIT, Entier_16);
15 type R(D : T_Valeur) is record
16 case D is
17 when BIT => V_BIT : T_Bit;
18 when Entier_16 => V_E16 : T_Entier_16;
19 end case;
20 end record;
21 for R use record
22 V_BIT at 0 range 0..7;
23 V_E16 at 0 range 0..15;
24 D at 8 range 0..7;
25 end record;
26 for R'size use 128;
28 A : R(Entier_16);
29 I : Integer;
31 begin
32 I := My_Q.X(A.V_E16);
33 end;