3 -- Grant of Unlimited Rights
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
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.
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.
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.
37 WITH REPORT
; USE REPORT
;
40 FUNCTION TWO_PARAMS
(I1
, I2
: INTEGER) RETURN CHARACTER IS
48 FUNCTION ONE_PARAM
(I1
: INTEGER) RETURN CHARACTER IS
50 IF I1
< IDENT_INT
(0) THEN
57 TEST
("C67002E", "USE OF OPERATOR SYMBOLS IN " &
58 "(OVERLOADED) FUNCTION SPECIFICATIONS");
60 -------------------------------------------------
65 TYPE LP
IS LIMITED PRIVATE;
66 FUNCTION "=" (LPA
, LPB
: LP
) RETURN BOOLEAN;
68 TYPE LP
IS NEW INTEGER;
74 FUNCTION "=" (LPA
, LPB
: LP
)
75 RETURN BOOLEAN RENAMES PKG
."=";
78 FUNCTION "=" (LPA
, LPB
: LP
) RETURN BOOLEAN IS
83 LP1
:= LP
(IDENT_INT
(7));
84 LP2
:= LP
(IDENT_INT
(8));
88 IF (LP1
= LP2
) OR NOT (LP2
= LP1
) OR
89 (LP1
= LP1
) OR (LP2
/= LP1
) THEN
90 FAILED
("OVERLOADING OF ""="" OPERATOR DEFECTIVE");
94 -------------------------------------------------
97 FUNCTION "AND" (I1
, I2
: INTEGER)
98 RETURN CHARACTER RENAMES TWO_PARAMS
;
101 IF (IDENT_INT
(10) AND 1) /= 'G' OR
102 (5 AND 10) /= 'L' THEN
103 FAILED
("OVERLOADING OF ""AND"" OPERATOR DEFECTIVE");
107 -------------------------------------------------
110 FUNCTION "OR" (I1
, I2
: INTEGER)
111 RETURN CHARACTER RENAMES TWO_PARAMS
;
114 IF (IDENT_INT
(10) OR 1) /= 'G' OR
115 (5 OR 10) /= 'L' THEN
116 FAILED
("OVERLOADING OF ""OR"" OPERATOR DEFECTIVE");
120 -------------------------------------------------
123 FUNCTION "XOR" (I1
, I2
: INTEGER)
124 RETURN CHARACTER RENAMES TWO_PARAMS
;
127 IF (IDENT_INT
(10) XOR 1) /= 'G' OR
128 (5 XOR 10) /= 'L' THEN
129 FAILED
("OVERLOADING OF ""XOR"" OPERATOR DEFECTIVE");
133 -------------------------------------------------
136 FUNCTION "<" (I1
, I2
: INTEGER)
137 RETURN CHARACTER RENAMES TWO_PARAMS
;
140 IF (IDENT_INT
(10) < 1) /= 'G' OR
142 FAILED
("OVERLOADING OF ""<"" OPERATOR DEFECTIVE");
146 -------------------------------------------------
149 FUNCTION "<=" (I1
, I2
: INTEGER)
150 RETURN CHARACTER RENAMES TWO_PARAMS
;
153 IF (IDENT_INT
(10) <= 1) /= 'G' OR
154 (5 <= 10) /= 'L' THEN
155 FAILED
("OVERLOADING OF ""<="" OPERATOR DEFECTIVE");
159 -------------------------------------------------
162 FUNCTION ">" (I1
, I2
: INTEGER)
163 RETURN CHARACTER RENAMES TWO_PARAMS
;
166 IF (IDENT_INT
(10) > 1) /= 'G' OR
168 FAILED
("OVERLOADING OF "">"" OPERATOR DEFECTIVE");
172 -------------------------------------------------
175 FUNCTION ">=" (I1
, I2
: INTEGER)
176 RETURN CHARACTER RENAMES TWO_PARAMS
;
179 IF (IDENT_INT
(10) >= 1) /= 'G' OR
180 (5 >= 10) /= 'L' THEN
181 FAILED
("OVERLOADING OF "">="" OPERATOR DEFECTIVE");
185 -------------------------------------------------
188 FUNCTION "&" (I1
, I2
: INTEGER)
189 RETURN CHARACTER RENAMES TWO_PARAMS
;
192 IF (IDENT_INT
(10) & 1) /= 'G' OR
194 FAILED
("OVERLOADING OF ""&"" OPERATOR DEFECTIVE");
198 -------------------------------------------------
201 FUNCTION "*" (I1
, I2
: INTEGER)
202 RETURN CHARACTER RENAMES TWO_PARAMS
;
205 IF (IDENT_INT
(10) * 1) /= 'G' OR
207 FAILED
("OVERLOADING OF ""*"" OPERATOR DEFECTIVE");
211 -------------------------------------------------
214 FUNCTION "/" (I1
, I2
: INTEGER)
215 RETURN CHARACTER RENAMES TWO_PARAMS
;
218 IF (IDENT_INT
(10) / 1) /= 'G' OR
220 FAILED
("OVERLOADING OF ""/"" OPERATOR DEFECTIVE");
224 -------------------------------------------------
227 FUNCTION "MOD" (I1
, I2
: INTEGER)
228 RETURN CHARACTER RENAMES TWO_PARAMS
;
231 IF (IDENT_INT
(10) MOD 1) /= 'G' OR
232 (5 MOD 10) /= 'L' THEN
233 FAILED
("OVERLOADING OF ""MOD"" OPERATOR DEFECTIVE");
237 -------------------------------------------------
240 FUNCTION "REM" (I1
, I2
: INTEGER)
241 RETURN CHARACTER RENAMES TWO_PARAMS
;
244 IF (IDENT_INT
(10) REM 1) /= 'G' OR
245 (5 REM 10) /= 'L' THEN
246 FAILED
("OVERLOADING OF ""REM"" OPERATOR DEFECTIVE");
250 -------------------------------------------------
253 FUNCTION "**" (I1
, I2
: INTEGER)
254 RETURN CHARACTER RENAMES TWO_PARAMS
;
257 IF (IDENT_INT
(10) ** 1) /= 'G' OR
258 (5 ** 10) /= 'L' THEN
259 FAILED
("OVERLOADING OF ""**"" OPERATOR DEFECTIVE");
263 -------------------------------------------------
266 FUNCTION "+" (I1
, I2
: INTEGER)
267 RETURN CHARACTER RENAMES TWO_PARAMS
;
270 IF (IDENT_INT
(10) + 1) /= 'G' OR
272 FAILED
("OVERLOADING OF ""+"" OPERATOR DEFECTIVE");
276 -------------------------------------------------
279 FUNCTION "-" (I1
, I2
: INTEGER)
280 RETURN CHARACTER RENAMES TWO_PARAMS
;
283 IF (IDENT_INT
(10) - 1) /= 'G' OR
285 FAILED
("OVERLOADING OF ""-"" OPERATOR DEFECTIVE");
289 -------------------------------------------------
292 FUNCTION "+" (I1
: INTEGER)
293 RETURN CHARACTER RENAMES ONE_PARAM
;
296 IF (+ IDENT_INT
(25) /= 'P') OR
297 (+ (0-25) /= 'N') THEN
298 FAILED
("OVERLOADING OF ""+"" " &
299 "OPERATOR (ONE OPERAND) DEFECTIVE");
303 -------------------------------------------------
306 FUNCTION "-" (I1
: INTEGER)
307 RETURN CHARACTER RENAMES ONE_PARAM
;
310 IF (- IDENT_INT
(25) /= 'P') OR
311 (- (0-25) /= 'N') THEN
312 FAILED
("OVERLOADING OF ""-"" " &
313 "OPERATOR (ONE OPERAND) DEFECTIVE");
317 -------------------------------------------------
320 FUNCTION "NOT" (I1
: INTEGER)
321 RETURN CHARACTER RENAMES ONE_PARAM
;
324 IF (NOT IDENT_INT
(25) /= 'P') OR
325 (NOT (0-25) /= 'N') THEN
326 FAILED
("OVERLOADING OF ""NOT"" " &
327 "OPERATOR (ONE OPERAND) DEFECTIVE");
331 -------------------------------------------------
334 FUNCTION "ABS" (I1
: INTEGER)
335 RETURN CHARACTER RENAMES ONE_PARAM
;
338 IF (ABS IDENT_INT
(25) /= 'P') OR
339 (ABS (0-25) /= 'N') THEN
340 FAILED
("OVERLOADING OF ""ABS"" " &
341 "OPERATOR (ONE OPERAND) DEFECTIVE");
345 -------------------------------------------------