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

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

Line No. Rev Author Line
1 149 jeremybenn
-- C93002A.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 DECLARED TASK OBJECTS ARE ACTIVATED BEFORE EXECUTION
26
--   OF THE FIRST STATEMENT FOLLOWING THE DECLARATIVE PART.
27
-- SUBTESTS ARE:
28
--   (A)  A SIMPLE TASK OBJECT, IN A BLOCK.
29
--   (B)  AN ARRAY OF TASK OBJECT, IN A FUNCTION.
30
--   (C)  A RECORD OF TASK OBJECT, IN A PACKAGE SPECIFICATION.
31
--   (D)  A RECORD OF ARRAY OF TASK OBJECT, IN A PACKAGE BODY.
32
--   (E)  AN ARRAY OF RECORD OF TASK OBJECT, IN A TASK BODY.
33
 
34
-- JRK 9/28/81
35
-- SPS 11/1/82
36
-- SPS 11/21/82
37
-- PWN 11/30/94 REMOVED PRAGMA PRIORITY INSTANCES FOR ADA 9X.
38
 
39
WITH REPORT; USE REPORT;
40
WITH SYSTEM; USE SYSTEM;
41
PROCEDURE C93002A IS
42
 
43
     GLOBAL : INTEGER;
44
 
45
     FUNCTION SIDE_EFFECT (I : INTEGER) RETURN INTEGER IS
46
     BEGIN
47
          GLOBAL := IDENT_INT (I);
48
          RETURN 0;
49
     END SIDE_EFFECT;
50
 
51
     TASK TYPE TT IS
52
          ENTRY E;
53
     END TT;
54
 
55
     TASK BODY TT IS
56
          I : INTEGER := SIDE_EFFECT (1);
57
     BEGIN
58
          NULL;
59
     END TT;
60
 
61
 
62
BEGIN
63
     TEST ("C93002A", "CHECK THAT DECLARED TASK OBJECTS ARE " &
64
                      "ACTIVATED BEFORE EXECUTION OF THE FIRST " &
65
                      "STATEMENT FOLLOWING THE DECLARATIVE PART");
66
 
67
     --------------------------------------------------
68
 
69
     GLOBAL := IDENT_INT (0);
70
 
71
     DECLARE -- (A)
72
 
73
          T : TT;
74
 
75
     BEGIN -- (A)
76
 
77
          IF GLOBAL /= 1 THEN
78
               FAILED ("A SIMPLE TASK OBJECT IN A BLOCK WAS " &
79
                       "ACTIVATED TOO LATE - (A)");
80
          END IF;
81
 
82
     END; -- (A)
83
 
84
     --------------------------------------------------
85
 
86
     GLOBAL := IDENT_INT (0);
87
 
88
     DECLARE -- (B)
89
 
90
          J : INTEGER;
91
 
92
          FUNCTION F RETURN INTEGER IS
93
               A : ARRAY (1..1) OF TT;
94
          BEGIN
95
               IF GLOBAL /= 1 THEN
96
                    FAILED ("AN ARRAY OF TASK OBJECT IN A FUNCTION " &
97
                            "WAS ACTIVATED TOO LATE - (B)");
98
               END IF;
99
               RETURN 0;
100
          END F;
101
 
102
     BEGIN -- (B)
103
 
104
          J := F ;
105
 
106
     END; -- (B)
107
 
108
     --------------------------------------------------
109
 
110
     GLOBAL := IDENT_INT (0);
111
 
112
     DECLARE -- (C1)
113
 
114
          PACKAGE P IS
115
               TYPE ARR IS ARRAY (1..1) OF TT;
116
               TYPE RT IS
117
                    RECORD
118
                         A : ARR;
119
                    END RECORD;
120
               R : RT;
121
          END P;
122
 
123
          PACKAGE BODY P IS
124
          BEGIN
125
               IF GLOBAL /= 1 THEN
126
                    FAILED ("A RECORD OF TASK OBJECT IN A PACKAGE " &
127
                            "SPECIFICATION WAS ACTIVATED TOO LATE " &
128
                            "- (C1)");
129
               END IF;
130
          END P;
131
 
132
     BEGIN -- (C1)
133
 
134
          NULL;
135
 
136
     END; -- (C1)
137
 
138
     --------------------------------------------------
139
 
140
     GLOBAL := IDENT_INT (0);
141
 
142
     DECLARE -- (C2)
143
 
144
          PACKAGE Q IS
145
               J : INTEGER;
146
          PRIVATE
147
               TYPE RT IS
148
                    RECORD
149
                         T : TT;
150
                    END RECORD;
151
               R : RT;
152
          END Q;
153
 
154
          PACKAGE BODY Q IS
155
          BEGIN
156
               IF GLOBAL /= 1 THEN
157
                    FAILED ("A RECORD OF TASK OBJECT IN A PACKAGE " &
158
                            "SPECIFICATION WAS ACTIVATED TOO LATE " &
159
                            "- (C2)");
160
               END IF;
161
          END Q;
162
 
163
     BEGIN -- (C2)
164
 
165
          NULL;
166
 
167
     END; -- (C2)
168
 
169
     --------------------------------------------------
170
 
171
     GLOBAL := IDENT_INT (0);
172
 
173
     DECLARE -- (D)
174
 
175
          PACKAGE P IS
176
               TYPE ARR IS ARRAY (1..1) OF TT;
177
               TYPE RAT IS
178
                    RECORD
179
                         A : ARR;
180
                    END RECORD;
181
          END P;
182
 
183
          PACKAGE BODY P IS
184
               RA : RAT;
185
          BEGIN
186
               IF GLOBAL /= 1 THEN
187
                    FAILED ("A RECORD OF ARRAY OF TASK OBJECT IN A " &
188
                            "PACKAGE BODY WAS ACTIVATED " &
189
                            "TOO LATE - (D)");
190
               END IF;
191
          END P;
192
 
193
     BEGIN -- (D)
194
 
195
          NULL;
196
 
197
     END; -- (D)
198
 
199
     --------------------------------------------------
200
 
201
     GLOBAL := IDENT_INT (0);
202
 
203
     DECLARE -- (E)
204
 
205
          TASK T IS
206
               ENTRY E;
207
          END T;
208
 
209
          TASK BODY T IS
210
               TYPE RT IS
211
                    RECORD
212
                         T : TT;
213
                    END RECORD;
214
               AR : ARRAY (1..1) OF RT;
215
          BEGIN
216
               IF GLOBAL /= 1 THEN
217
                    FAILED ("AN ARRAY OF RECORD OF TASK OBJECT IN A " &
218
                            "TASK BODY WAS ACTIVATED TOO LATE - (E)");
219
               END IF;
220
          END T;
221
 
222
     BEGIN -- (E)
223
 
224
          NULL;
225
 
226
     END; -- (E)
227
 
228
     --------------------------------------------------
229
 
230
     RESULT;
231
END C93002A;

powered by: WebSVN 2.1.0

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