1 |
12 |
jlechner |
-- ADA101A.ADA
|
2 |
|
|
|
3 |
|
|
-- Grant of Unlimited Rights
|
4 |
|
|
--
|
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
|
14 |
|
|
-- to do so.
|
15 |
|
|
--
|
16 |
|
|
-- DISCLAIMER
|
17 |
|
|
--
|
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.
|
24 |
|
|
--*
|
25 |
|
|
-- OBJECTIVE:
|
26 |
|
|
-- CHECK THAT UNCHECKED_DEALLOCATION CAN BE INSTANTIATED WITH ANY
|
27 |
|
|
-- TYPE AS THE OBJECT PARAMETER.
|
28 |
|
|
|
29 |
|
|
-- HISTORY:
|
30 |
|
|
-- JET 09/23/88 CREATED ORIGINAL TEST.
|
31 |
|
|
|
32 |
|
|
WITH REPORT; USE REPORT;
|
33 |
|
|
WITH UNCHECKED_DEALLOCATION;
|
34 |
|
|
PROCEDURE ADA101A IS
|
35 |
|
|
|
36 |
|
|
TYPE ENUM IS (CURLY, MOE, LARRY);
|
37 |
|
|
TYPE DER IS NEW INTEGER;
|
38 |
|
|
SUBTYPE SUB IS CHARACTER RANGE 'A'..'Z';
|
39 |
|
|
TASK TYPE TSK;
|
40 |
|
|
TYPE ACC IS ACCESS INTEGER;
|
41 |
|
|
|
42 |
|
|
PACKAGE P IS
|
43 |
|
|
TYPE PRIV IS PRIVATE;
|
44 |
|
|
PRIVATE
|
45 |
|
|
TYPE PRIV IS RANGE -100..100;
|
46 |
|
|
END P;
|
47 |
|
|
USE P;
|
48 |
|
|
|
49 |
|
|
TYPE ARR1 IS ARRAY (INTEGER RANGE 1..10) OF INTEGER;
|
50 |
|
|
TYPE ARR2 IS ARRAY (INTEGER RANGE <>) OF CHARACTER;
|
51 |
|
|
|
52 |
|
|
TYPE REC1 IS RECORD
|
53 |
|
|
D, I : INTEGER;
|
54 |
|
|
END RECORD;
|
55 |
|
|
|
56 |
|
|
TYPE REC2 (D : INTEGER) IS RECORD
|
57 |
|
|
C : CHARACTER;
|
58 |
|
|
END RECORD;
|
59 |
|
|
|
60 |
|
|
TYPE INTEGERA IS ACCESS INTEGER;
|
61 |
|
|
TYPE FLOATA IS ACCESS FLOAT;
|
62 |
|
|
TYPE ENUMA IS ACCESS ENUM;
|
63 |
|
|
TYPE BOOLEANA IS ACCESS BOOLEAN;
|
64 |
|
|
TYPE CHARACTERA IS ACCESS CHARACTER;
|
65 |
|
|
TYPE DERA IS ACCESS DER;
|
66 |
|
|
TYPE SUBA IS ACCESS SUB;
|
67 |
|
|
TYPE TSKA IS ACCESS TSK;
|
68 |
|
|
TYPE ACCA IS ACCESS ACC;
|
69 |
|
|
TYPE PRIVA IS ACCESS PRIV;
|
70 |
|
|
TYPE ARR1A IS ACCESS ARR1;
|
71 |
|
|
TYPE ARR2A IS ACCESS ARR2;
|
72 |
|
|
TYPE REC1A IS ACCESS REC1;
|
73 |
|
|
TYPE REC2A IS ACCESS REC2;
|
74 |
|
|
|
75 |
|
|
TASK BODY TSK IS
|
76 |
|
|
BEGIN
|
77 |
|
|
NULL;
|
78 |
|
|
END TSK;
|
79 |
|
|
|
80 |
|
|
PROCEDURE RLSI IS NEW UNCHECKED_DEALLOCATION(INTEGER, INTEGERA);
|
81 |
|
|
PROCEDURE RLSF IS NEW UNCHECKED_DEALLOCATION(FLOAT, FLOATA);
|
82 |
|
|
PROCEDURE RLSE IS NEW UNCHECKED_DEALLOCATION(ENUM, ENUMA);
|
83 |
|
|
PROCEDURE RLSB IS NEW UNCHECKED_DEALLOCATION(BOOLEAN, BOOLEANA);
|
84 |
|
|
PROCEDURE RLSC IS NEW UNCHECKED_DEALLOCATION(CHARACTER,CHARACTERA);
|
85 |
|
|
PROCEDURE RLSD IS NEW UNCHECKED_DEALLOCATION(DER, DERA);
|
86 |
|
|
PROCEDURE RLSS IS NEW UNCHECKED_DEALLOCATION(SUB, SUBA);
|
87 |
|
|
PROCEDURE RLST IS NEW UNCHECKED_DEALLOCATION(TSK, TSKA);
|
88 |
|
|
PROCEDURE RLSA IS NEW UNCHECKED_DEALLOCATION(ACC, ACCA);
|
89 |
|
|
PROCEDURE RLSP IS NEW UNCHECKED_DEALLOCATION(PRIV, PRIVA);
|
90 |
|
|
PROCEDURE RLSA1 IS NEW UNCHECKED_DEALLOCATION(ARR1, ARR1A);
|
91 |
|
|
PROCEDURE RLSA2 IS NEW UNCHECKED_DEALLOCATION(ARR2, ARR2A);
|
92 |
|
|
PROCEDURE RLSR1 IS NEW UNCHECKED_DEALLOCATION(REC1, REC1A);
|
93 |
|
|
PROCEDURE RLSR2 IS NEW UNCHECKED_DEALLOCATION(REC2, REC2A);
|
94 |
|
|
|
95 |
|
|
BEGIN
|
96 |
|
|
TEST ("ADA101A", "CHECK THAT UNCHECKED_DEALLOCATION CAN BE " &
|
97 |
|
|
"INSTANTIATED WITH ANY TYPE AS THE OBJECT " &
|
98 |
|
|
"PARAMETER");
|
99 |
|
|
|
100 |
|
|
RESULT;
|
101 |
|
|
END ADA101A;
|