Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c9 / c95009a.ada
blob30830e96c3480f86f8baf8e633e49766eb1a5d7f
1 -- C95009A.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 A TASK OBJECT CAN CALL ENTRIES OF OTHER TASKS.
27 -- THIS TEST CONTAINS SHARED VARIABLES.
29 -- JRK 11/5/81
30 -- JRK 8/3/84
32 WITH REPORT; USE REPORT;
33 PROCEDURE C95009A IS
35 V1 : INTEGER := 0;
36 V2 : INTEGER := 0;
38 PI : INTEGER := 0;
39 PO : INTEGER := 0;
41 BEGIN
42 TEST ("C95009A", "CHECK THAT A TASK OBJECT CAN CALL ENTRIES " &
43 "OF OTHER TASKS");
45 DECLARE
47 SUBTYPE INT IS INTEGER RANGE 1..5;
49 TASK T1 IS
50 ENTRY E1N;
51 ENTRY EF1P (INT) (I : OUT INTEGER);
52 END T1;
54 TASK TYPE T2T IS
55 ENTRY E2P (I : INTEGER);
56 ENTRY EF2N (INT);
57 END T2T;
59 TYPE AT2T IS ACCESS T2T;
60 AT2 : AT2T;
62 TASK BODY T1 IS
63 BEGIN
64 V1 := 1;
65 ACCEPT E1N;
66 V1 := 2;
67 AT2.E2P (1);
68 V1 := 3;
69 ACCEPT EF1P (2) (I : OUT INTEGER) DO
70 I := 2;
71 END EF1P;
72 V1 := 4;
73 AT2.EF2N (IDENT_INT(3));
74 V1 := 5;
75 END T1;
77 TASK BODY T2T IS
78 BEGIN
79 V2 := 1;
80 T1.E1N;
81 V2 := 2;
82 ACCEPT E2P (I : INTEGER) DO
83 PI := I;
84 END E2P;
85 V2 := 3;
86 T1.EF1P (2) (PO);
87 V2 := 4;
88 ACCEPT EF2N (1+IDENT_INT(2));
89 V2 := 5;
90 END T2T;
92 PACKAGE DUMMY IS
93 END DUMMY;
95 PACKAGE BODY DUMMY IS
96 BEGIN
97 AT2 := NEW T2T;
98 END DUMMY;
100 BEGIN
101 NULL;
102 END;
104 IF V1 /= 5 THEN
105 FAILED ("TASK T1 ONLY REACHED V1 = " & INTEGER'IMAGE(V1));
106 END IF;
108 IF V2 /= 5 THEN
109 FAILED ("TASK AT2 ONLY REACHED V2 = " & INTEGER'IMAGE(V2));
110 END IF;
112 IF PI /= 1 THEN
113 FAILED ("ENTRY IN PARAMETER NOT PASSED CORRECTLY");
114 END IF;
116 IF PO /= 2 THEN
117 FAILED ("ENTRY OUT PARAMETER NOT PASSED CORRECTLY");
118 END IF;
120 RESULT;
121 END C95009A;