2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / opt57.ads
blob1bee7992b1508b7b90e11310fc70e83e442e79d6
1 -- { dg-do compile }
2 -- { dg-options "-O3" }
4 with Ada.Finalization; use Ada.Finalization;
5 with Opt57_Pkg; use Opt57_Pkg;
7 package Opt57 is
9 procedure Update;
11 procedure Init;
13 type Module_Factory is abstract new Limited_Controlled with private;
15 type Root_Module_Rec (Language : access Module_Factory'Class)
16 is abstract new GC_Pool with null record;
18 type List is tagged limited private;
19 type Linkable is abstract new Root_Module_Rec with private;
20 type Linkable_Ptr is access all Linkable'Class;
22 private
24 type Link is access all List'Class;
25 type Link_Constant is access constant List'Class;
26 type List is tagged limited record
27 Next : Link;
28 end record;
30 type Links_Type (Container : access Linkable) is new List with null record;
32 type Linkable is abstract new Root_Module_Rec with record
33 On_List : Link_Constant;
34 Links : aliased Links_Type (Linkable'Access);
35 end record;
37 type Module_Rec (Language : access Module_Factory'Class)
38 is abstract new Linkable (Language) with null record;
39 type Module_Ptr is access all Module_Rec'Class;
41 type Private_Module_Factory;
42 type Private_Module_Factory_Ptr is access Private_Module_Factory;
44 type Module_Factory is abstract new Limited_Controlled with record
45 Priv : Private_Module_Factory_Ptr;
46 end record;
48 type Module_Factory_Ptr is access all Module_Factory'Class;
50 end Opt57;