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/] [c3/] [c34003a.ada] - Blame information for rev 309

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

Line No. Rev Author Line
1 294 jeremybenn
-- C34003A.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 REQUIRED PREDEFINED OPERATIONS ARE DECLARED
26
-- (IMPLICITLY) FOR DERIVED FLOATING POINT TYPES.
27
 
28
-- JRK 9/4/86
29
-- GJD 11/14/95  REMOVED USES OF OBSOLETE ADA 83 ATTRIBUTES.
30
 
31
WITH SYSTEM; USE SYSTEM;
32
WITH REPORT; USE REPORT;
33
 
34
PROCEDURE C34003A IS
35
 
36
     TYPE PARENT IS DIGITS 5;
37
 
38
     SUBTYPE SUBPARENT IS PARENT RANGE
39
               PARENT (IDENT_INT (-50)) ..
40
               PARENT (IDENT_INT ( 50));
41
 
42
     TYPE T IS NEW SUBPARENT DIGITS 4 RANGE
43
               PARENT (IDENT_INT (-30)) ..
44
               PARENT (IDENT_INT ( 30));
45
 
46
     TYPE FIXED IS DELTA 0.1 RANGE -1000.0 .. 1000.0;
47
 
48
     X : T        := -30.0;
49
     W : PARENT   := -100.0;
50
     R : CONSTANT := 1.0;
51
     M : CONSTANT := 100.0;
52
     B : BOOLEAN  := FALSE;
53
     F : FLOAT    := 0.0;
54
     G : FIXED    := 0.0;
55
 
56
     Z : CONSTANT T := 0.0;
57
 
58
     PROCEDURE A (X : ADDRESS) IS
59
     BEGIN
60
          B := IDENT_BOOL (TRUE);
61
     END A;
62
 
63
     FUNCTION IDENT (X : T) RETURN T IS
64
     BEGIN
65
          IF EQUAL (3, 3) THEN
66
               RETURN X;                          -- ALWAYS EXECUTED.
67
          END IF;
68
          RETURN T'FIRST;
69
     END IDENT;
70
 
71
BEGIN
72
     TEST ("C34003A", "CHECK THAT THE REQUIRED PREDEFINED OPERATIONS " &
73
                      "ARE DECLARED (IMPLICITLY) FOR DERIVED " &
74
                      "FLOATING POINT TYPES");
75
 
76
     X := IDENT (30.0);
77
     IF X /= 30.0 THEN
78
          FAILED ("INCORRECT :=");
79
     END IF;
80
 
81
     IF T'(X) /= 30.0 THEN
82
          FAILED ("INCORRECT QUALIFICATION");
83
     END IF;
84
 
85
     IF T (X) /= 30.0 THEN
86
          FAILED ("INCORRECT SELF CONVERSION");
87
     END IF;
88
 
89
     IF EQUAL (3, 3) THEN
90
          W := -30.0;
91
     END IF;
92
     IF T (W) /= -30.0 THEN
93
          FAILED ("INCORRECT CONVERSION FROM PARENT");
94
     END IF;
95
 
96
     IF PARENT (X) /= 30.0 OR PARENT (Z - 100.0) /= -100.0 THEN
97
          FAILED ("INCORRECT CONVERSION TO PARENT");
98
     END IF;
99
 
100
     IF T (IDENT_INT (-30)) /= -30.0 THEN
101
          FAILED ("INCORRECT CONVERSION FROM INTEGER");
102
     END IF;
103
 
104
     IF INTEGER (X) /= 30 OR INTEGER (Z - 100.0) /= -100 THEN
105
          FAILED ("INCORRECT CONVERSION TO INTEGER");
106
     END IF;
107
 
108
     IF EQUAL (3, 3) THEN
109
          F := -30.0;
110
     END IF;
111
     IF T (F) /= -30.0 THEN
112
          FAILED ("INCORRECT CONVERSION FROM FLOAT");
113
     END IF;
114
 
115
     IF FLOAT (X) /= 30.0 OR FLOAT (Z - 100.0) /= -100.0 THEN
116
          FAILED ("INCORRECT CONVERSION TO FLOAT");
117
     END IF;
118
 
119
     IF EQUAL (3, 3) THEN
120
          G := -30.0;
121
     END IF;
122
     IF T (G) /= -30.0 THEN
123
          FAILED ("INCORRECT CONVERSION FROM FIXED");
124
     END IF;
125
 
126
     IF FIXED (X) /= 30.0 OR FIXED (Z - 100.0) /= -100.0 THEN
127
          FAILED ("INCORRECT CONVERSION TO FIXED");
128
     END IF;
129
 
130
     IF IDENT (R) /= 1.0 OR X = M THEN
131
          FAILED ("INCORRECT IMPLICIT CONVERSION");
132
     END IF;
133
 
134
     IF IDENT (30.0) /= 30.0 OR X = 100.0 THEN
135
          FAILED ("INCORRECT REAL LITERAL");
136
     END IF;
137
 
138
     IF X = IDENT (0.0) OR X = 100.0 THEN
139
          FAILED ("INCORRECT =");
140
     END IF;
141
 
142
     IF X /= IDENT (30.0) OR NOT (X /= 100.0) THEN
