OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C97302A.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 WHENEVER AN INDEX IS PRESENT IN A TIMED_ENTRY_CALL, IT
26
-- IS EVALUATED BEFORE ANY PARAMETER ASSOCIATIONS ARE EVALUATED, AND 
27
-- PARAMETER ASSOCIATIONS ARE EVALUATED BEFORE THE DELAY EXPRESSION.
28
-- THEN A RENDEZVOUS IS ATTEMPTED.
29
 
30
-- RJW 3/31/86
31
 
32
with Impdef;
33
WITH REPORT; USE REPORT;
34
WITH CALENDAR; USE CALENDAR;
35
PROCEDURE C97302A IS
36
 
37
     INDEX_COMPUTED  :  BOOLEAN  :=  FALSE;
38
     PARAM_COMPUTED  :  BOOLEAN  :=  FALSE;
39
     DELAY_COMPUTED  :  BOOLEAN  :=  FALSE;
40
BEGIN
41
 
42
     TEST ("C97302A", "CHECK THAT WHENEVER AN INDEX IS PRESENT IN " &
43
                      "A TIMED_ENTRY_CALL, IT IS EVALUATED BEFORE " &
44
                      "ANY PARAMETER ASSOCIATIONS ARE EVALUATED, " &
45
                      "AND PARAMETER ASSOCIATIONS ARE EVALUATED " &
46
                      "BEFORE THE DELAY EXPRESSION" );
47
     DECLARE
48
 
49
          WAIT_TIME : DURATION := 3.0 * Impdef.One_Second;
50
 
51
          TYPE SHORT IS RANGE 10 .. 20;
52
 
53
          TASK  T  IS
54
               ENTRY  DO_IT_NOW_OR_WAIT
55
                                      ( SHORT )
56
                                      ( DID_YOU_DO_IT : IN BOOLEAN );
57
               ENTRY  KEEP_ALIVE;
58
          END  T;
59
 
60
          TASK BODY  T  IS
61
          BEGIN
62
               ACCEPT  KEEP_ALIVE;
63
          END  T;
64
 
65
          FUNCTION  F1 (X : SHORT) RETURN SHORT IS
66
          BEGIN
67
               INDEX_COMPUTED  :=  TRUE;
68
               RETURN (15);
69
          END  F1;
70
 
71
          FUNCTION  F2 RETURN BOOLEAN  IS
72
          BEGIN
73
               IF INDEX_COMPUTED THEN
74
                    NULL;
75
               ELSE
76
                    FAILED ( "INDEX NOT EVALUATED FIRST" );
77
               END IF;
78
               PARAM_COMPUTED  :=  TRUE;
79
               RETURN (FALSE);
80
          END  F2;
81
 
82
          FUNCTION F3 RETURN DURATION IS
83
          BEGIN
84
               IF PARAM_COMPUTED THEN
85
                    NULL;
86
               ELSE
87
                    FAILED ( "PARAMETERS NOT EVALUATED BEFORE DELAY " &
88
                             "EXPRESSION" );
89
               END IF;
90
               DELAY_COMPUTED := TRUE;
91
               RETURN (WAIT_TIME);
92
          END;
93
     BEGIN
94
 
95
          SELECT
96
               T.DO_IT_NOW_OR_WAIT
97
                                      ( F1 (15) )
98
                                      ( NOT F2 );
99
               FAILED ("RENDEZVOUS OCCURRED");
100
          OR
101
               DELAY F3;
102
          END SELECT;
103
 
104
          T.KEEP_ALIVE;
105
 
106
     END;   -- END OF BLOCK CONTAINING THE ENTRY CALLS.
107
 
108
     IF  DELAY_COMPUTED  THEN
109
          NULL;
110
     ELSE
111
          FAILED( "DELAY EXPRESSION NOT EVALUATED" );
112
     END IF;
113
 
114
     RESULT;
115
 
116
END  C97302A;

powered by: WebSVN 2.1.0

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