OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c34014e.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C34014E.ADA
2
 
3
--                             Grant of Unlimited Rights
4
--
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 
14
--     to do so.
15
--
16
--                                    DISCLAIMER
17
--
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.
24
--*
25
-- OBJECTIVE:
26
--     CHECK THAT A DERIVED SUBPROGRAM IS VISIBLE AND FURTHER DERIVABLE
27
--     UNDER APPROPRIATE CIRCUMSTANCES.
28
 
29
--     CHECK WHEN THE DERIVED SUBPROGRAM IS IMPLICITLY DECLARED IN THE
30
--     VISIBLE PART OF A PACKAGE AND A HOMOGRAPHIC SUBPROGRAM IS LATER
31
--     DECLARED EXPLICITLY IN THE PACKAGE BODY.
32
 
33
-- HISTORY:
34
--     JRK 09/15/87  CREATED ORIGINAL TEST.
35
--     GJD 11/15/95  REMOVED ADA 83 INCOMPATIBILITIES.
36
--     PWN 04/11/96  Restored subtests in Ada95 legal format.
37
 
38
WITH REPORT; USE REPORT;
39
 
40
PROCEDURE C34014E IS
41
 
42
     PACKAGE P IS
43
          TYPE T IS RANGE -100 .. 100;
44
          FUNCTION F RETURN T;
45
     END P;
46
     USE P;
47
 
48
     PACKAGE BODY P IS
49
          FUNCTION F RETURN T IS
50
          BEGIN
51
               RETURN T (IDENT_INT (1));
52
          END F;
53
     END P;
54
 
55
BEGIN
56
     TEST ("C34014E", "CHECK THAT A DERIVED SUBPROGRAM IS VISIBLE " &
57
                      "AND FURTHER DERIVABLE UNDER APPROPRIATE " &
58
                      "CIRCUMSTANCES.  CHECK WHEN THE DERIVED " &
59
                      "SUBPROGRAM IS IMPLICITLY DECLARED IN THE " &
60
                      "VISIBLE PART OF A PACKAGE AND A HOMOGRAPHIC " &
61
                      "SUBPROGRAM IS LATER DECLARED EXPLICITLY IN " &
62
                      "THE PACKAGE BODY");
63
 
64
     -----------------------------------------------------------------
65
 
66
     COMMENT ("NEW SUBPROGRAM DECLARED BY SUBPROGRAM DECLARATION");
67
 
68
     DECLARE
69
 
70
          PACKAGE Q IS
71
               TYPE QT IS NEW T;
72
               X : QT := F;
73
          END Q;
74
          USE Q;
75
 
76
          PACKAGE BODY Q IS
77
               FUNCTION F RETURN QT;
78
               TYPE QR IS
79
                    RECORD
80
                         C : QT := F;
81
                    END RECORD;
82
               TYPE QS IS NEW QT;
83
 
84
               FUNCTION F RETURN QT IS
85
               BEGIN
86
                    RETURN QT (IDENT_INT (2));
87
               END F;
88
 
89
               PACKAGE R IS
90
                    Y : QR;
91
                    Z : QS := F;
92
               END R;
93
               USE R;
94
          BEGIN
95
               IF X /= 1 THEN
96
                    FAILED ("OLD SUBPROGRAM NOT VISIBLE - SUBPROG " &
97
                            "DECL - 1");
98
               END IF;
99
 
100
               IF Y.C /= 2 THEN
101
                    FAILED ("NEW SUBPROGRAM NOT VISIBLE - SUBPROG " &
102
                            "DECL");
103
               END IF;
104
 
105
            IF Z /= 2 THEN
106
                 FAILED ("OLD SUBPROGRAM NOT DERIVED - SUBPROG " &
107
                            "DECL - 1");
108
            END IF;
109
          END Q;
110
 
111
          PACKAGE R IS
112
               Y : QT := F;
113
               TYPE RT IS NEW QT;
114
               Z : RT := F;
115
          END R;
116
          USE R;
117
 
118
     BEGIN
119
          IF Y /= 1 THEN
120
               FAILED ("OLD SUBPROGRAM NOT VISIBLE - SUBPROG DECL - 2");
121
          END IF;
122
 
123
          IF Z /= 1 THEN
124
               FAILED ("OLD SUBPROGRAM NOT DERIVED - SUBPROG DECL - 2");
