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/] [c6/] [c67002e.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C67002E.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 ALL OPERATOR SYMBOLS CAN BE USED IN (OVERLOADED)
26
-- FUNCTION SPECIFICATIONS WITH THE REQUIRED NUMBER OF PARAMETERS.
27
-- THIS TEST CHECKS RENAMING DECLARATIONS FOR THESE FUNCTIONS.
28
--   SUBTESTS ARE:
29
--        (A) THROUGH (P): "=", "AND", "OR", "XOR", "<", "<=",
30
--             ">", ">=", "&", "*", "/", "MOD", "REM", "**", "+", "-",
31
--             RESPECTIVELY.  ALL OF THESE HAVE TWO PARAMETERS.
32
--        (Q), (R), (S), AND (T): "+", "-", "NOT", "ABS", RESPECTIVELY,
33
--             WITH ONE PARAMETER.
34
 
35
-- CPP 6/26/84
36
 
37
WITH REPORT;  USE REPORT;
38
PROCEDURE C67002E IS
39
 
40
     FUNCTION TWO_PARAMS (I1, I2 : INTEGER) RETURN CHARACTER IS
41
     BEGIN
42
          IF I1 > I2 THEN
43
               RETURN 'G';
44
          ELSE RETURN 'L';
45
          END IF;
46
     END TWO_PARAMS;
47
 
48
     FUNCTION ONE_PARAM (I1 : INTEGER) RETURN CHARACTER IS
49
     BEGIN
50
          IF I1 < IDENT_INT(0) THEN
51
               RETURN 'N';
52
          ELSE RETURN 'P';
53
          END IF;
54
     END ONE_PARAM;
55
 
56
BEGIN
57
     TEST ("C67002E", "USE OF OPERATOR SYMBOLS IN " &
58
           "(OVERLOADED) FUNCTION SPECIFICATIONS");
59
 
60
     -------------------------------------------------
61
 
62
     DECLARE -- (A)
63
 
64
          PACKAGE PKG IS
65
               TYPE LP IS LIMITED PRIVATE;
66
               FUNCTION "=" (LPA, LPB : LP) RETURN BOOLEAN;
67
          PRIVATE
68
               TYPE LP IS NEW INTEGER;
69
          END PKG;
70
          USE PKG;
71
 
72
          LP1, LP2 : LP;
73
 
74
          FUNCTION "=" (LPA, LPB : LP)
75
               RETURN BOOLEAN RENAMES PKG."=";
76
 
77
          PACKAGE BODY PKG IS
78
               FUNCTION "=" (LPA, LPB : LP) RETURN BOOLEAN IS
79
               BEGIN
80
                    RETURN LPA > LPB;
81
               END "=";
82
          BEGIN
83
               LP1 := LP (IDENT_INT (7));
84
               LP2 := LP (IDENT_INT (8));
85
          END PKG;
86
 
87
     BEGIN -- (A)
88
          IF (LP1 = LP2) OR NOT (LP2 = LP1) OR
89
             (LP1 = LP1) OR (LP2 /= LP1) THEN
90
               FAILED ("OVERLOADING OF ""="" OPERATOR DEFECTIVE");
91
          END IF;
92
     END; -- (A)
93
 
94
     -------------------------------------------------
95
 
96
     DECLARE -- (B)
97
          FUNCTION "AND" (I1, I2 : INTEGER)
98
               RETURN CHARACTER RENAMES TWO_PARAMS;
99
 
100
     BEGIN -- (B)
101
          IF (IDENT_INT (10) AND 1) /= 'G' OR
102
             (5 AND 10) /= 'L' THEN
103
               FAILED ("OVERLOADING OF ""AND"" OPERATOR DEFECTIVE");
104
          END IF;
105
     END; -- (B)
106
 
107
     -------------------------------------------------
108
 
109
     DECLARE -- (C)
110
          FUNCTION "OR" (I1, I2 : INTEGER)
111
               RETURN CHARACTER RENAMES TWO_PARAMS;
112
 
113
     BEGIN -- (C)
114
          IF (IDENT_INT (10) OR 1) /= 'G' OR
115
             (5 OR 10) /= 'L' THEN
116
               FAILED ("OVERLOADING OF ""OR"" OPERATOR DEFECTIVE");
117
          END IF;
118
     END; -- (C)
119
 
120
     -------------------------------------------------
121
 
122
     DECLARE -- (D)
123
          FUNCTION "XOR" (I1, I2 : INTEGER)
124
               RETURN CHARACTER RENAMES TWO_PARAMS;
125
 
126
     BEGIN -- (D)
127
          IF (IDENT_INT (10) XOR 1) /= 'G' OR
128
             (5 XOR 10) /= 'L' THEN
129
               FAILED ("OVERLOADING OF ""XOR"" OPERATOR DEFECTIVE");
130
          END IF;
131
     END; -- (D)
132
 
133
     -------------------------------------------------
134
 
135
     DECLARE -- (E)
136
          FUNCTION "<" (I1, I2 : INTEGER)
137
               RETURN CHARACTER RENAMES TWO_PARAMS;
138
 
139
     BEGIN -- (E)
140
          IF (IDENT_INT (10) < 1) /= 'G' OR
141
             (5 < 10) /= 'L' THEN
142
               FAILED ("OVERLOADING OF ""<"" OPERATOR DEFECTIVE");
143
          END IF;
144
     END; -- (E)
145
 
146
     -------------------------------------------------
147
 
148
     DECLARE -- (F)
149
          FUNCTION "<=" (I1, I2 : INTEGER)
150
               RETURN CHARACTER RENAMES TWO_PARAMS;
151
 
152
     BEGIN -- (F)
153
          IF (IDENT_INT (10) <= 1) /= 'G' OR
154
             (5 <= 10) /= 'L' THEN
155
               FAILED ("OVERLOADING OF ""<="" OPERATOR DEFECTIVE");
156
          END IF;
157
     END; -- (F)
158
 
159
     -------------------------------------------------
160
 
161
     DECLARE -- (G)
162
          FUNCTION ">" (I1, I2 : INTEGER)
163
               RETURN CHARACTER RENAMES TWO_PARAMS;
164
 
165
     BEGIN -- (G)
166
          IF (IDENT_INT (10) > 1) /= 'G' OR
167
             (5 > 10) /= 'L' THEN
168
               FAILED ("OVERLOADING OF "">"" OPERATOR DEFECTIVE");
169
          END IF;
170
     END; -- (G)
171
 
172
     -------------------------------------------------
173
 
174
     DECLARE -- (H)
175
          FUNCTION ">=" (I1, I2 : INTEGER)
176
               RETURN CHARACTER RENAMES TWO_PARAMS;
177
 
178
     BEGIN -- (H)
179
          IF (IDENT_INT (10) >= 1) /= 'G' OR
180
             (5 >= 10) /= 'L' THEN
181
               FAILED ("OVERLOADING OF "">="" OPERATOR DEFECTIVE");
182
          END IF;
183
     END; -- (H)
184
 
185
     -------------------------------------------------
186
 
187
     DECLARE -- (I)
188
          FUNCTION "&" (I1, I2 : INTEGER)
189
               RETURN CHARACTER RENAMES TWO_PARAMS;
190
 
191
     BEGIN -- (I)
192
          IF (IDENT_INT (10) & 1) /= 'G' OR
193
             (5 & 10) /= 'L' THEN
194
               FAILED ("OVERLOADING OF ""&"" OPERATOR DEFECTIVE");
195
          END IF;
196
     END; -- (I)
197
 
198
     -------------------------------------------------
199
 
200
     DECLARE -- (J)
201
          FUNCTION "*" (I1, I2 : INTEGER)
202
               RETURN CHARACTER RENAMES TWO_PARAMS;
203
 
204
     BEGIN -- (J)
205
          IF (IDENT_INT (10) * 1) /= 'G' OR
206
             (5 * 10) /= 'L' THEN
207
               FAILED ("OVERLOADING OF ""*"" OPERATOR DEFECTIVE");
208
          END IF;
209
     END; -- (J)
210
 
211
     -------------------------------------------------
212
 
213
     DECLARE -- (K)
214
          FUNCTION "/" (I1, I2 : INTEGER)
215
               RETURN CHARACTER RENAMES TWO_PARAMS;
216
 
217
     BEGIN -- (K)
218
          IF (IDENT_INT (10) / 1) /= 'G' OR
219
             (5 / 10) /= 'L' THEN
220
               FAILED ("OVERLOADING OF ""/"" OPERATOR DEFECTIVE");
221
          END IF;
222
     END; -- (K)
223
 
224
     -------------------------------------------------
225
 
226
     DECLARE -- (L)
227
          FUNCTION "MOD" (I1, I2 : INTEGER)
228
               RETURN CHARACTER RENAMES TWO_PARAMS;
229
 
230
     BEGIN -- (L)
231
          IF (IDENT_INT (10) MOD 1) /= 'G' OR
232
             (5 MOD 10) /= 'L' THEN
233
               FAILED ("OVERLOADING OF ""MOD"" OPERATOR DEFECTIVE");
234
          END IF;
235
     END; -- (L)
236
 
237
     -------------------------------------------------
238
 
239
     DECLARE -- (M)
240
          FUNCTION "REM" (I1, I2 : INTEGER)
241
               RETURN CHARACTER RENAMES TWO_PARAMS;
242
 
243
     BEGIN -- (M)
244
          IF (IDENT_INT (10) REM 1) /= 'G' OR
245
             (5 REM 10) /= 'L' THEN
246
               FAILED ("OVERLOADING OF ""REM"" OPERATOR DEFECTIVE");
247
          END IF;
248
     END; -- (M)
249
 
250
     -------------------------------------------------
251
 
252
     DECLARE -- (N)
253
          FUNCTION "**" (I1, I2 : INTEGER)
254
               RETURN CHARACTER RENAMES TWO_PARAMS;
255
 
256
     BEGIN -- (N)
257
          IF (IDENT_INT (10) ** 1) /= 'G' OR
258
             (5 ** 10) /= 'L' THEN
259
               FAILED ("OVERLOADING OF ""**"" OPERATOR DEFECTIVE");
260
          END IF;
261
     END; -- (N)
262
 
263
     -------------------------------------------------
264
 
265
     DECLARE -- (O)
266
          FUNCTION "+" (I1, I2 : INTEGER)
267
               RETURN CHARACTER RENAMES TWO_PARAMS;
268
 
269
     BEGIN -- (O)
270
          IF (IDENT_INT (10) + 1) /= 'G' OR
271
             (5 + 10) /= 'L' THEN
272
               FAILED ("OVERLOADING OF ""+"" OPERATOR DEFECTIVE");
273
          END IF;
274
     END; -- (O)
275
 
276
     -------------------------------------------------
277
 
278
     DECLARE -- (P)
279
          FUNCTION "-" (I1, I2 : INTEGER)
280
               RETURN CHARACTER RENAMES TWO_PARAMS;
281
 
282
     BEGIN -- (P)
283
          IF (IDENT_INT (10) - 1) /= 'G' OR
284
             (5 - 10) /= 'L' THEN
285
               FAILED ("OVERLOADING OF ""-"" OPERATOR DEFECTIVE");
286
          END IF;
287
     END; -- (P)
288
 
289
     -------------------------------------------------
290
 
291
     DECLARE -- (Q)
292
          FUNCTION "+" (I1 : INTEGER)
293
               RETURN CHARACTER RENAMES ONE_PARAM;
294
 
295
     BEGIN -- (Q)
296
          IF (+ IDENT_INT(25) /= 'P') OR
297
             (+ (0-25) /= 'N') THEN
298
               FAILED ("OVERLOADING OF ""+"" " &
299
                       "OPERATOR (ONE OPERAND) DEFECTIVE");
300
          END IF;
301
     END; -- (Q)
302
 
303
     -------------------------------------------------
304
 
305
     DECLARE -- (R)
306
          FUNCTION "-" (I1 : INTEGER)
307
               RETURN CHARACTER RENAMES ONE_PARAM;
308
 
309
     BEGIN -- (R)
310
          IF (- IDENT_INT(25) /= 'P') OR
311
             (- (0-25) /= 'N') THEN
312
               FAILED ("OVERLOADING OF ""-"" " &
313
                       "OPERATOR (ONE OPERAND) DEFECTIVE");
314
          END IF;
315
     END; -- (R)
316
 
317
     -------------------------------------------------
318
 
319
     DECLARE -- (S)
320
          FUNCTION "NOT" (I1 : INTEGER)
321
               RETURN CHARACTER RENAMES ONE_PARAM;
322
 
323
     BEGIN -- (S)
324
          IF (NOT IDENT_INT(25) /= 'P') OR
325
             (NOT (0-25) /= 'N') THEN
326
               FAILED ("OVERLOADING OF ""NOT"" " &
327
                       "OPERATOR (ONE OPERAND) DEFECTIVE");
328
          END IF;
329
     END; -- (S)
330
 
331
     -------------------------------------------------
332
 
333
     DECLARE -- (T)
334
          FUNCTION "ABS" (I1 : INTEGER)
335
               RETURN CHARACTER RENAMES ONE_PARAM;
336
 
337
     BEGIN -- (T)
338
          IF (ABS IDENT_INT(25) /= 'P') OR
339
             (ABS (0-25) /= 'N') THEN
340
               FAILED ("OVERLOADING OF ""ABS"" " &
341
                       "OPERATOR (ONE OPERAND) DEFECTIVE");
342
          END IF;
343
     END; -- (T)
344
 
345
     -------------------------------------------------
346
 
347
     RESULT;
348
END C67002E;

powered by: WebSVN 2.1.0

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