OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c8/] [c83027c.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C83027C.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 A DECLARATION WITHIN THE DISCRIMINANT PART OF A
27
--     PRIVATE TYPE DECLARATION, AN INCOMPLETE TYPE DECLARATION, AND A
28
--     GENERIC FORMAL TYPE DECLARATION HIDES AN OUTER DECLARATION OF A
29
--     HOMOGRAPH.  ALSO, CHECK THAT THE OUTER DECLARATION IS DIRECTLY
30
--     VISIBLE IN BOTH DECLARATIVE REGIONS BEFORE THE DECLARATION OF THE
31
--     INNER HOMOGRAPH AND THE OUTER DECLARATION IS VISIBLE BY SELECTION
32
--     AFTER THE INNER HOMOGRAPH DECLARATION.
33
 
34
-- HISTORY:
35
--     BCB 09/06/88  CREATED ORIGINAL TEST.
36
 
37
WITH REPORT; USE REPORT;
38
PROCEDURE C83027C IS
39
 
40
     GENERIC
41
          TYPE T IS PRIVATE;
42
          X : T;
43
     FUNCTION GEN_FUN RETURN T;
44
 
45
     FUNCTION GEN_FUN RETURN T IS
46
     BEGIN
47
          RETURN X;
48
     END GEN_FUN;
49
 
50
BEGIN
51
     TEST ("C83027C", "CHECK THAT A DECLARATION IN THE DISCRIMINANT " &
52
                      "PART OF A PRIVATE TYPE DECLARATION, AN " &
53
                      "INCOMPLETE TYPE DECLARATION, AND A GENERIC " &
54
                      "FORMAL TYPE DECLARATION HIDES AN OUTER " &
55
                      "DECLARATION OF A HOMOGRAPH");
56
 
57
     ONE:
58
     DECLARE
59
          A : INTEGER := IDENT_INT(2);
60
 
61
          D : INTEGER := IDENT_INT(2);
62
 
63
          G : INTEGER := IDENT_INT(2);
64
          H : INTEGER := G;
65
 
66
          TYPE REC (Z : INTEGER) IS RECORD
67
               NULL;
68
          END RECORD;
69
 
70
          GENERIC
71
               TYPE INNER3 (G : INTEGER) IS PRIVATE;
72
          PACKAGE P_ONE IS
73
               TYPE INNER (X : INTEGER := A;
74
                           A : INTEGER := IDENT_INT(3);
75
                           C : INTEGER := ONE.A) IS PRIVATE;
76
               TYPE INNER2 (Y : INTEGER := D;
77
                            D : INTEGER := IDENT_INT(3);
78
                            F : INTEGER := ONE.D);
79
               TYPE INNER2 (Y : INTEGER := D;
80
                            D : INTEGER := IDENT_INT(3);
81
                            F : INTEGER := ONE.D) IS RECORD
82
                    E : INTEGER := D;
83
               END RECORD;
84
          PRIVATE
85
               TYPE INNER (X : INTEGER := A;
86
                           A : INTEGER := IDENT_INT(3);
87
                           C : INTEGER := ONE.A) IS RECORD
88
                    B : INTEGER := A;
89
               END RECORD;
90
          END P_ONE;
91
 
92
          PACKAGE BODY P_ONE IS
93
               RECVAR : INNER;
94
               RECVAR2 : INNER2;
95
               RECVAR3 : INNER3(3);
96
          BEGIN
97
               IF RECVAR.A /= IDENT_INT(3) THEN
98
                    FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 1");
99
               END IF;
100
 
101
               IF A /= IDENT_INT(2) THEN
102
                    FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 2");
103
               END IF;
104
 
105
               IF RECVAR.B /= IDENT_INT(3) THEN
106
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 3");
107
               END IF;
108
 
109
               IF RECVAR.C /= IDENT_INT(2) THEN
110
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 4");
111
               END IF;
112
 
113
               IF RECVAR.X /= IDENT_INT(2) THEN
114
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 5");
115
               END IF;
116
 
117
               IF RECVAR2.D /= IDENT_INT(3) THEN
118
                    FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 6");
119
               END IF;
120
 
121
               IF D /= IDENT_INT(2) THEN
122
                    FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 7");
123
               END IF;
124
 
125
               IF RECVAR2.E /= IDENT_INT(3) THEN
126
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 8");
127
               END IF;
128
 
129
               IF RECVAR2.F /= IDENT_INT(2) THEN
130
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 9");
131
               END IF;
132
 
133
               IF RECVAR2.Y /= IDENT_INT(2) THEN
134
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 10");
135
               END IF;
136
 
137
               IF RECVAR3.G /= IDENT_INT(3) THEN
138
                    FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 11");
139
               END IF;
140
 
141
               IF G /= IDENT_INT(2) THEN
142
                    FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 12");
143
               END IF;
144
 
145
               IF H /= IDENT_INT(2) THEN
146
                    FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 13");
147
               END IF;
148
          END P_ONE;
149
 
150
          PACKAGE NEW_P_ONE IS NEW P_ONE (REC);
151
 
152
     BEGIN  -- ONE
153
          NULL;
154
     END ONE;
155
 
156
     RESULT;
157
END C83027C;

powered by: WebSVN 2.1.0

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