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/] [c3/] [c39006a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C39006A.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 PROGRAM_ERROR IS RAISED IF AN ATTEMPT IS MADE TO CALL A
26
-- SUBPROGRAM WHOSE BODY HAS NOT YET BEEN ELABORATED.  CHECK THE
27
-- FOLLOWING:
28
--     A) A FUNCTION IS CALLED IN THE INITIALIZATION EXPRESSION OF A
29
--        SCALAR VARIABLE OR A RECORD COMPONENT, AND THE SCALAR OR
30
--        RECORD VARIABLE'S DECLARATION IS ELABORATED BEFORE THE
31
--        SUBPROGRAM BODY IS ELABORATED.
32
 
33
-- TBN  8/14/86
34
 
35
WITH REPORT; USE REPORT;
36
PROCEDURE C39006A IS
37
 
38
BEGIN
39
     TEST ("C39006A", "CHECK THAT PROGRAM_ERROR IS RAISED IF AN " &
40
                      "ATTEMPT IS MADE TO CALL A SUBPROGRAM WHOSE " &
41
                      "BODY HAS NOT YET BEEN ELABORATED");
42
     BEGIN
43
          DECLARE
44
 
45
               FUNCTION INIT_1 (A : INTEGER) RETURN INTEGER;
46
 
47
               VAR1 : INTEGER := INIT_1 (1);
48
 
49
               FUNCTION INIT_1 (A : INTEGER) RETURN INTEGER IS
50
               BEGIN
51
                    RETURN (A + IDENT_INT(1));
52
               END INIT_1;
53
 
54
          BEGIN
55
               FAILED ("PROGRAM_ERROR NOT RAISED - 1");
56
          END;
57
 
58
     EXCEPTION
59
          WHEN PROGRAM_ERROR =>
60
               NULL;
61
          WHEN OTHERS =>
62
               FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
63
     END;
64
 
65
     BEGIN
66
          DECLARE
67
 
68
               FUNCTION INIT_2 (A : INTEGER) RETURN INTEGER;
69
 
70
               TYPE REC1 IS
71
                    RECORD
72
                         NUMBER : INTEGER := INIT_2 (2);
73
                    END RECORD;
74
 
75
               VAR2 : REC1;
76
 
77
               FUNCTION INIT_2 (A : INTEGER) RETURN INTEGER IS
78
               BEGIN
79
                    RETURN (A + IDENT_INT(1));
80
               END INIT_2;
81
 
82
          BEGIN
83
               FAILED ("PROGRAM_ERROR NOT RAISED - 2");
84
          END;
85
 
86
     EXCEPTION
87
          WHEN PROGRAM_ERROR =>
88
               NULL;
89
          WHEN OTHERS =>
90
               FAILED ("UNEXPECTED EXCEPTION RAISED - 2");
91
     END;
92
 
93
     BEGIN
94
          DECLARE
95
 
96
               FUNCTION F1 RETURN INTEGER;
97
 
98
               PACKAGE PACK IS
99
                    VAR1 : INTEGER := F1;
100
               END PACK;
101
 
102
               FUNCTION F1 RETURN INTEGER IS
103
               BEGIN
104
                    RETURN (IDENT_INT(1));
105
               END F1;
106
 
107
          BEGIN
108
               FAILED ("PROGRAM_ERROR NOT RAISED - 3");
109
          END;
110
 
111
     EXCEPTION
112
          WHEN PROGRAM_ERROR =>
113
               NULL;
114
          WHEN OTHERS =>
115
               FAILED ("UNEXPECTED EXCEPTION RAISED - 3");
116
     END;
117
 
118
     BEGIN
119
          DECLARE
120
 
121
               PACKAGE PACK IS
122
                    FUNCTION F2 RETURN INTEGER;
123
                    VAR2 : INTEGER := F2;
124
               END PACK;
125
 
126
               PACKAGE BODY PACK IS
127
                    FUNCTION F2 RETURN INTEGER IS
128
                    BEGIN
129
                         RETURN (IDENT_INT(3));
130
                    END F2;
131
               END PACK;
132
 
133
          BEGIN
134
               FAILED ("PROGRAM_ERROR NOT RAISED - 4");
135
          END;
136
 
137
     EXCEPTION
138
          WHEN PROGRAM_ERROR =>
139
               NULL;
140
          WHEN OTHERS =>
141
               FAILED ("UNEXPECTED EXCEPTION RAISED - 4");
142
     END;
143
 
144
     BEGIN
145
          DECLARE
146
 
147
               FUNCTION INIT_3 (A : INTEGER) RETURN INTEGER;
148
 
149
               GENERIC
150
                    PACKAGE Q IS
151
                         VAR1 : INTEGER := INIT_3 (1);
152
                    END Q;
153
 
154
               PACKAGE NEW_Q IS NEW Q;
155
 
156
               FUNCTION INIT_3 (A : INTEGER) RETURN INTEGER IS
157
               BEGIN
158
                    RETURN (A + IDENT_INT(3));
159
               END INIT_3;
160
 
161
          BEGIN
162
               FAILED ("PROGRAM_ERROR NOT RAISED - 5");
163
          END;
164
 
165
     EXCEPTION
166
          WHEN PROGRAM_ERROR =>
167
               NULL;
168
          WHEN OTHERS =>
169
               FAILED ("UNEXPECTED EXCEPTION RAISED - 5");
170
     END;
171
 
172
     BEGIN
173
          DECLARE
174
 
175
               FUNCTION FUN RETURN INTEGER;
176
 
177
               TYPE PARAM IS
178
                    RECORD
179
                         COMP : INTEGER := FUN;
180
                    END RECORD;
181
 
182
               GENERIC
183
                    TYPE T IS PRIVATE;
184
               PACKAGE GP IS
185
                    OBJ : T;
186
               END GP;
187
 
188
               PACKAGE INST IS NEW GP(PARAM);
189
 
190
               FUNCTION FUN RETURN INTEGER IS
191
               BEGIN
192
                    RETURN (IDENT_INT(3));
193
               END FUN;
194
 
195
          BEGIN
196
               FAILED ("PROGRAM_ERROR NOT RAISED - 6");
197
          END;
198
 
199
     EXCEPTION
200
          WHEN PROGRAM_ERROR =>
201
               NULL;
202
          WHEN OTHERS =>
203
               FAILED ("UNEXPECTED EXCEPTION RAISED - 6");
204
     END;
205
 
206
     RESULT;
207
END C39006A;

powered by: WebSVN 2.1.0

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