OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c9/] [c95022a.ada] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
--C95022A.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 IT IS POSSIBLE TO ACCEPT AN ENTRY CALL FROM INSIDE THE
26
--THE BODY OF AN ACCEPT STATEMENT.
27
 
28
--CHECK THE CASE OF NORMAL ENTRY TERMINATION.
29
 
30
-- JEAN-PIERRE ROSEN 25-FEB-1984
31
-- JBG 6/1/84
32
 
33
-- FOUR CLIENT TASKS CALL ONE SERVER TASK.  EACH CLIENT CALLS JUST ONE
34
-- ENTRY OF THE SERVER TASK.  THE TEST CHECKS TO BE SURE THAT CALLS FROM
35
-- DIFFERENT TASKS ARE NOT MIXED UP.
36
 
37
WITH REPORT; USE REPORT;
38
PROCEDURE C95022A IS
39
 
40
BEGIN
41
     TEST("C95022A", "CHECK THAT EMBEDDED RENDEZVOUS ARE PROCESSED " &
42
                     "CORRECTLY");
43
     DECLARE
44
 
45
          TASK TYPE CLIENT IS
46
               ENTRY GET_ID (I : INTEGER);
47
               ENTRY RESTART;
48
          END CLIENT;
49
 
50
          T_ARR : ARRAY (1..4) OF CLIENT;
51
 
52
          TASK SERVER IS
53
               ENTRY E1 (I : IN OUT INTEGER);
54
               ENTRY E2 (I : IN OUT INTEGER);
55
               ENTRY E3 (I : IN OUT INTEGER);
56
               ENTRY E4 (I : IN OUT INTEGER);
57
          END SERVER;
58
 
59
          TASK BODY SERVER IS
60
          BEGIN
61
 
62
               ACCEPT E1 (I : IN OUT INTEGER) DO
63
                    ACCEPT E2 (I : IN OUT INTEGER) DO
64
                         I := IDENT_INT(I);
65
                         ACCEPT E3 (I : IN OUT INTEGER) DO
66
                              ACCEPT E4 (I : IN OUT INTEGER) DO
67
                                   I := IDENT_INT(I);
68
                              END E4;
69
                              I := IDENT_INT(I);
70
                         END E3;
71
                    END E2;
72
                    I := IDENT_INT(I);
73
               END E1;
74
 
75
               FOR I IN 1 .. 4 LOOP
76
                    T_ARR(I).RESTART;
77
               END LOOP;
78
          END SERVER;
79
 
80
          TASK BODY CLIENT IS
81
               ID      : INTEGER;
82
               SAVE_ID : INTEGER;
83
          BEGIN
84
               ACCEPT GET_ID (I : INTEGER) DO
85
                    ID := I;
86
               END GET_ID;
87
 
88
               SAVE_ID := ID;
89
 
90
               CASE ID IS
91
                    WHEN 1      => SERVER.E1(ID);
92
                    WHEN 2      => SERVER.E2(ID);
93
                    WHEN 3      => SERVER.E3(ID);
94
                    WHEN 4      => SERVER.E4(ID);
95
                    WHEN OTHERS => FAILED("INCORRECT ID");
96
               END CASE;
97
 
98
               ACCEPT RESTART;  -- WAIT FOR ALL TASKS TO HAVE COMPLETED
99
                                -- RENDEZVOUS
100
               IF ID /= SAVE_ID THEN
101
                    FAILED("SCRAMBLED EMBEDDED RENDEZVOUS");
102
               END IF;
103
          EXCEPTION
104
               WHEN OTHERS => FAILED("EXCEPTION IN CLIENT");
105
          END CLIENT;
106
 
107
     BEGIN
108
          FOR I IN 1 .. 4 LOOP
109
               T_ARR(I).GET_ID(I);
110
          END LOOP;
111
     END;
112
 
113
     RESULT;
114
 
115
END C95022A;

powered by: WebSVN 2.1.0

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