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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C74409B.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 IF A COMPOSITE TYPE IS DECLARED IN THE SAME PACKAGE 
26
-- AS A LIMITED PRIVATE TYPE AND HAS A COMPONENT OF THAT TYPE, 
27
-- THE COMPOSITE TYPE IS TREATED AS A LIMITED TYPE UNTIL THE 
28
-- EARLIEST PLACE WITHIN THE IMMEDIATE SCOPE OF THE DECLARATION 
29
-- OF THE COMPOSITE TYPE AND AFTER THE FULL DECLARATION OF THE 
30
-- LIMITED PRIVATE TYPE
31
 
32
-- DSJ 5/5/83
33
-- JBG 9/23/83
34
 
35
WITH REPORT;
36
PROCEDURE C74409B IS
37
 
38
     USE REPORT;
39
 
40
BEGIN
41
 
42
     TEST("C74409B", "CHECK THAT A COMPOSITE TYPE WITH A LIMITED " &
43
                     "PRIVATE COMPONENT IS TREATED AS A LIMITED " &
44
                     "TYPE UNTIL ASSIGNMENT AND EQUALITY ARE BOTH " &
45
                     "AVAILABLE FOR THE COMPOSITE TYPE");
46
 
47
     DECLARE
48
 
49
          PACKAGE P IS
50
               TYPE LP IS LIMITED PRIVATE;
51
               PACKAGE Q IS
52
                    TYPE LP_ARRAY IS ARRAY (1 .. 2) OF LP;
53
               END Q;
54
          PRIVATE
55
               TYPE LP IS NEW INTEGER;
56
          END P;
57
 
58
          PACKAGE BODY P IS
59
               USE Q;
60
               FUNCTION "=" (L,R : LP_ARRAY) RETURN BOOLEAN IS  -- LEGAL
61
               BEGIN
62
                    RETURN TRUE;
63
               END;
64
 
65
               GENERIC
66
                    TYPE T IS PRIVATE;     -- NOTE: NOT LIMITED PRIVATE
67
                    C, D : T;
68
               PACKAGE A IS
69
                    -- IRRELEVANT DETAILS
70
               END A;
71
 
72
               PACKAGE BODY A IS
73
               BEGIN
74
                    IF C = D THEN
75
                         FAILED ("USED WRONG EQUALITY OPERATOR");
76
                    END IF;
77
               END A;
78
 
79
               PACKAGE BODY Q IS
80
                    PACKAGE ANOTHER_NEW_A IS
81
                         NEW A (LP_ARRAY, (2,3), (4,5)); -- LEGAL
82
               END Q;
83
          END P;
84
 
85
     BEGIN
86
 
87
          NULL;
88
 
89
     END;
90
 
91
     RESULT;
92
 
93
END C74409B;

powered by: WebSVN 2.1.0

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