annotate gcc/testsuite/ada/acats/tests/l/la140202.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 -- LA140202.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 library level instance depends on
kono
parents:
diff changeset
30 -- a library level generic function whose body is changed.
kono
parents:
diff changeset
31 --
kono
parents:
diff changeset
32 -- TEST DESCRIPTION:
kono
parents:
diff changeset
33 -- This test compiles a generic function, an instance of a generic
kono
parents:
diff changeset
34 -- function that withs the first function and a main procedure that
kono
parents:
diff changeset
35 -- withs the instance. Then a new version of the first generic function
kono
parents:
diff changeset
36 -- is compiled (in a separate file, simulating editing and modification
kono
parents:
diff changeset
37 -- of the unit). Unless automatic recompilation is supported, this
kono
parents:
diff changeset
38 -- test should fail to link. Otherwise, the test should recompile and
kono
parents:
diff changeset
39 -- link the correct version of the withed function and report "PASSED"
kono
parents:
diff changeset
40 -- at execution time.
kono
parents:
diff changeset
41 --
kono
parents:
diff changeset
42 -- SPECIAL REQUIREMENTS:
kono
parents:
diff changeset
43 -- To build this test:
kono
parents:
diff changeset
44 -- 1) Compile the file LA140200 (and include the results in the
kono
parents:
diff changeset
45 -- program library).
kono
parents:
diff changeset
46 -- 2) Compile the file LA140201 (and include the results in the
kono
parents:
diff changeset
47 -- program library).
kono
parents:
diff changeset
48 -- 3) Compile the file LA140202 (and include the results in the
kono
parents:
diff changeset
49 -- program library).
kono
parents:
diff changeset
50 -- 4) Compile the file LA140203 (and include the results in the
kono
parents:
diff changeset
51 -- program library).
kono
parents:
diff changeset
52 -- 5) Attempt to build an executable image.
kono
parents:
diff changeset
53 -- 6) If an executable image results, run it.
kono
parents:
diff changeset
54 --
kono
parents:
diff changeset
55 -- TEST FILES:
kono
parents:
diff changeset
56 -- This test consists of the following files:
kono
parents:
diff changeset
57 -- LA140200.A
kono
parents:
diff changeset
58 -- LA140201.A
kono
parents:
diff changeset
59 -- -> LA140202.AM
kono
parents:
diff changeset
60 -- LA140203.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 -- LA140202 is missing or obsolete, or that LA14020_3 or LA14020_4
kono
parents:
diff changeset
65 -- is missing or obsolete (optional) and no executable image
kono
parents:
diff changeset
66 -- results. The test passes if an executable image is produced
kono
parents:
diff changeset
67 -- and reports "PASSED" (in the case where the implementation
kono
parents:
diff changeset
68 -- supports automatic recompilation).
kono
parents:
diff changeset
69 --
kono
parents:
diff changeset
70 --
kono
parents:
diff changeset
71 -- CHANGE HISTORY:
kono
parents:
diff changeset
72 -- 01 MAY 95 ACVC 1.12 LA5008Q baseline version
kono
parents:
diff changeset
73 -- 23 JUN 95 SAIC Initial version
kono
parents:
diff changeset
74 -- 29 FEB 96 SAIC First revision after review
kono
parents:
diff changeset
75 -- 12 DEC 96 SAIC Reorganized to permit automatic recompilation.
kono
parents:
diff changeset
76 -- Reworded objective. Moved instance to
kono
parents:
diff changeset
77 -- library-level and redesigned to use generic
kono
parents:
diff changeset
78 -- formal function. Fixed arithmetic errors.
kono
parents:
diff changeset
79 --
kono
parents:
diff changeset
80 --!
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 with LA14020_0.LA14020_1;
kono
parents:
diff changeset
83 with LA14020_2;
kono
parents:
diff changeset
84 pragma Elaborate (LA14020_2);
kono
parents:
diff changeset
85 function LA14020_3 is new LA14020_2 (LA14020_0.LA14020_1.Bigger_Basket);
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 --==================================================================--
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 with LA14020_0.LA14020_1;
kono
parents:
diff changeset
90 generic
kono
parents:
diff changeset
91 type Market_Basket is new LA14020_0.LA14020_1.Bigger_Basket with private;
kono
parents:
diff changeset
92 with function "+" (L,R: Market_Basket) return Market_Basket is <>;
kono
parents:
diff changeset
93 function LA14020_4 (B1, B2 : Market_Basket) return Market_Basket;
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 --==================================================================--
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 with LA14020_3;
kono
parents:
diff changeset
98 function LA14020_4 (B1, B2 : Market_Basket) return Market_Basket is
kono
parents:
diff changeset
99 Result : Market_Basket;
kono
parents:
diff changeset
100 begin
kono
parents:
diff changeset
101 Result := B1 + B2;
kono
parents:
diff changeset
102 Result.Total := integer (Result.App) + integer (Result.Ora);
kono
parents:
diff changeset
103 return Result;
kono
parents:
diff changeset
104 end LA14020_4;
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 --==================================================================--
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 with Report;
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 with LA14020_0.LA14020_1;
kono
parents:
diff changeset
111 with LA14020_3;
kono
parents:
diff changeset
112 with LA14020_4;
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 procedure LA140202 is
kono
parents:
diff changeset
115 package Child renames LA14020_0.LA14020_1;
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 Basket_1 : Child.Bigger_Basket := (App => 5, Ora => 20, Total => 0);
kono
parents:
diff changeset
118 Basket_2 : Child.Bigger_Basket := (App => 7, Ora => 3, Total => 0);
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 function Total is new LA14020_4 (Child.Bigger_Basket, LA14020_3);
kono
parents:
diff changeset
121 begin
kono
parents:
diff changeset
122 Report.Test ("LA14020", "Check that a compilation unit may " &
kono
parents:
diff changeset
123 "not depend semantically on two " &
kono
parents:
diff changeset
124 "different versions of the same " &
kono
parents:
diff changeset
125 "compilation unit. Check the case " &
kono
parents:
diff changeset
126 "where a library level instance " &
kono
parents:
diff changeset
127 "depends on a library level generic " &
kono
parents:
diff changeset
128 "function whose body is changed");
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 Basket_1 := Total (Basket_1, Basket_2);
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 if Basket_1.App = 10 or
kono
parents:
diff changeset
133 Basket_1.Ora = 6 or
kono
parents:
diff changeset
134 Basket_1.Total = 16
kono
parents:
diff changeset
135 then
kono
parents:
diff changeset
136 Report.Failed ("Revised generic function not used");
kono
parents:
diff changeset
137 elsif Basket_1.App /= 12 or
kono
parents:
diff changeset
138 Basket_1.Ora /= 23 or
kono
parents:
diff changeset
139 Basket_1.Total /= 35 then
kono
parents:
diff changeset
140 Report.Failed ("Incorrect result returned");
kono
parents:
diff changeset
141 end if;
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 Report.Result;
kono
parents:
diff changeset
144 end LA140202;