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/] [c8/] [c87b32a.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
-- C87B32A.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 OVERLOADING RESOLUTION USES THE FOLLOWING RULES:
26
 
27
-- FOR ATTRIBUTES OF THE FORM: T'SUCC (X), T'PRED (X), T'POS (X),
28
-- AND T'IMAGE (X) , THE OPERAND X MUST BE OF TYPE T.
29
--
30
-- FOR THE ATTRIBUTE OF THE FORM T'VAL (X), THE OPERAND X MUST BE
31
-- OF AN INTEGER TYPE.
32
--
33
-- FOR THE ATTRIBUTE OF THE FORM T'VALUE (X), THE OPERAND X MUST 
34
-- BE OF THE PREDEFINED TYPE STRING.
35
 
36
-- TRH  13 SEPT 82
37
-- JRK  12 JAN  84
38
 
39
WITH REPORT; USE REPORT;
40
 
41
PROCEDURE C87B32A IS
42
 
43
     TYPE COLOR  IS (BROWN, RED, WHITE);
44
     TYPE SCHOOL IS (HARVARD, BROWN, YALE);
45
     TYPE COOK   IS (SIMMER, SAUTE, BROWN, BOIL);
46
     TYPE SUGAR  IS (DEXTROSE, CANE, GLUCOSE, BROWN);
47
     TYPE WHOLE  IS NEW INTEGER RANGE 0 .. INTEGER'LAST;
48
     TYPE LIT_CHAR IS ('+', '-', '0', '1', '2', '3', '4', '5', '6', '7',
49
                       '8', '9');
50
     TYPE LIT_STRING IS ARRAY (POSITIVE RANGE <>) OF LIT_CHAR;
51
 
52
     FUNCTION "+" (X, Y : WHOLE) RETURN WHOLE
53
          RENAMES "*";
54
 
55
     FUNCTION F1 RETURN STRING IS
56
     BEGIN
57
          RETURN "+10";
58
     END F1;
59
 
60
     FUNCTION F1 RETURN LIT_STRING IS
61
     BEGIN
62
          FAILED ("THE VALUE ATTRIBUTE TAKES A PREDEFINED STRING " &
63
                  "OPERAND");
64
          RETURN "+3";
65
     END F1;
66
 
67
     FUNCTION F1 RETURN CHARACTER IS
68
     BEGIN
69
          FAILED ("THE VALUE ATTRIBUTE TAKES A STRING OPERAND");
70
          RETURN '2';
71
     END F1;
72
 
73
     FUNCTION F2 (X : INTEGER) RETURN FLOAT IS
74
     BEGIN
75
          FAILED ("THE VAL ATTRIBUTE TAKES AN INTEGER TYPE OPERAND");
76
          RETURN 0.0;
77
     END F2;
78
 
79
     FUNCTION F2 (X : INTEGER := 1) RETURN INTEGER IS
80
     BEGIN
81
          RETURN X;
82
     END F2;
83
 
84
BEGIN
85
     TEST ("C87B32A","OVERLOADED OPERANDS FOR THE ATTRIBUTES " &
86
           "T'PRED, T'SUCC, T'POS, T'VAL, T'IMAGE AND T'VALUE");
87
 
88
     IF COLOR'POS   (BROWN) /= 0        THEN
89
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
90
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 1");
91
     END IF;
92
 
93
     IF SCHOOL'POS (BROWN) /= 1         THEN
94
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
95
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 2");
96
     END IF;
97
 
98
     IF COOK'POS    (BROWN) /= 2        THEN
99
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
100
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 3");
101
     END IF;
102
 
103
     IF SUGAR'POS  (BROWN) /= 3         THEN
104
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
105
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 4");
106
     END IF;
107
 
108
     IF SCHOOL'PRED (BROWN) /= HARVARD  THEN
109
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
110
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 5");
111
     END IF;
112
 
113
     IF COOK'PRED  (BROWN) /= SAUTE     THEN
114
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
115
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 6");
116
     END IF;
117
 
118
     IF SUGAR'PRED  (BROWN) /= GLUCOSE  THEN
119
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
120
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 7");
121
     END IF;
122
 
123
     IF COLOR'SUCC (BROWN) /= RED       THEN
124
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
125
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 8");
126
     END IF;
127
 
128
     IF SCHOOL'SUCC (BROWN) /= YALE     THEN
129
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
130
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 9");
131
     END IF;
132
 
133
     IF COOK'SUCC  (BROWN) /= BOIL      THEN
134
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
135
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 10");
136
     END IF;
137
 
138
     IF COLOR'VAL (F2 (0))  /= BROWN    THEN
139
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
140
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 11");
141
     END IF;
142
 
143
     IF SCHOOL'VAL (F2)    /= BROWN     THEN
144
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
145
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 12");
146
     END IF;
147
 
148
     IF COOK'VAL  (F2 (2))  /= BROWN    THEN
149
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
150
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 13");
151
     END IF;
152
 
153
     IF SUGAR'VAL  (F2)    /= CANE      THEN
154
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
155
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 14");
156
     END IF;
157
 
158
     IF WHOLE'POS   (1 + 1)   /= 1      THEN
159
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
160
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 15");
161
     END IF;
162
 
163
     IF WHOLE'VAL   (1 + 1) /= 2        THEN
164
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
165
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 16");
166
     END IF;
167
 
168
     IF WHOLE'SUCC  (1 + 1)   /= 2      THEN
169
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
170
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 17");
171
     END IF;
172
 
173
     IF WHOLE'PRED  (1 + 1) /= 0        THEN
174
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
175
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 18");
176
     END IF;
177
 
178
     IF WHOLE'VALUE ("+1") + 1 /= 1     THEN
179
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
180
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 19");
181
     END IF;
182
 
183
     IF WHOLE'IMAGE (1 + 1) /= " 1"     THEN
184
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
185
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 20");
186
     END IF;
187
 
188
     IF WHOLE'VALUE (F1) + 1  /= 10     THEN
189
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
190
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 21");
191
     END IF;
192
 
193
     IF WHOLE'VAL (1) + 1   /= 1        THEN
194
        FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" &
195
                " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 22");
196
     END IF;
197
 
198
     RESULT;
199
END C87B32A;

powered by: WebSVN 2.1.0

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