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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C41306C.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 IF  F  IS A FUNCTION RETURNING AN ACCESS VALUE DESIGNATING
26
--     A TASK OF A TYPE HAVING
27
--     AN ENTRY  E ,  AN ENTRY CALL OF THE FORM
28
--
29
--                           F.E
30
--
31
--     IS PERMITTED.
32
 
33
 
34
-- RM  02/02/82
35
-- ABW 07/16/82
36
-- EG  05/28/85
37
 
38
WITH REPORT; USE REPORT;
39
 
40
PROCEDURE C41306C IS
41
 
42
BEGIN
43
 
44
     TEST ( "C41306C" , "CHECK THAT IF  F  IS A FUNCTION RETURNING" &
45
                        " AN ACCESS VALUE DESIGNATING"              &
46
                        " A TASK OF A TYPE HAVING AN ENTRY  E ,  AN" &
47
                        " ENTRY CALL OF THE FORM  F.E  IS PERMITTED" );
48
 
49
 
50
     -------------------------------------------------------------------
51
 
52
     DECLARE
53
 
54
          X  : INTEGER  :=  0 ;
55
 
56
          TASK TYPE  T  IS
57
               ENTRY  E ;
58
          END  T ;
59
 
60
          TYPE  A_T  IS  ACCESS T ;
61
 
62
          TASK BODY  T  IS
63
          BEGIN
64
               ACCEPT  E  DO
65
                    X := IDENT_INT(17) ;
66
               END  E ;
67
          END  T ;
68
 
69
          FUNCTION  F1  RETURN  A_T  IS
70
               A_T_VAR1 : A_T := NEW T ;
71
          BEGIN
72
               RETURN  A_T_VAR1 ;
73
          END  F1 ;
74
 
75
          FUNCTION F2 (A, B : BOOLEAN) RETURN A_T IS
76
               A_T_VAR2 : A_T := NEW T;
77
          BEGIN
78
               IF A AND B THEN
79
                    NULL;
80
               END IF;
81
               RETURN A_T_VAR2;
82
          END F2;
83
 
84
     BEGIN
85
 
86
          F1.E ;      --  THE ELABOR. OF  F1 (BODY)  ACTIVATES THE TASK,
87
                      --      WHICH  PROCEEDS TO WAIT FOR ENTRY  E  TO
88
                      --      BE CALLED.
89
 
90
                      --  THE CALLED ENTRY CAUSES  X  TO BE SET TO  17 .
91
 
92
          IF  X /= 17
93
          THEN
94
               FAILED( "WRONG VALUE FOR GLOBAL VARIABLE   (1)" );
95
          END IF;
96
 
97
          X := 0;
98
          F2(TRUE, TRUE).E;   -- THE ELABORATION OF F2 (BODY) ACTIVATES
99
                              -- THE TASK, WHICH PROCEEDS TO WAIT FOR
100
                              -- ENTRY E TO BE CALLED.
101
 
102
                              -- THE CALLED ENTRY CAUSES X TO BE SET TO
103
                              -- 17.
104
 
105
          IF X /= 17 THEN
106
               FAILED ("WRONG VALUE FOR GLOBAL VARIABLE (2)");
107
          END IF;
108
 
109
     END ;
110
 
111
     -------------------------------------------------------------------
112
 
113
     DECLARE
114
 
115
          X  : INTEGER  :=  0 ;
116
 
117
          TASK TYPE  T  IS
118
               ENTRY  E ;
119
          END  T ;
120
 
121
          TYPE  A_T  IS  ACCESS T ;
122
 
123
          TASK BODY  T  IS
124
          BEGIN
125
               ACCEPT  E  DO
126
                    X := IDENT_INT(17) ;
127
               END  E ;
128
          END  T ;
129
 
130
          FUNCTION  F3  RETURN  A_T  IS
131
          BEGIN
132
               RETURN  NEW T ;
133
          END  F3;
134
 
135
          FUNCTION F4 (C, D : BOOLEAN) RETURN A_T IS
136
          BEGIN
137
               IF C AND D THEN
138
                    NULL;
139
               END IF;
140
               RETURN NEW T;
141
          END F4;
142
 
143
     BEGIN
144
 
145
          F3.E ;      --  THE ELABOR. OF  F3 (BODY)  ACTIVATES THE TASK,
146
                      --      WHICH  PROCEEDS TO WAIT FOR ENTRY  E  TO
147
                      --      BE CALLED.
148
 
149
                      --  THE CALLED ENTRY CAUSES  X  TO BE SET TO  17 .
150
 
151
          IF  X /= 17
152
          THEN
153
               FAILED( "WRONG VALUE FOR GLOBAL VARIABLE   (3)" );
154
          END IF;
155
 
156
          X := 0;
157
          F4(TRUE, TRUE).E;   -- THE ELABORATION OF F4 (BODY) ACTIVATES
158
                              -- THE TASK WHICH PROCEEDS TO WAIT FOR
159
                              -- ENTRY E TO BE CALLED.
160
 
161
                              -- THE CALLED ENTRY CAUSES X TO BE SET TO
162
                              -- 17.
163
 
164
          IF X /= 17 THEN
165
               FAILED ("WRONG VALUE FOR GLOBAL VARIABLE (4)");
166
          END IF;
167
 
168
     END ;
169
 
170
     -------------------------------------------------------------------
171
 
172
     DECLARE
173
 
174
          X  : INTEGER  :=  0 ;
175
 
176
          TASK TYPE  T  IS
177
               ENTRY  E ;
178
          END  T ;
179
 
180
          TYPE  A_T  IS  ACCESS T ;
181
 
182
          TASK BODY  T  IS
183
          BEGIN
184
               ACCEPT  E  DO
185
                    X := IDENT_INT(17) ;
186
               END  E ;
187
          END  T ;
188
 
189
     BEGIN
190
 
191
          DECLARE
192
 
193
               F3 : A_T := NEW T;
194
 
195
          BEGIN
196
 
197
               F3.E;
198
 
199
                      --  THE CALLED ENTRY CAUSES  X  TO BE SET TO  17 .
200
 
201
               IF  X /= 17 THEN
202
                    FAILED( "WRONG VALUE FOR GLOBAL VARIABLE   (5)" );
203
               END IF;
204
 
205
          END;
206
 
207
     END ;
208
 
209
     -------------------------------------------------------------------
210
 
211
 
212
     RESULT;
213
 
214
 
215
END C41306C;

powered by: WebSVN 2.1.0

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