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/] [c37008b.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C37008B.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 NO CONSTRAINT ERROR IS RAISED FOR AN UNUSED TYPE
26
-- DECLARATION WITH AN INVALID DEFAULT VALUE
27
 
28
-- JBG 9/11/81
29
-- SPS 10/25/82
30
 
31
WITH REPORT;
32
USE REPORT;
33
PROCEDURE C37008B IS
34
BEGIN
35
     TEST ("C37008B", "CHECK THAT INVALID DEFAULT RECORD"
36
                    & " COMPONENT INITIALIZATIONS DO NOT RAISE"
37
                    & " CONSTRAINT_ERROR");
38
 
39
     BEGIN
40
          DECLARE
41
               TYPE R1 IS RECORD
42
                    C1 : INTEGER RANGE 1 .. 5 := 0;
43
               END RECORD;
44
          BEGIN
45
               NULL;
46
          END;
47
     EXCEPTION
48
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 1");
49
     END;
50
 
51
     BEGIN
52
          DECLARE
53
               TYPE R IS RECORD
54
                    C : CHARACTER RANGE 'A' .. 'Y' := 'Z';
55
               END RECORD;
56
          BEGIN
57
               NULL;
58
          END;
59
     EXCEPTION
60
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 1A");
61
     END;
62
 
63
     BEGIN
64
          DECLARE
65
               TYPE R2 IS RECORD
66
                    C2 : BOOLEAN RANGE FALSE .. FALSE := TRUE;
67
               END RECORD;
68
          BEGIN
69
               NULL;
70
          END;
71
     EXCEPTION
72
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 2");
73
     END;
74
 
75
     BEGIN
76
          DECLARE
77
               TYPE E IS (E1, E2, E3);
78
               TYPE R IS RECORD
79
                    C : E RANGE E2 .. E3 := E1;
80
               END RECORD;
81
          BEGIN
82
               NULL;
83
          END;
84
     EXCEPTION
85
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 2A");
86
     END;
87
 
88
     BEGIN
89
          DECLARE
90
               TYPE R3 IS RECORD
91
                    C3 : INTEGER RANGE 1 .. 5;
92
               END RECORD;
93
               TYPE R3A IS RECORD
94
                    C3A : R3 := (OTHERS => 6);
95
               END RECORD;
96
          BEGIN
97
               NULL;
98
          END;
99
     EXCEPTION
100
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 3");
101
     END;
102
 
103
     BEGIN
104
          DECLARE
105
               TYPE ARR IS ARRAY (1..3) OF INTEGER RANGE 8..9;
106
               TYPE R4 IS RECORD
107
                    C4 : ARR
108
                         := (1 => 8, 2 => 9, 3 => 10);
109
               END RECORD;
110
          BEGIN
111
               NULL;
112
          END;
113
     EXCEPTION
114
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 4");
115
     END;
116
 
117
     BEGIN
118
          DECLARE
119
               TYPE A IS ARRAY (NATURAL RANGE <> )
120
                    OF INTEGER RANGE 1 .. 5;
121
 
122
               TYPE AA IS ACCESS A;
123
 
124
               TYPE R5 IS RECORD
125
                    C5 : AA := NEW A'(4, 5, 6);
126
               END RECORD;
127
          BEGIN
128
               NULL;
129
          END;
130
     EXCEPTION
131
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 5");
132
     END;
133
 
134
     BEGIN
135
          DECLARE
136
               TYPE A IS ARRAY (NATURAL RANGE <> )
137
                    OF INTEGER RANGE 1 .. 5;
138
 
139
               TYPE AA IS ACCESS A (1 .. 3);
140
 
141
               TYPE R6 IS RECORD
142
                    C6 : AA := NEW A'(4, 4, 4, 4);
143
               END RECORD;
144
          BEGIN
145
               NULL;
146
          END;
147
     EXCEPTION
148
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 6");
149
     END;
150
 
151
     BEGIN
152
          DECLARE
153
               TYPE AI IS ACCESS INTEGER RANGE 6 .. 8;
154
 
155
               TYPE R7 IS RECORD
156
                    C7 : AI := NEW INTEGER'(5);
157
               END RECORD;
158
          BEGIN
159
               NULL;
160
          END;
161
     EXCEPTION
162
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 7");
163
     END;
164
 
165
     BEGIN
166
          DECLARE
167
               TYPE UA IS ARRAY (NATURAL RANGE <> )
168
                    OF INTEGER RANGE 3 .. 5;
169
 
170
               SUBTYPE CA IS UA (7 .. 8);
171
 
172
               TYPE R8 IS RECORD
173
                    C8 : CA := (6 .. 8 => 4);
174
               END RECORD;
175
          BEGIN
176
               NULL;
177
          END;
178
     EXCEPTION
179
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 8");
180
     END;
181
 
182
     BEGIN
183
          DECLARE
184
               TYPE UA IS ARRAY (NATURAL RANGE <> )
185
                    OF INTEGER RANGE 3 .. IDENT_INT(5);
186
 
187
               TYPE R9 IS RECORD
188
                    C9 : UA (11 .. 11) := (11 => 6);
189
               END RECORD;
190
          BEGIN
191
               NULL;
192
          END;
193
     EXCEPTION
194
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 9");
195
     END;
196
 
197
     BEGIN
198
          DECLARE
199
               TYPE A IS ARRAY (NATURAL RANGE <> )
200
                    OF INTEGER RANGE 1 .. IDENT_INT (5);
201
 
202
               TYPE AA IS ACCESS A;
203
 
204
               TYPE R10 IS RECORD
205
                    C10 : AA := NEW A'(4, 5, 6);
206
               END RECORD;
207
          BEGIN
208
               NULL;
209
          END;
210
     EXCEPTION
211
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 10");
212
     END;
213
 
214
     BEGIN
215
          DECLARE
216
               TYPE A IS ARRAY (NATURAL RANGE <> )
217
                    OF INTEGER RANGE 1 .. 5;
218
 
219
               TYPE AA IS ACCESS A (IDENT_INT (1) .. IDENT_INT (3));
220
 
221
               TYPE R11 IS RECORD
222
                    C11 : AA := NEW A'(4, 4, 4, 4);
223
               END RECORD;
224
          BEGIN
225
               NULL;
226
          END;
227
     EXCEPTION
228
          WHEN OTHERS => FAILED ("EXCEPTION RAISED 11");
229
     END;
230
 
231
     RESULT;
232
END C37008B;

powered by: WebSVN 2.1.0

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