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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c5/] [c51004a.ada] - Blame information for rev 750

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

Line No. Rev Author Line
1 720 jeremybenn
-- C51004A.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
-- CHECK THAT LABELS, LOOP IDENTIFIERS, AND BLOCK IDENTIFIERS ARE
26
-- IMPLICITLY DECLARED AT THE END OF THE DECLARATIVE PART.  PRIOR TO
27
-- THE END OF THE DECLARATIVE PART, THEY MAY BE USED TO REFERENCE
28
-- ENTITIES IN AN ENCLOSING SCOPE.  SUBTESTS ARE:
29
--        (A) BLOCK.
30
--        (B) PROCEDURE BODY.
31
--        (C) PACKAGE BODY.
32
--        (D) GENERIC FUNCTION BODY.
33
--        (E) GENERIC PACKAGE BODY.
34
--        (F) TASK BODY.
35
 
36
-- CPP  6/1/84
37
 
38
WITH REPORT;  USE REPORT;
39
PROCEDURE C51004A IS
40
 
41
BEGIN
42
     TEST("C51004A", "CHECK THAT LABELS, LOOP IDENTIFIERS, AND BLOCK " &
43
          "IDENTIFIERS MAY BE USED PRIOR TO THEIR IMPLICIT " &
44
          "DECLARATION");
45
 
46
OUTER: DECLARE
47
 
48
          TYPE IDN1 IS NEW INTEGER;
49
          IDN2 : CONSTANT INTEGER := 2;
50
          TYPE IDN3 IS ACCESS INTEGER;
51
 
52
     BEGIN     -- OUTER
53
 
54
     -----------------------------------------------
55
 
56
     A :  DECLARE
57
 
58
               A1 : IDN1;
59
               A2 : CONSTANT INTEGER := IDN2;
60
               A3 : IDN3;
61
 
62
               TEMP : INTEGER;
63
 
64
          BEGIN     -- A
65
 
66
           <<IDN1>> TEMP := 0;
67
 
68
             IDN2 : FOR I IN 1..1 LOOP
69
                         TEMP := A2;
70
                    END LOOP IDN2;
71
 
72
             IDN3 : BEGIN
73
                         NULL;
74
                    END IDN3;
75
 
76
          END A;
77
 
78
     -----------------------------------------------
79
 
80
     B :  DECLARE
81
 
82
               PROCEDURE P (TEMP : OUT INTEGER) IS
83
 
84
                    B1 : IDN1;
85
                    B2 : CONSTANT INTEGER := IDN2 + 2;
86
                    B3 : IDN3;
87
 
88
               BEGIN     -- P
89
 
90
          <<L>> <<IDN1>> TEMP := 0;
91
 
92
                  IDN2 : WHILE B2 < 0 LOOP
93
                              TEMP := 0;
94
                         END LOOP IDN2;
95
 
96
                  IDN3 : DECLARE
97
                         BEGIN
98
                              NULL;
99
                         END IDN3;
100
 
101
               END P;
102
 
103
          BEGIN     -- B
104
               NULL;
105
          END B;
106
 
107
     -----------------------------------------------
108
 
109
     C :  DECLARE
110
 
111
               PACKAGE PKG IS
112
               END PKG;
113
 
114
               PACKAGE BODY PKG IS
115
 
116
                    C1 : IDN1;
117
                    C2 : CONSTANT INTEGER := 2 * IDN2;
118
                    C3 : IDN3;
119
 
120
                    TEMP : INTEGER;
121
 
122
               BEGIN
123
 
124
                <<IDN1>> TEMP := 0;
125
 
126
                  IDN2 : LOOP
127
                              TEMP := 0;
128
                              EXIT;
129
                         END LOOP IDN2;
130
 
131
                  IDN3 : BEGIN
132
                              NULL;
133
                         END IDN3;
134
 
135
               END PKG;
136
 
137
          BEGIN     -- C
138
               NULL;
139
          END C;
140
 
141
     ---------------------------------------------------
142
 
143
     D :  DECLARE
144
 
145
               GENERIC
146
                    TYPE Q IS (<>);
147
               FUNCTION FN RETURN INTEGER;
148
 
149
               FUNCTION FN RETURN INTEGER IS
150
 
151
                    D1 : IDN1;
152
                    D2 : CONSTANT INTEGER := IDN2;
153
                    D3 : IDN3;
154
 
155
                    TEMP : INTEGER;
156
 
157
               BEGIN
158
 
159
                <<IDN1>> TEMP := 0;
160
 
161
                  IDN2 : FOR I IN 1..5 LOOP
162
                              TEMP := 0;
163
                         END LOOP IDN2;
164
 
165
                  IDN3 : BEGIN
166
                              NULL;
167
                         END IDN3;
168
 
169
                         RETURN TEMP;
170
 
171
               END FN;
172
 
173
          BEGIN
174
               NULL;
175
          END D;
176
 
177
     -----------------------------------------------
178
 
179
     E :  DECLARE
180
 
181
               GENERIC
182
 
183
                    TYPE ELEMENT IS (<>);
184
                    ITEM : ELEMENT;
185
 
186
               PACKAGE PKG IS
187
               END PKG;
188
 
189
               PACKAGE BODY PKG IS
190
 
191
                    E1 : IDN1 RANGE 1..5;
192
                    E2 : CONSTANT INTEGER := IDN2;
193
                    E3 : IDN3;
194
 
195
                    TEMP : ELEMENT;
196
 
197
               BEGIN
198
 
199
          <<IDN1>> <<L>> TEMP := ITEM;
200
 
201
                  IDN2 : WHILE TEMP /= ITEM LOOP
202
                              TEMP := ITEM;
203
                         END LOOP IDN2;
204
 
205
                  IDN3 : DECLARE
206
                         BEGIN
207
                              NULL;
208
                         END IDN3;
209
 
210
               END PKG;
211
 
212
          BEGIN     -- E
213
 
214
               DECLARE
215
                    PACKAGE P1 IS NEW PKG (INTEGER, 0);
216
               BEGIN
217
                    NULL;
218
               END;
219
 
220
          END E;
221
 
222
     -----------------------------------------------
223
 
224
     F :  DECLARE
225
 
226
               TASK T;
227
 
228
               TASK BODY T IS
229
 
230
                    F1 : IDN1 RANGE -4..2;
231
                    F2 : CONSTANT INTEGER := IDN2;
232
                    F3 : IDN3;
233
 
234
                    TEMP : INTEGER;
235
 
236
               BEGIN
237
 
238
                <<IDN1>> TEMP := 1;
239
 
240
                  IDN2 : LOOP
241
                              TEMP := TEMP + 1;
242
                              EXIT;
243
                         END LOOP IDN2;
244
 
245
                  IDN3 : DECLARE
246
                         BEGIN
247
                              TEMP := TEMP + 1;
248
                         END IDN3;
249
 
250
               END T;
251
 
252
          BEGIN     -- F
253
               NULL;
254
          END F;
255
 
256
     -----------------------------------------------
257
 
258
     END OUTER;
259
 
260
     RESULT;
261
END C51004A;

powered by: WebSVN 2.1.0

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