annotate gcc/testsuite/ada/acats/tests/l/la140162.am @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- LA140162.AM
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 -- Check that a compilation unit may not depend semantically
kono
parents:
diff changeset
28 -- on two different versions of the same compilation unit.
kono
parents:
diff changeset
29 -- Check the case where a separate procedure depends
kono
parents:
diff changeset
30 -- on a withed generic package that is changed.
kono
parents:
diff changeset
31 --
kono
parents:
diff changeset
32 -- TEST DESCRIPTION:
kono
parents:
diff changeset
33 -- This test declares a package which contains a generic procedure GP,
kono
parents:
diff changeset
34 -- the body of which is a subunit. The package also contains a procedure
kono
parents:
diff changeset
35 -- P which instantiates GP and calls the instance. The instance itself
kono
parents:
diff changeset
36 -- calls a procedure which is declared within the instance of a generic
kono
parents:
diff changeset
37 -- package X. The test compiles each of these compilation units and the
kono
parents:
diff changeset
38 -- main procedure, then compiles a new version of the generic package X
kono
parents:
diff changeset
39 -- (in a separate file, simulating an editing modification to the unit).
kono
parents:
diff changeset
40 -- Unless automatic recompilation is supported, this test should fail to
kono
parents:
diff changeset
41 -- link. Otherwise, the test should recompile and link the correct
kono
parents:
diff changeset
42 -- version of the generic package X and report "PASSED" at execution time.
kono
parents:
diff changeset
43 --
kono
parents:
diff changeset
44 -- SPECIAL REQUIREMENTS:
kono
parents:
diff changeset
45 -- To build this test:
kono
parents:
diff changeset
46 -- 1) Compile the file LA140160 (and include the results in the
kono
parents:
diff changeset
47 -- program library).
kono
parents:
diff changeset
48 -- 2) Compile the file LA140161 (and include the results in the
kono
parents:
diff changeset
49 -- program library).
kono
parents:
diff changeset
50 -- 3) Compile the file LA140162 (and include the results in the
kono
parents:
diff changeset
51 -- program library).
kono
parents:
diff changeset
52 -- 4) Compile the file LA140163 (and include the results in the
kono
parents:
diff changeset
53 -- program library).
kono
parents:
diff changeset
54 -- 5) Attempt to build an executable image.
kono
parents:
diff changeset
55 -- 6) If an executable image results, run it.
kono
parents:
diff changeset
56 --
kono
parents:
diff changeset
57 -- TEST FILES:
kono
parents:
diff changeset
58 -- This test consists of the following files:
kono
parents:
diff changeset
59 -- LA140160.A
kono
parents:
diff changeset
60 -- LA140161.A
kono
parents:
diff changeset
61 -- -> LA140162.AM
kono
parents:
diff changeset
62 -- LA140163.A
kono
parents:
diff changeset
63 --
kono
parents:
diff changeset
64 -- PASS/FAIL CRITERIA:
kono
parents:
diff changeset
65 -- The test passes if a link time error message reports that
kono
parents:
diff changeset
66 -- LA14016_4.gen_def is missing or obsolete and no executable
kono
parents:
diff changeset
67 -- image results. The test also passes if an executable image is
kono
parents:
diff changeset
68 -- produced and reports "PASSED" (in the case where the implementation
kono
parents:
diff changeset
69 -- supports automatic recompilation).
kono
parents:
diff changeset
70 --
kono
parents:
diff changeset
71 --
kono
parents:
diff changeset
72 -- CHANGE HISTORY:
kono
parents:
diff changeset
73 -- 01 MAY 95 ACVC 1.12 LA5008L baseline version
kono
parents:
diff changeset
74 -- 16 JUN 95 SAIC Initial version
kono
parents:
diff changeset
75 -- 07 DEC 96 SAIC Modified unit names and prologue to conform
kono
parents:
diff changeset
76 -- to coding conventions. Restructured subunits
kono
parents:
diff changeset
77 -- to prevent potential Program_Error due to
kono
parents:
diff changeset
78 -- premature instantiation of gen_def. Moved
kono
parents:
diff changeset
79 -- LA14016_1 to a separate file. Added pragma
kono
parents:
diff changeset
80 -- Elaborate to context clause of LA14016_3.
kono
parents:
diff changeset
81 --
kono
parents:
diff changeset
82 --
kono
parents:
diff changeset
83 --!
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 package body LA14016_1 is
kono
parents:
diff changeset
86 procedure inc (param : in out new_t) is
kono
parents:
diff changeset
87 begin
kono
parents:
diff changeset
88 param.count := param.count + 1;
kono
parents:
diff changeset
89 end inc;
kono
parents:
diff changeset
90 function status (param : new_t) return LA14016_0.status_code is
kono
parents:
diff changeset
91 begin
kono
parents:
diff changeset
92 return LA14016_0.status_code(param.count);
kono
parents:
diff changeset
93 end status;
kono
parents:
diff changeset
94 end LA14016_1;
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 ---------------------------------------------------------
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 with LA14016_0;
kono
parents:
diff changeset
99 package LA14016_2 is
kono
parents:
diff changeset
100 type extended is new LA14016_0.tagged_type with
kono
parents:
diff changeset
101 record
kono
parents:
diff changeset
102 status : LA14016_0.status_code := 10;
kono
parents:
diff changeset
103 end record;
kono
parents:
diff changeset
104 function status (param : extended) return LA14016_0.status_code;
kono
parents:
diff changeset
105 end LA14016_2;
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 ---------------------------------------------------------
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 package body LA14016_2 is
kono
parents:
diff changeset
110 function status (param : extended) return LA14016_0.status_code is
kono
parents:
diff changeset
111 begin
kono
parents:
diff changeset
112 return param.status;
kono
parents:
diff changeset
113 end status;
kono
parents:
diff changeset
114 end LA14016_2;
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 ---------------------------------------------------------
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 with LA14016_0;
kono
parents:
diff changeset
119 with LA14016_1;
kono
parents:
diff changeset
120 with LA14016_2;
kono
parents:
diff changeset
121 pragma Elaborate (LA14016_1);
kono
parents:
diff changeset
122 package LA14016_3 is new LA14016_1 (LA14016_2.extended,
kono
parents:
diff changeset
123 LA14016_0.status_code);
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 ---------------------------------------------------------
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 with LA14016_3;
kono
parents:
diff changeset
128 package LA14016_4 is
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 procedure gen_caller (p1 : in out LA14016_3.new_t);
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 generic
kono
parents:
diff changeset
133 new_max : integer;
kono
parents:
diff changeset
134 procedure gen_def (param : in out LA14016_3.new_t);
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 end LA14016_4;
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 ---------------------------------------------------------
kono
parents:
diff changeset
139
kono
parents:
diff changeset
140 package body LA14016_4 is
kono
parents:
diff changeset
141 procedure gen_def (param : in out LA14016_3.new_t) is separate;
kono
parents:
diff changeset
142 procedure gen_caller (p1 : in out LA14016_3.new_t) is separate;
kono
parents:
diff changeset
143 end LA14016_4;
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 ---------------------------------------------------------
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 separate (LA14016_4)
kono
parents:
diff changeset
148 procedure gen_def (param : in out LA14016_3.new_t) is
kono
parents:
diff changeset
149 begin
kono
parents:
diff changeset
150 param.status := LA14016_3.default_status; --originally 0
kono
parents:
diff changeset
151 --later change to 5
kono
parents:
diff changeset
152 param.count := param.status;
kono
parents:
diff changeset
153 LA14016_3.inc (param);
kono
parents:
diff changeset
154 end gen_def;
kono
parents:
diff changeset
155
kono
parents:
diff changeset
156 ---------------------------------------------------------
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 separate (LA14016_4)
kono
parents:
diff changeset
159 procedure gen_caller (p1 : in out LA14016_3.new_t) is
kono
parents:
diff changeset
160 procedure default is new gen_def (101);
kono
parents:
diff changeset
161 begin
kono
parents:
diff changeset
162 default (p1);
kono
parents:
diff changeset
163 end gen_caller;
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 ---------------------------------------------------------
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 with Report; use Report;
kono
parents:
diff changeset
168 with LA14016_3;
kono
parents:
diff changeset
169 with LA14016_4;
kono
parents:
diff changeset
170 with LA14016_2;
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 procedure LA140162 is
kono
parents:
diff changeset
173 E : LA14016_3.new_t; --status defaults to 10
kono
parents:
diff changeset
174 begin
kono
parents:
diff changeset
175 Test ("LA14016","Check that a compilation unit may not depend " &
kono
parents:
diff changeset
176 "semantically on two different versions of the " &
kono
parents:
diff changeset
177 "same compilation unit. Check the case where a " &
kono
parents:
diff changeset
178 "separate procedure depends on a withed generic " &
kono
parents:
diff changeset
179 "package that is changed");
kono
parents:
diff changeset
180
kono
parents:
diff changeset
181 LA14016_4.gen_caller (E);
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 if E.status = 0 then
kono
parents:
diff changeset
184 Failed ("Old generic used");
kono
parents:
diff changeset
185 elsif E.status = 10 then
kono
parents:
diff changeset
186 Failed ("Status not updated");
kono
parents:
diff changeset
187 elsif E.status /= 5 then
kono
parents:
diff changeset
188 Failed ("Wrong status value used");
kono
parents:
diff changeset
189 end if;
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 if E.count /= 6 then
kono
parents:
diff changeset
192 Failed ("Count not properly handled");
kono
parents:
diff changeset
193 end if;
kono
parents:
diff changeset
194
kono
parents:
diff changeset
195 Result;
kono
parents:
diff changeset
196 end LA140162;