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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C97116A.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
-- OBJECTIVE:
26
--     CHECK THAT THE GUARD CONDITIONS IN A SELECTIVE WAIT STATEMENT
27
--     ARE NOT RE-EVALUATED DURING THE WAIT.
28
 
29
-- HISTORY:
30
--     WRG 7/10/86  CREATED ORIGINAL TEST.
31
--     RJW 5/15/90  REMOVED SHARED VARIABLES.
32
 
33
with Impdef;
34
WITH REPORT; USE REPORT;
35
PROCEDURE C97116A IS
36
 
37
     GUARD_EVALUATIONS : NATURAL := 0;
38
 
39
     FUNCTION GUARD RETURN BOOLEAN IS
40
     BEGIN
41
          GUARD_EVALUATIONS := GUARD_EVALUATIONS + 1;
42
          RETURN FALSE;
43
     END GUARD;
44
 
45
     FUNCTION SO_LONG RETURN DURATION IS
46
     BEGIN
47
          RETURN 20.0;
48
     END SO_LONG;
49
 
50
BEGIN
51
 
52
     TEST ("C97116A", "CHECK THAT THE GUARD CONDITIONS IN A " &
53
                      "SELECTIVE WAIT STATEMENT ARE NOT RE-EVALUATED " &
54
                      "DURING THE WAIT");
55
 
56
     DECLARE
57
 
58
          TASK T IS
59
               ENTRY E;
60
          END T;
61
 
62
          TASK BODY T IS
63
          BEGIN
64
               SELECT
65
                    ACCEPT E;
66
                    FAILED ("ACCEPTED NONEXISTENT CALL TO E");
67
               OR WHEN GUARD     =>
68
                    DELAY 0.0;
69
                    FAILED ("EXECUTED ALTERNATIVE CLOSED BY FALSE " &
70
                            "GUARD FUNCTION" );
71
               OR
72
                    DELAY SO_LONG * Impdef.One_Second;
73
               END SELECT;
74
          EXCEPTION
75
               WHEN OTHERS =>
76
                    FAILED ("EXCEPTION RAISED");
77
          END T;
78
 
79
          TASK GET_CPU;
80
 
81
          TASK BODY GET_CPU IS
82
          BEGIN
83
               WHILE NOT T'TERMINATED LOOP
84
                    DELAY 1.0 * Impdef.One_Second;
85
               END LOOP;
86
 
87
          END GET_CPU;
88
 
89
     BEGIN
90
 
91
          NULL;
92
 
93
     END;
94
 
95
     IF GUARD_EVALUATIONS /= 1 THEN
96
          FAILED ("GUARD EVALUATED" &
97
                  NATURAL'IMAGE(GUARD_EVALUATIONS) & " TIMES");
98
     END IF;
99
 
100
     RESULT;
101
 
102
END C97116A;

powered by: WebSVN 2.1.0

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