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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cc/] [cc3207b.ada] - Blame information for rev 309

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CC3207B.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 INSTANTIATION IS LEGAL IF A FORMAL
27
--     PARAMETER HAVING A LIMITED PRIVATE TYPE WITHOUT
28
--     A DISCRIMINANT IS USED TO DECLARE AN ACCESS
29
--     TYPE IN A BLOCK THAT CONTAINS A SELECTIVE WAIT
30
--     WITH A TERMINATE ALTERNATIVE, AND ACTUAL
31
--     PARAMETER'S BASE IS A TASK TYPE OR TYPE WITH A
32
--     SUBCOMPONENT OF A TASK TYPE.
33
 
34
-- HISTORY:
35
--     LDC  06/24/88  CREATED ORIGINAL TEST.
36
 
37
WITH REPORT;
38
USE REPORT;
39
 
40
PROCEDURE CC3207B IS
41
BEGIN
42
     TEST("CC3207B","CHECK THAT INSTANTIATION IS LEGAL IF A "     &
43
                    "FORMAL PARAMETER HAVING A LIMITED PRIVATE "  &
44
                    "TYPE WITHOUT A DISCRIMINANT IS USED TO "     &
45
                    "DECLARE AN ACCESS TYPE IN A BLOCK THAT "     &
46
                    "CONTAINS A SELECTIVE WAIT WITH A TERMINATE " &
47
                    "ALTERNATIVE, AND ACTUAL PARAMETER'S BASE "   &
48
                    "A TASK TYPE OR TYPE WITH A SUBCOMPONENT OF " &
49
                    "A TASK TYPE. ");
50
 
51
     DECLARE
52
          TASK TYPE TT IS
53
               ENTRY E;
54
          END TT;
55
 
56
          TYPE TT_ARR IS ARRAY (1..2) OF TT;
57
 
58
          TYPE TT_REC IS RECORD
59
               COMP : TT_ARR;
60
          END RECORD;
61
 
62
          GENERIC
63
               TYPE T IS LIMITED PRIVATE;
64
          PACKAGE GEN IS
65
               TASK TSK IS
66
                    ENTRY ENT(A : OUT INTEGER);
67
               END TSK;
68
          END GEN;
69
 
70
          INT : INTEGER;
71
 
72
          TASK BODY TT IS
73
          BEGIN
74
               SELECT
75
                    ACCEPT E;
76
               OR
77
                    TERMINATE;
78
               END SELECT;
79
          END TT;
80
 
81
          PACKAGE BODY GEN IS
82
               TASK BODY TSK IS
83
               BEGIN
84
                    DECLARE
85
                         TYPE ACC_T IS ACCESS T;
86
                         TA : ACC_T := NEW T;
87
                    BEGIN
88
                         SELECT
89
                              ACCEPT ENT(A : OUT INTEGER) DO
90
                                   A := IDENT_INT(7);
91
                              END;
92
                         OR
93
                              TERMINATE;
94
                         END SELECT;
95
                    END;
96
               END TSK;
97
          END GEN;
98
 
99
          PACKAGE GEN_TSK     IS NEW GEN(TT);
100
          PACKAGE GEN_TSK_SUB IS NEW GEN(TT_REC);
101
 
102
     BEGIN
103
          GEN_TSK.TSK.ENT(INT);
104
 
105
          IF INT /= IDENT_INT(7) THEN
106
               FAILED("THE WRONG VALUE WAS RETURNED BY THE TASK");
107
          END IF;
108
 
109
          INT := 0;
110
          GEN_TSK_SUB.TSK.ENT(INT);
111
 
112
          IF INT /= IDENT_INT(7) THEN
113
               FAILED("THE WRONG VALUE WAS RETURNED BY THE TASK, " &
114
                      "WITH ACTUAL PARAMETER'S BASE IS A SUB" &
115
                      "COMPONENT OF A TASK TYPE");
116
          END IF;
117
          RESULT;
118
     END;
119
END CC3207B;

powered by: WebSVN 2.1.0

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