OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cd/] [cd1009n.ada] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CD1009N.ADA
2
 
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.
15
--
16
--                                    DISCLAIMER
17
--
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 MAY BE GIVEN
27
--     IN THE VISIBLE OR PRIVATE PART OF A PACKAGE FOR A RECORD TYPE
28
--     DECLARED IN THE VISIBLE PART OF THE SAME PACKAGE.
29
 
30
-- HISTORY:
31
--     VCL 10/08/87  CREATED ORIGINAL TEST.
32
--     BCB 03/20/89  CHANGED EXTENSION FROM '.ADA' TO '.DEP', CORRECTED
33
--                    CHECKS FOR FAILURE.
34
 
35
WITH SYSTEM;
36
WITH REPORT; USE REPORT;
37
PROCEDURE CD1009N IS
38
BEGIN
39
     TEST ("CD1009N", "A RECORD REPRESENTATION CLAUSE MAY BE GIVEN " &
40
                      "IN THE VISIBLE OR PRIVATE PART OF A PACKAGE " &
41
                      "FOR A RECORD TYPE DECLARED IN THE " &
42
                      "VISIBLE PART OF THE SAME PACKAGE");
43
     DECLARE
44
          PACKAGE PACK IS
45
               UNITS_PER_INTEGER : CONSTANT :=
46
                    (INTEGER'SIZE + SYSTEM.STORAGE_UNIT - 1) /
47
                    SYSTEM.STORAGE_UNIT;
48
 
49
               TYPE CHECK_TYPE_1 IS
50
                    RECORD
51
                         I1 : INTEGER RANGE 0 .. 255;
52
                         B1 : BOOLEAN;
53
                         B2 : BOOLEAN;
54
                         I2 : INTEGER RANGE 0 .. 15;
55
                    END RECORD;
56
               FOR CHECK_TYPE_1 USE
57
                    RECORD
58
                         I1 AT 0 * UNITS_PER_INTEGER
59
                              RANGE 0 .. INTEGER'SIZE - 1;
60
                         B1 AT 1 * UNITS_PER_INTEGER
61
                              RANGE 0 .. BOOLEAN'SIZE - 1;
62
                         B2 AT 2 * UNITS_PER_INTEGER
63
                              RANGE 0 .. BOOLEAN'SIZE - 1;
64
                         I2 AT 3 * UNITS_PER_INTEGER
65
                              RANGE 0 .. INTEGER'SIZE - 1;
66
                    END RECORD;
67
 
68
               TYPE CHECK_TYPE_2 IS
69
                    RECORD
70
                         I1 : INTEGER RANGE 0 .. 255;
71
                         B1 : BOOLEAN;
72
                         B2 : BOOLEAN;
73
                         I2 : INTEGER RANGE 0 .. 15;
74
                    END RECORD;
75
 
76
          PRIVATE
77
               FOR CHECK_TYPE_2 USE
78
                         RECORD
79
                         I1 AT 0 * UNITS_PER_INTEGER
80
                              RANGE 0 .. INTEGER'SIZE - 1;
81
                         B1 AT 1 * UNITS_PER_INTEGER
82
                              RANGE 0 .. BOOLEAN'SIZE - 1;
83
                         B2 AT 2 * UNITS_PER_INTEGER
84
                              RANGE 0 .. BOOLEAN'SIZE - 1;
85
                         I2 AT 3 * UNITS_PER_INTEGER
86
                              RANGE 0 .. INTEGER'SIZE - 1;
87
                         END RECORD;
88
          END PACK;
89
 
90
          USE PACK;
91
 
92
          R1 : CHECK_TYPE_1;
93
 
94
          R2 : CHECK_TYPE_2;
95
     BEGIN
96
          IF R1.I1'FIRST_BIT /= 0 OR
97
                    R1.I1'LAST_BIT /= INTEGER'SIZE - 1 OR
98
                    R1.I1'POSITION /= 0 THEN
99
               FAILED ("INCORRECT REPRESENTATION FOR R1.I1");
100
          END IF;
101
 
102
          IF R1.B1'FIRST_BIT /= 0 OR
103
                    R1.B1'LAST_BIT /= BOOLEAN'SIZE - 1 OR
104
                    R1.B1'POSITION /= 1 * UNITS_PER_INTEGER THEN
105
               FAILED ("INCORRECT REPRESENTATION FOR R1.B1");
106
          END IF;
107
 
108
          IF R1.B2'FIRST_BIT /= 0 OR
109
                    R1.B2'LAST_BIT /= BOOLEAN'SIZE - 1 OR
110
                    R1.B2'POSITION /= 2 * UNITS_PER_INTEGER THEN
111
               FAILED ("INCORRECT REPRESENTATION FOR R1.B2");
112
          END IF;
113
 
114
          IF R1.I2'FIRST_BIT /= 0 OR
115
                    R1.I2'LAST_BIT /= INTEGER'SIZE - 1 OR
116
                    R1.I2'POSITION /= 3 * UNITS_PER_INTEGER THEN
117
               FAILED ("INCORRECT REPRESENTATION FOR R1.I2");
118
          END IF;
119
 
120
 
121
          IF R2.I1'FIRST_BIT /= 0 OR
122
                    R2.I1'LAST_BIT /= INTEGER'SIZE - 1 OR
123
                    R2.I1'POSITION /= 0 THEN
124
               FAILED ("INCORRECT REPRESENTATION FOR R2.I1");
125
          END IF;
126
 
127
          IF R2.B1'FIRST_BIT /= 0 OR
128
                    R2.B1'LAST_BIT /= BOOLEAN'SIZE - 1 OR
129
                    R2.B1'POSITION /= 1 * UNITS_PER_INTEGER THEN
130
               FAILED ("INCORRECT REPRESENTATION FOR R2.B1");
131
          END IF;
132
 
133
          IF R2.B2'FIRST_BIT /= 0 OR
134
                    R2.B2'LAST_BIT /= BOOLEAN'SIZE - 1 OR
135
                    R2.B2'POSITION /= 2 * UNITS_PER_INTEGER THEN
136
               FAILED ("INCORRECT REPRESENTATION FOR R2.B2");
137
          END IF;
138
 
139
          IF R2.I2'FIRST_BIT /= 0 OR
140
                    R2.I2'LAST_BIT /= INTEGER'SIZE - 1 OR
141
                    R2.I2'POSITION /= 3 * UNITS_PER_INTEGER THEN
142
               FAILED ("INCORRECT REPRESENTATION FOR R2.I2");
143
          END IF;
144
     END;
145
 
146
     RESULT;
147
END CD1009N;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.