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.
26 -- CHECK THAT WHEN A SIZE SPECIFICATION IS GIVEN FOR AN
27 -- INTEGER TYPE, THEN OPERATIONS ON VALUES OF SUCH A TYPE
28 -- WITH THE SMALLEST APPROPRIATE SIGNED SIZE ARE NOT
29 -- AFFECTED BY THE REPRESENTATION CLAUSE.
32 -- JET 08/12/87 CREATED ORIGINAL TEST.
33 -- DHH 04/10/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA', CHANGED
34 -- SIZE CLAUSE VALUE TO 7, CHANGED OPERATOR ON 'SIZE
35 -- CHECKS AND ADDED REPRESENTAION CLAUSE CHECK.
36 -- RJW 03/28/90 REMOVED ERRONEOUS REFERENCES TO LENGTH_CHECK.
37 -- JRL 03/27/92 ELIMINATED REDUNDANT TESTING.
39 WITH REPORT
; USE REPORT
;
40 WITH LENGTH_CHECK
; -- CONTAINS A CALL TO 'FAILED'.
43 BASIC_SIZE
: CONSTANT := 7;
45 TYPE INT
IS RANGE -63 .. 63;
47 FOR INT
'SIZE USE BASIC_SIZE
;
53 TYPE ARRAY_TYPE
IS ARRAY (INTEGER RANGE -1 .. 1) OF INT
;
54 PRAGMA PACK
(ARRAY_TYPE
);
55 INTARRAY
: ARRAY_TYPE
:= (-63, 0, 63);
57 TYPE REC_TYPE
IS RECORD
62 PRAGMA PACK
(REC_TYPE
);
66 FUNCTION IDENT
(I
: INT
) RETURN INT
IS
75 PROCEDURE CHECK_1
IS NEW LENGTH_CHECK
(INT
);
78 PROCEDURE PROC
(PIN
, PIP
: INT
;
79 PIOZ
, PIOP
: IN OUT INT
;
83 IF PIN
'SIZE < IDENT_INT
(BASIC_SIZE
) THEN
84 FAILED
("INCORRECT VALUE FOR PIN'SIZE");
87 FOR P1
IN IDENT
(PIN
) .. IDENT
(PIOP
) LOOP
88 IF NOT (P1
IN PIN
.. PIP
) OR
89 (P1
NOT IN IDENT
(-63) .. IDENT
(63)) THEN
90 FAILED
("INCORRECT RESULTS FOR MEMBERSHIP " &
95 IF NOT ((+PIP
= PIOP
) AND
97 (ABS PIN
= PIOP
)) THEN
98 FAILED
("INCORRECT RESULTS FOR UNARY ARITHMETIC " &
102 IF INT
'VAL (-63) /= IDENT
(PIN
) OR
103 INT
'VAL (0) /= IDENT
(PIOZ
) OR
104 INT
'VAL (63) /= IDENT
(PIOP
) THEN
105 FAILED
("INCORRECT VALUE FOR INT'VAL - 1");
108 IF INT
'PRED (PIOZ
) /= IDENT
(-1) OR
109 INT
'PRED (PIP
) /= IDENT
(62) THEN
110 FAILED
("INCORRECT VALUE FOR INT'PRED - 1");
113 IF INT
'VALUE ("-63") /= IDENT
(PIN
) OR
114 INT
'VALUE ("0") /= IDENT
(PIOZ
) OR
115 INT
'VALUE ("63") /= IDENT
(PIOP
) THEN
116 FAILED
("INCORRECT VALUE FOR INT'VALUE - 1");
124 TEST
("CD2A32A", "CHECK THAT WHEN A SIZE SPECIFICATION IS " &
125 "GIVEN FOR AN INTEGER TYPE, THEN " &
126 "OPERATIONS ON VALUES OF SUCH A TYPE WITH " &
127 "THE SMALLEST APPROPRIATE SIGNED SIZE ARE " &
128 "NOT AFFECTED BY THE REPRESENTATION CLAUSE");
130 CHECK_1
(I1
, 7, "INT");
132 PROC
(-63, 63, I2
, I3
, I3
);
134 IF INT
'SIZE /= IDENT_INT
(BASIC_SIZE
) THEN
135 FAILED
("INCORRECT VALUE FOR INT'SIZE");
138 IF I1
'SIZE < IDENT_INT
(BASIC_SIZE
) THEN
139 FAILED
("INCORRECT VALUE FOR I1'SIZE");
142 IF NOT ((I1
< IDENT
(0)) AND
143 (IDENT
(I3
) > IDENT
(I2
)) AND
144 (I2
<= IDENT
(0)) AND
145 (IDENT
(63) = I3
)) THEN
146 FAILED
("INCORRECT RESULTS FOR RELATIONAL OPERATORS - 2");
149 IF NOT (((I1
+ I3
) = I2
) AND
154 ((I1
REM 10) = IDENT
(-3)) AND
155 ((I3
MOD 10) = IDENT
(3))) THEN
156 FAILED
("INCORRECT RESULTS FOR BINARY ARITHMETIC " &
160 IF INT
'FIRST /= IDENT
(-63) THEN
161 FAILED
("INCORRECT VALUE FOR INT'FIRST - 2");
164 IF INT
'POS (I1
) /= IDENT_INT
(-63) OR
165 INT
'POS (I2
) /= IDENT_INT
( 0) OR
166 INT
'POS (I3
) /= IDENT_INT
( 63) THEN
167 FAILED
("INCORRECT VALUE FOR INT'POS - 2");
170 IF INT
'SUCC (I1
) /= IDENT
(-62) OR
171 INT
'SUCC (I2
) /= IDENT
(1) THEN
172 FAILED
("INCORRECT VALUE FOR INT'SUCC - 2");
175 IF INT
'IMAGE (I1
) /= IDENT_STR
("-63") OR
176 INT
'IMAGE (I2
) /= IDENT_STR
(" 0") OR
177 INT
'IMAGE (I3
) /= IDENT_STR
(" 63") THEN
178 FAILED
("INCORRECT VALUE FOR INT'IMAGE - 2");
181 IF INTARRAY
(0)'SIZE < IDENT_INT
(BASIC_SIZE
) THEN
182 FAILED
("INCORRECT VALUE FOR INTARRAY(0)'SIZE");
185 IF NOT ((INTARRAY
(-1) < IDENT
(0)) AND
186 (IDENT
(INTARRAY
(1)) > IDENT
(INTARRAY
(0))) AND
187 (INTARRAY
(0) <= IDENT
(0)) AND
188 (IDENT
(63) = INTARRAY
(1))) THEN
189 FAILED
("INCORRECT RESULTS FOR RELATIONAL OPERATORS - 3");
192 FOR I
IN IDENT
(INTARRAY
(-1)) .. IDENT
(INTARRAY
(1)) LOOP
193 IF NOT (I
IN INTARRAY
(-1) .. INTARRAY
(1)) OR
194 (I
NOT IN IDENT
(-63) .. IDENT
(63)) THEN
195 FAILED
("INCORRECT RESULTS FOR MEMBERSHIP " &
200 IF NOT ((+INTARRAY
(-1) = INTARRAY
(-1)) AND
201 (-INTARRAY
( 1) = INTARRAY
(-1)) AND
202 (ABS INTARRAY
(-1) = INTARRAY
(1))) THEN
203 FAILED
("INCORRECT RESULTS FOR UNARY ARITHMETIC " &
207 IF INT
'VAL (-63) /= IDENT
(INTARRAY
(-1)) OR
208 INT
'VAL ( 0) /= IDENT
(INTARRAY
( 0)) OR
209 INT
'VAL ( 63) /= IDENT
(INTARRAY
( 1)) THEN
210 FAILED
("INCORRECT VALUE FOR INT'VAL - 3");
213 IF INT
'PRED (INTARRAY
(0)) /= IDENT
(-1) OR
214 INT
'PRED (INTARRAY
(1)) /= IDENT
(62) THEN
215 FAILED
("INCORRECT VALUE FOR INT'PRED - 3");
218 IF INT
'VALUE ("-63") /= IDENT
(INTARRAY
(-1)) OR
219 INT
'VALUE ("0") /= IDENT
(INTARRAY
( 0)) OR
220 INT
'VALUE ("63") /= IDENT
(INTARRAY
( 1)) THEN
221 FAILED
("INCORRECT VALUE FOR INT'VALUE - 3");
224 IF IREC
.COMPP
'SIZE < IDENT_INT
(BASIC_SIZE
) THEN
225 FAILED
("INCORRECT VALUE FOR IREC.COMPP'SIZE");
228 IF NOT ((IREC
.COMPN
< IDENT
(0)) AND
229 (IDENT
(IREC
.COMPP
) > IDENT
(IREC
.COMPZ
)) AND
230 (IREC
.COMPZ
<= IDENT
(0)) AND
231 (IDENT
(63) = IREC
.COMPP
)) THEN
232 FAILED
("INCORRECT RESULTS FOR RELATIONAL OPERATORS - 4");
235 FOR I
IN IDENT
(IREC
.COMPN
) .. IDENT
(IREC
.COMPP
) LOOP
236 IF NOT (I
IN IREC
.COMPN
.. IREC
.COMPP
) OR
237 (I
NOT IN IDENT
(-63) .. IDENT
(63)) THEN
238 FAILED
("INCORRECT RESULTS FOR MEMBERSHIP " &
243 IF NOT (((IREC
.COMPN
+ IREC
.COMPP
) = IREC
.COMPZ
) AND
244 ((IREC
.COMPZ
- IREC
.COMPP
) = IREC
.COMPN
) AND
245 ((IREC
.COMPP
* IREC
.COMPZ
) = IREC
.COMPZ
) AND
246 ((IREC
.COMPZ
/ IREC
.COMPN
) = IREC
.COMPZ
) AND
247 ((IREC
.COMPN
** 1) = IREC
.COMPN
) AND
248 ((IREC
.COMPN
REM 10) = IDENT
(-3)) AND
249 ((IREC
.COMPP
MOD 10) = IDENT
( 3))) THEN
250 FAILED
("INCORRECT RESULTS FOR BINARY ARITHMETIC " &
254 IF INT
'POS (IREC
.COMPN
) /= IDENT_INT
(-63) OR
255 INT
'POS (IREC
.COMPZ
) /= IDENT_INT
( 0) OR
256 INT
'POS (IREC
.COMPP
) /= IDENT_INT
( 63) THEN
257 FAILED
("INCORRECT VALUE FOR INT'POS - 4");
260 IF INT
'SUCC (IREC
.COMPN
) /= IDENT
(-62) OR
261 INT
'SUCC (IREC
.COMPZ
) /= IDENT
( 1) THEN
262 FAILED
("INCORRECT VALUE FOR INT'SUCC - 4");
265 IF INT
'IMAGE (IREC
.COMPN
) /= IDENT_STR
("-63") OR
266 INT
'IMAGE (IREC
.COMPZ
) /= IDENT_STR
(" 0") OR
267 INT
'IMAGE (IREC
.COMPP
) /= IDENT_STR
(" 63") THEN
268 FAILED
("INCORRECT VALUE FOR INT'IMAGE - 4");