Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c3 / c37103a.ada
blob10878357fae4fbfa794bbdbf9aa4aa269641092d
1 -- C37103A.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 DISCRIMINANTS MAY BE BOOLEAN, CHARACTER, USER_ENUM,
26 -- INTEGER, DERIVED CHARACTER, DERIVED USER_ENUM, DERIVED INTEGER,
27 -- AND DERIVED DERIVED USER_ENUM.
29 -- DAT 5/18/81
30 -- SPS 10/25/82
32 WITH REPORT; USE REPORT;
34 PROCEDURE C37103A IS
35 BEGIN
36 TEST ("C37103A", "MANY DIFFERENT DISCRIMINANT TYPES");
37 DECLARE
38 PACKAGE P1 IS
39 TYPE ENUM IS (A, Z, Q, 'W', 'A');
40 END P1;
42 PACKAGE P2 IS
43 TYPE E2 IS NEW P1.ENUM;
44 END P2;
46 PACKAGE P3 IS
47 TYPE E3 IS NEW P2.E2;
48 END P3;
50 USE P1, P2, P3;
51 TYPE INT IS NEW INTEGER RANGE -3 .. 7;
52 TYPE CHAR IS NEW CHARACTER;
53 TYPE R1 (D : ENUM) IS RECORD NULL; END RECORD;
54 TYPE R2 (D : INTEGER) IS RECORD NULL; END RECORD;
55 TYPE R3 (D : BOOLEAN) IS RECORD NULL; END RECORD;
56 TYPE R4 (D : CHARACTER) IS RECORD NULL; END RECORD;
57 TYPE R5 (D : CHAR) IS RECORD NULL; END RECORD;
58 TYPE R6 (D : E2) IS RECORD NULL; END RECORD;
59 TYPE R7 (D : E3) IS RECORD NULL; END RECORD;
60 TYPE R8 (D : INT) IS RECORD NULL; END RECORD;
61 O1 : R1(A) := (D => A);
62 O2 : R2(3) := (D => 3);
63 O3 : R3(TRUE) := (D => TRUE);
64 O4 : R4(ASCII.NUL) := (D => ASCII.NUL);
65 O5 : R5('A') := (D => 'A');
66 O6 : R6('A') := (D => 'A');
67 O7 : R7(A) := (D => A);
68 O8 : R8(2) := (D => 2);
69 BEGIN
70 IF O1.D /= A
71 OR O2.D /= 3
72 OR NOT O3.D
73 OR O4.D IN 'A' .. 'Z'
74 OR O5.D /= 'A'
75 OR O6.D /= 'A'
76 OR O7.D /= A
77 OR O8.D /= 2
78 THEN FAILED ("WRONG DISCRIMINANT VALUE");
79 END IF;
80 END;
82 RESULT;
83 END C37103A;