1-- FA21A00.A
2--
3--                             Grant of Unlimited Rights
4--
5--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7--     unlimited rights in the software and documentation contained herein.
8--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
9--     this public release, the Government intends to confer upon all
10--     recipients unlimited rights  equal to those held by the Government.
11--     These rights include rights to use, duplicate, release or disclose the
12--     released technical data and computer software in whole or in part, in
13--     any manner and for any purpose whatsoever, and to have or permit others
14--     to do so.
15--
16--                                    DISCLAIMER
17--
18--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23--     PARTICULAR PURPOSE OF SAID MATERIAL.
24--*
25--
26-- FOUNDATION DESCRIPTION:
27--      This foundation declares various supporting types, objects, and
28--      subprograms for use in tests checking preelaborability.
29--
30-- CHANGE HISTORY:
31--      20 Mar 95   SAIC    Initial prerelease version.
32--
33--!
34
35with Ada.Finalization; -- Preelaborated library unit.
36package FA21A00 is
37
38   pragma Preelaborate (FA21A00);
39
40
41   type My_Int is new Integer range 0 .. 100;
42   function Func return My_Int;                 -- Non-static function.
43
44   subtype Idx is Natural range 1 .. 5;
45
46   Three : constant My_Int :=  3;
47   Ten   :          My_Int := 10;               -- Non-static.
48
49   type RecWithDisc (D: My_Int) is record
50      Twice: My_Int := D*2;
51   end record;
52
53   type RecCallDefault is record
54      C : My_Int := Func;
55      D : My_Int := 0;
56   end record;
57
58   type RecPrimDefault is record
59      C : My_Int := Ten;
60   end record;
61
62   type Tag is tagged record
63      C : My_Int;
64   end record;
65
66   type AccTag is access all Tag;
67
68   Tag1: aliased Tag;                                                 -- OK.
69
70   type My_Controlled is new Ada.Finalization.Controlled with record
71      C : My_Int;
72   end record;
73
74   type ContComp is tagged record
75      C: My_Controlled;
76   end record;
77
78   task type Tsk (D: My_Int);
79
80   protected type Prot is
81      entry E;
82   end Prot;
83
84   type Priv is tagged private;
85
86   type PrivComp is array (1 .. 5) of Priv;
87
88   type Pri_Ext is new Tag with private;
89
90   type PriExtComp is array (1 .. 5) of Pri_Ext;
91
92private
93
94   type Priv is tagged record
95      B: Boolean;
96   end record;
97
98   type Pri_Ext is new Tag with record
99      N: String (1 .. 5);
100   end record;
101
102end FA21A00;
103
104
105     --===================================================================--
106
107
108package body FA21A00 is
109
110   task body Tsk is
111   begin
112      null;
113   end Tsk;
114
115   protected body Prot is
116      entry E when False is
117      begin
118         null;
119      end E;
120   end Prot;
121
122   function Func return My_Int is
123   begin
124      return 0;
125   end Func;
126
127end FA21A00;
128