gcc/
[official-gcc.git] / gcc / testsuite / gnat.dg / specs / discr_private.ads
blob0ddfbd137ff775d666142a88d387b4575b88506d
1 -- { dg-do compile }
2 -- { dg-options "-gnatws" }
4 package Discr_Private is
6 package Dec is
7 type T_DECIMAL (Prec : Integer := 1) is private;
8 private
9 type T_DECIMAL (Prec : Integer := 1) is record
10 case Prec is
11 when 1 .. 2 => Value : Integer;
12 when others => null;
13 end case;
14 end record;
15 end;
17 type Value_T is record
18 Bits : Dec.T_DECIMAL(1);
19 end record;
20 for Value_T'size use 88;
22 type Value_Entry_T is record
23 Index : Integer;
24 Value : Value_T;
25 end record;
27 type Value_Mode is (QI, HI, SI, DI, XI);
28 for Value_Mode'size use 8;
30 type Valid_Modes_T is array (Value_Mode) of Boolean;
32 type Register_T is record
33 Ventry : Value_Entry_T;
34 Vmodes : Valid_Modes_T;
35 end record;
37 type Regid_T is (Latch, Acc);
38 for Regid_T use (Latch => 0, Acc => 2);
39 for Regid_T'Size use 8;
41 type Regarray_T is array (Regid_T) of Register_T;
43 type Machine_T (Up : Boolean := True) is record
44 case Up is
45 when True => Regs : Regarray_T;
46 when False => null;
47 end case;
48 end record;
50 end Discr_Private;