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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C99004A.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 PREFIX OF 'TERMINATED AND 'CALLABLE CAN BE A
27
--     FUNCTION CALL RETURNING AN OBJECT HAVING A TASK TYPE.
28
 
29
--     NOTE: SEE TEST C38202A FOR CHECKS INVOLVING PREFIXES WHICH ARE
30
--     ACCESS TYPES DENOTING TASK TYPES OR WHICH ARE FUNCTIONS
31
--     RETURNING ACCESS TYPES DENOTING TASK TYPES.
32
 
33
-- HISTORY:
34
--     RJW 09/16/86 CREATED ORIGINAL TEST.
35
--     DHH 10/15/87 CORRECTED HEADER COMMENTS.
36
 
37
with Impdef;
38
WITH REPORT; USE REPORT;
39
PROCEDURE C99004A IS
40
 
41
     TYPE ENUM IS (A, B, C, D);
42
 
43
     EARRAY : ARRAY (ENUM) OF STRING (1 .. 17) :=
44
                                        (A => "BEFORE ACTIVATION",
45
                                         B => "DURING ACTIVATION",
46
                                         C => "DURING EXECUTION ",
47
                                         D => "AFTER TERMINATION" );
48
 
49
     FUNCTION CHECK (S : STRING; CALL, B1, TERM, B2 : BOOLEAN;
50
                     E : ENUM) RETURN BOOLEAN IS
51
     BEGIN
52
          IF CALL /= B1 THEN
53
               FAILED ( "INCORRECT VALUE FOR " & S & "'CALLABLE " &
54
                         EARRAY (E) & " OF TASK" );
55
          END IF;
56
 
57
          IF TERM /= B2 THEN
58
               FAILED ( "INCORRECT VALUE FOR " & S & "'TERMINATED " &
59
                         EARRAY (E) & " OF TASK" );
60
          END IF;
61
 
62
          RETURN IDENT_BOOL (TRUE);
63
     END CHECK;
64
 
65
 
66
BEGIN
67
     TEST ( "C99004A", "CHECK THAT THE PREFIX OF 'TERMINATED AND " &
68
                       "'CALLABLE CAN BE A FUNCTION CALL RETURNING " &
69
                       "AN OBJECT HAVING A TASK TYPE" );
70
 
71
     DECLARE
72
 
73
          TASK TYPE TT IS
74
               ENTRY E;
75
          END TT;
76
 
77
          PACKAGE PKG1 IS
78
               T1 : TT;
79
          END PKG1;
80
 
81
          FUNCTION F RETURN TT IS
82
          BEGIN
83
               RETURN PKG1.T1;
84
          END F;
85
 
86
          PACKAGE PKG2 IS
87
               A1 : BOOLEAN := CHECK ("F", F'CALLABLE, TRUE,
88
                                      F'TERMINATED, FALSE, A);
89
          END PKG2;
90
 
91
          TASK MAIN_TASK IS
92
               ENTRY E (INTEGER RANGE 1 .. 2);
93
          END MAIN_TASK;
94
 
95
          TASK BODY TT IS
96
               B1 : BOOLEAN := CHECK ("F", F'CALLABLE, TRUE,
97
                                      F'TERMINATED, FALSE, B);
98
               C1 : BOOLEAN;
99
          BEGIN
100
               C1 := CHECK ("F", F'CALLABLE, TRUE,
101
                            F'TERMINATED, FALSE, C);
102
               MAIN_TASK.E (1);
103
               MAIN_TASK.E (2);
104
          END TT;
105
 
106
          PACKAGE BODY PKG1 IS
107
          BEGIN
108
               NULL;
109
          END;
110
 
111
          TASK BODY MAIN_TASK IS
112
               D1 : BOOLEAN;
113
          BEGIN
114
               ACCEPT E (1);
115
               ABORT PKG1.T1;
116
               DELAY 5.0 * Impdef.One_Long_Second;
117
               D1 := CHECK ("F", F'CALLABLE, FALSE,
118
                             F'TERMINATED, TRUE, D);
119
          END MAIN_TASK;
120
 
121
     BEGIN
122
          NULL;
123
     END;
124
 
125
     DECLARE
126
 
127
          TASK TYPE TT IS
128
               ENTRY E;
129
          END TT;
130
 
131
          T2 : TT;
132
 
133
          A2 : BOOLEAN := CHECK ("T2", T2'CALLABLE, TRUE,
134
                                  T2'TERMINATED, FALSE, A);
135
 
136
          TASK MAIN_TASK IS
137
               ENTRY E (INTEGER RANGE 1 .. 2);
138
          END MAIN_TASK;
139
 
140
          TASK BODY TT IS
141
               B2 : BOOLEAN := CHECK ("T2", T2'CALLABLE, TRUE,
142
                                       T2'TERMINATED, FALSE, B);
143
               C2 : BOOLEAN;
144
          BEGIN
145
               C2 := CHECK ("T2", T2'CALLABLE, TRUE,
146
                             T2'TERMINATED, FALSE, C);
147
               MAIN_TASK.E (1);
148
               MAIN_TASK.E (2);
149
          END TT;
150
 
151
          TASK BODY MAIN_TASK IS
152
               D2 : BOOLEAN;
153
          BEGIN
154
               ACCEPT E (1);
155
               ABORT T2;
156
               DELAY 5.0 * Impdef.One_Long_Second;
157
               D2 := CHECK ("T2", T2'CALLABLE, FALSE,
158
                             T2'TERMINATED, TRUE, D);
159
          END MAIN_TASK;
160
 
161
     BEGIN
162
          NULL;
163
     END;
164
 
165
     RESULT;
166
END C99004A;

powered by: WebSVN 2.1.0

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