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/] [cb/] [cb2004a.ada] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
-- CB2004A.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 A PREDEFINED OR A PROGRAMMER DEFINED EXCEPTION
26
--    RAISED SEVERAL LEVELS INSIDE A HIERARCHY OF NESTED BLOCKS
27
--    CAN BE SUCCESSFULLY HANDLED IN AN OUTER BLOCK.
28
 
29
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
30
-- ***       remove incompatibilities associated with the transition   -- 9X
31
-- ***       to Ada 9X.                                                -- 9X
32
-- ***                                                                 -- 9X
33
 
34
-- DCB 5/12/80
35
-- JRK 11/17/80
36
-- SPS 11/2/82
37
-- MRM 03/30/93   REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
38
 
39
WITH REPORT;
40
PROCEDURE CB2004A IS
41
 
42
     USE REPORT;
43
 
44
     FLOW_COUNT : INTEGER := 0;
45
 
46
     E1, E2, E3 : EXCEPTION;
47
 
48
BEGIN
49
     TEST("CB2004A","CHECK THAT EXCEPTIONS RAISED INSIDE NESTED " &
50
          "BLOCKS CAN BE HANDLED IN OUTER BLOCKS");
51
 
52
     BEGIN
53
 
54
          -- PROGRAMMER-DEFINED EXCEPTION, SINGLE EXCEPTON_CHOICE.
55
 
56
          BEGIN
57
               BEGIN
58
                    BEGIN
59
                         FLOW_COUNT := FLOW_COUNT + 1;
60
                         RAISE E1;
61
                         FAILED("PROGRAMMER-DEFINED EXCEPTION " &
62
                                "NOT RAISED  #1");
63
 
64
                    EXCEPTION
65
                         WHEN E2 | E3 =>
66
                              FAILED("WRONG PROGRAMMER-" &
67
                                     "DEFINED EXCEPTION HANDLED   #1");
68
                    END;
69
 
70
               EXCEPTION
71
                    WHEN CONSTRAINT_ERROR |
72
                         PROGRAM_ERROR | STORAGE_ERROR |
73
                         TASKING_ERROR | E2 | E3     =>
74
                         FAILED("WRONG  " &
75
                                "EXCEPTION HANDLED   #1");
76
               END;
77
 
78
          EXCEPTION
79
               WHEN E1 =>
80
                    FLOW_COUNT := FLOW_COUNT + 1;
81
          END;
82
 
83
          -- PROGRAMMER-DEFINED EXCEPTION, MULTIPLE EXCEPTION_CHOICES.
84
 
85
          BEGIN
86
               BEGIN
87
                    BEGIN
88
                         FLOW_COUNT := FLOW_COUNT + 1;
89
                         RAISE E2;
90
                         FAILED("PROGRAMMER-DEFINED EXCEPTION " &
91
                                "NOT RAISED  #2");
92
 
93
                    EXCEPTION
94
                         WHEN E1 | E3 =>
95
                              FAILED("WRONG PROGRAMMER-" &
96
                                     "DEFINED EXCEPTION HANDLED   #2");
97
                    END;
98
 
99
               EXCEPTION
100
                    WHEN CONSTRAINT_ERROR |
101
                         PROGRAM_ERROR | STORAGE_ERROR |
102
                         TASKING_ERROR | E1 | E3     =>
103
                         FAILED("WRONG  " &
104
                                "EXCEPTION HANDLED   #2");
105
               END;
106
 
107
          EXCEPTION
108
               WHEN E3 =>
109
                    FAILED("WRONG EXCEPTION HANDLED  #2A");
110
               WHEN E1 | E2 | CONSTRAINT_ERROR =>
111
                    FLOW_COUNT := FLOW_COUNT + 1;
112
          END;
113
 
114
          -- PROGRAMMER-DEFINED EXCEPTION, 'OTHERS' CHOICE.
115
 
116
          BEGIN
117
               BEGIN
118
                    BEGIN
119
                         FLOW_COUNT := FLOW_COUNT + 1;
120
                         RAISE E1;
121
                         FAILED("PROGRAMMER-DEFINED EXCEPTION " &
122
                                "NOT RAISED  #3");
123
 
124
                    EXCEPTION
125
                         WHEN E2 | E3 =>
126
                              FAILED("WRONG PROGRAMMER-" &
127
                                     "DEFINED EXCEPTION HANDLED   #3");
128
                    END;
129
 
130
               EXCEPTION
131
                    WHEN CONSTRAINT_ERROR |
132
                         PROGRAM_ERROR | STORAGE_ERROR |
133
                         TASKING_ERROR | E2 | E3   =>
