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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CB4008A.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 NESTED LAST WISHES EXCEPTION HANDLERS WORK 
26
-- (FOR PROCEDURES).
27
 
28
-- DAT 4/15/81
29
-- SPS 3/28/83
30
 
31
WITH REPORT; USE REPORT;
32
 
33
PROCEDURE CB4008A IS
34
 
35
     C : INTEGER := 0;
36
 
37
     E : EXCEPTION;
38
 
39
     DEPTH : CONSTANT := 99;
40
 
41
     PROCEDURE F;
42
 
43
     PROCEDURE I IS
44
     BEGIN
45
          C := C + 1;
46
          IF C >= DEPTH THEN
47
               RAISE E;
48
          END IF;
49
     END I;
50
 
51
     PROCEDURE O IS
52
     BEGIN
53
          C := C - 1;
54
     END O;
55
 
56
     PROCEDURE X IS
57
          PROCEDURE X1 IS
58
               PROCEDURE X2 IS
59
               BEGIN
60
                    F;
61
               END X2;
62
 
63
               PROCEDURE X3 IS
64
               BEGIN
65
                    I;
66
                    X2;
67
               EXCEPTION
68
                    WHEN E => O; RAISE;
69
               END X3;
70
          BEGIN
71
               I;
72
               X3;
73
          EXCEPTION
74
               WHEN E => O; RAISE;
75
          END X1;
76
 
77
          PROCEDURE X1A IS
78
          BEGIN
79
               I;
80
               X1;
81
               FAILED ("INCORRECT EXECUTION SEQUENCE");
82
          EXCEPTION
83
               WHEN E => O; RAISE;
84
          END X1A;
85
     BEGIN
86
          I;
87
          X1A;
88
     EXCEPTION
89
          WHEN E => O; RAISE;
90
     END X;
91
 
92
     PROCEDURE Y IS
93
     BEGIN
94
          I;
95
          X;
96
     EXCEPTION WHEN E => O; RAISE;
97
     END Y;
98
 
99
     PROCEDURE F IS
100
          PROCEDURE F2;
101
 
102
          PROCEDURE F1 IS
103
          BEGIN
104
               I;
105
               F2;
106
          EXCEPTION WHEN E => O; RAISE;
107
          END F1;
108
 
109
          PROCEDURE F2 IS
110
          BEGIN
111
               I;
112
               Y;
113
          EXCEPTION WHEN E => O; RAISE;
114
          END F2;
115
     BEGIN
116
          I;
117
          F1;
118
     EXCEPTION WHEN E => O; RAISE;
119
     END F;
120
 
121
BEGIN
122
     TEST ("CB4008A", "(PROCEDURE) LAST WISHES UNWIND PROPERLY");
123
 
124
     BEGIN
125
          I;
126
          Y;
127
          FAILED ("INCORRECT EXECUTION SEQUENCE 2");
128
     EXCEPTION
129
          WHEN E =>
130
               O;
131
               IF C /= 0 THEN
132
                    FAILED ("EXCEPTION HANDLER MISSED SOMEWHERE");
133
               END IF;
134
     END;
135
 
136
     RESULT;
137
END CB4008A;

powered by: WebSVN 2.1.0

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