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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c7/] [c74401k.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- C74401K.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 OUT PARAMETERS OF AN ENTRY DECLARATION CAN HAVE A LIMITED
26
-- PRIVATE TYPE IF THE ENTRY DECLARATION OCCURS IN THE VISIBLE PART OF A
27
-- PACKAGE SPECIFICATION, INCLUDING WITHIN PACKAGES NESTED IN A VISIBLE
28
-- PART.
29
 
30
-- CHECK THAT A RENAMING DECLARATION CAN RENAME AN ENTRY DECLARED
31
-- WITH AN OUT PARAMETER.
32
 
33
-- JBG 5/1/85
34
 
35
WITH REPORT; USE REPORT;
36
PROCEDURE C74401K IS
37
 
38
     PACKAGE PKG IS
39
          TYPE LP IS LIMITED PRIVATE;
40
          TASK P20 IS
41
               ENTRY TP20 (X : OUT LP);        -- OK.
42
               ENTRY RESET (X : OUT LP);
43
          END P20;
44
          FUNCTION EQ (L, R : LP) RETURN BOOLEAN;
45
          VAL1 : CONSTANT LP;
46
 
47
          PACKAGE NESTED IS
48
               TASK NEST1 IS
49
                    ENTRY TNEST1 (X : OUT LP);
50
               END NEST1;
51
          PRIVATE
52
               TASK NEST2 IS
53
                    ENTRY TNEST2 (X : OUT LP);
54
               END NEST2;
55
          END NESTED;
56
     PRIVATE
57
          TYPE LP IS NEW INTEGER;
58
          VAL1 : CONSTANT LP := LP(IDENT_INT(3));
59
     END PKG;
60
 
61
     VAR : PKG.LP;
62
 
63
     PACKAGE BODY PKG IS
64
          TASK BODY P20 IS
65
          BEGIN
66
               LOOP
67
                    SELECT
68
                         ACCEPT TP20 (X : OUT LP) DO
69
                              X := 3;
70
                         END TP20;
71
                    OR
72
                         ACCEPT RESET (X : OUT LP) DO
73
                              X := 0;
74
                         END RESET;
75
                    OR
76
                         TERMINATE;
77
                    END SELECT;
78
               END LOOP;
79
          END P20;
80
 
81
          FUNCTION EQ (L, R : LP) RETURN BOOLEAN IS
82
          BEGIN
83
               RETURN L = R;
84
          END EQ;
85
 
86
          PACKAGE BODY NESTED IS
87
               TASK BODY NEST1 IS
88
               BEGIN
89
                    ACCEPT TNEST1 (X : OUT LP) DO
90
                         X := 3;
91
                    END TNEST1;
92
               END NEST1;
93
 
94
               TASK BODY NEST2 IS
95
               BEGIN
96
                    NULL;
97
               END NEST2;
98
          END NESTED;
99
     BEGIN
100
          VAR := LP(IDENT_INT(0));
101
     END PKG;
102
 
103
     PACKAGE PKG1 IS
104
          PROCEDURE P21 (X : OUT PKG.LP) RENAMES PKG.P20.TP20;   -- OK:
105
                                                            -- RENAMING.
106
     END PKG1;
107
 
108
BEGIN
109
 
110
     TEST ("C74401K", "CHECK THAT A PROCEDURE CAN HAVE AN OUT " &
111
                      "PARAMETER WITH A LIMITED PRIVATE TYPE");
112
 
113
     PKG.P20.RESET (VAR);
114
     PKG.P20.TP20 (VAR);
115
 
116
     IF NOT PKG.EQ (VAR, PKG.VAL1) THEN
117
          FAILED ("DIRECT CALL NOT CORRECT");
118
     END IF;
119
 
120
     PKG.P20.RESET (VAR);
121
     PKG1.P21 (VAR);
122
 
123
     IF NOT PKG.EQ (VAR, PKG.VAL1) THEN
124
          FAILED ("RENAMED CALL NOT CORRECT");
125
     END IF;
126
 
127
     PKG.P20.RESET (VAR);
128
     PKG.NESTED.NEST1.TNEST1 (VAR);
129
 
130
     IF NOT PKG.EQ (VAR, PKG.VAL1) THEN
131
          FAILED ("NESTED CALL NOT CORRECT");
132
     END IF;
133
 
134
     RESULT;
135
 
136
END C74401K;

powered by: WebSVN 2.1.0

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