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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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