Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c6 / c67002e.ada
blobaa3695239514daf57bf0cba531f352ee11273043
1 -- C67002E.ADA
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.
16 -- DISCLAIMER
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.
35 -- CPP 6/26/84
37 WITH REPORT; USE REPORT;
38 PROCEDURE C67002E IS
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;
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;
56 BEGIN
57 TEST ("C67002E", "USE OF OPERATOR SYMBOLS IN " &
58 "(OVERLOADED) FUNCTION SPECIFICATIONS");
60 -------------------------------------------------
62 DECLARE -- (A)
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;
72 LP1, LP2 : LP;
74 FUNCTION "=" (LPA, LPB : LP)
75 RETURN BOOLEAN RENAMES PKG."=";
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;
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)
94 -------------------------------------------------
96 DECLARE -- (B)
97 FUNCTION "AND" (I1, I2 : INTEGER)
98 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
107 -------------------------------------------------
109 DECLARE -- (C)
110 FUNCTION "OR" (I1, I2 : INTEGER)
111 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
120 -------------------------------------------------
122 DECLARE -- (D)
123 FUNCTION "XOR" (I1, I2 : INTEGER)
124 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
133 -------------------------------------------------
135 DECLARE -- (E)
136 FUNCTION "<" (I1, I2 : INTEGER)
137 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
146 -------------------------------------------------
148 DECLARE -- (F)
149 FUNCTION "<=" (I1, I2 : INTEGER)
150 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
159 -------------------------------------------------
161 DECLARE -- (G)
162 FUNCTION ">" (I1, I2 : INTEGER)
163 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
172 -------------------------------------------------
174 DECLARE -- (H)
175 FUNCTION ">=" (I1, I2 : INTEGER)
176 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
185 -------------------------------------------------
187 DECLARE -- (I)
188 FUNCTION "&" (I1, I2 : INTEGER)
189 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
198 -------------------------------------------------
200 DECLARE -- (J)
201 FUNCTION "*" (I1, I2 : INTEGER)
202 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
211 -------------------------------------------------
213 DECLARE -- (K)
214 FUNCTION "/" (I1, I2 : INTEGER)
215 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
224 -------------------------------------------------
226 DECLARE -- (L)
227 FUNCTION "MOD" (I1, I2 : INTEGER)
228 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
237 -------------------------------------------------
239 DECLARE -- (M)
240 FUNCTION "REM" (I1, I2 : INTEGER)
241 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
250 -------------------------------------------------
252 DECLARE -- (N)
253 FUNCTION "**" (I1, I2 : INTEGER)
254 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
263 -------------------------------------------------
265 DECLARE -- (O)
266 FUNCTION "+" (I1, I2 : INTEGER)
267 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
276 -------------------------------------------------
278 DECLARE -- (P)
279 FUNCTION "-" (I1, I2 : INTEGER)
280 RETURN CHARACTER RENAMES TWO_PARAMS;
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)
289 -------------------------------------------------
291 DECLARE -- (Q)
292 FUNCTION "+" (I1 : INTEGER)
293 RETURN CHARACTER RENAMES ONE_PARAM;
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)
303 -------------------------------------------------
305 DECLARE -- (R)
306 FUNCTION "-" (I1 : INTEGER)
307 RETURN CHARACTER RENAMES ONE_PARAM;
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)
317 -------------------------------------------------
319 DECLARE -- (S)
320 FUNCTION "NOT" (I1 : INTEGER)
321 RETURN CHARACTER RENAMES ONE_PARAM;
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)
331 -------------------------------------------------
333 DECLARE -- (T)
334 FUNCTION "ABS" (I1 : INTEGER)
335 RETURN CHARACTER RENAMES ONE_PARAM;
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)
345 -------------------------------------------------
347 RESULT;
348 END C67002E;