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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CB4001A.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 ANY EXCEPTION RAISED IN THE STATEMENT SEQUENCE OF A
26
-- SUBPROGRAM IS PROPAGATED TO THE CALLER OF THE SUBPROGRAM, NOT TO THE
27
-- STATICALLY ENCLOSING LEXICAL ENVIRONMENT.
28
 
29
-- RM  05/30/80
30
-- JRK 11/19/80
31
-- SPS 03/28/83
32
-- EG  10/30/85  ELIMINATE THE USE OF NUMERIC_ERROR IN TEST.
33
 
34
WITH REPORT;
35
PROCEDURE CB4001A IS
36
 
37
     USE REPORT;
38
 
39
     E1 : EXCEPTION;
40
     I9 : INTEGER RANGE 1..10 ;
41
     FLOW_COUNT : INTEGER := 0 ;
42
 
43
BEGIN
44
     TEST("CB4001A","CHECK THAT ANY EXCEPTION RAISED IN THE " &
45
          "STATEMENT SEQUENCE OF A SUBPROGRAM IS " &
46
          "PROPAGATED TO THE CALLER, NOT TO THE STATICALLY ENCLOSING" &
47
          " LEXICAL ENVIRONMENT");
48
 
49
     BEGIN   --  BLOCK WITH HANDLERS; LEX. ENVIRONMT FOR ALL PROC.DEFS
50
 
51
          DECLARE   --  BLOCK WITH PROCEDURE DEFINITIONS
52
 
53
               PROCEDURE  CALLEE1 ;
54
               PROCEDURE  CALLEE2 ;
55
               PROCEDURE  CALLEE3 ;
56
               PROCEDURE  R ;
57
               PROCEDURE  S ;
58
 
59
               PROCEDURE  CALLER1  IS
60
               BEGIN
61
                    FLOW_COUNT := FLOW_COUNT + 1 ;
62
                    CALLEE1 ;
63
                    FAILED("EXCEPTION NOT RAISED  (CALLER1)");
64
               EXCEPTION
65
                    WHEN E1 =>
66
                         FLOW_COUNT := FLOW_COUNT + 1 ;
67
               END ;
68
 
69
               PROCEDURE  CALLER2  IS
70
               BEGIN
71
                    FLOW_COUNT := FLOW_COUNT + 1 ;
72
                    CALLEE2 ;
73
                    FAILED("EXCEPTION NOT RAISED  (CALLER2)");
74
               EXCEPTION
75
                    WHEN CONSTRAINT_ERROR =>
76
                         FLOW_COUNT := FLOW_COUNT + 1 ;
77
               END ;
78
 
79
               PROCEDURE  CALLER3  IS
80
               BEGIN
81
                    FLOW_COUNT := FLOW_COUNT + 1 ;
82
                    CALLEE3 ;
83
                    FAILED("EXCEPTION NOT RAISED  (CALLER3)");
84
               EXCEPTION
85
                    WHEN CONSTRAINT_ERROR =>
86
                         FLOW_COUNT := FLOW_COUNT + 1 ;
87
               END ;
88
 
89
               PROCEDURE  CALLEE1  IS
90
               BEGIN
91
                    FLOW_COUNT := FLOW_COUNT + 1 ;
92
                    R ;
93
                    FAILED("EXCEPTION NOT RAISED  (CALLEE1)");
94
               END ;
95
 
96
               PROCEDURE  CALLEE2  IS
97
               BEGIN
98
                    FLOW_COUNT := FLOW_COUNT + 1 ;
99
                    RAISE  CONSTRAINT_ERROR ;
100
                    FAILED("EXCEPTION NOT RAISED  (CALLEE2)");
101
               EXCEPTION
102
                    WHEN PROGRAM_ERROR =>
103
                         FAILED("WRONG EXCEPTION RAISED  (CALLEE2)");
104
               END ;
105
 
106
               PROCEDURE  CALLEE3  IS
107
               BEGIN
108
                    FLOW_COUNT := FLOW_COUNT + 1 ;
109
                    I9 := IDENT_INT(20) ;
110
                    FAILED("EXCEPTION NOT RAISED  (CALLEE3)");
111
               END ;
112
 
113
               PROCEDURE  R  IS
114
                    E2 : EXCEPTION;
115
               BEGIN
116
                    FLOW_COUNT := FLOW_COUNT + 10 ;
117
                    S ;
118
                    FAILED("EXCEPTION E1 NOT RAISED (PROC R)");
119
               EXCEPTION
120
                    WHEN E2 =>
121
                         FAILED("WRONG EXCEPTION RAISED  (PROC R)");
122
               END ;
123
 
124
               PROCEDURE  S  IS
125
               BEGIN
126
                    FLOW_COUNT := FLOW_COUNT + 10 ;
127
                    RAISE  E1 ;
128
                    FAILED("EXCEPTION  E1  NOT RAISED  (PROC S)");
129
               END ;
130
 
131
          BEGIN   --  (THE BLOCK WITH PROC. DEFS)
132
 
133
               CALLER1;
134
               CALLER2;
135
               CALLER3;
136
 
137
          END ;   --  (THE BLOCK WITH PROC. DEFS)
138
 
139
     EXCEPTION
140
 
141
          WHEN OTHERS =>
142
               FAILED("EXCEPTION PROPAGATED STATICALLY");
143
 
144
     END ;
145
 
146
     IF  FLOW_COUNT /= 29  THEN
147
          FAILED("INCORRECT FLOW_COUNT VALUE");
148
     END IF;
149
 
150
     RESULT;
151
END CB4001A;

powered by: WebSVN 2.1.0

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