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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c5/] [c52102d.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
-- C52102D.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 THE ASSIGNMENT OF OVERLAPPING SOURCE AND TARGET VARIABLES
26
--    (INCLUDING ARRAYS AND SLICES IN VARIOUS COMBINATIONS) SATISFIES
27
--    THE SEMANTICS OF "COPY" ASSIGNMENT WHEN INITIAL ASSIGNMENT VALUES
28
--    REQUIRE RUN-TIME EVALUATION.   (THIS TEST IS IN TWO PARTS,
29
--    COVERING RESPECTIVELY STATIC AND DYNAMIC BOUNDS.)
30
 
31
-- PART 2:  DYNAMIC BOUNDS
32
 
33
 
34
-- RM 02/27/80
35
-- SPS 2/18/83
36
-- JBG 3/15/84
37
-- JBG 6/9/84
38
-- BHS 6/26/84
39
 
40
WITH REPORT;
41
PROCEDURE  C52102D  IS
42
 
43
     USE  REPORT;
44
     IDENT_INT_0 : INTEGER := IDENT_INT(0);
45
     IDENT_INT_1 : INTEGER := IDENT_INT (1);
46
     IDENT_INT_2 : INTEGER := IDENT_INT (2);
47
     IDENT_INT_3 : INTEGER := IDENT_INT (3);
48
     IDENT_INT_4 : INTEGER := IDENT_INT (4);
49
     IDENT_INT_5 : INTEGER := IDENT_INT (5);
50
     IDENT_INT_6 : INTEGER := IDENT_INT (6);
51
     IDENT_INT_8 : INTEGER := IDENT_INT (8);
52
     IDENT_INT_9 : INTEGER := IDENT_INT (9);
53
 
54
     FUNCTION ID_I (X : INTEGER) RETURN INTEGER RENAMES IDENT_INT;
55
     FUNCTION ID_B (X : BOOLEAN) RETURN BOOLEAN RENAMES IDENT_BOOL;
56
 
57
BEGIN
58
 
59
 
60
     TEST( "C52102D" , "CHECK THAT THE ASSIGNMENT OF OVERLAPPING " &
61
                       "SOURCE AND TARGET VARIABLES (INCLUDING " &
62
                       "ARRAYS AND SLICES IN VARIOUS COMBINATIONS) " &
63
                       "SATISFIES THE SEMANTICS OF ""COPY"" " &
64
                       "ASSIGNMENT WHEN INITIAL ASSIGNMENT VALUES " &
65
                       "ARE DYNAMIC  (PART 2: DYNAMIC BOUNDS)" );
66
 
67
     -------------------------------------------------------------------
68
     --------------------  ARRAYS OF INTEGERS  -------------------------
69
 
70
     DECLARE
71
          A   :    ARRAY( 1..IDENT_INT_4 ) OF INTEGER;
72
 
73
     BEGIN
74
          A   :=   ( ID_I(11),  ID_I(12),  ID_I(13),  ID_I(14) );
75
          A   :=   (  1   , A(IDENT_INT_1) , A(IDENT_INT_2) ,
76
                                              A(IDENT_INT_1) );
77
          IF  A /= (  1   ,  11  ,  12  ,  11  )  THEN
78
               FAILED( "WRONG VALUES  -  I1" );
79
          END IF;
80
 
81
          A   :=   (  ID_I(11),  ID_I(12),  ID_I(13),  ID_I(14) );
82
          A   :=   ( A(IDENT_INT_4) , A(IDENT_INT_3) ,
83
                                       A(IDENT_INT_4) ,  1   );
84
          IF  A /= (  14  ,  13  ,  14  ,  1   )  THEN
85
               FAILED( "WRONG VALUES  -  I2" );
86
          END IF;
87
 
88
     END;
89
 
90
 
91
     DECLARE
92
          A   :    ARRAY( -4..IDENT_INT_4 ) OF INTEGER;
93
 
94
     BEGIN
95
          A   :=  ( -ID_I(4), -ID_I(3), -ID_I(2), -ID_I(1),
96
                    ID_I(100), ID_I(1), ID_I(2), ID_I(3), ID_I(4));
97
          A(-4..IDENT_INT_0)  :=  A(IDENT_INT_0..4);
98
          IF    A   /=  ( 100 , 1 , 2 , 3 , 4 , 1 , 2 , 3 , 4 )
99
          THEN
100
               FAILED( "WRONG VALUES  -  I3" );
101
          END IF;
102
 
103
          A   :=  ( -ID_I(4), -ID_I(3), -ID_I(2), -ID_I(1),
104
                    ID_I(100), ID_I(1), ID_I(2), ID_I(3), ID_I(4));
105
          A(IDENT_INT_0..4)   :=  A(-4..IDENT_INT_0);
106
          IF    A   /=  ( -4 , -3 , -2 , -1 , -4  , -3 , -2 , -1 , 100 )
107
          THEN
108
               FAILED( "WRONG VALUES  -  I4" );
109
          END IF;
110
 
111
     END;
112
 
113
 
114
     DECLARE
115
          TYPE INT_ARR IS ARRAY (INTEGER RANGE <>) OF INTEGER;
116
          A   :  INT_ARR (1..10);
117
 
118
     BEGIN
119
          A   :=  ( ID_I(1), ID_I(2), ID_I(3), ID_I(4), ID_I(5),
120
                    ID_I(6), ID_I(7), ID_I(8), ID_I(9), ID_I(10));
121
          A   :=  0  &  A(IDENT_INT_1..IDENT_INT_2)  &
122
                        A(IDENT_INT_1..IDENT_INT_2)  &
123
                        A(IDENT_INT_1..IDENT_INT_5);
124
          IF     A  /=  ( 0 , 1 , 2 , 1 , 2 , 1 , 2 , 3 , 4 , 5  )
125
          THEN
126
               FAILED( "WRONG VALUES  -  I5" );
127
          END IF;
128
 
129
          A   :=  ( ID_I(1), ID_I(2), ID_I(3), ID_I(4), ID_I(5),
130
                    ID_I(6), ID_I(7), ID_I(8), ID_I(9), ID_I(10));
131
          A   :=  A(IDENT_INT_6..IDENT_INT_9)  &
132
                  A(IDENT_INT_8..IDENT_INT_9)  &
133
                  A(IDENT_INT_8..IDENT_INT_9)  &  0  &  0;
134
          IF   A  /=  ( 6 , 7 , 8 , 9 , 8 , 9 , 8 , 9 , 0 , 0  )
135
          THEN
136
               FAILED( "WRONG VALUES  -  I6" );
137
          END IF;
138
 
139
     END;
140
 
141
 
142
     -------------------------------------------------------------------
143
     --------------------  ARRAYS OF BOOLEANS  -------------------------
144
 
145
     DECLARE
146
          A   :    ARRAY( 1..4 ) OF BOOLEAN;
147
 
148
     BEGIN
149
          A   :=   (ID_B(FALSE), ID_B(TRUE), ID_B(TRUE), ID_B(FALSE));
150
          A   :=   (  TRUE  , A(IDENT_INT_1) , A(IDENT_INT_2) ,
151
                                                A(IDENT_INT_1)  );
152
          IF  A /= (  TRUE  ,FALSE , TRUE , FALSE )
153
          THEN
154
               FAILED( "WRONG VALUES  -  B1" );
155
          END IF;
156
 
157
          A   :=   (ID_B(FALSE), ID_B(TRUE), ID_B(TRUE), ID_B(FALSE));
158
          A   :=   (  A(IDENT_INT_4)  , A(IDENT_INT_3) ,
159
                                         A(IDENT_INT_4) ,  TRUE );
160
          IF  A /= (  FALSE , TRUE , FALSE,  TRUE )
161
          THEN
162
               FAILED( "WRONG VALUES  -  B2" );
163
          END IF;
164
 
165
     END;
166
 
167
 
168
     DECLARE
169
          A   :    ARRAY( -IDENT_INT_4..4 ) OF BOOLEAN;
170
 
171
     BEGIN
172
          A  := (ID_B(FALSE), ID_B(FALSE), ID_B(FALSE), ID_B(FALSE),
173
                 ID_B(FALSE), ID_B(TRUE), ID_B(TRUE),
174
                 ID_B(TRUE), ID_B(TRUE));
175
          A(-IDENT_INT_4..IDENT_INT_0)  :=  A(IDENT_INT_0..4);
176
          IF A /= (FALSE, TRUE, TRUE, TRUE, TRUE,TRUE, TRUE, TRUE,TRUE)
177
          THEN
178
               FAILED( "WRONG VALUES  -  B3" );
179
          END IF;
180
 
181
          A  := (ID_B(FALSE), ID_B(FALSE), ID_B(FALSE), ID_B(FALSE),
182
                 ID_B(TRUE), ID_B(TRUE), ID_B(TRUE),
183
                 ID_B(TRUE), ID_B(TRUE));
184
          A(IDENT_INT_0..4)   :=  A(-4..IDENT_INT_0);
185
          IF A /= (FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE)
186
          THEN
187
               FAILED( "WRONG VALUES  -  B4" );
188
          END IF;
189
 
190
     END;
191
 
192
 
193
     DECLARE
194
          TYPE B_ARR IS ARRAY (INTEGER RANGE <>) OF BOOLEAN;
195
          A  :  B_ARR (1..10);
196
 
197
     BEGIN
198
          A := (ID_B(TRUE), ID_B(FALSE), ID_B(TRUE), ID_B(FALSE),
199
                ID_B(TRUE), ID_B(FALSE), ID_B(TRUE),
200
                ID_B(FALSE), ID_B(TRUE), ID_B(FALSE));
201
          A :=  FALSE  &  A(IDENT_INT_1..IDENT_INT_2)  &
202
                          A(IDENT_INT_1..IDENT_INT_2)  &
203
                          A(IDENT_INT_1..IDENT_INT_5);
204
          IF A/=(FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE)
205
          THEN
206
               FAILED( "WRONG VALUES  -  B5" );
207
          END IF;
208
 
209
          A := (ID_B(TRUE), ID_B(FALSE), ID_B(TRUE), ID_B(FALSE),
210
                ID_B(TRUE), ID_B(FALSE), ID_B(TRUE),
211
                ID_B(FALSE), ID_B(TRUE), ID_B(FALSE));
212
          A :=  A(IDENT_INT_6..IDENT_INT_9)  &
213
                A(IDENT_INT_8..IDENT_INT_9)  &
214
                A(IDENT_INT_8..IDENT_INT_9)  &  FALSE  &  TRUE;
215
          IF A/=(FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE)
216
          THEN
217
               FAILED( "WRONG VALUES  -  B6" );
218
          END IF;
219
 
220
     END;
221
 
222
 
223
     -------------------------------------------------------------------
224
     --------------------  CHARACTER STRINGS  --------------------------
225
 
226
     DECLARE
227
          A   :    STRING( 1..4 );
228
 
229
     BEGIN
230
          IF EQUAL (3,3) THEN
231
               A   :=   "ARGH";
232
          END IF;
233
          A   :=   (  'Q' , A(IDENT_INT_1) , A(IDENT_INT_2) ,
234
                                              A(IDENT_INT_1) );
235
          IF  A /= "QARA"  THEN
236
               FAILED( "WRONG VALUES  -  C1" );
237
          END IF;
238
 
239
          IF EQUAL (3,3) THEN
240
               A   :=   "ARGH";
241
          END IF;
242
          A   :=   ( A(IDENT_INT_4) , A(IDENT_INT_3) ,
243
                     A(IDENT_INT_4) , 'X' );
244
          IF  A /= "HGHX"  THEN
245
               FAILED( "WRONG VALUES  -  C2" );
246
          END IF;
247
 
248
     END;
249
 
250
 
251
     DECLARE
252
          A   :    STRING( IDENT_INT(96)..104 );
253
 
254
     BEGIN
255
          IF EQUAL (3,3) THEN
256
               A  :=  "APHRODITE";
257
          END IF;
258
          A(IDENT_INT(96)..IDENT_INT(100))  :=  A(IDENT_INT(100)..
259
                                                  IDENT_INT(104));
260
          IF   A  /=  "ODITEDITE"   THEN
261
               FAILED( "WRONG VALUES  -  C3" );
262
          END IF;
263
 
264
          IF EQUAL (3,3) THEN
265
               A  :=  "APHRODITE";
266
          END IF;
267
          A(IDENT_INT(100)..IDENT_INT(104)) :=  A(IDENT_INT(96)..
268
                                                  IDENT_INT(100)) ;
269
          IF   A  /=  "APHRAPHRO"   THEN
270
               FAILED( "WRONG VALUES  -  C4" );
271
          END IF;
272
 
273
     END;
274
 
275
 
276
     DECLARE
277
          TYPE CH_ARR IS ARRAY (INTEGER RANGE <>) OF CHARACTER;
278
          A  :  CH_ARR (IDENT_INT_1..9);
279
 
280
     BEGIN
281
          IF EQUAL (3,3) THEN
282
               A  :=  "CAMBRIDGE";
283
          END IF;
284
          A  :=  'S'  &  A(IDENT_INT_1..IDENT_INT_2)  &
285
                         A(IDENT_INT_1..IDENT_INT_2)  &
286
                         A(IDENT_INT_1..IDENT_INT_4);
287
          IF  A  /=  "SCACACAMB"  THEN
288
               FAILED( "WRONG VALUES  -  C5" );
289
          END IF;
290
 
291
          IF EQUAL (3,3) THEN
292
               A  :=  "CAMBRIDGE";
293
          END IF;
294
          A  :=  A(IDENT_INT_8..IDENT_INT_8)  &
295
                 A(IDENT_INT_6..IDENT_INT_8)  &
296
                 A(IDENT_INT_6..IDENT_INT_8)  &  "EA";
297
          IF  A  /=  "GIDGIDGEA"  THEN
298
               FAILED( "WRONG VALUES  -  C6" );
299
          END IF;
300
 
301
     END;
302
 
303
 
304
     RESULT;
305
 
306
 
307
END C52102D;

powered by: WebSVN 2.1.0

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