125
          END IF;
126
     END;
127
 
128
     -----------------------------------------------------------------
129
 
130
     COMMENT ("NEW SUBPROGRAM DECLARED BY RENAMING");
131
 
132
     DECLARE
133
 
134
          PACKAGE Q IS
135
               TYPE QT IS NEW T;
136
               X : QT := F;
137
          END Q;
138
          USE Q;
139
 
140
          PACKAGE BODY Q IS
141
               FUNCTION G RETURN QT;
142
               FUNCTION F RETURN QT RENAMES G;
143
               TYPE QR IS
144
                    RECORD
145
                         C : QT := F;
146
                    END RECORD;
147
               TYPE QS IS NEW QT;
148
 
149
               FUNCTION G RETURN QT IS
150
               BEGIN
151
                    RETURN QT (IDENT_INT (2));
152
               END G;
153
 
154
               PACKAGE R IS
155
                    Y : QR;
156
                    Z : QS := F;
157
               END R;
158
               USE R;
159
          BEGIN
160
               IF X /= 1 THEN
161
                    FAILED ("OLD SUBPROGRAM NOT VISIBLE - RENAMING - " &
162
                            "1");
163
               END IF;
164
 
165
               IF Y.C /= 2 THEN
166
                    FAILED ("NEW SUBPROGRAM NOT VISIBLE - RENAMING");
167
               END IF;
168
 
169
               IF Z /= 2 THEN
170
                    FAILED ("OLD SUBPROGRAM NOT DERIVED - RENAMING - " &
171
                            "1");
172
               END IF;
173
          END Q;
174
 
175
          PACKAGE R IS
176
               Y : QT := F;
177
               TYPE RT IS NEW QT;
178
               Z : RT := F;
179
          END R;
180
          USE R;
181
 
182
     BEGIN
183
          IF Y /= 1 THEN
184
               FAILED ("OLD SUBPROGRAM NOT VISIBLE - RENAMING - 2");
185
          END IF;
186
 
187
          IF Z /= 1 THEN
188
               FAILED ("OLD SUBPROGRAM NOT DERIVED - RENAMING - 2");
189
          END IF;
190
     END;
191
 
192
     -----------------------------------------------------------------
193
 
194
     COMMENT ("NEW SUBPROGRAM DECLARED BY GENERIC INSTANTIATION");
195
 
196
     DECLARE
197
 
198
          GENERIC
199
               TYPE T IS RANGE <>;
200
          FUNCTION G RETURN T;
201
 
202
          FUNCTION G RETURN T IS
203
          BEGIN
204
               RETURN T (IDENT_INT (2));
205
          END G;
206
 
207
          PACKAGE Q IS
208
               TYPE QT IS NEW T;
209
               X : QT := F;
210
          END Q;
211
          USE Q;
212
 
213
          PACKAGE BODY Q IS
214
               FUNCTION F IS NEW G (QT);
215
               W : QT := F;
216
               TYPE QS IS NEW QT;
217
               Z : QS := F;
218
          BEGIN
219
               IF X /= 1 THEN
220
                    FAILED ("OLD SUBPROGRAM NOT VISIBLE - " &
221
                            "INSTANTIATION - 1");
222
               END IF;
223
 
224
               IF W /= 2 THEN
225
                    FAILED ("NEW SUBPROGRAM NOT VISIBLE - " &
226
                            "INSTANTIATION");
227
               END IF;
228
 
229
               IF Z /= 2 THEN
230
                    FAILED ("OLD SUBPROGRAM NOT DERIVED - " &
231
                            "INSTANTIATION - 1");
232
               END IF;
233
          END Q;
234
 
235
          PACKAGE R IS
236
               Y : QT := F;
237
               TYPE RT IS NEW QT;
238
               Z : RT := F;
239
          END R;
240
          USE R;
241
 
242
     BEGIN
243
          IF Y /= 1 THEN
244
               FAILED ("OLD SUBPROGRAM NOT VISIBLE - INSTANTIATION - " &
245
                       "2");
246
          END IF;
247
 
248
          IF Z /= 1 THEN
249
               FAILED ("OLD SUBPROGRAM NOT DERIVED - INSTANTIATION - " &
250
                       "2");
251
          END IF;
252
     END;
253
 
254
     -----------------------------------------------------------------
255
 
256
     RESULT;
257
END C34014E;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.