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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c45231a.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C45231A.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 RELATIONAL AND MEMBERSHIP OPERATIONS YIELD CORRECT 
26
-- RESULTS FOR PREDEFINED TYPE INTEGER (INCLUDING THE CASE IN WHICH THE
27
-- RELATIONAL OPERATORS ARE REDEFINED).
28
 
29
-- SUBTESTS ARE:
30
--     (A). TESTS FOR RELATIONAL OPERATORS.
31
--     (B). TESTS FOR MEMBERSHIP OPERATORS.
32
--     (C). TESTS FOR MEMBERSHIP OPERATORS IN THE CASE IN WHICH THE 
33
--          RELATIONAL OPERATORS ARE REDEFINED.
34
 
35
 
36
-- RJW 2/4/86
37
 
38
WITH REPORT; USE REPORT;
39
 
40
PROCEDURE C45231A IS
41
 
42
 
43
BEGIN
44
 
45
     TEST ( "C45231A", "CHECK THAT THE RELATIONAL AND " &
46
                       "MEMBERSHIP OPERATIONS YIELD CORRECT " &
47
                       "RESULTS FOR PREDEFINED TYPE INTEGER " &
48
                       "(INCLUDING THE CASE IN WHICH THE " &
49
                       "RELATIONAL OPERATORS ARE REDEFINED)" );
50
 
51
     DECLARE -- (A)
52
 
53
          I1A, I1B   : INTEGER          := IDENT_INT (1);
54
          I2         : INTEGER          := IDENT_INT (2);
55
          CI2        : CONSTANT INTEGER := 2;
56
 
57
 
58
     BEGIN -- (A)
59
 
60
          IF (I2 = CI2) AND (NOT (I2 /= CI2)) THEN
61
               NULL;
62
          ELSE
63
               FAILED ( "RELATIONAL TEST - 1" );
64
          END IF;
65
 
66
          IF (I2 /= 4) AND (NOT (I2 = 4)) THEN
67
               NULL;
68
          ELSE
69
               FAILED ( "RELATIONAL TEST - 2" );
70
          END IF;
71
 
72
          IF (I1A = I1B) AND (NOT (I1A /= I1B)) THEN
73
               NULL;
74
          ELSE
75
               FAILED ( "RELATIONAL TEST - 3" );
76
          END IF;
77
 
78
          IF (I2 >= CI2) AND (NOT (I2 < CI2)) THEN
79
               NULL;
80
          ELSE
81
               FAILED ( "RELATIONAL TEST - 4");
82
          END IF;
83
 
84
          IF (I2 <= 4) AND (NOT (I2 > 4)) THEN
85
               NULL;
86
          ELSE
87
               FAILED ( "RELATIONAL TEST - 5" );
88
          END IF;
89
 
90
          IF (I1A >= I1B) AND (I1A <= I1B) THEN
91
               NULL;
92
          ELSE
93
               FAILED ( "RELATIONAL TEST - 6" );
94
          END IF;
95
 
96
          IF ">" (LEFT => CI2, RIGHT => I1A) THEN
97
               NULL;
98
          ELSE
99
               FAILED ( "RELATIONAL TEST - 7" );
100
          END IF;
101
 
102
          IF "<" (LEFT => I1A, RIGHT => I2) THEN
103
               NULL;
104
          ELSE
105
               FAILED ( "RELATIONAL TEST - 8" );
106
          END IF;
107
 
108
          IF ">=" (LEFT => I1A, RIGHT => I1A ) THEN
109
               NULL;
110
          ELSE
111
               FAILED ( "RELATIONAL TEST - 9 ");
112
          END IF;
113
 
114
          IF "<=" (LEFT => I1A, RIGHT => CI2) THEN
115
               NULL;
116
          ELSE
117
               FAILED ( "RELATIONAL TEST - 10 ");
118
          END IF;
119
 
120
          IF "=" (LEFT => I1A, RIGHT => I1B ) THEN
121
               NULL;
122
          ELSE
123
               FAILED ( "RELATIONAL TEST - 11 ");
124
          END IF;
125
 
126
          IF "/=" (LEFT => CI2, RIGHT => 4) THEN
127
               NULL;
128
          ELSE
129
               FAILED ( "RELATIONAL TEST - 12 ");
130
          END IF;
131
 
132
     END; -- (A) 
133
 
134
     ----------------------------------------------------------------
135
 
136
     DECLARE -- (B)
137
 
138
          SUBTYPE ST IS INTEGER RANGE -10 .. 10;
