1-- C41207A.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 DISCRETE RANGE IN A SLICE CAN HAVE THE FORM
27--     A'RANGE, WHERE A IS A CONSTRAINED ARRAY SUBTYPE OR AN ARRAY
28--     OBJECT.
29
30-- HISTORY:
31--     BCB 07/13/88  CREATED ORIGINAL TEST.
32
33WITH REPORT; USE REPORT;
34
35PROCEDURE C41207A IS
36
37     TYPE ARR IS ARRAY(INTEGER RANGE <>) OF INTEGER;
38
39     SUBTYPE A1 IS ARR(1..5);
40
41     ARR_VAR : ARR(1..10) := (90,91,92,93,94,95,96,97,98,99);
42
43     A2 : ARRAY(1..5) OF INTEGER := (80,81,82,83,84);
44
45BEGIN
46     TEST ("C41207A", "CHECK THAT THE DISCRETE RANGE IN A SLICE CAN " &
47                      "HAVE THE FORM A'RANGE, WHERE A IS A " &
48                      "CONSTRAINED ARRAY SUBTYPE OR AN ARRAY OBJECT");
49
50     ARR_VAR (A1'RANGE) := (1,2,3,4,5);
51
52     IF NOT (EQUAL(ARR_VAR(1),1) AND EQUAL(ARR_VAR(2),2) AND
53         EQUAL(ARR_VAR(3),3) AND EQUAL(ARR_VAR(4),4) AND
54         EQUAL(ARR_VAR(5),5)) THEN
55          FAILED ("IMPROPER RESULT FROM SLICE ASSIGNMENT USING THE " &
56                  "RANGE OF A CONSTRAINED ARRAY SUBTYPE");
57     END IF;
58
59     ARR_VAR (A2'RANGE) := (6,7,8,9,10);
60
61     IF (NOT EQUAL(ARR_VAR(1),6) OR NOT EQUAL(ARR_VAR(2),7) OR
62         NOT EQUAL(ARR_VAR(3),8) OR NOT EQUAL(ARR_VAR(4),9) OR
63         NOT EQUAL(ARR_VAR(5),10)) THEN
64          FAILED ("IMPROPER RESULT FROM SLICE ASSIGNMENT USING THE " &
65                  "RANGE OF AN ARRAY OBJECT");
66     END IF;
67
68     RESULT;
69END C41207A;
70