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 UNCONSTRAINED RECORD, PRIVATE, LIMITED PRIVATE, AND ARRAY
26 -- FORMAL PARAMETERS USE THE CONSTRAINTS OF ACTUAL PARAMETERS.
28 -- (A) RECORD TYPE, UNCONSTRAINED ACTUALS, DEFAULTS.
29 -- (B) PRIVATE TYPE, CONSTRAINED ACTUALS, NO DEFAULTS.
30 -- (C) LIMITED PRIVATE TYPE, UNCONSTRAINED ACTUALS, NO DEFAULTS.
31 -- (D) ARRAY TYPE, CONSTRAINED ACTUALS, DEFAULTS.
43 TEST
("C64106A", "CHECK USE OF ACTUAL CONSTRAINTS BY " &
44 "UNCONSTRAINED FORMAL PARAMETERS");
50 SUBTYPE INT
IS INTEGER RANGE 0..100;
52 TYPE RECTYPE
(CONSTRAINT
: INT
:= 80) IS
55 STRFIELD
: STRING (1..CONSTRAINT
);
58 REC1
: RECTYPE
:= (10,10,"0123456789");
59 REC2
: RECTYPE
:= (17,7,"C64106A..........");
60 REC3
: RECTYPE
:= (1,1,"A");
63 PROCEDURE CHK_RECTYPE1
(REC1
: IN RECTYPE
:= (2,0,"AB");
65 REC3
: IN OUT RECTYPE
);
67 PROCEDURE CHK_RECTYPE2
(REC
: OUT RECTYPE
);
72 PROCEDURE CHK_RECTYPE1
(REC1
: IN RECTYPE
:= (2,0,"AB");
74 REC3
: IN OUT RECTYPE
) IS
76 IF (REC1
.CONSTRAINT
/= IDENT_INT
(10)) THEN
77 FAILED
("RECORD TYPE IN PARAMETER DID " &
78 "NOT USE CONSTRAINT OF ACTUAL");
80 IF (REC2
.CONSTRAINT
/= IDENT_INT
(17)) THEN
81 FAILED
("RECORD TYPE OUT PARAMETER DID " &
82 "NOT USE CONSTRAINT OF ACTUAL");
84 IF (REC3
.CONSTRAINT
/= IDENT_INT
(1)) THEN
85 FAILED
("RECORD TYPE IN OUT PARAMETER DID " &
86 "NOT USE CONSTRAINT OF ACTUAL");
91 PROCEDURE CHK_RECTYPE2
(REC
: OUT RECTYPE
) IS
93 IF (REC
.CONSTRAINT
/= IDENT_INT
(80)) THEN
94 FAILED
("RECORD TYPE OUT PARAMETER DID " &
95 "NOT USE CONSTRAINT OF " &
96 "UNINITIALIZED ACTUAL");
98 REC
:= (10,10,"9876543210");
104 PKG
.CHK_RECTYPE1
(PKG
.REC1
, PKG
.REC2
, PKG
.REC3
);
105 PKG
.CHK_RECTYPE2
(PKG
.REC4
);
109 ---------------------------------------------
115 SUBTYPE INT
IS INTEGER RANGE 0..100;
117 TYPE RECTYPE
(CONSTRAINT
: INT
:= 80) IS PRIVATE;
120 PROCEDURE CHK_RECTYPE1
(REC1
: IN RECTYPE
;
122 REC3
: IN OUT RECTYPE
);
124 PROCEDURE CHK_RECTYPE2
(REC
: OUT RECTYPE
);
127 TYPE RECTYPE
(CONSTRAINT
: INT
:= 80) IS
130 STRFIELD
: STRING (1..CONSTRAINT
);
134 REC1
: PKG
.RECTYPE
(10);
135 REC2
: PKG
.RECTYPE
(17);
136 REC3
: PKG
.RECTYPE
(1);
137 REC4
: PKG
.RECTYPE
(10);
141 PROCEDURE CHK_RECTYPE1
(REC1
: IN RECTYPE
;
143 REC3
: IN OUT RECTYPE
) IS
145 IF (REC1
.CONSTRAINT
/= IDENT_INT
(10)) THEN
146 FAILED
("PRIVATE TYPE IN PARAMETER DID " &
147 "NOT USE CONSTRAINT OF ACTUAL");
149 IF (REC2
.CONSTRAINT
/= IDENT_INT
(17)) THEN
150 FAILED
("PRIVATE TYPE OUT PARAMETER DID " &
151 "NOT USE CONSTRAINT OF ACTUAL");
153 IF (REC3
.CONSTRAINT
/= IDENT_INT
(1)) THEN
154 FAILED
("PRIVATE TYPE IN OUT PARAMETER DID " &
155 "NOT USE CONSTRAINT OF ACTUAL");
160 PROCEDURE CHK_RECTYPE2
(REC
: OUT RECTYPE
) IS
162 IF (REC
.CONSTRAINT
/= IDENT_INT
(10)) THEN
163 FAILED
("PRIVATE TYPE OUT PARAMETER DID " &
164 "NOT USE CONSTRAINT OF " &
165 "UNINITIALIZED ACTUAL");
167 REC
:= (10,10,"9876543210");
171 REC1
:= (10,10,"0123456789");
172 REC2
:= (17,7,"C64106A..........");
179 PKG
.CHK_RECTYPE1
(REC1
, REC2
, REC3
);
180 PKG
.CHK_RECTYPE2
(REC4
);
184 ---------------------------------------------
190 SUBTYPE INT
IS INTEGER RANGE 0..100;
192 TYPE RECTYPE
(CONSTRAINT
: INT
:= 80) IS
195 PROCEDURE CHK_RECTYPE1
(REC1
: IN RECTYPE
;
197 REC3
: IN OUT RECTYPE
);
199 PROCEDURE CHK_RECTYPE2
(REC
: OUT RECTYPE
);
202 TYPE RECTYPE
(CONSTRAINT
: INT
:= 80) IS
205 STRFIELD
: STRING (1..CONSTRAINT
);
209 REC1
: PKG
.RECTYPE
; -- 10
210 REC2
: PKG
.RECTYPE
; -- 17
211 REC3
: PKG
.RECTYPE
; -- 1
212 REC4
: PKG
.RECTYPE
; -- 80
216 PROCEDURE CHK_RECTYPE1
(REC1
: IN RECTYPE
;
218 REC3
: IN OUT RECTYPE
) IS
220 IF (REC1
.CONSTRAINT
/= IDENT_INT
(10)) THEN
221 FAILED
("LIMITED PRIVATE TYPE IN PARAMETER " &
222 "DID NOT USE CONSTRAINT OF " &
225 IF (REC2
.CONSTRAINT
/= IDENT_INT
(17)) THEN
226 FAILED
("LIMITED PRIVATE TYPE OUT PARAMETER " &
227 "DID NOT USE CONSTRAINT OF " &
230 IF (REC3
.CONSTRAINT
/= IDENT_INT
(1)) THEN
231 FAILED
("LIMITED PRIVATE TYPE IN OUT " &
232 "PARAMETER DID NOT USE " &
233 "CONSTRAINT OF ACTUAL");
238 PROCEDURE CHK_RECTYPE2
(REC
: OUT RECTYPE
) IS
240 IF (REC
.CONSTRAINT
/= IDENT_INT
(80)) THEN
241 FAILED
("LIMITED PRIVATE TYPE OUT " &
242 "PARAMETER DID NOT USE " &
243 "CONSTRAINT OF UNINITIALIZED ACTUAL");
245 REC
:= (10,10,"9876543210");
249 REC1
:= (10,10,"0123456789");
250 REC2
:= (17,7,"C64106A..........");
256 PKG
.CHK_RECTYPE1
(REC1
, REC2
, REC3
);
257 PKG
.CHK_RECTYPE2
(REC4
);
261 ---------------------------------------------
265 TYPE ATYPE
IS ARRAY (INTEGER RANGE <>, POSITIVE RANGE <>) OF
268 A1
, A2
, A3
: ATYPE
(-1..1, 4..5) := (('A','B'),
272 A4
: ATYPE
(-1..1, 4..5);
274 CA1
: CONSTANT ATYPE
(8..9, -7..INTEGER'FIRST) :=
275 (8..9 => (-7..INTEGER'FIRST => 'A'));
277 S1
: STRING(1..INTEGER'FIRST) := "";
278 S2
: STRING(-5..-7) := "";
279 S3
: STRING(1..0) := "";
281 PROCEDURE CHK_ARRAY1
(A1
: IN ATYPE
:= CA1
; A2
: OUT ATYPE
;
282 A3
: IN OUT ATYPE
) IS
284 IF ((A1
'FIRST(1) /= IDENT_INT
(-1)) OR
285 (A1
'LAST(1) /= IDENT_INT
(1)) OR
286 (A1
'FIRST(2) /= IDENT_INT
(4)) OR
287 (A1
'LAST(2) /= IDENT_INT
(5))) THEN
288 FAILED
("ARRAY TYPE IN PARAMETER DID NOT " &
289 "USE CONSTRAINTS OF ACTUAL");
291 IF ((A2
'FIRST(1) /= IDENT_INT
(-1)) OR
292 (A2
'LAST(1) /= IDENT_INT
(1)) OR
293 (A2
'FIRST(2) /= IDENT_INT
(4)) OR
294 (A2
'LAST(2) /= IDENT_INT
(5))) THEN
295 FAILED
("ARRAY TYPE OUT PARAMETER DID NOT USE" &
296 "CONSTRAINTS OF ACTUAL");
298 IF ((A3
'FIRST(1) /= IDENT_INT
(-1)) OR
299 (A3
'LAST(1) /= IDENT_INT
(1)) OR
300 (A3
'FIRST(2) /= IDENT_INT
(4)) OR
301 (A3
'LAST(2) /= IDENT_INT
(5))) THEN
302 FAILED
("ARRAY TYPE IN OUT PARAMETER DID NOT " &
303 "USE CONSTRAINTS OF ACTUAL");
308 PROCEDURE CHK_ARRAY2
(A4
: OUT ATYPE
) IS
310 IF ((A4
'FIRST(1) /= IDENT_INT
(-1)) OR
311 (A4
'LAST(1) /= IDENT_INT
(1)) OR
312 (A4
'FIRST(2) /= IDENT_INT
(4)) OR
313 (A4
'LAST(2) /= IDENT_INT
(5))) THEN
314 FAILED
("ARRAY TYPE OUT PARAMETER DID NOT " &
315 "USE CONSTRAINTS OF UNINITIALIZED " &
321 PROCEDURE CHK_STRING
(S1
: IN STRING;
325 IF ((S1
'FIRST /= IDENT_INT
(1)) OR
326 (S1
'LAST /= IDENT_INT
(INTEGER'FIRST))) THEN
327 FAILED
("STRING TYPE IN PARAMETER DID NOT " &
328 "USE CONSTRAINTS OF ACTUAL NULL " &
331 IF ((S2
'FIRST /= IDENT_INT
(-5)) OR
332 (S2
'LAST /= IDENT_INT
(-7))) THEN
333 FAILED
("STRING TYPE IN OUT PARAMETER DID NOT " &
334 "USE CONSTRAINTS OF ACTUAL NULL STRING");
336 IF ((S3
'FIRST /= IDENT_INT
(1)) OR
337 (S3
'LAST /= IDENT_INT
(0))) THEN
338 FAILED
("STRING TYPE OUT PARAMETER DID NOT " &
339 "USE CONSTRAINTS OF ACTUAL NULL STRING");
345 CHK_ARRAY1
(A1
, A2
, A3
);
347 CHK_STRING
(S1
, S2
, S3
);