annotate gcc/testsuite/ada/acats/tests/c3/c3a2a02.a @ 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 -- C3A2A02.A
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, for X'Access of a general access type A, Program_Error is
kono
parents:
diff changeset
28 -- raised if the accessibility level of X is deeper than that of A.
kono
parents:
diff changeset
29 -- Check for cases where X'Access occurs in an instance body, and A
kono
parents:
diff changeset
30 -- is a type either declared inside the instance, or declared outside
kono
parents:
diff changeset
31 -- the instance but not passed as an actual during instantiation.
kono
parents:
diff changeset
32 --
kono
parents:
diff changeset
33 -- TEST DESCRIPTION:
kono
parents:
diff changeset
34 -- In order to satisfy accessibility requirements, the designated
kono
parents:
diff changeset
35 -- object X must be at the same or a less deep nesting level than the
kono
parents:
diff changeset
36 -- general access type A -- X must "live" as long as A. Nesting
kono
parents:
diff changeset
37 -- levels are the run-time nestings of masters: block statements;
kono
parents:
diff changeset
38 -- subprogram, task, and entry bodies; and accept statements. Packages
kono
parents:
diff changeset
39 -- are invisible to accessibility rules.
kono
parents:
diff changeset
40 --
kono
parents:
diff changeset
41 -- This test declares three generic packages:
kono
parents:
diff changeset
42 --
kono
parents:
diff changeset
43 -- (1) One in which X is of a formal tagged derived type and declared
kono
parents:
diff changeset
44 -- in the body, A is a type declared outside the instance, and
kono
parents:
diff changeset
45 -- X'Access occurs in the declarative part of a nested subprogram.
kono
parents:
diff changeset
46 --
kono
parents:
diff changeset
47 -- (2) One in which X is a formal object of a tagged type, A is a
kono
parents:
diff changeset
48 -- type declared outside the instance, and X'Access occurs in the
kono
parents:
diff changeset
49 -- declarative part of the body.
kono
parents:
diff changeset
50 --
kono
parents:
diff changeset
51 -- (3) One in which there are two X's and two A's. In the first pair,
kono
parents:
diff changeset
52 -- X is a formal in object of a tagged type, A is declared in the
kono
parents:
diff changeset
53 -- specification, and X'Access occurs in the declarative part of
kono
parents:
diff changeset
54 -- the body. In the second pair, X is of a formal derived type,
kono
parents:
diff changeset
55 -- X and A are declared in the specification, and X'Access occurs
kono
parents:
diff changeset
56 -- in the sequence of statements of the body.
kono
parents:
diff changeset
57 --
kono
parents:
diff changeset
58 -- The test verifies the following:
kono
parents:
diff changeset
59 --
kono
parents:
diff changeset
60 -- For (1), Program_Error is raised when the nested subprogram is
kono
parents:
diff changeset
61 -- called, if the generic package is instantiated at a deeper level
kono
parents:
diff changeset
62 -- than that of A. The exception is propagated to the innermost
kono
parents:
diff changeset
63 -- enclosing master. Also, check that Program_Error is not raised
kono
parents:
diff changeset
64 -- if the instantiation is at the same level as that of A.
kono
parents:
diff changeset
65 --
kono
parents:
diff changeset
66 -- For (2), Program_Error is raised upon instantiation if the object
kono
parents:
diff changeset
67 -- passed as an actual during instantiation has an accessibility level
kono
parents:
diff changeset
68 -- deeper than that of A. The exception is propagated to the innermost
kono
parents:
diff changeset
69 -- enclosing master. Also, check that Program_Error is not raised if
kono
parents:
diff changeset
70 -- the level of the actual object is not deeper than that of A.
kono
parents:
diff changeset
71 --
kono
parents:
diff changeset
72 -- For (3), Program_Error is not raised, for actual objects at
kono
parents:
diff changeset
73 -- various accessibility levels (since A will have at least the same
kono
parents:
diff changeset
74 -- accessibility level as X in all cases, no exception should ever
kono
parents:
diff changeset
75 -- be raised).
kono
parents:
diff changeset
76 --
kono
parents:
diff changeset
77 -- TEST FILES:
kono
parents:
diff changeset
78 -- The following files comprise this test:
kono
parents:
diff changeset
79 --
kono
parents:
diff changeset
80 -- F3A2A00.A
kono
parents:
diff changeset
81 -- -> C3A2A02.A
kono
parents:
diff changeset
82 --
kono
parents:
diff changeset
83 --
kono
parents:
diff changeset
84 -- CHANGE HISTORY:
kono
parents:
diff changeset
85 -- 12 May 95 SAIC Initial prerelease version.
kono
parents:
diff changeset
86 -- 10 Jul 95 SAIC Modified code to avoid dead variable optimization.
kono
parents:
diff changeset
87 -- 26 Jun 98 EDS Added pragma Elaborate (C3A2A02_0) to package
kono
parents:
diff changeset
88 -- package C3A2A02_3, in order to avoid possible
kono
parents:
diff changeset
89 -- instantiation error.
kono
parents:
diff changeset
90 --!
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 with F3A2A00;
kono
parents:
diff changeset
93 generic
kono
parents:
diff changeset
94 type FD is new F3A2A00.Tagged_Type with private;
kono
parents:
diff changeset
95 package C3A2A02_0 is
kono
parents:
diff changeset
96 procedure Proc;
kono
parents:
diff changeset
97 end C3A2A02_0;
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 --==================================================================--
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 with Report;
kono
parents:
diff changeset
104 package body C3A2A02_0 is
kono
parents:
diff changeset
105 X : aliased FD;
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 procedure Proc is
kono
parents:
diff changeset
108 Ptr : F3A2A00.AccTagClass_L0 := X'Access;
kono
parents:
diff changeset
109 begin
kono
parents:
diff changeset
110 -- Avoid optimization (dead variable removal of Ptr):
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
kono
parents:
diff changeset
113 Report.Failed ("Unexpected error in Proc");
kono
parents:
diff changeset
114 end if;
kono
parents:
diff changeset
115 end Proc;
kono
parents:
diff changeset
116 end C3A2A02_0;
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 --==================================================================--
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 with F3A2A00;
kono
parents:
diff changeset
123 generic
kono
parents:
diff changeset
124 FObj : in out F3A2A00.Tagged_Type;
kono
parents:
diff changeset
125 package C3A2A02_1 is
kono
parents:
diff changeset
126 procedure Dummy; -- Needed to allow package body.
kono
parents:
diff changeset
127 end C3A2A02_1;
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 --==================================================================--
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 with Report;
kono
parents:
diff changeset
134 package body C3A2A02_1 is
kono
parents:
diff changeset
135 Ptr : F3A2A00.AccTag_L0 := FObj'Access;
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 procedure Dummy is
kono
parents:
diff changeset
138 begin
kono
parents:
diff changeset
139 null;
kono
parents:
diff changeset
140 end Dummy;
kono
parents:
diff changeset
141 begin
kono
parents:
diff changeset
142 -- Avoid optimization (dead variable removal of Ptr):
kono
parents:
diff changeset
143
kono
parents:
diff changeset
144 if not Report.Equal (Ptr.C, Ptr.C) then -- Always false.
kono
parents:
diff changeset
145 Report.Failed ("Unexpected error in C3A2A02_1 instance");
kono
parents:
diff changeset
146 end if;
kono
parents:
diff changeset
147 end C3A2A02_1;
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149
kono
parents:
diff changeset
150 --==================================================================--
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 with F3A2A00;
kono
parents:
diff changeset
154 generic
kono
parents:
diff changeset
155 type FD is new F3A2A00.Array_Type;
kono
parents:
diff changeset
156 FObj : in F3A2A00.Tagged_Type;
kono
parents:
diff changeset
157 package C3A2A02_2 is
kono
parents:
diff changeset
158 type GAF is access all FD;
kono
parents:
diff changeset
159 type GAO is access constant F3A2A00.Tagged_Type;
kono
parents:
diff changeset
160 XG : aliased FD;
kono
parents:
diff changeset
161 PtrF : GAF;
kono
parents:
diff changeset
162 Index : Integer := FD'First;
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 procedure Dummy; -- Needed to allow package body.
kono
parents:
diff changeset
165 end C3A2A02_2;
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 --==================================================================--
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 with Report;
kono
parents:
diff changeset
172 package body C3A2A02_2 is
kono
parents:
diff changeset
173 PtrO : GAO := FObj'Access;
kono
parents:
diff changeset
174
kono
parents:
diff changeset
175 procedure Dummy is
kono
parents:
diff changeset
176 begin
kono
parents:
diff changeset
177 null;
kono
parents:
diff changeset
178 end Dummy;
kono
parents:
diff changeset
179 begin
kono
parents:
diff changeset
180 PtrF := XG'Access;
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182 -- Avoid optimization (dead variable removal of PtrO and/or PtrF):
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 if not Report.Equal (PtrO.C, PtrO.C) then -- Always false.
kono
parents:
diff changeset
185 Report.Failed ("Unexpected error in C3A2A02_2 instance: PtrO");
kono
parents:
diff changeset
186 end if;
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 if not Report.Equal (PtrF(Index).C, PtrF(Index).C) then -- Always false.
kono
parents:
diff changeset
189 Report.Failed ("Unexpected error in C3A2A02_2 instance: PtrF");
kono
parents:
diff changeset
190 end if;
kono
parents:
diff changeset
191 end C3A2A02_2;
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193
kono
parents:
diff changeset
194 --==================================================================--
kono
parents:
diff changeset
195
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 -- The instantiation of C3A2A02_0 should NOT result in any exceptions.
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 with F3A2A00;
kono
parents:
diff changeset
200 with C3A2A02_0;
kono
parents:
diff changeset
201 pragma Elaborate (C3A2A02_0);
kono
parents:
diff changeset
202 package C3A2A02_3 is new C3A2A02_0 (F3A2A00.Tagged_Type);
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204
kono
parents:
diff changeset
205 --==================================================================--
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207
kono
parents:
diff changeset
208 with F3A2A00;
kono
parents:
diff changeset
209 with C3A2A02_0;
kono
parents:
diff changeset
210 with C3A2A02_1;
kono
parents:
diff changeset
211 with C3A2A02_2;
kono
parents:
diff changeset
212 with C3A2A02_3;
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 with Report;
kono
parents:
diff changeset
215 procedure C3A2A02 is
kono
parents:
diff changeset
216 begin -- C3A2A02. -- [ Level = 1 ]
kono
parents:
diff changeset
217
kono
parents:
diff changeset
218 Report.Test ("C3A2A02", "Run-time accessibility checks: instance " &
kono
parents:
diff changeset
219 "bodies. Type of X'Access is local or global to instance");
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222 SUBTEST1:
kono
parents:
diff changeset
223 declare -- [ Level = 2 ]
kono
parents:
diff changeset
224 Result1 : F3A2A00.TC_Result_Kind;
kono
parents:
diff changeset
225 Result2 : F3A2A00.TC_Result_Kind;
kono
parents:
diff changeset
226 begin -- SUBTEST1.
kono
parents:
diff changeset
227
kono
parents:
diff changeset
228 declare -- [ Level = 3 ]
kono
parents:
diff changeset
229 package Pack_Same_Level renames C3A2A02_3;
kono
parents:
diff changeset
230 begin
kono
parents:
diff changeset
231 -- The accessibility level of Pack_Same_Level.X is that of the
kono
parents:
diff changeset
232 -- instance (0), not that of the renaming declaration. The level of
kono
parents:
diff changeset
233 -- the type of Pack_Same_Level.X'Access (F3A2A00.AccTagClass_L0) is
kono
parents:
diff changeset
234 -- 0. Therefore, the X'Access in Pack_Same_Level.Proc does not raise
kono
parents:
diff changeset
235 -- an exception when the subprogram is called. The level of execution
kono
parents:
diff changeset
236 -- of the subprogram is irrelevant:
kono
parents:
diff changeset
237
kono
parents:
diff changeset
238 Pack_Same_Level.Proc;
kono
parents:
diff changeset
239 Result1 := F3A2A00.OK; -- Expected result.
kono
parents:
diff changeset
240 exception
kono
parents:
diff changeset
241 when Program_Error => Result1 := F3A2A00.P_E;
kono
parents:
diff changeset
242 when others => Result1 := F3A2A00.O_E;
kono
parents:
diff changeset
243 end;
kono
parents:
diff changeset
244
kono
parents:
diff changeset
245 F3A2A00.TC_Display_Results (Result1, F3A2A00.OK,
kono
parents:
diff changeset
246 "SUBTEST #1 (same level)");
kono
parents:
diff changeset
247
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 declare -- [ Level = 3 ]
kono
parents:
diff changeset
250 -- The instantiation of C3A2A02_0 should NOT result in any
kono
parents:
diff changeset
251 -- exceptions.
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 package Pack_Deeper_Level is new C3A2A02_0 (F3A2A00.Tagged_Type);
kono
parents:
diff changeset
254 begin
kono
parents:
diff changeset
255 -- The accessibility level of Pack_Deeper_Level.X is that of the
kono
parents:
diff changeset
256 -- instance (3). The level of the type of Pack_Deeper_Level.X'Access
kono
parents:
diff changeset
257 -- (F3A2A00.AccTagClass_L0) is 0. Therefore, the X'Access in
kono
parents:
diff changeset
258 -- Pack_Deeper_Level.Proc propagates Program_Error when the
kono
parents:
diff changeset
259 -- subprogram is called:
kono
parents:
diff changeset
260
kono
parents:
diff changeset
261 Pack_Deeper_Level.Proc;
kono
parents:
diff changeset
262 Result2 := F3A2A00.OK;
kono
parents:
diff changeset
263 exception
kono
parents:
diff changeset
264 when Program_Error => Result2 := F3A2A00.P_E; -- Expected result.
kono
parents:
diff changeset
265 when others => Result2 := F3A2A00.O_E;
kono
parents:
diff changeset
266 end;
kono
parents:
diff changeset
267
kono
parents:
diff changeset
268 F3A2A00.TC_Display_Results (Result2, F3A2A00.P_E,
kono
parents:
diff changeset
269 "SUBTEST #1: deeper level");
kono
parents:
diff changeset
270
kono
parents:
diff changeset
271 exception
kono
parents:
diff changeset
272 when Program_Error =>
kono
parents:
diff changeset
273 Report.Failed ("SUBTEST #1: Program_Error incorrectly raised " &
kono
parents:
diff changeset
274 "during instantiation of generic");
kono
parents:
diff changeset
275 when others =>
kono
parents:
diff changeset
276 Report.Failed ("SUBTEST #1: Unexpected exception raised " &
kono
parents:
diff changeset
277 "during instantiation of generic");
kono
parents:
diff changeset
278 end SUBTEST1;
kono
parents:
diff changeset
279
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 SUBTEST2:
kono
parents:
diff changeset
283 declare -- [ Level = 2 ]
kono
parents:
diff changeset
284 Result1 : F3A2A00.TC_Result_Kind;
kono
parents:
diff changeset
285 Result2 : F3A2A00.TC_Result_Kind;
kono
parents:
diff changeset
286 begin -- SUBTEST2.
kono
parents:
diff changeset
287
kono
parents:
diff changeset
288 declare -- [ Level = 3 ]
kono
parents:
diff changeset
289 X_L3 : F3A2A00.Tagged_Type;
kono
parents:
diff changeset
290 begin
kono
parents:
diff changeset
291 declare -- [ Level = 4 ]
kono
parents:
diff changeset
292 -- The accessibility level of the actual object corresponding to
kono
parents:
diff changeset
293 -- FObj in Pack_PE is 3. The level of the type of FObj'Access
kono
parents:
diff changeset
294 -- (F3A2A00.AccTag_L0) is 0. Therefore, the FObj'Access in Pack_PE
kono
parents:
diff changeset
295 -- propagates Program_Error when the instance body is elaborated:
kono
parents:
diff changeset
296
kono
parents:
diff changeset
297 package Pack_PE is new C3A2A02_1 (X_L3);
kono
parents:
diff changeset
298 begin
kono
parents:
diff changeset
299 Result1 := F3A2A00.OK;
kono
parents:
diff changeset
300 end;
kono
parents:
diff changeset
301 exception
kono
parents:
diff changeset
302 when Program_Error => Result1 := F3A2A00.P_E; -- Expected result.
kono
parents:
diff changeset
303 when others => Result1 := F3A2A00.O_E;
kono
parents:
diff changeset
304 end;
kono
parents:
diff changeset
305
kono
parents:
diff changeset
306 F3A2A00.TC_Display_Results (Result1, F3A2A00.P_E,
kono
parents:
diff changeset
307 "SUBTEST #2: deeper level");
kono
parents:
diff changeset
308
kono
parents:
diff changeset
309
kono
parents:
diff changeset
310 begin -- [ Level = 3 ]
kono
parents:
diff changeset
311 declare -- [ Level = 4 ]
kono
parents:
diff changeset
312 -- The accessibility level of the actual object corresponding to
kono
parents:
diff changeset
313 -- FObj in Pack_OK is 0. The level of the type of FObj'Access
kono
parents:
diff changeset
314 -- (F3A2A00.AccTag_L0) is also 0. Therefore, the FObj'Access in
kono
parents:
diff changeset
315 -- Pack_OK does not raise an exception when the instance body is
kono
parents:
diff changeset
316 -- elaborated:
kono
parents:
diff changeset
317
kono
parents:
diff changeset
318 package Pack_OK is new C3A2A02_1 (F3A2A00.X_L0);
kono
parents:
diff changeset
319 begin
kono
parents:
diff changeset
320 Result2 := F3A2A00.OK; -- Expected result.
kono
parents:
diff changeset
321 end;
kono
parents:
diff changeset
322 exception
kono
parents:
diff changeset
323 when Program_Error => Result2 := F3A2A00.P_E;
kono
parents:
diff changeset
324 when others => Result2 := F3A2A00.O_E;
kono
parents:
diff changeset
325 end;
kono
parents:
diff changeset
326
kono
parents:
diff changeset
327 F3A2A00.TC_Display_Results (Result2, F3A2A00.OK,
kono
parents:
diff changeset
328 "SUBTEST #2: same level");
kono
parents:
diff changeset
329
kono
parents:
diff changeset
330 end SUBTEST2;
kono
parents:
diff changeset
331
kono
parents:
diff changeset
332
kono
parents:
diff changeset
333
kono
parents:
diff changeset
334 SUBTEST3:
kono
parents:
diff changeset
335 declare -- [ Level = 2 ]
kono
parents:
diff changeset
336 Result1 : F3A2A00.TC_Result_Kind;
kono
parents:
diff changeset
337 Result2 : F3A2A00.TC_Result_Kind;
kono
parents:
diff changeset
338 begin -- SUBTEST3.
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340 declare -- [ Level = 3 ]
kono
parents:
diff changeset
341 X_L3 : F3A2A00.Tagged_Type;
kono
parents:
diff changeset
342 begin
kono
parents:
diff changeset
343 declare -- [ Level = 4 ]
kono
parents:
diff changeset
344 -- Since the accessibility level of the type of X'Access in
kono
parents:
diff changeset
345 -- both cases within Pack_OK1 is that of the instance, and since
kono
parents:
diff changeset
346 -- X is either passed as an actual (in which case its level will
kono
parents:
diff changeset
347 -- not be deeper than that of the instance) or is declared within
kono
parents:
diff changeset
348 -- the instance (in which case its level is the same as that of
kono
parents:
diff changeset
349 -- the instance), no exception should be raised when the instance
kono
parents:
diff changeset
350 -- body is elaborated:
kono
parents:
diff changeset
351
kono
parents:
diff changeset
352 package Pack_OK1 is new C3A2A02_2 (F3A2A00.Array_Type, X_L3);
kono
parents:
diff changeset
353 begin
kono
parents:
diff changeset
354 Result1 := F3A2A00.OK; -- Expected result.
kono
parents:
diff changeset
355 end;
kono
parents:
diff changeset
356 exception
kono
parents:
diff changeset
357 when Program_Error => Result1 := F3A2A00.P_E;
kono
parents:
diff changeset
358 when others => Result1 := F3A2A00.O_E;
kono
parents:
diff changeset
359 end;
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 F3A2A00.TC_Display_Results (Result1, F3A2A00.OK,
kono
parents:
diff changeset
362 "SUBTEST #3: 1st okay case");
kono
parents:
diff changeset
363
kono
parents:
diff changeset
364
kono
parents:
diff changeset
365 declare -- [ Level = 3 ]
kono
parents:
diff changeset
366 type My_Array is new F3A2A00.Array_Type;
kono
parents:
diff changeset
367 begin
kono
parents:
diff changeset
368 declare -- [ Level = 4 ]
kono
parents:
diff changeset
369 -- Since the accessibility level of the type of X'Access in
kono
parents:
diff changeset
370 -- both cases within Pack_OK2 is that of the instance, and since
kono
parents:
diff changeset
371 -- X is either passed as an actual (in which case its level will
kono
parents:
diff changeset
372 -- not be deeper than that of the instance) or is declared within
kono
parents:
diff changeset
373 -- the instance (in which case its level is the same as that of
kono
parents:
diff changeset
374 -- the instance), no exception should be raised when the instance
kono
parents:
diff changeset
375 -- body is elaborated:
kono
parents:
diff changeset
376
kono
parents:
diff changeset
377 package Pack_OK2 is new C3A2A02_2 (My_Array, F3A2A00.X_L0);
kono
parents:
diff changeset
378 begin
kono
parents:
diff changeset
379 Result2 := F3A2A00.OK; -- Expected result.
kono
parents:
diff changeset
380 end;
kono
parents:
diff changeset
381 exception
kono
parents:
diff changeset
382 when Program_Error => Result2 := F3A2A00.P_E;
kono
parents:
diff changeset
383 when others => Result2 := F3A2A00.O_E;
kono
parents:
diff changeset
384 end;
kono
parents:
diff changeset
385
kono
parents:
diff changeset
386 F3A2A00.TC_Display_Results (Result2, F3A2A00.OK,
kono
parents:
diff changeset
387 "SUBTEST #3: 2nd okay case");
kono
parents:
diff changeset
388
kono
parents:
diff changeset
389
kono
parents:
diff changeset
390 end SUBTEST3;
kono
parents:
diff changeset
391
kono
parents:
diff changeset
392
kono
parents:
diff changeset
393
kono
parents:
diff changeset
394 Report.Result;
kono
parents:
diff changeset
395
kono
parents:
diff changeset
396 end C3A2A02;