139
 
140
          I1 : INTEGER := IDENT_INT (1);
141
          I5 : INTEGER := IDENT_INT (5);
142
 
143
          CI2  : CONSTANT INTEGER := 2;
144
          CI10 : CONSTANT INTEGER := 10;
145
 
146
 
147
     BEGIN -- (B)
148
 
149
          IF (I1 IN ST) AND (I1 NOT IN CI2 .. CI10) THEN
150
               NULL;
151
          ELSE
152
               FAILED ( "MEMBERSHIP TEST - B.1" );
153
          END IF;
154
 
155
          IF (IDENT_INT (11) NOT IN ST) AND (CI2 IN I1 .. I5) THEN
156
               NULL;
157
          ELSE
158
               FAILED ( "MEMBERSHIP TEST - B.2" );
159
          END IF;
160
 
161
          IF NOT (I5 NOT IN CI2 .. 10) AND NOT (IDENT_INT (-11) IN ST)
162
             THEN
163
               NULL;
164
          ELSE
165
               FAILED ( "MEMBERSHIP TEST - B.3" );
166
          END IF;
167
 
168
          IF NOT (I1 IN CI2 .. CI10) AND NOT (I5 NOT IN ST) THEN
169
               NULL;
170
          ELSE
171
               FAILED ( "MEMBERSHIP TEST - B.4" );
172
          END IF;
173
 
174
          IF (I1 NOT IN I5 .. I1) AND NOT (I5 IN I5 .. I1) THEN
175
               NULL;
176
          ELSE
177
               FAILED ( "MEMBERSHIP TEST - B.5" );
178
          END IF;
179
 
180
     END; -- (B)
181
 
182
     -------------------------------------------------------------
183
 
184
     DECLARE -- (C)
185
 
186
          SUBTYPE ST IS INTEGER RANGE -10 .. 10;
187
 
188
          I1 : INTEGER := IDENT_INT (1);
189
          I5 : INTEGER := IDENT_INT (5);
190
 
191
          CI2  : CONSTANT INTEGER := 2;
192
          CI10 : CONSTANT INTEGER := 10;
193
 
194
 
195
          FUNCTION ">" ( L, R : INTEGER ) RETURN BOOLEAN IS
196
          BEGIN
197
               RETURN INTEGER'POS (L) <= INTEGER'POS (R);
198
          END;
199
 
200
          FUNCTION ">=" ( L, R : INTEGER ) RETURN BOOLEAN IS
201
          BEGIN
202
               RETURN INTEGER'POS (L) < INTEGER'POS (R);
203
          END;
204
 
205
          FUNCTION "<" ( L, R : INTEGER ) RETURN BOOLEAN IS
206
          BEGIN
207
               RETURN  INTEGER'POS (L) >= INTEGER'POS (R);
208
          END;
209
 
210
          FUNCTION "<=" ( L, R : INTEGER ) RETURN BOOLEAN IS
211
          BEGIN
212
               RETURN INTEGER'POS (L) > INTEGER'POS (R);
213
          END;
214
 
215
     BEGIN -- (C)
216
 
217
          IF (I1 IN ST) AND (I1 NOT IN CI2 .. CI10) THEN
218
               NULL;
219
          ELSE
220
               FAILED ( "MEMBERSHIP TEST - C.1" );
221
          END IF;
222
 
223
          IF (IDENT_INT (11) NOT IN ST) AND (CI2 IN I1 .. I5) THEN
224
               NULL;
225
          ELSE
226
               FAILED ( "MEMBERSHIP TEST - C.2" );
227
          END IF;
228
 
229
          IF NOT (I5 NOT IN CI2 .. 10) AND NOT (IDENT_INT (-11) IN ST)
230
             THEN
231
               NULL;
232
          ELSE
233
               FAILED ( "MEMBERSHIP TEST - C.3" );
234
          END IF;
235
 
236
          IF NOT (I1 IN CI2 .. CI10) AND NOT (I5 NOT IN ST) THEN
237
               NULL;
238
          ELSE
239
               FAILED ( "MEMBERSHIP TEST - C.4" );
240
          END IF;
241
 
242
          IF (I1 NOT IN I5 .. I1) AND NOT (I5 IN I5 .. I1) THEN
243
               NULL;
244
          ELSE
245
               FAILED ( "MEMBERSHIP TEST - C.5" );
246
          END IF;
247
 
248
     END; -- (C)
249
 
250
     RESULT;
251
 
252
END C45231A;

powered by: WebSVN 2.1.0

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