1 |
720 |
jeremybenn |
-- CD3021A.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 THE AGGREGATE IN AN ENUMERATION REPRESENTATION CLAUSE
|
27 |
|
|
-- IS NOT AMBIGUOUS EVEN IF THERE ARE SEVERAL ONE-DIMENSIONAL ARRAY
|
28 |
|
|
-- TYPES WITH THE ENUMERATION TYPE AS THE INDEX SUBTYPE.
|
29 |
|
|
|
30 |
|
|
-- HISTORY:
|
31 |
|
|
-- BCB 09/30/87 CREATED ORIGINAL TEST.
|
32 |
|
|
-- BCB 03/20/89 CHANGED EXTENSION FROM '.ADA' TO '.DEP', CORRECTED
|
33 |
|
|
-- CHECKS FOR FAILURE.
|
34 |
|
|
|
35 |
|
|
WITH REPORT; USE REPORT;
|
36 |
|
|
|
37 |
|
|
PROCEDURE CD3021A IS
|
38 |
|
|
|
39 |
|
|
TYPE ENUM IS (A,B,C);
|
40 |
|
|
|
41 |
|
|
TYPE ARR1 IS ARRAY(ENUM) OF INTEGER;
|
42 |
|
|
TYPE ARR2 IS ARRAY(ENUM) OF INTEGER;
|
43 |
|
|
TYPE ARR3 IS ARRAY(ENUM) OF INTEGER;
|
44 |
|
|
|
45 |
|
|
FOR ENUM USE (A => 1,B => 2,C => 3);
|
46 |
|
|
|
47 |
|
|
A1 : ARR1 := (A => 5,B => 6,C => 13);
|
48 |
|
|
A2 : ARR2 := (A => 1,B => 2,C => 3);
|
49 |
|
|
A3 : ARR3 := (A => 0,B => 1,C => 2);
|
50 |
|
|
|
51 |
|
|
BEGIN
|
52 |
|
|
|
53 |
|
|
TEST ("CD3021A", "CHECK THAT THE AGGREGATE IN AN ENUMERATION " &
|
54 |
|
|
"REPRESENTATION CLAUSE IS NOT AMBIGUOUS EVEN " &
|
55 |
|
|
"IF THERE ARE SEVERAL ONE-DIMENSIONAL ARRAY " &
|
56 |
|
|
"TYPES WITH THE ENUMERATION TYPE AS THE INDEX " &
|
57 |
|
|
"SUBTYPE");
|
58 |
|
|
|
59 |
|
|
IF (A1 /= (IDENT_INT (5), IDENT_INT (6), IDENT_INT (13))) OR
|
60 |
|
|
(A2 /= (IDENT_INT (1), IDENT_INT (2), IDENT_INT (3))) OR
|
61 |
|
|
(A3 /= (IDENT_INT (0), IDENT_INT (1), IDENT_INT (2))) THEN
|
62 |
|
|
FAILED ("INCORRECT VALUES FOR ARRAYS");
|
63 |
|
|
END IF;
|
64 |
|
|
|
65 |
|
|
RESULT;
|
66 |
|
|
END CD3021A;
|