OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cb/] [cb3004a.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CB3004A.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 WHEN AN INNER UNIT REDECLARES AN EXCEPTION NAME
26
--    THE HIDDEN DEFINITION IS STILL AVAILABLE FOR USE.
27
 
28
--  NOTE : WE ASSUME FUNCTIONS ACT LIKE PROCEDURES AND
29
--  THAT UNITS, BLOCKS, AND PROCEDURES ACT THE SAME
30
--  IN OTHER CONTEXTS (E.G. TASKS AND PACKAGES).
31
 
32
-- DCB 6/2/80
33
-- JRK 11/19/80
34
-- SPS 3/24/83
35
 
36
WITH REPORT;
37
PROCEDURE CB3004A IS
38
 
39
     USE REPORT;
40
 
41
     E1 : EXCEPTION;
42
     FLOW_COUNT : INTEGER := 0;
43
 
44
     PROCEDURE P1 IS
45
          E1, E2 : EXCEPTION;
46
 
47
          PROCEDURE P2 IS
48
               E1 : EXCEPTION;
49
          BEGIN
50
               FLOW_COUNT := FLOW_COUNT + 1;
51
               RAISE E1;
52
               FAILED("E1 EXCEPTION NOT RAISED");
53
          EXCEPTION
54
               WHEN P1.E1 =>
55
                    FAILED("P1.E1 EXCEPTION RAISED WHEN " &
56
                           "(P2)E1 EXPECTED");
57
               WHEN E1 =>
58
                    BEGIN
59
                         FLOW_COUNT := FLOW_COUNT + 1;
60
                         RAISE P1.E1;
61
                         FAILED("P1.E1 EXCEPTION NOT RAISED");
62
                    EXCEPTION
63
                         WHEN E1 =>
64
                              FAILED("(P2)E1 EXCEPTION RAISED WHEN" &
65
                                     " P1.E1 EXPECTED");
66
                         WHEN P1.E1 =>
67
                              FLOW_COUNT := FLOW_COUNT + 1;
68
                         WHEN OTHERS =>
69
                              FAILED("OTHERS RAISED WHEN P1.E1 " &
70
                                     "EXPECTED");
71
                    END;
72
               WHEN OTHERS =>
73
                    FAILED("OTHERS RAISED WHEN (P2)E1 EXPECTED");
74
          END P2;
75
 
76
          PROCEDURE P3 IS
77
               CONSTRAINT_ERROR : EXCEPTION;
78
          BEGIN
79
               FLOW_COUNT := FLOW_COUNT + 1;
80
               RAISE CONSTRAINT_ERROR;
81
               FAILED("CONSTRAINT_ERROR EXCEPTION NOT RAISED");
82
          EXCEPTION
83
               WHEN STANDARD.CONSTRAINT_ERROR =>
84
                    FAILED("STANDARD.CONSTRAINT_ERROR EXCEPTION " &
85
                           "RAISED WHEN " &
86
                           "(P3)CONSTRAINT_ERROR EXPECTED");
87
               WHEN CONSTRAINT_ERROR =>
88
                    BEGIN
89
                         FLOW_COUNT := FLOW_COUNT + 1;
90
                         RAISE STANDARD.CONSTRAINT_ERROR;
91
                         FAILED("STANDARD.CONSTRAINT_ERROR " &
92
                                "EXCEPTION NOT RAISED");
93
                    EXCEPTION
94
                         WHEN CONSTRAINT_ERROR =>
95
                              FAILED("(P3)CONSTRAINT_ERROR " &
96
                                     "EXCEPTION RAISED WHEN " &
97
                                     "STANDARD.CONSTRAINT_ERROR " &
98
                                     "EXPECTED");
99
                         WHEN STANDARD.CONSTRAINT_ERROR =>
100
                              FLOW_COUNT := FLOW_COUNT + 1;
101
                         WHEN OTHERS =>
102
                               FAILED("OTHERS RAISED WHEN " &
103
                                      "STANDARD.CONSTRAINT_ERROR " &
104
                                      "EXPECTED");
105
                    END;
106
               WHEN OTHERS =>
107
                    FAILED("OTHERS RAISED WHEN " &
108
                           "(P3)CONSTRAINT_ERROR EXPECTED");
109
          END P3;
110
 
111
          PROCEDURE P4 IS
112
               E2 : EXCEPTION;
113
          BEGIN
114
               FLOW_COUNT := FLOW_COUNT + 1;
115
               RAISE P1.E2;
116
               FAILED("P1.E2 EXCEPTION NOT RAISED");
117
          EXCEPTION
118
               WHEN E2 =>
119
                    FAILED("(P4).E2 RAISED WHEN P1.E2 EXPECTED");
120
          END P4;
121
 
122
     BEGIN  -- P1
123
          P2;
124
          P3;
125
          P4;
126
          FAILED("P1.E2 EXCEPTION NOT PROPAGATED FROM P4");
127
     EXCEPTION
128
          WHEN E2 =>
129
               FLOW_COUNT := FLOW_COUNT + 1;
130
          WHEN OTHERS =>
131
               FAILED("EXCEPTION RAISED WHERE NONE EXPECTED");
132
     END P1;
133
 
134
BEGIN
135
     TEST("CB3004A","CHECK THAT WHEN EXCEPTION NAMES" &
136
          " ARE REDECLARED THE HIDDEN DEFINITION IS STILL AVAILABLE");
137
 
138
     P1;
139
 
140
     IF FLOW_COUNT /= 8 THEN
141
          FAILED("INCORRECT FLOW_COUNT VALUE");
142
     END IF;
143
 
144
     RESULT;
145
END CB3004A;

powered by: WebSVN 2.1.0

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