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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C52010A.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 RECORD ASSIGNMENTS USE "COPY" SEMANTICS. (PART I).
26
 
27
 
28
-- FACTORS AFFECTING THE SITUATION TO BE TESTED:
29
--
30
--        COMPONENT TYPE                     * INTEGER
31
--                                           * BOOLEAN (OMITTED)
32
--                                           * CHARACTER (OMITTED)
33
--                                           * USER-DEFINED ENUMERATION
34
--
35
--        DERIVED VS. NON-DERIVED
36
--
37
--        TYPE VS. SUBTYPE
38
--
39
--        ORDER OF COMPONENT ASSIGNMENTS     * LEFT-TO-RIGHT
40
--                                           * RIGHT-TO-LEFT
41
--                                           * INSIDE-OUT
42
--                                           * OUTSIDE IN
43
 
44
 
45
-- RM 02/23/80
46
-- SPS 3/21/83
47
 
48
WITH REPORT;
49
PROCEDURE C52010A IS
50
 
51
     USE REPORT;
52
 
53
     TYPE  ENUM  IS  ( AA , BB , CC , DD , EE , FF , GG , HH ,
54
                       II , JJ , KK , LL , MM , NN , PP , QQ ,
55
                                 TT , UU , VV , WW , XX , YY );
56
 
57
BEGIN
58
 
59
     TEST ( "C52010A" ,  "CHECK THAT RECORD ASSIGNMENTS USE ""COPY""" &
60
                         " SEMANTICS" );
61
 
62
 
63
     DECLARE
64
          TYPE  REC  IS
65
               RECORD
66
                    X , Y  :  INTEGER ;
67
               END RECORD;
68
          R  :  REC ;
69
     BEGIN
70
 
71
          R  :=  ( 5 , 8 ) ;
72
          R  :=  ( X => 1 , Y => R.X ) ;
73
          IF  R  /=  ( 1 , 5 )  THEN
74
               FAILED ( "WRONG VALUE  (1)" );
75
          END IF;
76
 
77
          R  :=  ( 5 , 8 ) ;
78
          R  :=  ( Y => 1 , X => R.Y ) ;
79
          IF  R  /=  ( 8 , 1 )  THEN
80
               FAILED ( "WRONG VALUE  (2)" );
81
          END IF;
82
 
83
          R  :=  ( 5 , 8 ) ;
84
          R  :=  ( R.Y+1 , R.X+1 ) ;
85
          IF  R  /=  ( 9 , 6 ) THEN
86
               FAILED ( "WRONG VALUE  (3)" );
87
          END IF;
88
 
89
     END;
90
 
91
     DECLARE
92
          TYPE  REC3  IS
93
               RECORD
94
                    DEEP0     :  INTEGER   ;
95
                    DEEP      :  INTEGER   ;
96
               END RECORD;
97
          TYPE  REC2  IS
98
               RECORD
99
                    YX        :  REC3      ;
100
                    MODERATE  :  INTEGER   ;
101
               END RECORD;
102
          TYPE  REC  IS
103
               RECORD
104
                    SHALLOW   :  INTEGER   ;
105
                    YZ        :  REC2      ;
106
               END RECORD;
107
          R  :  REC ;
108
     BEGIN
109
          R  :=  ( 0              , ((5,  1         ), 2             ));
110
          R  :=  ( R.YZ.MODERATE+8, ((7, R.SHALLOW+1),R.YZ.YX.DEEP+99));
111
          IF R/= (              10, ((7,           1),            100))
112
          THEN
113
               FAILED ( "WRONG VALUE  (4)" );
114
          END IF;
115
     END;
116
 
117
 
118
     DECLARE
119
          TYPE  SUB_ENUM  IS  NEW ENUM RANGE  AA..DD ;
120
          TYPE  REC  IS
121
               RECORD
122
                    X , Y  :  SUB_ENUM ;
123
               END RECORD;
124
          R  :  REC ;
125
     BEGIN
126
          R  :=  ( AA , CC ) ;
127
          R  :=  ( X => BB , Y => R.X ) ;
128
          IF  R  /=  ( BB , AA )  THEN
129
               FAILED ( "WRONG VALUE  (5)" );
130
          END IF;
131
 
132
          R  :=  ( AA , CC ) ;
133
          R  :=  ( Y => BB , X => R.Y ) ;
134
          IF  R  /=  ( CC , BB )  THEN
135
               FAILED ( "WRONG VALUE  (6)" );
136
          END IF;
137
 
138
          R  :=  ( AA , CC ) ;
139
          R  :=  ( SUB_ENUM'SUCC( R.Y ) , SUB_ENUM'SUCC( R.X ) ) ;
140
          IF  R /= ( DD , BB )  THEN
141
               FAILED ( "WRONG VALUE  (7)" );
142
          END IF;
143
 
144
     END;
145
 
146
 
147
     DECLARE
148
          TYPE  REC3  IS
149
               RECORD
150
                    DEEP0      :  ENUM ;
151
                    DEEP       :  ENUM ;
152
               END RECORD;
153
          TYPE  REC2  IS
154
               RECORD
155
                    YX         :  REC3 ;
156
                    MODERATE   :  ENUM ;
157
               END RECORD;
158
          TYPE  REC  IS
159
               RECORD
160
                    SHALLOW    :  ENUM ;
161
                    YZ         :  REC2 ;
162
               END RECORD;
163
          R  :  REC ;
164
     BEGIN
165
 
166
          R  :=  (    TT ,
167
                   (( YY , II ) ,
168
                      AA ) ) ;
169
 
170
          R  :=  (    ENUM'SUCC(ENUM'SUCC( R.YZ.MODERATE )) ,
171
                   (( AA , ENUM'SUCC( R.SHALLOW ) ) ,
172
                    ( ENUM'SUCC(ENUM'SUCC(ENUM'SUCC(ENUM'SUCC(
173
                                R.YZ.YX.DEEP )))) ) ) ) ;
174
 
175
          IF R/= (    CC ,
176
                   (( AA , UU ) ,
177
                      MM ) )
178
          THEN
179
               FAILED ( "WRONG VALUE  (8)" );
180
          END IF;
181
 
182
     END;
183
 
184
     RESULT ;
185
 
186
END C52010A ;

powered by: WebSVN 2.1.0

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