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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C97115A.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 WHETHER AN ENTRY FAMILY INDEX EXPRESSION FOLLOWING AN OPEN
26
-- GUARD IS EVALUATED DIRECTLY AFTER THE GUARD, OR ONLY AFTER ALL GUARDS
27
-- HAVE BEEN EVALUATED, OR IN SOME MIXED ORDER SUCH THAT INDEX
28
-- EXPRESSIONS ARE EVALUATED AFTER THEIR GUARDS ARE DETERMINED TO BE
29
-- OPEN. 
30
 
31
-- RM 5/11/82
32
-- SPS 11/21/82
33
-- JBG 10/24/83
34
-- PWN 09/11/94  REMOVED PRAGMA PRIORITY FOR ADA 9X.
35
 
36
with Impdef;
37
WITH REPORT; USE REPORT;
38
WITH SYSTEM; USE SYSTEM;
39
PROCEDURE C97115A IS
40
 
41
 
42
     -- THE TASK WILL HAVE LAST PRIORITY ( PRIORITY'FIRST )
43
 
44
     EVAL_ORDER  :  STRING (1..6)       := ( 1..6 => '*' );
45
     EVAL_ORD    :  STRING (1..6)       := ( 1..6 => '*' );
46
     INDEX       :  INTEGER             := 0;
47
 
48
 
49
     FUNCTION F1 (X:INTEGER) RETURN INTEGER IS
50
     BEGIN
51
          INDEX := INDEX + 1;
52
          EVAL_ORDER (INDEX) := 'F';    -- 123: FGH
53
          EVAL_ORD   (INDEX) := 'G';    -- 123: GGG ( 'G' FOR 'GUARD' )
54
          RETURN ( IDENT_INT(7) );
55
     END F1;
56
 
57
 
58
     FUNCTION F2 (X:INTEGER) RETURN INTEGER IS
59
     BEGIN
60
          INDEX := INDEX + 1;
61
          EVAL_ORDER (INDEX) := 'G';
62
          EVAL_ORD   (INDEX) := 'G';
63
          RETURN ( IDENT_INT(7) );
64
     END F2;
65
 
66
 
67
     FUNCTION F3 (X:INTEGER) RETURN INTEGER IS
68
     BEGIN
69
          INDEX := INDEX + 1;
70
          EVAL_ORDER (INDEX) := 'H';
71
          EVAL_ORD   (INDEX) := 'G';
72
          RETURN ( IDENT_INT(7) );
73
     END F3;
74
 
75
 
76
     FUNCTION  I1 ( X:INTEGER )  RETURN BOOLEAN  IS
77
     BEGIN
78
          INDEX := INDEX + 1;
79
          EVAL_ORDER (INDEX) := 'A';  -- 123: ABC
80
          EVAL_ORD   (INDEX) := 'I';  -- 123: III ( 'I' FOR 'INDEX' )
81
          RETURN ( IDENT_BOOL(TRUE) );    -- (THAT'S ENTRY-FAMILY INDEX)
82
     END I1;
83
 
84
 
85
     FUNCTION  I2 ( X:INTEGER )  RETURN BOOLEAN  IS
86
     BEGIN
87
          INDEX := INDEX + 1;
88
          EVAL_ORDER (INDEX) := 'B';
89
          EVAL_ORD   (INDEX) := 'I';
90
          RETURN ( IDENT_BOOL(TRUE) );
91
     END I2;
92
 
93
 
94
     FUNCTION  I3 ( X:INTEGER )  RETURN BOOLEAN  IS
95
     BEGIN
96
          INDEX := INDEX + 1;
97
          EVAL_ORDER (INDEX) := 'C';
98
          EVAL_ORD   (INDEX) := 'I';
99
          RETURN ( IDENT_BOOL(TRUE) );
100
     END I3;
101
 
102
     FUNCTION POS_OF (FUNC : CHARACTER) RETURN INTEGER  IS
103
     BEGIN
104
          FOR I IN EVAL_ORDER'RANGE LOOP
105
               IF EVAL_ORDER(I) = FUNC THEN
106
                    RETURN I;
107
               END IF;
108
          END LOOP;
109
          FAILED ("DID NOT FIND LETTER " & FUNC);
110
          RETURN 0;
111
     END POS_OF;
112
 
113
 
114
BEGIN
115
 
116
 
117
     TEST ("C97115A", "CHECK THAT THE INDEX EXPRESSIONS ARE" &
118
                      " EVALUATED AFTER THE GUARDS BUT"      &
119
                      " BEFORE THE RENDEZVOUS IS ATTEMPTED"  );
120
 
121
 
122
     DECLARE
123
 
124
 
125
          TASK T IS
126
 
127
 
128
               ENTRY E ( BOOLEAN );
129
               ENTRY E1;
130
 
131
          END T;
132
 
133
 
134
          TASK BODY T IS
135
          BEGIN
136
 
137
 
138
               WHILE  E1'COUNT = 0  -- IF  E1  NOT YET CALLED, THEN GIVE
139
               LOOP                 --     THE MAIN TASK AN OPPORTUNITY
140
                    DELAY  10.01 * Impdef.One_Second;   --     TO ISSUE THE CALL.
141
               END LOOP;
142
 
143
 
144
               SELECT
145
 
146
                         ACCEPT  E1;
147
 
148
               OR
149
 
150
                    WHEN  6 + F1(7) = 13  =>
151
                         ACCEPT  E ( I1(17) );
152
 
153
               OR
154
 
155
                    WHEN  6 + F2(7) = 13  =>
156
                         ACCEPT  E ( I2(17) );
157
 
158
               OR
159
 
160
                    WHEN  6 + F3(7) = 13  =>
161
                         ACCEPT  E ( I3(17) );
162
 
163
               END SELECT;
164
 
165
 
166
          END T;
167
 
168
 
169
     BEGIN
170
 
171
          T.E1;
172
 
173
     END; -- END OF BLOCK CONTAINING THE ENTRY CALLS
174
 
175
 
176
     COMMENT ("GUARD AND INDEX FUNCTIONS WERE CALLED IN ORDER " &
177
               EVAL_ORDER);
178
     COMMENT ("GUARD AND INDEX EXPRESSIONS WERE EVALUATED IN THE " &
179
              "ORDER " & EVAL_ORD);
180
 
181
     IF POS_OF ('F') > POS_OF ('A') OR
182
        POS_OF ('G') > POS_OF ('B') OR
183
        POS_OF ('H') > POS_OF ('C') THEN
184
          FAILED ("AN INDEX EXPRESSION WAS EVALUATED TOO EARLY");
185
     END IF;
186
 
187
     RESULT;
188
 
189
END  C97115A;

powered by: WebSVN 2.1.0

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