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 THE REQUIRED PREDEFINED OPERATIONS ARE DECLARED
27 -- (IMPLICITLY) FOR DERIVED ONE-DIMENSIONAL ARRAY TYPES
28 -- WHOSE COMPONENT TYPE IS A CHARACTER TYPE.
31 -- JRK 9/15/86 CREATED ORIGINAL TEST.
32 -- RJW 8/21/89 MODIFIED CHECKS FOR OBJECT AND TYPE SIZES.
33 -- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X.
35 WITH SYSTEM
; USE SYSTEM
;
36 WITH REPORT
; USE REPORT
;
40 TYPE COMPONENT
IS NEW CHARACTER;
44 FIRST
: CONSTANT := 0;
45 LAST
: CONSTANT := 100;
47 SUBTYPE INDEX
IS INTEGER RANGE FIRST
.. LAST
;
49 TYPE PARENT
IS ARRAY (INDEX
RANGE <>) OF COMPONENT
;
51 FUNCTION CREATE
( F
, L
: INDEX
;
53 DUMMY
: PARENT
-- TO RESOLVE OVERLOADING.
60 TYPE T
IS NEW PARENT
(IDENT_INT
(5) .. IDENT_INT
(7));
62 TYPE ARRT
IS ARRAY (INTEGER RANGE <>) OF COMPONENT
;
63 SUBTYPE ARR
IS ARRT
(2 .. 4);
65 X
: T
:= (OTHERS => 'B');
66 W
: PARENT
(5 .. 7) := (OTHERS => 'B');
69 U
: ARR
:= (OTHERS => C
);
72 PROCEDURE A
(X
: ADDRESS
) IS
74 B
:= IDENT_BOOL
(TRUE);
77 FUNCTION V
RETURN T
IS
95 B
:= COMPONENT
'SUCC (B
);
102 FUNCTION IDENT
(X
: T
) RETURN T
IS
104 IF EQUAL
(X
'LENGTH, X
'LENGTH) THEN
105 RETURN X
; -- ALWAYS EXECUTED.
107 RETURN (OTHERS => '-');
111 TEST
("C34005G", "CHECK THAT THE REQUIRED PREDEFINED OPERATIONS " &
112 "ARE DECLARED (IMPLICITLY) FOR DERIVED " &
113 "ONE-DIMENSIONAL ARRAY TYPES WHOSE COMPONENT " &
114 "TYPE IS A CHARACTER TYPE");
118 FAILED
("INCORRECT :=");
121 IF T
'(X) /= "ABC" THEN
122 FAILED ("INCORRECT QUALIFICATION");
125 IF T (X) /= "ABC" THEN
126 FAILED ("INCORRECT SELF CONVERSION");
132 IF T (W) /= "ABC" THEN
133 FAILED ("INCORRECT CONVERSION FROM PARENT");
137 IF PARENT (X) /= "ABC" OR
138 PARENT (CREATE (2, 3, 'D
', X)) /= "DE" THEN
139 FAILED ("INCORRECT CONVERSION TO PARENT");
142 WHEN CONSTRAINT_ERROR =>
143 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 1");
145 FAILED ("CALL TO CREATE RAISED EXCEPTION - 1");
151 IF T (U) /= "ABC" THEN
152 FAILED ("INCORRECT CONVERSION FROM ARRAY");
156 IF ARR (X) /= "ABC" OR
157 ARRT (CREATE (1, 2, 'C
', X)) /= "CD" THEN
158 FAILED ("INCORRECT CONVERSION TO ARRAY");
161 WHEN CONSTRAINT_ERROR =>
162 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 2");
164 FAILED ("CALL TO CREATE RAISED EXCEPTION - 2");
167 IF IDENT ("ABC") /= ('A
', 'B
', 'C
') OR
169 FAILED ("INCORRECT STRING LITERAL");
172 IF IDENT (('A
', 'B
', 'C
')) /= "ABC" OR
174 FAILED ("INCORRECT AGGREGATE");
178 IF X (IDENT_INT (5)) /= 'A
' OR
179 CREATE (2, 3, 'D
', X) (3) /= 'E
' THEN
180 FAILED ("INCORRECT INDEX (VALUE)");
183 WHEN CONSTRAINT_ERROR =>
184 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 3");
186 FAILED ("CALL TO CREATE RAISED EXCEPTION - 3");
189 X (IDENT_INT (7)) := 'D
';
191 FAILED ("INCORRECT INDEX (ASSIGNMENT)");
196 IF X (IDENT_INT (6) .. IDENT_INT (7)) /= "BC" OR
197 CREATE (1, 4, 'D
', X) (1 .. 3) /= "DEF" THEN
198 FAILED ("INCORRECT SLICE (VALUE)");
201 WHEN CONSTRAINT_ERROR =>
202 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 4");
204 FAILED ("CALL TO CREATE RAISED EXCEPTION - 4");
207 X (IDENT_INT (5) .. IDENT_INT (6)) := "DE";
209 FAILED ("INCORRECT SLICE (ASSIGNMENT)");
213 IF X = IDENT ("ABD") OR X = "AB" THEN
214 FAILED ("INCORRECT =");
217 IF X /= IDENT ("ABC") OR NOT (X /= "BC") THEN
218 FAILED ("INCORRECT /=");
221 IF X < IDENT ("ABC") OR X < "AB" THEN
222 FAILED ("INCORRECT <");
225 IF X > IDENT ("ABC") OR X > "AC" THEN
226 FAILED ("INCORRECT >");
229 IF X <= IDENT ("ABB") OR X <= "ABBD" THEN
230 FAILED ("INCORRECT <=");
233 IF X >= IDENT ("ABD") OR X >= "ABCA" THEN
234 FAILED ("INCORRECT >=");
237 IF NOT (X IN T) OR "AB" IN T THEN
238 FAILED ("INCORRECT ""IN""");
241 IF X NOT IN T OR NOT ("AB" NOT IN T) THEN
242 FAILED ("INCORRECT ""NOT IN""");
246 IF X & "DEF" /= "ABCDEF" OR
247 CREATE (2, 3, 'B
', X) & "DE" /= "BCDE" THEN
248 FAILED ("INCORRECT & (ARRAY, ARRAY)");
251 WHEN CONSTRAINT_ERROR =>
252 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 5");
254 FAILED ("CALL TO CREATE RAISED EXCEPTION - 5");
258 IF X & 'D
' /= "ABCD" OR
259 CREATE (2, 3, 'B
', X) & 'D
' /= "BCD" THEN
260 FAILED ("INCORRECT & (ARRAY, COMPONENT)");
263 WHEN CONSTRAINT_ERROR =>
264 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 6");
266 FAILED ("CALL TO CREATE RAISED EXCEPTION - 6");
270 IF 'D
' & X /= "DABC" OR
271 'B
' & CREATE (2, 3, 'C
', X) /= "BCD" THEN
272 FAILED ("INCORRECT & (COMPONENT, ARRAY)");
275 WHEN CONSTRAINT_ERROR =>
276 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 7");
278 FAILED ("CALL TO CREATE RAISED EXCEPTION - 7");
286 IF C & 'C
' /= CREATE (2, 3, 'B
', X) THEN
287 FAILED ("INCORRECT & (COMPONENT, COMPONENT)");
290 WHEN CONSTRAINT_ERROR =>
291 FAILED ("CALL TO CREATE RAISED CONSTRAINT_ERROR - 8");
293 FAILED ("CALL TO CREATE RAISED EXCEPTION - 8");
299 FAILED ("INCORRECT 'ADDRESS
");
303 FAILED ("INCORRECT
TYPE'FIRST");
307 FAILED ("INCORRECT OBJECT
'FIRST");
311 FAILED ("INCORRECT VALUE
'FIRST");
314 IF T'FIRST (N) /= 5 THEN
315 FAILED ("INCORRECT
TYPE'FIRST (N
)");
318 IF X'FIRST (N) /= 5 THEN
319 FAILED ("INCORRECT OBJECT
'FIRST (N
)");
322 IF V'FIRST (N) /= 5 THEN
323 FAILED ("INCORRECT VALUE
'FIRST (N
)");
327 FAILED ("INCORRECT
TYPE'LAST");
331 FAILED ("INCORRECT OBJECT
'LAST");
335 FAILED ("INCORRECT VALUE
'LAST");
338 IF T'LAST (N) /= 7 THEN
339 FAILED ("INCORRECT
TYPE'LAST (N
)");
342 IF X'LAST (N) /= 7 THEN
343 FAILED ("INCORRECT OBJECT
'LAST (N
)");
346 IF V'LAST (N) /= 7 THEN
347 FAILED ("INCORRECT VALUE
'LAST (N
)");
350 IF T'LENGTH /= 3 THEN
351 FAILED ("INCORRECT
TYPE'LENGTH");
354 IF X'LENGTH /= 3 THEN
355 FAILED ("INCORRECT OBJECT
'LENGTH");
358 IF V'LENGTH /= 3 THEN
359 FAILED ("INCORRECT VALUE
'LENGTH");
362 IF T'LENGTH (N) /= 3 THEN
363 FAILED ("INCORRECT
TYPE'LENGTH (N
)");
366 IF X'LENGTH (N) /= 3 THEN
367 FAILED ("INCORRECT OBJECT
'LENGTH (N
)");
370 IF V'LENGTH (N) /= 3 THEN
371 FAILED ("INCORRECT VALUE
'LENGTH (N
)");
375 Y : PARENT (T'RANGE);
377 IF Y'FIRST /= 5 OR Y'LAST /= 7 THEN
378 FAILED ("INCORRECT
TYPE'RANGE");
383 Y : PARENT (X'RANGE);
385 IF Y'FIRST /= 5 OR Y'LAST /= 7 THEN
386 FAILED ("INCORRECT OBJECT
'RANGE");
391 Y : PARENT (V'RANGE);
393 IF Y'FIRST /= 5 OR Y'LAST /= 7 THEN
394 FAILED ("INCORRECT VALUE
'RANGE");
399 Y : PARENT (T'RANGE (N));
401 IF Y'FIRST /= 5 OR Y'LAST /= 7 THEN
402 FAILED ("INCORRECT
TYPE'RANGE (N
)");
407 Y : PARENT (X'RANGE (N));
409 IF Y'FIRST /= 5 OR Y'LAST /= 7 THEN
410 FAILED ("INCORRECT OBJECT
'RANGE (N
)");
415 Y : PARENT (V'RANGE (N));
417 IF Y'FIRST /= 5 OR Y'LAST /= 7 THEN
418 FAILED ("INCORRECT VALUE
'RANGE (N
)");