2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / ada / acats / tests / c4 / c41306a.ada
blob2521d7bd44e1fbba93140df3755809238699f3ed
1 -- C41306A.ADA
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.
16 -- DISCLAIMER
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 A TASK OF A TYPE HAVING
26 -- AN ENTRY E , AN ENTRY CALL OF THE FORM
28 -- F.E
30 -- IS PERMITTED.
33 -- RM 2/2/82
34 -- ABW 7/16/82
36 WITH REPORT;
37 USE REPORT;
38 PROCEDURE C41306A IS
41 BEGIN
43 TEST ( "C41306A" , "CHECK THAT IF F IS A FUNCTION RETURNING" &
44 " A TASK OF A TYPE HAVING AN ENTRY E , AN" &
45 " ENTRY CALL OF THE FORM F.E IS PERMITTED");
48 -------------------------------------------------------------------
50 DECLARE
52 X : INTEGER := 0 ;
54 TASK TYPE T IS
55 ENTRY E ;
56 END T ;
58 T1 : T ;
60 TASK BODY T IS
61 BEGIN
62 ACCEPT E DO
63 X := IDENT_INT(17) ;
64 END E ;
65 ACCEPT E DO
66 X := IDENT_INT(16) ;
67 END E ;
68 END T ;
70 FUNCTION F1 RETURN T IS
71 BEGIN
72 RETURN T1 ;
73 END F1 ;
75 FUNCTION F2 (A,B : BOOLEAN) RETURN T IS
76 BEGIN
77 IF A AND B THEN NULL; END IF;
78 RETURN T1;
79 END F2;
81 BEGIN
83 F1.E ; -- X SET TO 17.
85 IF X /= 17 THEN
86 FAILED("WRONG VALUE FOR GLOBAL VARIABLE - 1");
87 END IF;
89 X := 0;
90 F2(TRUE,TRUE).E; -- X SET TO 16.
91 -- X TO BE SET TO 16.
93 IF X /= 16 THEN
94 FAILED("WRONG VALUE FOR GLOBAL VARIABLE - 2");
95 END IF;
97 END ;
99 -------------------------------------------------------------------
101 RESULT;
104 END C41306A;