Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c3 / c37005a.ada
blob0983fe00e96fa0075ffe6afbe55766514cb3e26f
1 -- C37005A.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 SCALAR RECORD COMPONENTS MAY HAVE NON-STATIC
26 -- RANGE CONSTRAINTS OR DEFAULT INITIAL VALUES.
28 -- DAT 3/6/81
29 -- JWC 6/28/85 RENAMED TO -AB
30 -- EDS 7/16/98 AVOID OPTIMIZATION
32 WITH REPORT;
33 PROCEDURE C37005A IS
35 USE REPORT;
37 BEGIN
38 TEST ("C37005A", "SCALAR RECORD COMPONENTS MAY HAVE NON-STATIC"
39 & " RANGE CONSTRAINTS OR DEFAULT INITIAL VALUES");
41 DECLARE
42 SUBTYPE DT IS INTEGER RANGE IDENT_INT (1) .. IDENT_INT (5);
43 L : INTEGER := IDENT_INT (DT'FIRST);
44 R : INTEGER := IDENT_INT (DT'LAST);
45 SUBTYPE DT2 IS INTEGER RANGE L .. R;
46 M : INTEGER := (L + R) / 2;
48 TYPE REC IS
49 RECORD
50 C1 : INTEGER := M;
51 C2 : DT2 := (L + R) / 2;
52 C3 : BOOLEAN RANGE (L < M) .. (R > M)
53 := IDENT_BOOL (TRUE);
54 C4 : INTEGER RANGE L .. R := DT'FIRST;
55 END RECORD;
57 R1, R2 : REC := ((L+R)/2, M, M IN DT, L);
58 R3 : REC;
59 BEGIN
60 IF R3 /= R1
61 THEN
62 FAILED ("INCORRECT RECORD VALUES");
63 END IF;
65 R3 := (R2.C2, R2.C1, R3.C3, R); -- CONSTRAINTS CHECKED BY :=
66 IF EQUAL(IDENT_INT(1), 2) THEN
67 FAILED("IMPOSSIBLE " & INTEGER'IMAGE(R3.C1)); --USE R3
68 END IF;
70 BEGIN
71 R3 := (M, M, IDENT_BOOL (FALSE), M); -- RAISES CON_ERR.
72 FAILED ("CONSTRAINT ERROR NOT RAISED " & INTEGER'IMAGE(R3.C1));
73 EXCEPTION
74 WHEN CONSTRAINT_ERROR => NULL;
75 WHEN OTHERS => FAILED ("WRONG EXCEPTION");
76 END;
78 FOR I IN DT LOOP
79 R3 := (I, I, I /= 100, I);
80 R1.C2 := I;
81 IF EQUAL(IDENT_INT(1), 2) THEN
82 FAILED("IMPOSSIBLE " &
83 INTEGER'IMAGE(R3.C1 + R1.C2)); --USE R3, R1
84 END IF;
85 END LOOP;
87 EXCEPTION
88 WHEN OTHERS => FAILED ("INVALID EXCEPTION");
89 END;
91 RESULT;
92 END C37005A;