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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c9/] [c93004c.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C93004C.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 DURING THE ACTIVATION OF A
26
-- TASK, OTHER TASKS ARE UNAFFECTED.
27
 
28
-- IF SEVERAL TASKS FAIL THEIR ACTIVATION, ONLY ONE TASKING_ERROR IS
29
-- RAISED.
30
 
31
-- THE ENCLOSING BLOCK RECEIVES TASKING_ERROR.
32
 
33
-- CHECK THAT TASKS WAITING ON ENTRIES OF SUCH TASKS RECEIVE
34
-- TASKING_ERROR
35
 
36
-- JEAN-PIERRE ROSEN 09-MAR-1984
37
-- JBG 06/01/84
38
-- JBG 05/23/85
39
-- EG  10/29/85  ELIMINATE THE USE OF NUMERIC_ERROR IN TEST.
40
-- PWN 11/30/94 REMOVED PRAGMA PRIORITY INSTANCES FOR ADA 9X.
41
 
42
WITH REPORT; USE REPORT;
43
WITH SYSTEM; USE SYSTEM;
44
PROCEDURE C93004C IS
45
 
46
BEGIN
47
     TEST("C93004C", "EXCEPTIONS DURING ACTIVATION");
48
 
49
     DECLARE
50
 
51
          TASK TYPE T1 IS
52
          END T1;
53
 
54
          TASK TYPE T2 IS
55
               ENTRY E;
56
          END T2;
57
 
58
          ARR_T2: ARRAY(INTEGER RANGE 1..4) OF T2;
59
 
60
          TYPE AT1 IS ACCESS T1;
61
 
62
          PACKAGE START_T1 IS      -- THIS PACKAGE TO AVOID ACCESS
63
          END START_T1;            -- BEFORE ELABORATION ON T1.
64
 
65
          TASK BODY T1 IS
66
          BEGIN
67
               DECLARE   -- THIS BLOCK TO CHECK THAT T1BIS TERMINATES.
68
                    TASK T1BIS IS
69
                    END T1BIS;
70
 
71
                    TASK BODY T1BIS IS
72
                    BEGIN
73
                         ARR_T2(IDENT_INT(2)).E;
74
                         FAILED ("RENDEZVOUS COMPLETED - T3");
75
                    EXCEPTION
76
                         WHEN TASKING_ERROR =>
77
                              NULL;
78
                         WHEN OTHERS =>
79
                              FAILED("ABNORMAL EXCEPTION - T3");
80
                    END T1BIS;
81
               BEGIN
82
                    NULL;
83
               END;
84
 
85
               ARR_T2(IDENT_INT(2)).E;   -- ARR_T2(2) IS NOW TERMINATED.
86
 
87
               FAILED ("RENDEZVOUS COMPLETED WITHOUT ERROR - T1");
88
 
89
          EXCEPTION
90
               WHEN TASKING_ERROR =>
91
                    NULL;
92
               WHEN OTHERS =>
93
                    FAILED("ABNORMAL EXCEPTION - T1");
94
          END;
95
 
96
          PACKAGE BODY START_T1 IS
97
               V_AT1 : AT1 := NEW T1;
98
          END START_T1;
99
 
100
          TASK BODY T2 IS
101
               I : POSITIVE := IDENT_INT(0); -- RAISE CONSTRAINT_ERROR.
102
          BEGIN
103
               IF I /= IDENT_INT(2) OR I = IDENT_INT(1) + 1 THEN
104
                    FAILED("T2 ACTIVATED OK");
105
               END IF;
106
          END T2;
107
 
108
          TASK T3 IS
109
               ENTRY E;
110
          END T3;
111
 
112
          TASK BODY T3 IS
113
          BEGIN     -- T3 MUST BE ACTIVATED OK.
114
               ACCEPT E;
115
          END T3;
116
 
117
     BEGIN
118
          FAILED ("TASKING_ERROR NOT RAISED IN MAIN");
119
          T3.E;          -- CLEAN UP.
120
     EXCEPTION
121
          WHEN TASKING_ERROR =>
122
               BEGIN
123
                    T3.E;
124
               EXCEPTION
125
                    WHEN TASKING_ERROR =>
126
                         FAILED ("T3 NOT ACTIVATED");
127
               END;
128
          WHEN CONSTRAINT_ERROR =>
129
               FAILED ("CONSTRAINT_ERROR RAISED IN MAIN");
130
          WHEN OTHERS =>
131
               FAILED ("ABNORMAL EXCEPTION IN MAIN-2");
132
     END;
133
 
134
     RESULT;
135
 
136
END C93004C;

powered by: WebSVN 2.1.0

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