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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C97112A.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 DELAY STATEMENT IS ALLOWED IN THE SEQUENCE OF STATEMENTS
26
-- OF A SELECT ALTERNATIVE OF A SELECTIVE WAIT CONTAINING A TERMINATE
27
-- ALTERNATIVE OR AN ELSE PART.
28
 
29
-- WRG 7/9/86
30
 
31
with Impdef;
32
WITH REPORT;   USE REPORT;
33
WITH CALENDAR; USE CALENDAR;
34
PROCEDURE C97112A IS
35
 
36
     ACCEPT_ALTERNATIVE_TAKEN : BOOLEAN := FALSE;
37
 
38
BEGIN
39
 
40
     TEST ("C97112A", "CHECK THAT A DELAY STATEMENT IS ALLOWED IN " &
41
                      "THE SEQUENCE OF STATEMENTS OF A SELECT " &
42
                      "ALTERNATIVE OF A SELECTIVE WAIT CONTAINING A " &
43
                      "TERMINATE ALTERNATIVE OR AN ELSE PART");
44
 
45
     --------------------------------------------------
46
 
47
  A: DECLARE
48
 
49
          TASK T IS
50
               ENTRY E;
51
          END T;
52
 
53
          TASK BODY T IS
54
               BEFORE, AFTER : TIME;
55
          BEGIN
56
               SELECT
57
                    ACCEPT E;
58
                    ACCEPT_ALTERNATIVE_TAKEN := TRUE;
59
                    BEFORE := CLOCK;
60
                    DELAY 10.0 * Impdef.One_Second;
61
                    AFTER  := CLOCK;
62
                    IF AFTER - BEFORE < 10.0 * Impdef.One_Second THEN
63
                         FAILED ("INSUFFICIENT DELAY (A)");
64
                    END IF;
65
               OR
66
                    TERMINATE;
67
               END SELECT;
68
          END T;
69
 
70
     BEGIN
71
 
72
          T.E;
73
 
74
     END A;
75
 
76
     IF NOT ACCEPT_ALTERNATIVE_TAKEN THEN
77
          FAILED ("ACCEPT ALTERNATIVE NOT TAKEN");
78
     END IF;
79
 
80
     --------------------------------------------------
81
 
82
  B: DECLARE
83
 
84
          TASK T IS
85
               ENTRY E;
86
          END T;
87
 
88
          TASK BODY T IS
89
               BEFORE, AFTER : TIME;
90
          BEGIN
91
               --ENSURE THAT E HAS BEEN CALLED BEFORE PROCEEDING:
92
               WHILE E'COUNT = 0 LOOP
93
                    DELAY 1.0 * Impdef.One_Second;
94
               END LOOP;
95
 
96
               SELECT
97
                    ACCEPT E;
98
                    BEFORE := CLOCK;
99
                    DELAY 10.0 * Impdef.One_Second;
100
                    AFTER  := CLOCK;
101
                    IF AFTER - BEFORE < 10.0 * Impdef.One_Second THEN
102
                         FAILED ("INSUFFICIENT DELAY (B-1)");
103
                    END IF;
104
               ELSE
105
                    FAILED ("ELSE PART EXECUTED (B-1)");
106
               END SELECT;
107
 
108
               SELECT
109
                    ACCEPT E;
110
                    FAILED ("ACCEPT STATEMENT EXECUTED (B-2)");
111
               ELSE
112
                    BEFORE := CLOCK;
113
                    DELAY 10.0 * Impdef.One_Second;
114
                    AFTER  := CLOCK;
115
                    IF AFTER - BEFORE < 10.0 * Impdef.One_Second THEN
116
                         FAILED ("INSUFFICIENT DELAY (B-2)");
117
                    END IF;
118
               END SELECT;
119
          EXCEPTION
120
               WHEN OTHERS =>
121
                    FAILED ("EXCEPTION RAISED");
122
          END T;
123
 
124
     BEGIN
125
 
126
          T.E;
127
 
128
     END B;
129
 
130
     --------------------------------------------------
131
 
132
     RESULT;
133
 
134
END C97112A;

powered by: WebSVN 2.1.0

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