134
                         FAILED("WRONG " &
135
                                "EXCEPTION HANDLED   #3");
136
               END;
137
 
138
          EXCEPTION
139
               WHEN E2 | CONSTRAINT_ERROR =>
140
                    FAILED("WRONG EXCEPTION HANDLED  #3A");
141
               WHEN OTHERS =>
142
                    FLOW_COUNT := FLOW_COUNT + 1;
143
          END;
144
 
145
          -- PREDEFINED EXCEPTION, SINGLE EXCEPTION_CHOICE.
146
 
147
          BEGIN
148
               BEGIN
149
                    BEGIN
150
                         FLOW_COUNT := FLOW_COUNT + 1;
151
                         RAISE CONSTRAINT_ERROR;
152
                         FAILED("PREDEFINED EXCEPTION NOT RAISED  #4");
153
 
154
                    EXCEPTION
155
                         WHEN E1 | E2 | E3 =>
156
                              FAILED("WRONG " &
157
                                     "EXCEPTION HANDLED   #4");
158
                    END;
159
 
160
               EXCEPTION
161
                    WHEN PROGRAM_ERROR | STORAGE_ERROR |
162
                         TASKING_ERROR     =>
163
                         FAILED("WRONG PREDEFINED " &
164
                                "EXCEPTION HANDLED   #4");
165
               END;
166
 
167
          EXCEPTION
168
               WHEN CONSTRAINT_ERROR =>
169
                    FLOW_COUNT := FLOW_COUNT + 1;
170
          END;
171
 
172
          -- PREDEFINED EXCEPTION, MULTIPLE EXCEPTION_CHOICES.
173
 
174
          BEGIN
175
               BEGIN
176
                    BEGIN
177
                         FLOW_COUNT := FLOW_COUNT + 1;
178
                         RAISE CONSTRAINT_ERROR;
179
                         FAILED("PREDEFINED EXCEPTION NOT RAISED  #5");
180
 
181
                    EXCEPTION
182
                         WHEN E1 | E2 | E3 =>
183
                              FAILED("WRONG " &
184
                                     "EXCEPTION HANDLED   #5");
185
                    END;
186
 
187
               EXCEPTION
188
                    WHEN PROGRAM_ERROR |
189
                         STORAGE_ERROR | TASKING_ERROR     =>
190
                         FAILED("WRONG PREDEFINED " &
191
                                "EXCEPTION HANDLED   #5");
192
               END;
193
 
194
          EXCEPTION
195
               WHEN E1 | E2 =>
196
                    FAILED("WRONG EXCEPTION HANDLED  #5A");
197
               WHEN CONSTRAINT_ERROR | E3 =>
198
                    FLOW_COUNT := FLOW_COUNT + 1;
199
          END;
200
 
201
          -- PREDEFINED EXCEPTION, 'OTHERS' CHOICE.
202
 
203
          BEGIN
204
               BEGIN
205
                    BEGIN
206
                         FLOW_COUNT := FLOW_COUNT + 1;
207
                         RAISE CONSTRAINT_ERROR;
208
                         FAILED("PREDEFINED EXCEPTION NOT RAISED  #6");
209
 
210
                    EXCEPTION
211
                         WHEN E1 | E2 | E3 =>
212
                              FAILED("WRONG " &
213
                                     " EXCEPTION HANDLED   #6");
214
                    END;
215
 
216
               EXCEPTION
217
                    WHEN PROGRAM_ERROR | STORAGE_ERROR |
218
                         TASKING_ERROR     =>
219
                         FAILED("WRONG PREDEFINED " &
220
                                "EXCEPTION HANDLED   #6");
221
               END;
222
 
223
          EXCEPTION
224
               WHEN E1 =>
225
                    FAILED("WRONG EXCEPTION HANDLED  #6A");
226
               WHEN OTHERS =>
227
                    FLOW_COUNT := FLOW_COUNT + 1;
228
          END;
229
 
230
     EXCEPTION
231
          WHEN E1 | E2 | E3 =>
232
               FAILED("PROGRAMMER-DEFINED EXCEPTION HANDLED IN" &
233
                      "WRONG SCOPE");
234
          WHEN CONSTRAINT_ERROR =>
235
               FAILED("CONSTRAINT_ERROR HANDLED IN WRONG SCOPE");
236
          WHEN OTHERS =>
237
               FAILED("OTHER EXCEPTIONS HANDLED IN WRONG SCOPE");
238
     END;
239
 
240
     IF FLOW_COUNT /= 12 THEN
241
          FAILED("INCORRECT FLOW_COUNT VALUE");
242
     END IF;
243
 
244
     RESULT;
245
END CB2004A;

powered by: WebSVN 2.1.0

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