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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CB4006A.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
-- OBJECTIVE:
26
--     CHECK THAT EXCEPTIONS IN A BLOCK IN A HANDLER
27
--     ARE HANDLED CORRECTLY.
28
 
29
-- HISTORY:
30
--     DAT 04/15/81
31
--     SPS 11/02/82
32
--     JET 01/06/88  UPDATED HEADER FORMAT AND ADDED CODE TO
33
--                   PREVENT OPTIMIZATION.
34
--     JRL 05/28/92  CHANGED CODE IN PROGRAM_ERROR BLOCK TO
35
--                   PREVENT OPTIMIZATION.
36
 
37
WITH REPORT;
38
USE REPORT;
39
 
40
PROCEDURE CB4006A IS
41
 
42
     I1 : INTEGER RANGE 1 .. 2 := 1;
43
 
44
     PROCEDURE P IS
45
     BEGIN
46
          IF EQUAL(3,3) THEN
47
               RAISE PROGRAM_ERROR;
48
          END IF;
49
     EXCEPTION
50
          WHEN PROGRAM_ERROR =>
51
               DECLARE
52
                    I : INTEGER RANGE 1 .. 1 := I1;
53
               BEGIN
54
                    IF EQUAL(I,I) THEN
55
                         I := I1 + 1;
56
                    END IF ;
57
                    FAILED ("EXCEPTION NOT RAISED 1");
58
 
59
                    IF NOT EQUAL(I,I) THEN
60
                         COMMENT ("CAN'T OPTIMIZE THIS");
61
                    END IF;
62
 
63
               EXCEPTION
64
                    WHEN CONSTRAINT_ERROR =>
65
                         IF I1 /= 1 THEN
66
                              FAILED ("WRONG HANDLER 1");
67
                         ELSE
68
                              I1 := I1 + 1;
69
                         END IF;
70
               END;
71
          WHEN CONSTRAINT_ERROR =>
72
               FAILED ("WRONG HANDLER 3");
73
     END P;
74
 
75
BEGIN
76
     TEST ("CB4006A", "CHECK THAT EXCEPTIONS IN BLOCKS IN " &
77
                      "HANDLERS WORK");
78
 
79
     P;
80
     IF IDENT_INT(I1) /= 2 THEN
81
          FAILED ("EXCEPTION NOT HANDLED CORRECTLY");
82
     ELSE
83
          BEGIN
84
               P;
85
               FAILED ("EXCEPTION NOT RAISED CORRECTLY 2");
86
          EXCEPTION
87
               WHEN CONSTRAINT_ERROR => NULL;
88
          END;
89
     END IF;
90
 
91
     RESULT;
92
 
93
EXCEPTION
94
     WHEN OTHERS => FAILED ("WRONG HANDLER 2");
95
          RESULT;
96
 
97
END CB4006A;

powered by: WebSVN 2.1.0

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