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/] [cd1009y.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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