OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c8/] [c83024e1.ada] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C83024E1M.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 DECLARATION IN THE DECLARATIVE REGION OF A GENERIC
27
--     PACKAGE HIDES AN OUTER DECLARATION OF A HOMOGRAPH. ALSO CHECK
28
--     THAT THE OUTER DECLARATION IS DIRECTLY VISIBLE IN BOTH
29
--     DECLARATIVE REGIONS BEFORE THE DECLARATION OF THE INNER HOMOGRAPH
30
--     AND THE OUTER DECLARATION IS VISIBLE BY SELECTION AFTER THE INNER
31
--     HOMOGRAPH DECLARATION, IF THE GENERIC PACKAGE BODY IS SEPARATELY
32
--     COMPILED, BUT NOT AS A SUBUNIT.
33
 
34
-- APPLICABILITY CRITERIA:
35
--     THIS TEST IS APPLICABLE TO IMPLEMENTATIONS THAT SUPPORT SEPARATE
36
--     COMPILATIONS OF GENERIC SPECIFICATIONS AND BODIES.
37
 
38
-- SEPARATE FILES ARE:
39
--     C83024E0.ADA -- GENERIC PACKAGE SPECIFICATIONS.
40
--     C83024E1M.ADA - (THIS FILE) GENERIC PACKAGE BODIES AND
41
--                     MAIN PROGRAM.
42
 
43
-- HISTORY:
44
--     BCB 08/30/88  CREATED ORIGINAL TEST.
45
-- PWN 11/30/94 ADDED A PROCEDURE TO KEEP PACKAGE BODIES LEGAL.
46
 
47
PACKAGE BODY C83024E_P1 IS
48
 
49
     PROCEDURE REQUIRE_BODY IS
50
     BEGIN
51
       NULL;
52
     END;
53
 
54
     PACKAGE BODY C83024E_PACK1 IS
55
     BEGIN
56
          IF A /= IDENT_INT(3) THEN
57
               FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 1");
58
          END IF;
59
 
60
          IF C83024E_P1.A /= IDENT_INT(2) THEN
61
               FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 2");
62
          END IF;
63
 
64
          IF C83024E_P1.B /= IDENT_INT(2) THEN
65
               FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 3");
66
          END IF;
67
 
68
          IF C /= IDENT_INT(2) THEN
69
               FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 4");
70
          END IF;
71
 
72
          IF X /= IDENT_INT(2) THEN
73
               FAILED ("INCORRECT VALUE PASSED IN - 5");
74
          END IF;
75
 
76
          IF EQUAL(1,1) THEN
77
               X := A;
78
          ELSE
79
               X := C83024E_P1.A;
80
          END IF;
81
     END C83024E_PACK1;
82
END C83024E_P1;
83
 
84
PACKAGE BODY C83024E_P2 IS
85
 
86
     PROCEDURE REQUIRE_BODY IS
87
     BEGIN
88
       NULL;
89
     END;
90
 
91
     PACKAGE BODY C83024E_PACK2 IS
92
     BEGIN
93
          IF A /= IDENT_INT(3) THEN
94
               FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 10");
95
          END IF;
96
 
97
          IF C83024E_P2.A /= IDENT_INT(2) THEN
98
               FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 11");
99
          END IF;
100
 
101
          IF C83024E_P2.B /= IDENT_INT(2) THEN
102
               FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 12");
103
          END IF;
104
 
105
          IF C /= IDENT_INT(3) THEN
106
               FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 13");
107
          END IF;
108
 
109
          IF X /= IDENT_INT(2) THEN
110
               FAILED ("INCORRECT VALUE PASSED IN - 14");
111
          END IF;
112
 
113
          IF EQUAL(1,1) THEN
114
               A := IDENT_INT(4);
115
          ELSE
116
               A := 1;
117
          END IF;
118
     END C83024E_PACK2;
119
END C83024E_P2;
120
 
