annotate gcc/testsuite/ada/acats/tests/l/la140221.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 -- LA140221.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 generic instantiation depends on
kono
parents:
diff changeset
30 -- a generic procedure that is changed.
kono
parents:
diff changeset
31 --
kono
parents:
diff changeset
32 -- TEST DESCRIPTION:
kono
parents:
diff changeset
33 -- This test compiles a generic procedure, a second generic
kono
parents:
diff changeset
34 -- procedure, a generic instantiation of the second procedure
kono
parents:
diff changeset
35 -- that depends on both the first and second generic
kono
parents:
diff changeset
36 -- procedures, and a main procedure that withs the instantiated
kono
parents:
diff changeset
37 -- procedure. Then, a new version of the first generic
kono
parents:
diff changeset
38 -- procedure is compiled (in a separate file, simulating
kono
parents:
diff changeset
39 -- editing and modification to the unit). Unless automatic
kono
parents:
diff changeset
40 -- recompilation is supported, this test should fail to link.
kono
parents:
diff changeset
41 -- Otherwise, the test should recompile and link the correct
kono
parents:
diff changeset
42 -- version of the withed function and report "PASSED" at
kono
parents:
diff changeset
43 -- execution time.
kono
parents:
diff changeset
44 --
kono
parents:
diff changeset
45 -- SPECIAL REQUIREMENTS:
kono
parents:
diff changeset
46 -- To build this test:
kono
parents:
diff changeset
47 -- 1) Compile the file LA140220 (and include the results in the
kono
parents:
diff changeset
48 -- program library).
kono
parents:
diff changeset
49 -- 2) Compile the file LA140221 (and include the results in the
kono
parents:
diff changeset
50 -- program library).
kono
parents:
diff changeset
51 -- 3) Compile the file LA140222 (and include the results in the
kono
parents:
diff changeset
52 -- program library).
kono
parents:
diff changeset
53 -- 4) Attempt to build an executable image.
kono
parents:
diff changeset
54 -- 5) If an executable image results, run it.
kono
parents:
diff changeset
55 --
kono
parents:
diff changeset
56 -- TEST FILES:
kono
parents:
diff changeset
57 -- This test consists of the following files:
kono
parents:
diff changeset
58 -- LA140220.A
kono
parents:
diff changeset
59 -- -> LA140221.AM
kono
parents:
diff changeset
60 -- LA140222.A
kono
parents:
diff changeset
61 --
kono
parents:
diff changeset
62 -- PASS/FAIL CRITERIA:
kono
parents:
diff changeset
63 -- The test passes if a link time error message reports that
kono
parents:
diff changeset
64 -- LA14022_2 is missing or obsolete and no executable image
kono
parents:
diff changeset
65 -- results. The test also passes if an executable image is produced
kono
parents:
diff changeset
66 -- and reports "PASSED" (in the case where the implementation supports
kono
parents:
diff changeset
67 -- automatic recompilation).
kono
parents:
diff changeset
68 --
kono
parents:
diff changeset
69 -- CHANGE HISTORY:
kono
parents:
diff changeset
70 -- 01 MAY 95 ACVC 1.12 LA5008S baseline version
kono
parents:
diff changeset
71 -- 23 JUN 95 SAIC Initial version
kono
parents:
diff changeset
72 -- 18 NOV 96 SAIC Modified unit names and prologue to conform
kono
parents:
diff changeset
73 -- to coding conventions.
kono
parents:
diff changeset
74 -- 07 DEC 96 SAIC Moved LA14022_0 to a separate file. Added
kono
parents:
diff changeset
75 -- pragma Elaborate to context clause of
kono
parents:
diff changeset
76 -- LA14022_2.
kono
parents:
diff changeset
77 --
kono
parents:
diff changeset
78 --!
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 package LA14022_1 is
kono
parents:
diff changeset
81 type rec_ptr;
kono
parents:
diff changeset
82 type rec is record
kono
parents:
diff changeset
83 data : integer;
kono
parents:
diff changeset
84 end record;
kono
parents:
diff changeset
85 type rec_ptr is access rec;
kono
parents:
diff changeset
86 subtype data_int is integer range 0..100;
kono
parents:
diff changeset
87 end LA14022_1;
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 with LA14022_0;
kono
parents:
diff changeset
91 with LA14022_1;
kono
parents:
diff changeset
92 pragma Elaborate (LA14022_0);
kono
parents:
diff changeset
93 procedure LA14022_2 is new
kono
parents:
diff changeset
94 LA14022_0 (stuff => LA14022_1.rec,
kono
parents:
diff changeset
95 ptr => LA14022_1.rec_ptr,
kono
parents:
diff changeset
96 return_result => LA14022_1.data_int,
kono
parents:
diff changeset
97 delta_val => 50);
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 with Report;
kono
parents:
diff changeset
100 use Report;
kono
parents:
diff changeset
101 with LA14022_2;
kono
parents:
diff changeset
102 with LA14022_1;
kono
parents:
diff changeset
103 use LA14022_1;
kono
parents:
diff changeset
104 procedure LA140221 is
kono
parents:
diff changeset
105 TC_val : LA14022_1.data_int := 10;
kono
parents:
diff changeset
106 P, Q : LA14022_1.rec_ptr;
kono
parents:
diff changeset
107 begin
kono
parents:
diff changeset
108 Test ("LA14022", "Check that a compilation unit may not " &
kono
parents:
diff changeset
109 "depend semantically on two different " &
kono
parents:
diff changeset
110 "versions of the same compilation unit. " &
kono
parents:
diff changeset
111 "Check the case where a generic " &
kono
parents:
diff changeset
112 "instantiation depends on a generic " &
kono
parents:
diff changeset
113 "procedure that is changed");
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 Q := P;
kono
parents:
diff changeset
116 LA14022_2 (Q, TC_val);
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 if Q /= P then
kono
parents:
diff changeset
119 Failed ("Wrong procedure result");
kono
parents:
diff changeset
120 end if;
kono
parents:
diff changeset
121 if TC_val = 60 then
kono
parents:
diff changeset
122 Failed ("Old instantiation used");
kono
parents:
diff changeset
123 elsif TC_val /= 10 then
kono
parents:
diff changeset
124 Failed ("Wrong result");
kono
parents:
diff changeset
125 end if;
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 Result;
kono
parents:
diff changeset
128 end LA140221;