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/] [a/] [a74205e.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
-- A74205E.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 THE ADDITIONAL OPERATIONS FOR A COMPOSITE TYPE WITH A
26
-- COMPONENT OF A PRIVATE TYPE ARE AVAILABLE AT THE EARLIEST
27
-- PLACE WITHIN THE IMMEDIATE SCOPE OF THE DECLARATION OF THE COMPOSITE
28
-- TYPE AND AFTER THE FULL DECLARATION OF THE PRIVATE TYPE.
29
 
30
-- IN PARTICULAR, CHECH FOR THE FOLLOWING :
31
 
32
-- (1)  RELATIONAL OPERATORS WITH ARRAYS OF SCALAR TYPES
33
-- (2)  EQUALITY WITH ARRAYS AND RECORDS OF LIMITED PRIVATE TYPES 
34
-- (3)  LOGICAL OPERATORS WITH ARRAYS OF BOOLEAN TYPES
35
-- (4)  CATENATION WITH ARRAYS OF LIMITED PRIVATE TYPES
36
-- (5)  INITIALIZATION WITH ARRAYS AND RECORDS OF LIMITED PRIVATE TYPES
37
-- (6)  ASSIGNMENT WITH ARRAYS AND RECORDS OF LIMITED PRIVATE TYPES
38
-- (7)  SELECTED COMPONENTS WITH COMPOSITES OF PRIVATE RECORD TYPES
39
-- (8)  INDEXED COMPONENTS WITH COMPOSITES OF PRIVATE ARRAY TYPES
40
-- (9)  SLICES WITH COMPOSITES OF PRIVATE ARRAY TYPES
41
-- (10) QUALIFICATION FOR COMPOSITES OF PRIVATE TYPES
42
-- (11) AGGREGATES FOR ARRAYS AND RECORDS OF PRIVATES TYPES
43
-- (12) USE OF 'SIZE FOR ARRAYS AND RECORDS OF PRIVATE TYPES
44
 
45
-- DSJ 5/2/83
46
 
47
WITH REPORT ;
48
PROCEDURE A74205E IS
49
 
50
     USE REPORT ;
51
 
52
BEGIN
53
 
54
     TEST("A74205E", "CHECK THAT ADDITIONAL OPERATIONS FOR "
55
                   & "COMPOSITE TYPES OF PRIVATE TYPES ARE "
56
                   & "AVAILABLE AT THE EARLIEST PLACE AFTER THE "
57
                   & "FULL DECLARATION AND IN THE IMMEDIATE "
58
                   & "SCOPE OF THE COMPOSITE TYPE") ;
59
 
60
     DECLARE
61
 
62
          PACKAGE PACK1 IS
63
               TYPE LP1 IS LIMITED PRIVATE ;
64
               PACKAGE PACK_LP IS
65
                    TYPE LP_ARR IS ARRAY (INTEGER RANGE <>) OF LP1 ;
66
                    SUBTYPE LP_ARR2 IS LP_ARR ( 1 .. 2 ) ;
67
                    SUBTYPE LP_ARR4 IS LP_ARR ( 1 .. 4 ) ;
68
               END PACK_LP ;
69
 
70
               TYPE T1 IS PRIVATE ;
71
               PACKAGE PACK2 IS
72
                    TYPE ARR IS ARRAY (INTEGER RANGE <>) OF T1 ;
73
                    SUBTYPE ARR2 IS ARR ( 1 .. 2 ) ;
74
                    SUBTYPE ARR4 IS ARR ( 1 .. 4 ) ;
75
               END PACK2 ;
76
 
77
               TYPE T2 IS PRIVATE ;
78
               TYPE T3 IS PRIVATE ;
79
               PACKAGE PACK3 IS
80
                    TYPE ARR_T2 IS ARRAY ( 1 .. 2 ) OF T2 ;
81
                    TYPE ARR_T3 IS ARRAY ( 1 .. 2 ) OF T3 ;
82
               END PACK3 ;
83
          PRIVATE
84
               TYPE LP1 IS NEW BOOLEAN ;
85
               TYPE T1 IS NEW BOOLEAN ;
86
               TYPE T2 IS ARRAY ( 1 .. 2 ) OF INTEGER ;
87
               TYPE T3 IS
88
                    RECORD
89
                         C1 : INTEGER ;
90
                    END RECORD ;
91
          END PACK1 ;
92
 
93
          PACKAGE BODY PACK1 IS
94
 
95
               PACKAGE BODY PACK_LP IS
96
                    L1, L2 : LP_ARR2 := (TRUE,FALSE) ; -- LEGAL
97
                    A3 : LP_ARR2 := L1 ;               -- LEGAL
98
                    B3 : BOOLEAN := L1 =  L2 ;         -- LEGAL
99
                    B4 : BOOLEAN := L1 /= L2 ;         -- LEGAL
100
               END PACK_LP ;
101
 
102
               PACKAGE BODY PACK2 IS
103
                    A1, A2 : ARR2 := (FALSE,TRUE) ;    -- LEGAL
104
                    A4 : ARR2    := ARR2'(A1) ;        -- LEGAL
105
                    B1 : BOOLEAN := A1 <  A2 ;         -- LEGAL
106
                    B2 : BOOLEAN := A1 >= A2 ;         -- LEGAL
107
                    N3 : INTEGER := A1'SIZE ;          -- LEGAL
108
                    PROCEDURE G1 (X : ARR2 := NOT A1) IS    -- LEGAL
109
                    BEGIN
110
                         NULL ;
111
                    END G1 ;
112
 
113
                    PROCEDURE G2 (X : ARR2 := A1 AND A2) IS -- LEGAL
114
                    BEGIN
115
                         NULL ;
116
                    END G2 ;
117
 
118
                    PROCEDURE G3 (X : ARR4 := A1 & A2) IS   -- LEGAL
119
                    BEGIN
120
                         NULL ;
121
                    END G3 ;
122
 
123
                    PROCEDURE G4 (X : ARR2 := (FALSE,TRUE) ) IS -- LEGAL
124
                    BEGIN
125
                         NULL ;
126
                    END G4 ;
127
               END PACK2 ;
128
 
129
               PACKAGE BODY PACK3 IS
130
                    X2 : ARR_T2 :=
131
                         (1=>(1,2), 2=>(3,4)) ;        -- LEGAL
132
                    X3 : ARR_T3 :=
133
                         (1=>(C1=>5), 2=>(C1=>6)) ;    -- LEGAL
134
                    N1 : INTEGER := X3(1).C1 ;         -- LEGAL
135
                    N2 : INTEGER := X2(1)(2) ;         -- LEGAL
136
                    N4 : T2      := X2(1)(1..2) ;      -- LEGAL
137
               END PACK3 ;
138
 
139
          END PACK1 ;
140
 
141
     BEGIN
142
 
143
          NULL ;
144
 
145
     END ;
146
 
147
     RESULT ;
148
 
149
END A74205E ;

powered by: WebSVN 2.1.0

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