121
PACKAGE BODY C83024E_P3 IS
122
 
123
     PROCEDURE REQUIRE_BODY IS
124
     BEGIN
125
       NULL;
126
     END;
127
 
128
     PACKAGE BODY C83024E_PACK3 IS
129
          C : INTEGER := A;
130
          A : INTEGER := IDENT_INT(3);
131
     BEGIN
132
          IF A /= IDENT_INT(3) THEN
133
               FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 20");
134
          END IF;
135
 
136
          IF C83024E_P3.A /= IDENT_INT(2) THEN
137
               FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 21");
138
          END IF;
139
 
140
          IF C83024E_P3.B /= IDENT_INT(2) THEN
141
               FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 22");
142
          END IF;
143
 
144
          IF C /= IDENT_INT(2) THEN
145
               FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 23");
146
          END IF;
147
 
148
          IF X /= IDENT_INT(2) THEN
149
               FAILED ("INCORRECT VALUE PASSED IN - 24");
150
          END IF;
151
 
152
          IF EQUAL(1,1) THEN
153
               X := A;
154
          ELSE
155
               NULL;
156
          END IF;
157
     END C83024E_PACK3;
158
END C83024E_P3;
159
 
160
PACKAGE BODY C83024E_P4 IS
161
 
162
     PROCEDURE REQUIRE_BODY IS
163
     BEGIN
164
       NULL;
165
     END;
166
 
167
     PACKAGE BODY C83024E_PACK4 IS
168
     BEGIN
169
          X := INTEGER(F);
170
     END C83024E_PACK4;
171
END C83024E_P4;
172
 
173
WITH REPORT; USE REPORT;
174
WITH C83024E_P1; WITH C83024E_P2;
175
WITH C83024E_P3; WITH C83024E_P4;
176
USE C83024E_P1; USE C83024E_P2;
177
USE C83024E_P3; USE C83024E_P4;
178
PROCEDURE C83024E1M IS
179
 
180
BEGIN
181
     TEST ("C83024E", "CHECK THAT A DECLARATION IN THE DECLARATIVE " &
182
                      "REGION OF A GENERIC PACKAGE HIDES AN OUTER " &
183
                      "DECLARATION OF A HOMOGRAPH");
184
 
185
     DECLARE
186
          PACKAGE NEW_C83024E_PACK1 IS NEW C83024E_PACK1 (C83024E_P1.A);
187
     BEGIN
188
          IF C83024E_P1.A /= IDENT_INT(3) THEN
189
               FAILED ("INCORRECT VALUE PASSED OUT - 6");
190
          END IF;
191
     END;
192
 
193
     DECLARE
194
          PACKAGE NEW_C83024E_PACK2 IS
195
               NEW C83024E_PACK2 (A => C83024E_P2.OBJ);
196
     BEGIN
197
          IF C83024E_P2.OBJ /= IDENT_INT(4) THEN
198
               FAILED ("INCORRECT VALUE PASSED OUT - 15");
199
          END IF;
200
     END;
201
 
202
     DECLARE
203
          PACKAGE NEW_C83024E_PACK3 IS NEW C83024E_PACK3 (C83024E_P3.A);
204
     BEGIN
205
          IF C83024E_P3.A /= IDENT_INT(3) THEN
206
               FAILED ("INCORRECT VALUE PASSED OUT - 25");
207
          END IF;
208
     END;
209
 
210
     DECLARE
211
          PACKAGE NEW_C83024E_PACK4 IS
212
               NEW C83024E_PACK4 (C83024E_P4.OBJ, FLO);
213
     BEGIN
214
          IF C83024E_P4.OBJ /= IDENT_INT(6) THEN
215
               FAILED ("INCORRECT VALUE RETURNED FROM FUNCTION - 60");
216
          END IF;
217
     END;
218
 
219
     RESULT;
220
END C83024E1M;

powered by: WebSVN 2.1.0

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