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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C32112B.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 CONSTRAINT_ERROR IS RAISED FOR THE DECLARATION OF A NULL
26
-- ARRAY OBJECT IF THE INITIAL VALUE IS NOT A NULL ARRAY.
27
 
28
-- RJW 7/20/86
29
-- GMT 7/01/87  ADDED CODE TO PREVENT DEAD VARIABLE OPTIMIZATION.
30
--              CHANGED THE RANGE VALUES OF A FEW DIMENSIONS.
31
 
32
WITH REPORT; USE REPORT;
33
 
34
PROCEDURE C32112B IS
35
 
36
     TYPE ARR1 IS ARRAY (NATURAL RANGE <>) OF INTEGER;
37
     SUBTYPE NARR1 IS ARR1 (IDENT_INT (2) .. IDENT_INT (1));
38
 
39
 
40
     TYPE ARR2 IS ARRAY (NATURAL RANGE <>, NATURAL RANGE <>)
41
          OF INTEGER;
42
     SUBTYPE NARR2 IS ARR2 (IDENT_INT (1) .. IDENT_INT (2),
43
                            IDENT_INT (1) .. IDENT_INT (0));
44
 
45
BEGIN
46
     TEST ("C32112B", "CHECK THAT CONSTRAINT_ERROR IS RAISED FOR " &
47
                      "THE DECLARATION OF A NULL ARRAY OBJECT IF " &
48
                      "THE INITIAL VALUE IS NOT A NULL ARRAY");
49
 
50
     BEGIN
51
          DECLARE
52
               A   : ARR1 (IDENT_INT(1) .. IDENT_INT(2));
53
               N1A : NARR1 := (A'RANGE => 0);
54
          BEGIN
55
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
56
                       "OF VARIABLE 'N1A'");
57
               A(1) := IDENT_INT(N1A(1));
58
          END;
59
     EXCEPTION
60
          WHEN CONSTRAINT_ERROR =>
61
               NULL;
62
          WHEN OTHERS =>
63
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
64
                       "OF VARIABLE 'N1A'");
65
     END;
66
 
67
     BEGIN
68
          DECLARE
69
               A   : ARR1 (IDENT_INT (1) .. IDENT_INT (2));
70
               N1B : CONSTANT NARR1 := (A'RANGE => 0);
71
          BEGIN
72
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
73
                       "OF CONSTANT 'N1B'");
74
               A(1) := IDENT_INT(N1B(1));
75
          END;
76
     EXCEPTION
77
          WHEN CONSTRAINT_ERROR =>
78
               NULL;
79
          WHEN OTHERS =>
80
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
81
                       "OF CONSTANT 'N1B'");
82
     END;
83
 
84
     BEGIN
85
          DECLARE
86
               A   : ARR1 (IDENT_INT (1) .. IDENT_INT (1));
87
               N1C : CONSTANT NARR1 := (A'RANGE => 0);
88
          BEGIN
89
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
90
                       "OF CONSTANT 'N1C'");
91
               A(1) := IDENT_INT(N1C(1));
92
          END;
93
     EXCEPTION
94
          WHEN CONSTRAINT_ERROR =>
95
               NULL;
96
          WHEN OTHERS =>
97
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
98
                       "OF CONSTANT 'N1C'");
99
     END;
100
 
101
     BEGIN
102
          DECLARE
103
               A   : ARR1 (IDENT_INT (1) .. IDENT_INT (1));
104
               N1D : NARR1 := (A'RANGE => 0);
105
          BEGIN
106
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
107
                       "OF VARIABLE 'N1D'");
108
               A(1) := IDENT_INT(N1D(1));
109
          END;
110
     EXCEPTION
111
          WHEN CONSTRAINT_ERROR =>
112
               NULL;
113
          WHEN OTHERS =>
114
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
115
                       "OF VARIABLE 'N1D'");
116
     END;
117
 
118
     BEGIN
119
          DECLARE
120
               A   : ARR1 (IDENT_INT (0) .. IDENT_INT (1));
121
               N1E : ARR1 (IDENT_INT (1) .. IDENT_INT (0)) :=
122
                          (A'RANGE  => 0);
123
          BEGIN
124
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
125
                       "OF VARIABLE 'N1E'");
126
               A(1) := IDENT_INT(N1E(1));
127
          END;
128
     EXCEPTION
129
          WHEN CONSTRAINT_ERROR =>
130
               NULL;
131
          WHEN OTHERS =>
132
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
133
                       "OF VARIABLE 'N1E'");
134
     END;
135
 
136
     BEGIN
137
          DECLARE
138
               A   : ARR1 (IDENT_INT (0) .. IDENT_INT (1));
139
               N1F : CONSTANT ARR1 (IDENT_INT (1) .. IDENT_INT (0)) :=
140
                     (A'RANGE => 0);
141
          BEGIN
142
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
143
                       "OF CONSTANT 'N1F'");
144
               A(1) := IDENT_INT(N1F(1));
145
          END;
