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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C93005A.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 WHEN AN EXCEPTION IS RAISED IN A DECLARATIVE PART, A TASK
26
-- DECLARED IN THE SAME DECLARATIVE PART BECOMES TERMINATED.
27
 
28
-- CHECK THAT A TASK WAITING ON ENTRIES OF SUCH A
29
-- TERMINATED-BEFORE-ACTIVATION TASK RECEIVES TASKING_ERROR.
30
 
31
-- JEAN-PIERRE ROSEN 3/9/84
32
-- JBG 06/01/84
33
-- JBG 05/23/85
34
-- EG  10/29/85  ELIMINATE THE USE OF NUMERIC_ERROR IN TEST.
35
-- PWN 01/31/95  REMOVED INCONSISTENCIES WITH ADA 9X.
36
 
37
WITH REPORT; USE REPORT;
38
WITH SYSTEM; USE SYSTEM;
39
PROCEDURE C93005A IS
40
 
41
BEGIN
42
     TEST("C93005A", "EXCEPTIONS RAISED IN A DECLARATIVE PART " &
43
                     "CONTAINING TASKS");
44
 
45
     BEGIN
46
 
47
          DECLARE
48
               TASK TYPE T1 IS     -- CHECKS THAT T2 TERMINATES.
49
               END T1;
50
 
51
               TYPE AT1 IS ACCESS T1;
52
 
53
               TASK T2 IS          -- WILL NEVER BE ACTIVATED.
54
                    ENTRY E;
55
               END T2;
56
 
57
               PACKAGE RAISE_IT IS
58
               END RAISE_IT;
59
 
60
               TASK BODY T2 IS
61
               BEGIN
62
                    FAILED ("T2 ACTIVATED");
63
                    -- IN CASE OF FAILURE
64
                    LOOP
65
                         SELECT
66
                              ACCEPT E;
67
                         OR
68
                              TERMINATE;
69
                         END SELECT;
70
                    END LOOP;
71
               END T2;
72
 
73
               TASK BODY T1 IS
74
               BEGIN
75
                    DECLARE  -- THIS BLOCK TO CHECK THAT T3 TERMINATES.
76
                         TASK T3 IS
77
                         END T3;
78
 
79
                         TASK BODY T3 IS
80
                         BEGIN
81
                              T2.E;
82
                              FAILED ("RENDEZVOUS COMPLETED WITHOUT " &
83
                                      "ERROR - T3");
84
                         EXCEPTION
85
                              WHEN TASKING_ERROR =>
86
                                   NULL;
87
                              WHEN OTHERS =>
88
                                   FAILED("ABNORMAL EXCEPTION - T3");
89
                         END T3;
90
                    BEGIN
91
                         NULL;
92
                    END;
93
 
94
                    T2.E;    --T2 IS NOW TERMINATED
95
 
96
                    FAILED ("RENDEZVOUS COMPLETED WITHOUT ERROR - T1");
97
 
98
               EXCEPTION
99
                    WHEN TASKING_ERROR =>
100
                         NULL;
101
                    WHEN OTHERS =>
102
                         FAILED("ABNORMAL EXCEPTION - T1");
103
               END;
104
 
105
               PACKAGE BODY RAISE_IT IS
106
                    PT1 : AT1 := NEW T1;
107
                    I   : POSITIVE := IDENT_INT(0); -- RAISE
108
                                                    -- CONSTRAINT_ERROR.
109
               BEGIN
110
                    IF I /= IDENT_INT(2) OR I = IDENT_INT(1) + 1 THEN
111
                         FAILED ("PACKAGE DIDN'T RAISE EXCEPTION");
112
                    END IF;
113
               END RAISE_IT;
114
 
115
          BEGIN     -- CAN'T LEAVE BLOCK UNTIL T1, T2, AND T3 ARE TERM.
116
               FAILED ("EXCEPTION NOT RAISED");
117
          END;
118
 
119
     EXCEPTION
120
          WHEN CONSTRAINT_ERROR =>
121
               NULL;
122
          WHEN TASKING_ERROR =>
123
               FAILED ("TASKING_ERROR IN MAIN PROGRAM");
124
          WHEN OTHERS =>
125
               FAILED ("ABNORMAL EXCEPTION IN MAIN-1");
126
     END;
127
 
128
     RESULT;
129
 
130
END C93005A;

powered by: WebSVN 2.1.0

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