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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C95012A.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 A CALL TO AN ENTRY OF A TASK THAT HAS NOT BEEN ACTIVATED
26
--   DOES NOT RAISE EXCEPTIONS.
27
 
28
-- THIS TEST CONTAINS RACE CONDITIONS.
29
 
30
-- JRK 11/6/81
31
-- SPS 11/21/82
32
-- PWN 01/31/95  REMOVED PRAGMA PRIORITY FOR ADA 9X.
33
 
34
with Impdef;
35
WITH REPORT; USE REPORT;
36
WITH SYSTEM; USE SYSTEM;
37
PROCEDURE C95012A IS
38
 
39
     I : INTEGER := 0;
40
 
41
 
42
BEGIN
43
     TEST ("C95012A", "CHECK THAT A CALL TO AN ENTRY OF A TASK " &
44
                      "THAT HAS NOT BEEN ACTIVATED DOES NOT " &
45
                      "RAISE EXCEPTIONS");
46
 
47
     DECLARE
48
 
49
          TASK T1 IS
50
               ENTRY E1 (I : OUT INTEGER);
51
          END T1;
52
 
53
          TASK TYPE T2T IS
54
               ENTRY E2 (I : OUT INTEGER);
55
          END T2T;
56
 
57
          TYPE AT2T IS ACCESS T2T;
58
          AT2 : AT2T;
59
 
60
          TASK BODY T1 IS
61
          BEGIN
62
               ACCEPT E1 (I : OUT INTEGER) DO
63
                    I := IDENT_INT (1);
64
               END E1;
65
          END T1;
66
 
67
          TASK BODY T2T IS
68
               J : INTEGER := 0;
69
          BEGIN
70
               BEGIN
71
                    T1.E1 (J);
72
               EXCEPTION
73
                    WHEN OTHERS =>
74
                         J := -1;
75
               END;
76
               ACCEPT E2 (I : OUT INTEGER) DO
77
                    I := J;
78
               END E2;
79
          END T2T;
80
 
81
          PACKAGE PKG IS
82
          END PKG;
83
 
84
          PACKAGE BODY PKG IS
85
          BEGIN
86
               AT2 := NEW T2T;
87
               DELAY 60.0 * Impdef.One_Second;
88
          END PKG;
89
 
90
     BEGIN
91
 
92
          AT2.ALL.E2 (I);
93
 
94
          IF I = -1 THEN
95
               FAILED ("EXCEPTION RAISED");
96
               T1.E1 (I);
97
          END IF;
98
 
99
          IF I /= 1 THEN
100
               FAILED ("WRONG VALUE PASSED");
101
          END IF;
102
 
103
     END;
104
 
105
     RESULT;
106
END C95012A;

powered by: WebSVN 2.1.0

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