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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c7/] [c74206a.ada] - Blame information for rev 316

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

Line No. Rev Author Line
1 294 jeremybenn
-- C74206A.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
-- CHECK THAT IF A COMPOSITE TYPE IS DECLARED IN THE PACKAGE AS A
26
-- PRIVATE TYPE AND CONTAINS A COMPONENT OF THE PRIVATE TYPE, OPERATIONS
27
-- OF THE COMPOSITE TYPE WHICH DO NOT DEPEND ON CHARACTERISTICS OF THE
28
-- PRIVATE TYPE ARE AVAILABLE AFTER THE FULL DECLARATION OF THE PRIVATE
29
-- TYPE, BUT BEFORE THE EARLIEST PLACE WITHIN THE IMMEDIATE SCOPE OF THE
30
-- DECLARATION OF THE COMPOSITE TYPE THAT IS AFTER THE FULL DECLARATION
31
-- OF THE PRIVATE TYPE.  IN PARTICULAR, CHECK FOR THE FOLLOWING :
32
 
33
--   'FIRST, 'LAST, 'RANGE, AND 'LENGTH FOR ARRAY TYPES
34
--   SELECTED COMPONENTS FOR DISCRIMINANTS AND COMPONENTS OF RECORDS
35
--   INDEXED COMPONENTS AND SLICES FOR ARRAYS
36
 
37
-- DSJ 5/5/83
38
-- JBG 3/8/84
39
 
40
WITH REPORT;
41
PROCEDURE C74206A IS
42
 
43
     USE REPORT;
44
 
45
BEGIN
46
 
47
     TEST("C74206A", "CHECK THAT ADDITIONAL OPERATIONS FOR "
48
                   & "COMPOSITE TYPES OF PRIVATE TYPES ARE "
49
                   & "AVAILABLE AT THE EARLIEST PLACE AFTER THE "
50
                   & "FULL DECLARATION OF THE PRIVATE TYPE EVEN "
51
                   & "IF BEFORE THE EARLIEST PLACE WITHIN THE "
52
                   & "IMMEDIATE SCOPE OF THE COMPOSITE TYPE");
53
 
54
     DECLARE
55
 
56
          PACKAGE PACK1 IS
57
               TYPE P1  IS PRIVATE;
58
               TYPE LP1 IS LIMITED PRIVATE;
59
 
60
               PACKAGE PACK_LP IS
61
                    TYPE LP_ARR IS ARRAY (1 .. 2) OF LP1;
62
                    TYPE LP_REC (D : INTEGER) IS
63
                         RECORD
64
                              C1, C2 : LP1;
65
                         END RECORD;
66
               END PACK_LP;
67
 
68
               PACKAGE PACK2 IS
69
                    TYPE ARR IS ARRAY ( 1 .. 2 ) OF P1;
70
                    TYPE REC (D : INTEGER) IS
71
                         RECORD
72
                              C1, C2 : P1;
73
                         END RECORD;
74
               END PACK2;
75
          PRIVATE
76
               TYPE P1  IS NEW BOOLEAN;
77
               TYPE LP1 IS NEW BOOLEAN;
78
          END PACK1;
79
 
80
          PACKAGE BODY PACK1 IS
81
 
82
               USE PACK_LP;
83
               USE PACK2;
84
 
85
               A1 : ARR;
86
               L1 : LP_ARR;
87
 
88
               N1 : INTEGER := ARR'FIRST;           -- LEGAL
89
               N2 : INTEGER := ARR'LAST;            -- LEGAL
90
               N3 : INTEGER := A1'LENGTH;           -- LEGAL
91
               N4 : INTEGER := LP_ARR'FIRST;        -- LEGAL
92
               N5 : INTEGER := LP_ARR'LAST;         -- LEGAL
93
               N6 : INTEGER := L1'LENGTH;           -- LEGAL
94
               B1 : BOOLEAN := 1 IN ARR'RANGE;      -- LEGAL
95
               B2 : BOOLEAN := 5 IN LP_ARR'RANGE;   -- LEGAL
96
 
97
               N7 : INTEGER := A1(1)'SIZE;          -- LEGAL: A1(1)
98
               N8 : INTEGER := L1(2)'SIZE;          -- LEGAL: L1(2)
99
 
100
               R1 : REC(1);
101
               Q1 : LP_REC(1);
102
 
103
               K1 : INTEGER := R1.D'SIZE;           -- LEGAL: R1.D
104
               K2 : INTEGER := R1.C1'SIZE;          -- LEGAL: R1.C1
105
               K3 : INTEGER := Q1.D'SIZE;           -- LEGAL: Q1.D
106
               K4 : INTEGER := Q1.C2'SIZE;          -- LEGAL: Q1.C2
107
 
108
          BEGIN
109
 
110
               IF N1 /= 1 OR N4 /= 1 THEN
111
                    FAILED ("WRONG VALUE FOR 'FIRST");
112
               END IF;
113
 
114
               IF N2 /= 2 OR N5 /= 2 THEN
115
                    FAILED ("WRONG VALUE FOR 'LAST");
116
               END IF;
117
 
118
               IF N3 /= 2 OR N6 /= 2 THEN
119
                    FAILED ("WRONG VALUE FOR 'LENGTH");
120
               END IF;
121
 
122
               IF B1 /= TRUE OR B2 /= FALSE THEN
123
                    FAILED ("INCORRECT RANGE TEST");
124
               END IF;
125
 
126
               IF N7 /= N8 THEN
127
                    FAILED ("INCORRECT INDEXED COMPONENTS");
128
               END IF;
129
 
130
               IF K1 /= K3 OR K2 /= K4 THEN
131
                    FAILED ("INCORRECT COMPONENT SELECTION");
132
               END IF;
133
 
134
          END PACK1;
135
 
136
     BEGIN
137
 
138
          NULL;
139
 
140
     END;
141
 
142
     RESULT;
143
 
144
END C74206A;

powered by: WebSVN 2.1.0

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