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 A VARIABLE CREATED BY A SUBPROGRAM 'IN OUT' FORMAL
27 -- PARAMETER CAN BE RENAMED AND HAS THE CORRECT VALUE, AND THAT
28 -- THE NEW NAME CAN BE USED IN AN ASSIGNMENT STATEMENT AND PASSED
29 -- ON AS AN ACTUAL SUBPROGRAM OR ENTRY 'IN OUT' OR 'OUT' PARAMETER,
30 -- AND AS AN ACTUAL GENERIC 'IN OUT' PARAMETER, AND THAT WHEN THE
31 -- VALUE OF THE RENAMED VARIABLE IS CHANGED, THE NEW VALUE IS
32 -- REFLECTED BY THE VALUE OF THE NEW NAME.
35 -- JET 03/15/88 CREATED ORIGINAL TEST.
37 WITH REPORT
; USE REPORT
;
40 TYPE ARRAY1
IS ARRAY (POSITIVE RANGE <>) OF INTEGER;
41 TYPE RECORD1
(D
: INTEGER) IS
43 FIELD1
: INTEGER := 1;
45 TYPE POINTER1
IS ACCESS INTEGER;
48 TYPE PRIVY
IS PRIVATE;
49 ZERO
: CONSTANT PRIVY
;
52 THREE
: CONSTANT PRIVY
;
53 FOUR
: CONSTANT PRIVY
;
54 FIVE
: CONSTANT PRIVY
;
55 FUNCTION IDENT
(I
: PRIVY
) RETURN PRIVY
;
56 FUNCTION NEXT
(I
: PRIVY
) RETURN PRIVY
;
58 TYPE PRIVY
IS RANGE 0..127;
59 ZERO
: CONSTANT PRIVY
:= 0;
60 ONE
: CONSTANT PRIVY
:= 1;
61 TWO
: CONSTANT PRIVY
:= 2;
62 THREE
: CONSTANT PRIVY
:= 3;
63 FOUR
: CONSTANT PRIVY
:= 4;
64 FIVE
: CONSTANT PRIVY
:= 5;
68 ENTRY ASSIGN
(J
: IN INTEGER);
69 ENTRY VALU
(J
: OUT INTEGER);
75 DA1
: ARRAY1
(1..3) := (OTHERS => 0);
76 DR1
: RECORD1
(1) := (D
=> 1, FIELD1
=> 0);
77 DP1
: POINTER1
:= NEW INTEGER'(0);
78 DV1 : PACK1.PRIVY := PACK1.ZERO;
87 GP1 : IN OUT POINTER1;
88 GV1 : IN OUT PACK1.PRIVY;
93 FUNCTION IDENT (P : POINTER1) RETURN POINTER1 IS
102 PACKAGE BODY PACK1 IS
103 FUNCTION IDENT (I : PRIVY) RETURN PRIVY IS
112 FUNCTION NEXT
(I
: PRIVY
) RETURN PRIVY
IS
118 PACKAGE BODY GENERIC1
IS
121 GA1
:= (GA1
(1)+1, GA1
(2)+1, GA1
(3)+1);
122 GR1
:= (D
=> 1, FIELD1
=> GR1
.FIELD1
+ 1);
123 GP1
:= NEW INTEGER'(GP1.ALL + 1);
124 GV1 := PACK1.NEXT(GV1);
129 TASK_VALUE : INTEGER := 0;
130 ACCEPTING_ENTRIES : BOOLEAN := TRUE;
132 WHILE ACCEPTING_ENTRIES LOOP
134 ACCEPT ASSIGN (J : IN INTEGER) DO
138 ACCEPT VALU (J : OUT INTEGER) DO
143 TASK_VALUE := TASK_VALUE + 1;
147 ACCEPTING_ENTRIES := FALSE;
153 PROCEDURE PROC (PI1 : IN OUT INTEGER; PA1 : IN OUT ARRAY1;
154 PR1 : IN OUT RECORD1; PP1 : IN OUT POINTER1;
155 PV1 : IN OUT PACK1.PRIVY; PT1 : IN OUT TASK1) IS
156 XPI1 : INTEGER RENAMES PI1;
157 XPA1 : ARRAY1 RENAMES PA1;
158 XPR1 : RECORD1 RENAMES PR1;
159 XPP1 : POINTER1 RENAMES PP1;
160 XPV1 : PACK1.PRIVY RENAMES PV1;
161 XPT1 : TASK1 RENAMES PT1;
164 ENTRY ENTRY1 (TI1 : OUT INTEGER; TA1 : OUT ARRAY1;
165 TR1 : OUT RECORD1; TP1 : IN OUT POINTER1;
166 TV1 : IN OUT PACK1.PRIVY;
172 PROCEDURE PROC1 (PPI1 : IN OUT INTEGER; PPA1 : IN OUT ARRAY1;
173 PPR1 : IN OUT RECORD1; PPP1 : OUT POINTER1;
174 PPV1 : OUT PACK1.PRIVY;
175 PPT1 : IN OUT TASK1) IS
178 PPA1 := (PPA1(1)+1, PPA1(2)+1, PPA1(3)+1);
179 PPR1 := (D => 1, FIELD1 => PPR1.FIELD1 + 1);
180 PPP1 := NEW INTEGER'(PP1
.ALL + 1);
181 PPV1
:= PACK1
.NEXT
(PV1
);
187 ACCEPT ENTRY1
(TI1
: OUT INTEGER; TA1
: OUT ARRAY1
;
188 TR1
: OUT RECORD1
; TP1
: IN OUT POINTER1
;
189 TV1
: IN OUT PACK1
.PRIVY
;
193 TA1
:= (PA1
(1)+1, PA1
(2)+1, PA1
(3)+1);
194 TR1
:= (D
=> 1, FIELD1
=> PR1
.FIELD1
+ 1);
195 TP1
:= NEW INTEGER'(TP1.ALL + 1);
196 TV1 := PACK1.NEXT(TV1);
201 PACKAGE GENPACK1 IS NEW GENERIC1
202 (XPI1, XPA1, XPR1, XPP1, XPV1, XPT1);
205 IF XPI1 /= IDENT_INT(1) THEN
206 FAILED ("INCORRECT VALUE OF XPI1 (1)");
209 IF XPA1 /= (IDENT_INT(1),IDENT_INT(1),IDENT_INT(1)) THEN
210 FAILED ("INCORRECT VALUE OF XPA1 (1)");
213 IF XPR1 /= (D => 1, FIELD1 => IDENT_INT(1)) THEN
214 FAILED ("INCORRECT VALUE OF XPR1 (1)");
217 IF XPP1 /= IDENT(PP1) OR XPP1.ALL /= IDENT_INT(1) THEN
218 FAILED ("INCORRECT VALUE OF XPP1 (1)");
221 IF PACK1."/=" (XPV1, PACK1.IDENT(PACK1.ONE)) THEN
222 FAILED ("INCORRECT VALUE OF XPV1 (1)");
226 IF I /= IDENT_INT(1) THEN
227 FAILED ("INCORRECT RETURN VALUE OF XPT1.VALU (1)");
230 PROC1(XPI1, XPA1, XPR1, XPP1, XPV1, XPT1);
232 IF XPI1 /= IDENT_INT(2) THEN
233 FAILED ("INCORRECT VALUE OF XPI1 (2)");
236 IF XPA1 /= (IDENT_INT(2),IDENT_INT(2),IDENT_INT(2)) THEN
237 FAILED ("INCORRECT VALUE OF XPA1 (2)");
240 IF XPR1 /= (D => 1, FIELD1 => IDENT_INT(2)) THEN
241 FAILED ("INCORRECT VALUE OF XPR1 (2)");
244 IF XPP1 /= IDENT(PP1) OR XPP1.ALL /= IDENT_INT(2) THEN
245 FAILED ("INCORRECT VALUE OF XPP1 (2)");
248 IF PACK1."/=" (XPV1, PACK1.IDENT(PACK1.TWO)) THEN
249 FAILED ("INCORRECT VALUE OF XPV1 (2)");
253 IF I /= IDENT_INT(2) THEN
254 FAILED ("INCORRECT RETURN VALUE FROM XPT1.VALU (2)");
257 CHK_TASK.ENTRY1 (XPI1, XPA1, XPR1, XPP1, XPV1, XPT1);
259 IF XPI1 /= IDENT_INT(3) THEN
260 FAILED ("INCORRECT VALUE OF XPI1 (3)");
263 IF XPA1 /= (IDENT_INT(3),IDENT_INT(3),IDENT_INT(3)) THEN
264 FAILED ("INCORRECT VALUE OF XPA1 (3)");
267 IF XPR1 /= (D => 1, FIELD1 => IDENT_INT(3)) THEN
268 FAILED ("INCORRECT VALUE OF XPR1 (3)");
271 IF XPP1 /= IDENT(PP1) OR XPP1.ALL /= IDENT_INT(3) THEN
272 FAILED ("INCORRECT VALUE OF XPP1 (3)");
275 IF PACK1."/=" (XPV1, PACK1.IDENT(PACK1.THREE)) THEN
276 FAILED ("INCORRECT VALUE OF XPV1 (3)");
280 IF I /= IDENT_INT(3) THEN
281 FAILED ("INCORRECT RETURN VALUE OF XPT1.VALU (3)");
285 XPA1 := (XPA1(1)+1, XPA1(2)+1, XPA1(3)+1);
286 XPR1 := (D => 1, FIELD1 => XPR1.FIELD1 + 1);
287 XPP1 := NEW INTEGER'(XPP1
.ALL + 1);
288 XPV1
:= PACK1
.NEXT
(XPV1
);
291 IF XPI1
/= IDENT_INT
(4) THEN
292 FAILED
("INCORRECT VALUE OF XPI1 (4)");
295 IF XPA1
/= (IDENT_INT
(4),IDENT_INT
(4),IDENT_INT
(4)) THEN
296 FAILED
("INCORRECT VALUE OF XPA1 (4)");
299 IF XPR1
/= (D
=> 1, FIELD1
=> IDENT_INT
(4)) THEN
300 FAILED
("INCORRECT VALUE OF XPR1 (4)");
303 IF XPP1
/= IDENT
(PP1
) OR XPP1
.ALL /= IDENT_INT
(4) THEN
304 FAILED
("INCORRECT VALUE OF XPP1 (4)");
307 IF PACK1
."/=" (XPV1
, PACK1
.IDENT
(PACK1
.FOUR
)) THEN
308 FAILED
("INCORRECT VALUE OF XPV1 (4)");
312 IF I
/= IDENT_INT
(4) THEN
313 FAILED
("INCORRECT RETURN VALUE OF XPT1.VALU (4)");
317 PA1
:= (PA1
(1)+1, PA1
(2)+1, PA1
(3)+1);
318 PR1
:= (D
=> 1, FIELD1
=> PR1
.FIELD1
+ 1);
319 PP1
:= NEW INTEGER'(PP1.ALL + 1);
320 PV1 := PACK1.NEXT(PV1);
323 IF XPI1 /= IDENT_INT(5) THEN
324 FAILED ("INCORRECT VALUE OF XPI1 (5)");
327 IF XPA1 /= (IDENT_INT(5),IDENT_INT(5),IDENT_INT(5)) THEN
328 FAILED ("INCORRECT VALUE OF XPA1 (5)");
331 IF XPR1 /= (D => 1, FIELD1 => IDENT_INT(5)) THEN
332 FAILED ("INCORRECT VALUE OF XPR1 (5)");
335 IF XPP1 /= IDENT(PP1) OR XPP1.ALL /= IDENT_INT(5) THEN
336 FAILED ("INCORRECT VALUE OF XPP1 (5)");
339 IF PACK1."/=" (XPV1, PACK1.IDENT(PACK1.FIVE)) THEN
340 FAILED ("INCORRECT VALUE OF XPV1 (5)");
344 IF I /= IDENT_INT(5) THEN
345 FAILED ("INCORRECT RETURN VALUE OF XPT1.VALU (5)");
350 TEST ("C85005B", "CHECK THAT A VARIABLE CREATED BY A SUBPROGRAM " &
351 "'IN OUT' FORMAL PARAMETER CAN BE RENAMED " &
352 "AND HAS THE CORRECT VALUE, AND THAT THE NEW " &
353 "NAME CAN BE USED IN AN ASSIGNMENT STATEMENT " &
354 "AND PASSED ON AS AN ACTUAL SUBPROGRAM OR " &
355 "ENTRY 'IN OUT' OR 'OUT' PARAMETER, AND AS AN " &
356 "ACTUAL GENERIC 'IN OUT' PARAMETER, AND THAT " &
357 "WHEN THE VALUE OF THE RENAMED VARIABLE IS " &
358 "CHANGED, THE NEW VALUE IS REFLECTED BY THE " &
359 "VALUE OF THE NEW NAME");
361 PROC (DI1, DA1, DR1, DP1, DV1, DT1);