143
          FAILED ("INCORRECT /=");
144
     END IF;
145
 
146
     IF X < IDENT (30.0) OR 100.0 < X THEN
147
          FAILED ("INCORRECT <");
148
     END IF;
149
 
150
     IF X > IDENT (30.0) OR X > 100.0 THEN
151
          FAILED ("INCORRECT >");
152
     END IF;
153
 
154
     IF X <= IDENT (0.0) OR 100.0 <= X THEN
155
          FAILED ("INCORRECT <=");
156
     END IF;
157
 
158
     IF IDENT (0.0) >= X OR X >= 100.0 THEN
159
          FAILED ("INCORRECT >=");
160
     END IF;
161
 
162
     IF NOT (X IN T) OR 100.0 IN T THEN
163
          FAILED ("INCORRECT ""IN""");
164
     END IF;
165
 
166
     IF X NOT IN T OR NOT (100.0 NOT IN T) THEN
167
          FAILED ("INCORRECT ""NOT IN""");
168
     END IF;
169
 
170
     IF +X /= 30.0 OR +(Z - 100.0) /= -100.0 THEN
171
          FAILED ("INCORRECT UNARY +");
172
     END IF;
173
 
174
     IF -X /= 0.0 - 30.0 OR -(Z - 100.0) /= 100.0 THEN
175
          FAILED ("INCORRECT UNARY -");
176
     END IF;
177
 
178
     IF ABS X /= 30.0 OR ABS (Z - 100.0) /= 100.0 THEN
179
          FAILED ("INCORRECT ABS");
180
     END IF;
181
 
182
     IF X + IDENT (-1.0) /= 29.0 OR X + 70.0 /= 100.0 THEN
183
          FAILED ("INCORRECT BINARY +");
184
     END IF;
185
 
186
     IF X - IDENT (30.0) /= 0.0 OR X - 100.0 /= -70.0 THEN
187
          FAILED ("INCORRECT BINARY -");
188
     END IF;
189
 
190
     IF X * IDENT (-1.0) /= -30.0 OR IDENT (2.0) * 50.0 /= 100.0 THEN
191
          FAILED ("INCORRECT *");
192
     END IF;
193
 
194
     IF X / IDENT (3.0) /= 10.0 OR 90.0 / X /= 3.0 THEN
195
          FAILED ("INCORRECT /");
196
     END IF;
197
 
198
     IF X ** IDENT_INT (1) /= 30.0 OR
199
        (Z + 100.0) ** IDENT_INT (1) /= 100.0 THEN
200
          FAILED ("INCORRECT **");
201
     END IF;
202
 
203
     B := FALSE;
204
     A (X'ADDRESS);
205
     IF NOT B THEN
206
          FAILED ("INCORRECT 'ADDRESS");
207
     END IF;
208
 
209
     IF T'BASE'SIZE < 27 THEN
210
          FAILED ("INCORRECT 'BASE'SIZE");
211
     END IF;
212
 
213
     IF T'DIGITS /= 4 OR T'BASE'DIGITS < 5 THEN
214
          FAILED ("INCORRECT 'DIGITS");
215
     END IF;
216
 
217
     IF T'FIRST /= -30.0 THEN
218
          FAILED ("INCORRECT 'FIRST");
219
     END IF;
220
 
221
     IF T'LAST /= 30.0 THEN
222
          FAILED ("INCORRECT 'LAST");
223
     END IF;
224
 
225
     IF T'MACHINE_EMAX < 1 OR T'BASE'MACHINE_EMAX /= T'MACHINE_EMAX THEN
226
          FAILED ("INCORRECT 'MACHINE_EMAX");
227
     END IF;
228
 
229
     IF T'MACHINE_EMIN > -1 OR T'BASE'MACHINE_EMIN /= T'MACHINE_EMIN THEN
230
          FAILED ("INCORRECT 'MACHINE_EMIN");
231
     END IF;
232
 
233
     IF T'MACHINE_MANTISSA < 1 OR
234
        T'BASE'MACHINE_MANTISSA /= T'MACHINE_MANTISSA THEN
235
          FAILED ("INCORRECT 'MACHINE_MANTISSA");
236
     END IF;
237
 
238
     IF T'MACHINE_OVERFLOWS /= T'BASE'MACHINE_OVERFLOWS THEN
239
          FAILED ("INCORRECT 'MACHINE_OVERFLOWS");
240
     END IF;
241
 
242
     IF T'MACHINE_RADIX < 2 OR
243
        T'BASE'MACHINE_RADIX /= T'MACHINE_RADIX THEN
244
          FAILED ("INCORRECT 'MACHINE_RADIX");
245
     END IF;
246
 
247
     IF T'MACHINE_ROUNDS /= T'BASE'MACHINE_ROUNDS THEN
248
          FAILED ("INCORRECT 'MACHINE_ROUNDS");
249
     END IF;
250
 
251
     IF T'SIZE < 23 THEN
252
          FAILED ("INCORRECT TYPE'SIZE");
253
     END IF;
254
 
255
     IF X'SIZE < 23 THEN
256
          FAILED ("INCORRECT OBJECT'SIZE");
257
     END IF;
258
 
259
     RESULT;
260
END C34003A;

powered by: WebSVN 2.1.0

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