146
     EXCEPTION
147
          WHEN CONSTRAINT_ERROR =>
148
               NULL;
149
          WHEN OTHERS =>
150
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
151
                       "OF CONSTANT 'N1F'");
152
     END;
153
 
154
     BEGIN
155
          DECLARE
156
               A   : ARR2 (IDENT_INT (1) .. IDENT_INT (2),
157
                           IDENT_INT (0) .. IDENT_INT (1));
158
               N2A : CONSTANT NARR2 := (A'RANGE => (A'RANGE (2) =>0));
159
          BEGIN
160
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
161
                       "OF CONSTANT 'N2'");
162
               A(1,1) := IDENT_INT(N2A(1,1));
163
          END;
164
     EXCEPTION
165
          WHEN CONSTRAINT_ERROR =>
166
               NULL;
167
          WHEN OTHERS =>
168
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
169
                       "OF CONSTANT 'N2A'");
170
     END;
171
 
172
     BEGIN
173
          DECLARE
174
               A : ARR2 (IDENT_INT (1) .. IDENT_INT (2),
175
                         IDENT_INT (0) .. IDENT_INT (1));
176
               N2B : NARR2 := (A'RANGE => (A'RANGE (2) =>0));
177
          BEGIN
178
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
179
                       "OF VARIABLE 'N2B'");
180
               A(1,1) := IDENT_INT(N2B(1,1));
181
          END;
182
     EXCEPTION
183
          WHEN CONSTRAINT_ERROR =>
184
               NULL;
185
          WHEN OTHERS =>
186
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
187
                       "OF VARIABLE 'N2B'");
188
     END;
189
 
190
     BEGIN
191
          DECLARE
192
               A : ARR2 (IDENT_INT (1) .. IDENT_INT (3),
193
                         IDENT_INT (1) .. IDENT_INT (1));
194
               N2C : CONSTANT NARR2 := (A'RANGE => (A'RANGE (2) =>0));
195
          BEGIN
196
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
197
                       "OF CONSTANT 'N2C'");
198
               A(1,1) := IDENT_INT(N2C(1,1));
199
          END;
200
     EXCEPTION
201
          WHEN CONSTRAINT_ERROR =>
202
               NULL;
203
          WHEN OTHERS =>
204
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
205
                       "OF CONSTANT 'N2C'");
206
     END;
207
 
208
     BEGIN
209
          DECLARE
210
               A : ARR2 (IDENT_INT (1) .. IDENT_INT (3),
211
                         IDENT_INT (1) .. IDENT_INT (1));
212
               N2D : NARR2 := (A'RANGE => (A'RANGE (2) =>0));
213
          BEGIN
214
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
215
                       "OF VARIABLE 'N2D'");
216
               A(1,1) := IDENT_INT(N2D(1,1));
217
          END;
218
     EXCEPTION
219
          WHEN CONSTRAINT_ERROR =>
220
               NULL;
221
          WHEN OTHERS =>
222
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
223
                       "OF VARIABLE 'N2D'");
224
     END;
225
 
226
     BEGIN
227
          DECLARE
228
               A : ARR2 (IDENT_INT (1) .. IDENT_INT (1),
229
                         IDENT_INT (1) .. IDENT_INT (1));
230
               N2E : CONSTANT ARR2 (IDENT_INT (2) .. IDENT_INT (1),
231
                                    IDENT_INT (1) .. IDENT_INT (1)) :=
232
                                   (A'RANGE => (A'RANGE (2) =>0));
233
          BEGIN
234
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
235
                       "OF CONSTANT 'N2E'");
236
               A(1,1) := IDENT_INT(N2E(1,1));
237
          END;
238
     EXCEPTION
239
          WHEN CONSTRAINT_ERROR =>
240
               NULL;
241
          WHEN OTHERS =>
242
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
243
                       "OF CONSTANT 'N2E'");
244
     END;
245
 
246
     BEGIN
247
          DECLARE
248
               A   : ARR2 (IDENT_INT (1) .. IDENT_INT (1),
249
                           IDENT_INT (1) .. IDENT_INT (1));
250
               N2F : ARR2 (IDENT_INT (2) .. IDENT_INT (1),
251
                           IDENT_INT (1) .. IDENT_INT (1)) :=
252
                           (A'RANGE => (A'RANGE (2) =>0));
253
          BEGIN
254
               FAILED ("NO EXCEPTION RAISED FOR INITIALIZATION " &
255
                       "OF VARIABLE 'N2F'");
256
               A(1,1) := IDENT_INT(N2F(1,1));
257
          END;
258
     EXCEPTION
259
          WHEN CONSTRAINT_ERROR =>
260
               NULL;
261
          WHEN OTHERS =>
262
               FAILED ("WRONG EXCEPTION RAISED FOR INITIALIZATION " &
263
                       "OF VARIABLE 'N2F'");
264
     END;
265
 
266
     RESULT;
267
END C32112B;

powered by: WebSVN 2.1.0

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