Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c4 / c43205e.ada
blobd06f209aec8b13f29b1f910b3e6203158e2bed2f
1 -- C43205E.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 -- 'FIRST OF THE INDEX SUBTYPE WHEN THE POSITIONAL AGGREGATE IS USED AS:
29 -- E) THE LEFT OR RIGHT OPERAND OF "&".
31 -- EG 01/26/84
33 WITH REPORT;
35 PROCEDURE C43205E IS
37 USE REPORT;
39 BEGIN
41 TEST("C43205E", "CASE E : OPERAND OF &");
43 BEGIN
45 CASE_E : DECLARE
47 SUBTYPE STE IS INTEGER RANGE 2 .. 10;
49 TYPE COLOR IS (RED, GREEN, BLUE);
50 TYPE TE IS ARRAY (STE RANGE <>) OF COLOR;
52 FUNCTION CONCAT1 RETURN TE IS
53 BEGIN
54 RETURN (RED, GREEN, BLUE) & (7 .. 8 => RED);
55 END;
57 FUNCTION CONCAT2 RETURN TE IS
58 BEGIN
59 RETURN (IDENT_INT(4) .. 3 => RED) & (GREEN, BLUE);
60 END;
62 FUNCTION CONCAT3 RETURN STRING IS
63 BEGIN
64 RETURN "TEST" & (7 .. 8 => 'X');
65 END;
67 FUNCTION CONCAT4 RETURN STRING IS
68 BEGIN
69 RETURN (8 .. 5 => 'A') & "BC";
70 END;
72 BEGIN
74 IF CONCAT1'FIRST /= IDENT_INT(2) THEN
75 FAILED ("CASE E1 : LOWER BOUND INCORRECTLY " &
76 "GIVEN BY 'FIRST");
77 ELSIF CONCAT1'LAST /= 6 THEN
78 FAILED ("CASE E1 : UPPER BOUND INCORRECTLY " &
79 "GIVEN BY 'LAST");
80 ELSIF CONCAT1 /= (RED, GREEN, BLUE, RED, RED) THEN
81 FAILED ("CASE E1 : INCORRECT VALUES PRODUCED");
82 END IF;
83 IF CONCAT2'FIRST /= IDENT_INT(2) THEN
84 FAILED ("CASE E2 : LOWER BOUND INCORRECTLY " &
85 "GIVEN BY 'FIRST");
86 ELSIF CONCAT2'LAST /= 3 THEN
87 FAILED ("CASE E2 : UPPER BOUND INCORRECTLY " &
88 "GIVEN BY 'LAST");
89 ELSIF CONCAT2 /= (GREEN, BLUE) THEN
90 FAILED ("CASE E2 : INCORRECT VALUES PRODUCED");
91 END IF;
92 IF CONCAT3'FIRST /= IDENT_INT(1) THEN
93 FAILED ("CASE E3 : LOWER BOUND INCORRECTLY " &
94 "GIVEN BY 'FIRST");
95 ELSIF CONCAT3'LAST /= 6 THEN
96 FAILED ("CASE E3 : UPPER BOUND INCORRECTLY " &
97 "GIVEN BY 'LAST");
98 ELSIF CONCAT3 /= "TESTXX" THEN
99 FAILED ("CASE E3 : INCORRECT VALUES PRODUCED");
100 END IF;
101 IF CONCAT4'FIRST /= IDENT_INT(1) THEN
102 FAILED ("CASE E4 : LOWER BOUND INCORRECTLY " &
103 "GIVEN BY 'FIRST");
104 ELSIF CONCAT4'LAST /= 2 THEN
105 FAILED ("CASE E4 : UPPER BOUND INCORRECTLY " &
106 "GIVEN BY 'LAST");
107 ELSIF CONCAT4 /= "BC" THEN
108 FAILED ("CASE E4 : INCORRECT VALUES PRODUCED");
109 END IF;
111 END CASE_E;
113 END;
115 RESULT;
117 END C43205E;