OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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