3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
6 -- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
7 -- software and documentation contained herein. Unlimited rights are
8 -- defined in DFAR 252.227-7013(a)(19). By making this public release,
9 -- the Government intends to confer upon all recipients unlimited rights
10 -- equal to those held by the Government. These rights include rights to
11 -- use, duplicate, release or disclose the released technical data and
12 -- computer software in whole or in part, in any manner and for any purpose
13 -- whatsoever, and to have or permit others to do so.
17 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
18 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
19 -- WARRANTY AS TO ANY MATTER WHATSOVER, INCLUDING THE CONDITIONS OF THE
20 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
21 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
22 -- PARTICULAR PURPOSE OF SAID MATERIAL.
26 -- Check the requirements of the revised 10.2.1(11) from Technical
27 -- Corrigendum 1 (originally discussed as AI95-00002).
28 -- A package subunit whose parent is a preelaborated subprogram need
29 -- not be preelaborable.
32 -- We create several preelaborated library procedures with
33 -- non-preelaborable package body subunits. We try various levels
34 -- of nesting of package and procedure subunits.
37 -- 29 JUN 1999 RAD Initial Version
38 -- 23 SEP 1999 RLB Improved comments, renamed, issued.
42 procedure CA21001_1
(X
: out Integer);
43 pragma Preelaborate
(CA21001_1
);
45 procedure CA21001_1
(X
: out Integer) is
46 function F
return Integer is separate;
49 function G
(X
: Integer) return Integer;
51 Not_Preelaborable
: Integer := F
; -- OK, by AI-2.
54 package body Sub
is separate;
67 package body Sub_Sub
is separate;
69 function G
(X
: Integer) return Integer is separate;
71 Not_Preelaborable
:= G
(F
); -- OK, by AI-2.
72 if Not_Preelaborable
/= 101 then
73 raise Program_Error
; -- Can't call Report.Failed, here,
74 -- because Report is not preelaborated.
78 separate(CA21001_1
.Sub
)
79 package body Sub_Sub
is
81 X
:= X
; -- OK by AI-2.
84 separate(CA21001_1
.Sub
)
85 function G
(X
: Integer) return Integer is
88 function H
(X
: Integer) return Integer;
90 Not_Preelaborable
: Integer := F
; -- OK, by AI-2.
92 package body G_Sub
is separate;
98 separate(CA21001_1
.Sub
.G
)
100 function H
(X
: Integer) return Integer is separate;
102 Not_Preelaborable
:= H
(F
); -- OK, by AI-2.
103 if Not_Preelaborable
/= 101 then
104 raise Program_Error
; -- Can't call Report.Failed, here,
105 -- because Report is not preelaborated.
109 separate(CA21001_1
.Sub
.G
.G_Sub
)
110 function H
(X
: Integer) return Integer is
116 function F
return Integer is
122 package body F_Sub
is separate;
127 separate(CA21001_1
.F
)
128 package body F_Sub
is
132 if True_Var
then -- OK by AI-2.
139 with Report
; use Report
;
145 "Test that a package subunit whose parent is a preelaborated"
146 & " subprogram need not be preelaborable");
149 Failed
("Bad value for X");