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/] [cd1009x.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
-- CD1009X.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 PRIVATE PART OF A PACKAGE FOR AN INCOMPLETE TYPE, WHOSE
28
--     FULL TYPE DECLARATION IS A RECORD TYPE DECLARED IN THE VISIBLE
29
--     PART OF THE SAME PACKAGE.
30
 
31
-- HISTORY:
32
--     VCL 10/21/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 CD1009X IS
39
BEGIN
40
     TEST ("CD1009X", "A RECORD REPRESENTATION CLAUSE MAY BE GIVEN " &
41
                      "IN THE PRIVATE PART OF A PACKAGE FOR AN " &
42
                      "INCOMPLETE TYPE, WHOSE FULL TYPE DECLARATION " &
43
                      "IS 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;
52
               TYPE ACC IS ACCESS CHECK_TYPE_1;
53
 
54
               TYPE CHECK_TYPE_1 IS
55
                    RECORD
56
                         I1 : INTEGER RANGE 0 .. 255;
57
                         B1 : BOOLEAN;
58
                         B2 : BOOLEAN;
59
                         I2 : INTEGER RANGE 0 .. 15;
60
                    END RECORD;
61
          PRIVATE
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
          USE PACK;
76
 
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 THEN
88
               FAILED ("INCORRECT REPRESENTATION FOR R1.B1");
89
          END IF;
90
 
91
          IF R1.B2'FIRST_BIT /= 0 OR
92
                    R1.B2'LAST_BIT /= BOOLEAN'SIZE - 1 OR
93
                    R1.B2'POSITION /= 2 * UNITS_PER_INTEGER THEN
94
               FAILED ("INCORRECT REPRESENTATION FOR R1.B2");
95
          END IF;
96
 
97
          IF R1.I2'FIRST_BIT /= 0 OR
98
                    R1.I2'LAST_BIT /= INTEGER'SIZE - 1 OR
99
                    R1.I2'POSITION /= 3 * UNITS_PER_INTEGER THEN
100
               FAILED ("INCORRECT REPRESENTATION FOR R1.I2");
101
          END IF;
102
     END;
103
 
104
     RESULT;
105
END CD1009X;

powered by: WebSVN 2.1.0

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