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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CB2005A.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 A RETURN STATEMENT CAN APPEAR IN AN EXCEPTION HANDLER
26
-- AND IT CAUSES CONTROL TO LEAVE THE SUBPROGRAM, FOR BOTH
27
-- FUNCTIONS AND PROCEDURES.
28
 
29
-- DAT 4/13/81
30
-- JRK 4/24/81
31
-- SPS 10/26/82
32
 
33
WITH REPORT; USE REPORT;
34
 
35
PROCEDURE CB2005A IS
36
 
37
     I : INTEGER RANGE 0 .. 1;
38
 
39
     FUNCTION SETI RETURN INTEGER IS
40
     BEGIN
41
          I := I + 1;
42
          FAILED ("CONSTRAINT_ERROR NOT RAISED 1");
43
          RETURN 0;
44
     EXCEPTION
45
          WHEN OTHERS =>
46
               RETURN I;
47
               FAILED ("FUNCTION RETURN STMT DID NOT RETURN");
48
               RETURN 0;
49
     END SETI;
50
 
51
     PROCEDURE ISET IS
52
     BEGIN
53
          I := 2;
54
          FAILED ("CONSTRAINT_ERROR NOT RAISED 2");
55
          I := 0;
56
     EXCEPTION
57
          WHEN OTHERS =>
58
               RETURN;
59
               FAILED ("PROCEDURE RETURN STMT DID NOT RETURN");
60
     END ISET;
61
 
62
BEGIN
63
     TEST ("CB2005A", "RETURN IN EXCEPTION HANDLERS");
64
 
65
     I := 1;
66
     IF SETI /= 1 THEN
67
          FAILED ("WRONG VALUE RETURNED 1");
68
     END IF;
69
 
70
     I := 1;
71
     ISET;
72
     IF I /= 1 THEN
73
          FAILED ("WRONG VALUE RETURNED 2");
74
     END IF;
75
 
76
     RESULT;
77
END CB2005A;

powered by: WebSVN 2.1.0

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