Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c4 / c43205k.ada
bloba3a712a447e835ef17ae23555f9135ee6584ed01
1 -- C43205K.ADA
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.
16 -- DISCLAIMER
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 -- CHECK THAT THE BOUNDS OF A POSITIONAL AGGREGATE ARE DETERMINED
26 -- CORRECTLY. IN PARTICULAR, CHECK THAT THE LOWER BOUND IS GIVEN BY
27 -- THE LOWER BOUND OF THE APPLICABLE INDEX CONSTRAINT WHEN THE
28 -- POSITIONAL AGGREGATE IS USED AS:
30 -- THE EXPRESSION OF AN ENCLOSING RECORD OR ARRAY AGGREGATE, AND
31 -- THE EXPRESSION GIVES THE VALUE OF A RECORD OR ARRAY COMPONENT
32 -- (WHICH IS NECESSARILY CONSTRAINED).
34 -- EG 01/27/84
35 -- JBG 3/30/84
37 WITH REPORT;
39 PROCEDURE C43205K IS
41 USE REPORT;
43 BEGIN
45 TEST("C43205K", "THE EXPRESSION OF AN ENCLOSING RECORD " &
46 "OR ARRAY AGGREGATE, AND THE EXPRESSION GIVES " &
47 "THE VALUE OF A RECORD OR ARRAY COMPONENT");
49 BEGIN
51 CASE_K : BEGIN
53 CASE_K1 : DECLARE
55 SUBTYPE SK1 IS INTEGER RANGE 2 .. 6;
56 TYPE BASE IS ARRAY(SK1 RANGE <>) OF INTEGER;
57 SUBTYPE TE1 IS BASE(IDENT_INT(3) .. 5);
58 TYPE TE2 IS ARRAY(1 .. 2) OF TE1;
60 E1 : TE2;
62 BEGIN
64 E1 := (1 .. 2 => (3, 2, 1));
65 IF (E1'FIRST /= 1 OR E1'LAST /= 2) OR ELSE
66 (E1(1)'FIRST /= 3 OR E1(1)'LAST /= 5 OR
67 E1(2)'FIRST /= 3 OR E1(2)'LAST /= 5) THEN
68 FAILED ("CASE K1 : INCORRECT BOUNDS");
69 ELSE
70 IF E1 /= (1 .. 2 => (3, 2, 1)) THEN
71 FAILED ("CASE K1 : ARRAY DOES NOT " &
72 "CONTAIN THE CORRECT VALUES");
73 END IF;
74 END IF;
76 END CASE_K1;
78 CASE_K2 : DECLARE
80 TYPE SK2 IS RANGE 2 .. 6;
81 TYPE BASE IS ARRAY(SK2 RANGE <>) OF INTEGER;
82 SUBTYPE TE1 IS BASE(3 .. 5);
83 TYPE TER IS
84 RECORD
85 REC : TE1;
86 END RECORD;
88 E2 : TER;
90 BEGIN
92 E2 := (REC => (3, 2, 1));
93 IF E2.REC'FIRST /= 3 OR E2.REC'LAST /= 5 THEN
94 FAILED ("CASE K2 : INCORRECT BOUNDS");
95 ELSE
96 IF E2.REC /= (3, 2, 1) THEN
97 FAILED ("CASE K2 : ARRAY DOES NOT " &
98 "CONTAIN CORRECT VALUES");
99 END IF;
100 END IF;
102 END CASE_K2;
104 END CASE_K;
106 END;
108 RESULT;
110 END C43205K;