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/] [c9/] [c95066a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C95066A.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 A STATIC EXPRESSION, CONSTANT NAME, ATTRIBUTE NAME,
26
-- VARIABLE, DEREFERENCED ACCESS, USER-DEFINED OPERATOR, USER-
27
-- DEFINED FUNCTION, OR ALLOCATOR CAN BE USED IN THE INITIALIZATION
28
-- EXPRESSION OF A FORMAL PARAMETER, AND THAT THE APPROPRIATE
29
-- VALUE IS USED AS A DEFAULT PARAMETER VALUE WHEN THE ENTRY
30
-- IS CALLED.
31
 
32
-- GLH  6/19/85
33
 
34
WITH REPORT;
35
PROCEDURE C95066A IS
36
 
37
     USE REPORT;
38
 
39
     TYPE INT IS RANGE 1 .. 10;
40
 
41
     TYPE ARR IS ARRAY (INTEGER RANGE <>) OF INTEGER;
42
 
43
     TYPE RECTYPE (CONSTRAINT : INTEGER) IS
44
          RECORD
45
               A : ARR (0..CONSTRAINT);
46
          END RECORD;
47
 
48
     C7   : CONSTANT INTEGER  := 7;
49
     V7   : INTEGER  := 7;
50
 
51
     TYPE  A_INT IS ACCESS INTEGER;
52
     C_A  : CONSTANT A_INT  := NEW INTEGER'(7);
53
 
54
     SUBTYPE RECTYPE1 IS RECTYPE (2 + 5);
55
     SUBTYPE RECTYPE2 IS RECTYPE (C7);
56
     SUBTYPE RECTYPE3 IS RECTYPE (V7);
57
 
58
     FUNCTION "&" (X,Y : INTEGER) RETURN INTEGER IS
59
     BEGIN
60
          RETURN 10;
61
     END "&";
62
 
63
     FUNCTION FUNC (X : INTEGER) RETURN INTEGER IS
64
     BEGIN
65
          RETURN X;
66
     END FUNC;
67
 
68
      -- STATIC EXPRESSION.
69
 
70
     TASK T1 IS
71
          ENTRY E1 (REC : RECTYPE1 := (3+4,(0,1,2,3,4,5,6,7)));
72
     END T1;
73
 
74
     TASK BODY T1 IS
75
     BEGIN
76
          ACCEPT E1 (REC : RECTYPE1 := (3+4,(0,1,2,3,4,5,6,7))) DO
77
               IF (REC /= (7,(0,1,2,3,4,5,6,7))) THEN
78
                    FAILED ("INCORRECT DEFAULT VALUE FOR " &
79
                            "E1 PARAMETER");
80
               END IF;
81
          END E1;
82
     END T1;
83
 
84
     -- CONSTANT NAME.
85
 
86
     TASK T2 IS
87
          ENTRY E2 (REC : RECTYPE2 := (C7,(0,1,2,3,4,5,6,7)));
88
     END T2;
89
 
90
     TASK BODY T2 IS
91
     BEGIN
92
          ACCEPT E2 (REC : RECTYPE2 := (C7,(0,1,2,3,4,5,6,7))) DO
93
               IF (REC /= (C7,(0,1,2,3,4,5,6,7))) THEN
94
                    FAILED ("INCORRECT DEFAULT VALUE FOR " &
95
                            "E2 PARAMETER");
96
               END IF;
97
          END E2;
98
     END T2;
99
 
100
     -- ATTRIBUTE NAME.
101
 
102
     TASK T3 IS
103
          ENTRY E3 (P1 : INT := INT'LAST);
104
     END T3;
105
 
106
     TASK BODY T3 IS
107
     BEGIN
108
          ACCEPT E3 (P1 : INT := INT'LAST) DO
109
               IF (P1 /= INT (10)) THEN
110
                    FAILED ("INCORRECT DEFAULT VALUE FOR " &
111
                            "E3 PARAMETER");
112
               END IF;
113
          END E3;
114
     END T3;
115
 
116
     -- VARIABLE.
117
 
118
     TASK T4 IS
119
          ENTRY E4 (P4 : RECTYPE3 := (V7,(0,1,2,3,4,5,6,7)));
120
     END T4;
121
 
122
     TASK BODY T4 IS
123
     BEGIN
124
          ACCEPT E4 (P4 : RECTYPE3 := (V7,(0,1,2,3,4,5,6,7))) DO
125
               IF (P4 /= (V7,(0,1,2,3,4,5,6,7))) THEN
126
                    FAILED ("INCORRECT DEFAULT VALUE FOR " &
127
                            "E4 PARAMETER");
128
               END IF;
129
          END E4;
130
     END T4;
131
 
132
     -- DEREFERENCED ACCESS.
133
 
134
     TASK T5 IS
135
          ENTRY E5 (P5 : INTEGER := C_A.ALL);
136
     END T5;
137
 
138
     TASK BODY T5 IS
139
     BEGIN
140
          ACCEPT E5 (P5 : INTEGER := C_A.ALL) DO
141
               IF (P5 /= C_A.ALL) THEN
142
                    FAILED ("INCORRECT DEFAULT VALUE FOR " &
143
                            "E5 PARAMETER");
144
               END IF;
145
          END E5;
146
     END T5;
147
 
148
     -- USER-DEFINED OPERATOR.
149
 
150
     TASK T6 IS
151
          ENTRY E6 (P6 : INTEGER := 6&4);
152
     END T6;
153
 
154
     TASK BODY T6 IS
155
     BEGIN
156
          ACCEPT E6 (P6 : INTEGER := 6&4) DO
157
               IF (P6 /= IDENT_INT(10)) THEN
158
                    FAILED ("INCORRECT DEFAULT VALUE " &
159
                            "FOR E6 PARAMETER");
160
               END IF;
161
          END E6;
162
     END T6;
163
 
164
     -- USER-DEFINED FUNCTION.
165
 
166
     TASK T7 IS
167
          ENTRY E7 (P7 : INTEGER := FUNC(10));
168
     END T7;
169
 
170
     TASK BODY T7 IS
171
     BEGIN
172
          ACCEPT E7 (P7 : INTEGER := FUNC(10)) DO
173
               IF (P7 /= IDENT_INT(10)) THEN
174
                    FAILED ("INCORRECT DEFAULT VALUE FOR " &
175
                            "E7 PARAMETER");
176
               END IF;
177
          END E7;
178
     END T7;
179
 
180
     -- ALLOCATOR.
181
 
182
     TASK T8 IS
183
          ENTRY E8 (P8 : A_INT := NEW INTEGER'(7));
184
     END T8;
185
 
186
     TASK BODY T8 IS
187
     BEGIN
188
          ACCEPT E8 (P8 : A_INT := NEW INTEGER'(7)) DO
189
               IF (P8.ALL /= IDENT_INT(7)) THEN
190
                    FAILED ("INCORRECT DEFAULT VALUE " &
191
                            "FOR E8 PARAMETER");
192
               END IF;
193
          END E8;
194
     END T8;
195
 
196
BEGIN
197
     TEST ("C95066A", "CHECK USE OF STATIC EXPRESSIONS, CONSTANT " &
198
                      "NAMES, ATTRIBUTE NAMES, VARIABLES, USER- " &
199
                      "DEFINED OPERATORS, USER-DEFINED FUNCTIONS, " &
200
                      "DEREFERENCED ACCESSES, AND ALLOCATORS IN " &
201
                      "THE FORMAL PART OF A TASK SPECIFICATION");
202
 
203
     T1.E1;
204
     T2.E2;
205
     T3.E3;
206
     T4.E4;
207
     T5.E5;
208
     T6.E6;
209
     T7.E7;
210
     T8.E8;
211
 
212
     RESULT;
213
 
214
END C95066A;

powered by: WebSVN 2.1.0

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