Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / cd / cd4051c.ada
blobea97f1caf7d0a0c94909dc6080698d2db65d5403
1 -- CD4051C.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 -- OBJECTIVE:
26 -- CHECK THAT A RECORD REPRESENTATION CLAUSE CAN BE GIVEN FOR
27 -- A DERIVED TYPE WHOSE PARENT TYPE IS A RECORD WITH A
28 -- DISCRIMINANT.
30 -- HISTORY:
31 -- BCB 03/20/89 CHANGED EXTENSION FROM '.ADA' TO '.DEP'.
32 -- RJW 08/25/87 CREATED ORIGINAL TEST.
34 WITH REPORT; USE REPORT;
35 WITH SYSTEM;
36 PROCEDURE CD4051C IS
38 UNITS_PER_INTEGER : CONSTANT :=
39 (INTEGER'SIZE + SYSTEM.STORAGE_UNIT - 1) /
40 SYSTEM.STORAGE_UNIT;
42 TYPE BASIC_CLAUSE (DISC : BOOLEAN) IS RECORD
43 INT_COMP : INTEGER;
44 CHAR_COMP : CHARACTER;
45 END RECORD;
47 TYPE CHECK_CLAUSE IS NEW BASIC_CLAUSE;
49 FOR CHECK_CLAUSE USE
50 RECORD
51 DISC AT 0
52 RANGE 0..BOOLEAN'SIZE - 1;
53 INT_COMP AT 1*UNITS_PER_INTEGER
54 RANGE 0..INTEGER'SIZE - 1;
55 CHAR_COMP AT 2*UNITS_PER_INTEGER
56 RANGE 0..CHARACTER'SIZE - 1;
57 END RECORD;
59 CHECK_RECORD : CHECK_CLAUSE (TRUE) := (TRUE, 1, 'A');
61 BEGIN
62 TEST ("CD4051C", "CHECK THAT A RECORD REPRESENTATION " &
63 "CLAUSE CAN BE GIVEN FOR A DERIVED TYPE " &
64 "WHOSE PARENT TYPE IS IS A RECORD TYPE " &
65 "WITH DISCRIMINANTS");
67 IF CHECK_RECORD.DISC'FIRST_BIT /= 0 THEN
68 FAILED ("INCORRECT VALUE FOR FIRST_BIT OF DISC");
69 END IF;
71 IF CHECK_RECORD.DISC'LAST_BIT /= BOOLEAN'SIZE - 1 THEN
72 FAILED ("INCORRECT VALUE FOR LAST_BIT OF DISC");
73 END IF;
75 IF CHECK_RECORD.DISC'POSITION /= IDENT_INT (0) THEN
76 FAILED ("INCORRECT VALUE FOR POSITION OF DISC");
77 END IF;
79 IF CHECK_RECORD.INT_COMP'FIRST_BIT /= 0 THEN
80 FAILED ("INCORRECT VALUE FOR FIRST_BIT OF INT_COMP");
81 END IF;
83 IF CHECK_RECORD.INT_COMP'LAST_BIT /=
84 IDENT_INT (INTEGER'SIZE - 1) THEN
85 FAILED ("INCORRECT VALUE FOR LAST_BIT OF INT_COMP");
86 END IF;
88 IF CHECK_RECORD.INT_COMP'POSITION /=
89 IDENT_INT (UNITS_PER_INTEGER) THEN
90 FAILED ("INCORRECT VALUE FOR POSITION OF INT_COMP");
91 END IF;
93 IF CHECK_RECORD.CHAR_COMP'FIRST_BIT /= IDENT_INT (0) THEN
94 FAILED ("INCORRECT VALUE FOR FIRST_BIT OF CHAR_COMP");
95 END IF;
97 IF CHECK_RECORD.CHAR_COMP'LAST_BIT /=
98 IDENT_INT (CHARACTER'SIZE - 1) THEN
99 FAILED ("INCORRECT VALUE FOR LAST_BIT OF CHAR_COMP");
100 END IF;
102 IF CHECK_RECORD.CHAR_COMP'POSITION /=
103 IDENT_INT (2 * UNITS_PER_INTEGER) THEN
104 FAILED ("INCORRECT VALUE FOR POSITION OF CHAR_COMP");
105 END IF;
107 RESULT;
108 END CD4051C;