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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C85009A.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 PREDEFINED AND USER-DEFINED EXCEPTIONS CAN BE RENAMED
27
--     AND THAT HANDLERS REFERRING TO EITHER NAME ARE INVOKED WHEN THE
28
--     EXCEPTION IS RAISED, EVEN BY AN EXPLICIT 'RAISE' STATEMENT
29
--     REFERRING TO THE OTHER NAME.
30
 
31
-- HISTORY:
32
--     JET 03/24/88  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
PROCEDURE C85009A IS
36
 
37
     MY_EXCEPTION : EXCEPTION;
38
 
39
     MY_EXCEPTION2 : EXCEPTION RENAMES MY_EXCEPTION;
40
 
41
     CONSTRAINT_ERROR2 : EXCEPTION RENAMES CONSTRAINT_ERROR;
42
 
43
     I : INTEGER := 1;
44
 
45
BEGIN
46
     TEST ("C85009A", "CHECK THAT PREDEFINED AND USER-DEFINED " &
47
                      "EXCEPTIONS CAN BE RENAMED AND THAT HANDLERS " &
48
                      "REFERRING TO EITHER NAME ARE INVOKED WHEN " &
49
                      "THE EXCEPTION IS RAISED, EVEN BY AN EXPLICIT " &
50
                      "'RAISE' STATEMENT REFERRING TO THE OTHER NAME");
51
 
52
     BEGIN
53
          RAISE MY_EXCEPTION;
54
          FAILED ("MY_EXCEPTION NOT RAISED");
55
     EXCEPTION
56
          WHEN MY_EXCEPTION2 =>
57
               NULL;
58
          WHEN OTHERS =>
59
               FAILED ("WRONG EXCEPTION RAISED BY MY_EXCEPTION");
60
     END;
61
 
62
     BEGIN
63
          RAISE MY_EXCEPTION2;
64
          FAILED ("MY_EXCEPTION2 NOT RAISED");
65
     EXCEPTION
66
          WHEN MY_EXCEPTION =>
67
               NULL;
68
          WHEN OTHERS =>
69
               FAILED ("WRONG EXCEPTION RAISED BY MY_EXCEPTION2");
70
     END;
71
 
72
     DECLARE
73
          TYPE COLORS IS (RED, BLUE, YELLOW);
74
          E : COLORS := RED;
75
     BEGIN
76
          E := COLORS'PRED(E);
77
          IF NOT EQUAL(COLORS'POS(E),COLORS'POS(E)) THEN
78
               COMMENT("DON'T OPTIMIZE E");
79
          END IF;
80
          FAILED ("CONSTRAINT_ERROR NOT RAISED BY PRED(RED)");
81
     EXCEPTION
82
          WHEN CONSTRAINT_ERROR2 =>
83
               NULL;
84
          WHEN OTHERS =>
85
               FAILED ("WRONG EXCEPTION RAISED BY PRED(RED)");
86
     END;
87
 
88
     BEGIN
89
          RAISE CONSTRAINT_ERROR;
90
          FAILED ("CONSTRAINT_ERROR NOT RAISED");
91
     EXCEPTION
92
          WHEN CONSTRAINT_ERROR2 =>
93
               NULL;
94
          WHEN OTHERS =>
95
               FAILED ("WRONG EXCEPTION RAISED BY CONSTRAINT_ERROR");
96
     END;
97
 
98
     BEGIN
99
          RAISE CONSTRAINT_ERROR2;
100
          FAILED ("CONSTRAINT_ERROR2 NOT RAISED");
101
     EXCEPTION
102
          WHEN CONSTRAINT_ERROR =>
103
               NULL;
104
          WHEN OTHERS =>
105
               FAILED ("WRONG EXCEPTION RAISED BY CONSTRAINT_ERROR2");
106
     END;
107
 
108
     RESULT;
109
END C85009A;

powered by: WebSVN 2.1.0

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