OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c9/] [c9a010a.ada] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
-- C9A010A.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
-- ABORTING AN ABNORMAL (NOT YET TERMINATED) TASK.
28
 
29
-- JEAN-PIERRE ROSEN 09 MARCH 1984
30
-- JBG 6/1/84
31
-- JWC 6/28/85   RENAMED FROM C9A009E-B.ADA
32
-- PWN 01/31/95  REMOVED PRAGMA PRIORITY FOR ADA 9X.
33
 
34
WITH SYSTEM; USE SYSTEM;
35
WITH REPORT; USE REPORT;
36
PROCEDURE C9A010A IS
37
 
38
BEGIN
39
 
40
     TEST("C9A010A", "ABORTING AN ABNORMAL TASK");
41
 
42
     DECLARE
43
     -- T1 CALLS T2.  WHILE IN RENDEVOUS, T2 ABORTS T1 AND WAITS FOR A
44
     -- CALL FROM THE MAIN PROGRAM.  WHEN THE CALL IS ACCEPTED, THE MAIN
45
     -- PROGRAM AGAIN ABORTS T1, WHICH IS NOW ABNORMAL, SINCE T1 HAS NOT
46
     -- YET COMPLETED ITS RENDEVOUS WITH T2.
47
 
48
          TASK T1 IS
49
          END T1;
50
 
51
          TASK T2 IS
52
               ENTRY E1;
53
               ENTRY E2;
54
          END T2;
55
 
56
          TASK BODY T1 IS
57
          BEGIN
58
               T2.E1;
59
               FAILED("T1 NOT ABORTED");
60
          EXCEPTION
61
               WHEN TASKING_ERROR =>
62
                    FAILED ("TASKING_ERROR IN T1");
63
               WHEN OTHERS =>
64
                    FAILED ("OTHER EXCEPTION IN T1");
65
          END T1;
66
 
67
          TASK BODY T2 IS
68
          BEGIN
69
               ACCEPT E1 DO
70
                    ABORT  T1;
71
                    ACCEPT E2;     -- NOTE CALLER REMAINS IN RENDEVOUS
72
                    ACCEPT E2;     -- UNTIL TWO ENTRY CALLS ACCEPTED
73
               END E1;
74
          END T2;
75
     BEGIN
76
          T2.E2;    -- ONLY ACCEPTED AFTER T1 HAS BEEN ABORTED.
77
          ABORT T1; -- T1 IS ABNORMAL BECAUSE IT IS STILL IN RENDEVOUS.
78
          IF T1'CALLABLE THEN
79
               FAILED ("T1 CALLABLE AFTER BEING ABORTED");
80
          END IF;
81
          IF T1'TERMINATED THEN
82
               FAILED ("T1 TERMINATED ALTHOUGH IN RENDEVOUS");
83
          END IF;
84
          T2.E2; -- T1'S RENDEVOUS CAN NOW COMPLETE; T1 CAN TERMINATE.
85
     END;
86
 
87
     RESULT;
88
 
89
END C9A010A;

powered by: WebSVN 2.1.0

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