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/] [c45231d.tst] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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