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/] [c9a009a.ada] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
-- C9A009A.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
-- TEST ABORT DURING RENDEZVOUS
26
 
27
-- CALLING TASK IN RENDEVOUS IS NAMED IN ABORT STATEMENT.
28
 
29
-- JEAN-PIERRE ROSEN 09 MARCH 1984
30
-- JBG 6/1/84
31
-- JWC 6/28/85   RENAMED FROM C9A009D-B.ADA
32
 
33
WITH SYSTEM; USE SYSTEM;
34
WITH REPORT; USE REPORT;
35
PROCEDURE C9A009A IS
36
 
37
BEGIN
38
 
39
     TEST("C9A009A", "CALLING TASK IS ABORTED DIRECTLY");
40
 
41
     DECLARE
42
     -- T1 CALLS T2, WHICH ABORTS T1 WHILE IN RENDEVOUS
43
 
44
          T2_CONTINUED : BOOLEAN := FALSE;
45
 
46
          TASK CONTINUED IS
47
               ENTRY GET (T2_CONTINUED : OUT BOOLEAN);
48
               ENTRY PUT (T2_CONTINUED : IN  BOOLEAN);
49
          END CONTINUED;
50
 
51
          TASK BODY CONTINUED IS
52
               CONTINUED : BOOLEAN := FALSE;
53
          BEGIN
54
               LOOP
55
                    SELECT
56
                         ACCEPT GET (T2_CONTINUED : OUT BOOLEAN) DO
57
                              T2_CONTINUED := CONTINUED;
58
                         END GET;
59
                    OR
60
                         ACCEPT PUT (T2_CONTINUED : IN BOOLEAN) DO
61
                              CONTINUED := T2_CONTINUED;
62
                         END PUT;
63
                    OR
64
                         TERMINATE;
65
                    END SELECT;
66
               END LOOP;
67
          END CONTINUED;
68
 
69
     BEGIN     -- THIS BLOCK WILL MAKE SURE T2 IS TERMINATED, AND SO,
70
               -- T2_CONTINUED IS ASSIGNED A VALUE IF T2 CONTINUES
71
               -- EXECUTION CORRECTLY.
72
 
73
          DECLARE
74
 
75
               TASK T1;
76
 
77
               TASK T2 IS
78
                    ENTRY E1;
79
               END T2;
80
 
81
               TASK BODY T1 IS
82
               BEGIN
83
                    T2.E1;
84
                    FAILED ("T1 NOT ABORTED");
85
               EXCEPTION
86
                    WHEN TASKING_ERROR =>
87
                         FAILED ("TASKING_ERROR RAISED IN T1");
88
                    WHEN OTHERS =>
89
                         FAILED ("OTHER EXCEPTION RAISED - T1");
90
               END T1;
91
 
92
               TASK BODY T2 IS
93
               BEGIN
94
                    ACCEPT E1 DO
95
                         ABORT T1;
96
                         ABORT T1;
97
                         ABORT T1; -- WHY NOT?
98
                         IF T1'TERMINATED THEN
99
                              FAILED ("T1 PREMATURELY TERMINATED");
100
                         END IF;
101
                    END E1;
102
                    CONTINUED.PUT (T2_CONTINUED => TRUE);
103
               END T2;
104
          BEGIN
105
               NULL;
106
          END;
107
     -- T2 NOW TERMINATED
108
          CONTINUED.GET (T2_CONTINUED);
109
          IF NOT T2_CONTINUED THEN
110
               FAILED ("WHEN CALLER WAS ABORTED IN RENDEVOUS, CALLED " &
111
                       "TASK DID NOT CONTINUE");
112
          END IF;
113
     END;
114
 
115
     RESULT;
116
 
117
END C9A009A;

powered by: WebSVN 2.1.0

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