3 -- Grant of Unlimited Rights
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
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.
27 -- Check that a compilation unit may not depend semantically
28 -- on two different versions of the same compilation unit.
29 -- Check the case where a generic package depends on another
30 -- generic package specification.
33 -- This test compiles a generic package specification, then
34 -- compiles a generic package specification and body,
35 -- followed by a procedure that makes a call to a procedure
36 -- contained inside the second generic package. Then, the
37 -- first generic package specification is recompiled,
38 -- making the body of the generic package LA140060 obsolete.
39 -- Unless automatic recompilation is supported this test should
40 -- fail to link. Otherwise, the test should recompile and link
41 -- the correct version of the units and report "PASSED" at
44 -- SPECIAL REQUIREMENTS:
45 -- To build this test:
46 -- 1) Compile the file LA140060 (and include the results in the
48 -- 2) Compile the file LA140061 (and include the results in the
50 -- 3) Compile the file LA140062 (and include the results in the
52 -- 4) Compile the file LA140063 (and include the results in the
54 -- 5) Attempt to build an executable image.
55 -- 6) If an executable image results, run it.
58 -- This test consists of the following files:
64 -- PASS/FAIL CRITERIA:
65 -- Expect a link-time error message that the body of generic
66 -- package LA14006_1 is missing or obsolete. If automatic
67 -- recompilation is supported, and an executable image is
68 -- built, expect a "PASSED" message from execution.
72 -- 01 MAY 95 ACVC 1.12 LA5008K baseline version
73 -- 09 MAY 95 SAIC Initial version
74 -- 17 NOV 96 SAIC Modified unit names and prologue to conform
75 -- to coding conventions.
76 -- 07 DEC 96 SAIC Moved LA14006_0 to a separate file. Added
77 -- pragma Elaborate to context clause of LA14006_2.
85 type additional is (<>);
88 type T3 is new t_type with record
89 h: additional := add_val;
92 procedure P (TC_Change : out integer);
94 package inst is new LA14006_0 (T3);
97 ----------------------------------------------------------------
99 package body LA14006_1 is
100 procedure P (TC_Change : out integer) is
102 TC_Change := inst.TC_Var.g;
106 ----------------------------------------------------------------
109 pragma Elaborate (LA14006_1);
110 package LA14006_2 is new LA14006_1 (integer, 300);
112 ----------------------------------------------------------------
114 with Report; use Report;
116 procedure LA140062 is
117 TC_Val : integer := 0;
119 Test ("LA14006", "Check that a compilation unit may not " &
120 "depend semantically on two different " &
121 "versions of the same compilation unit. " &
122 "Check the case where a generic package " &
123 "depends on another generic package " &
126 LA14006_2.P (TC_Val);
129 Failed ("Obsolete unit used in elaboration");
130 elsif TC_Val /= -10 then
131 Failed ("Incorrect test value received");