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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cb/] [cb2007a.ada] - Blame information for rev 316

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CB2007A.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 AN EXIT STATEMENT IN A HANDLER CAN TRANSFER CONTROL
26
-- OUT OF A LOOP.
27
 
28
-- DAT 4/13/81
29
--  RM 4/30/81
30
-- SPS 3/23/83
31
 
32
WITH REPORT; USE REPORT;
33
 
34
PROCEDURE CB2007A IS
35
BEGIN
36
     TEST ("CB2007A", "EXIT STATEMENTS IN EXCEPTION HANDLERS");
37
 
38
     DECLARE
39
          FLOW_INDEX : INTEGER := 0 ;
40
     BEGIN
41
 
42
          FOR I IN 1 .. 10 LOOP
43
               BEGIN
44
                    IF I = 1 THEN
45
                         RAISE CONSTRAINT_ERROR;
46
                    END IF;
47
                    FAILED ("WRONG CONTROL FLOW 1");
48
               EXCEPTION
49
                    WHEN CONSTRAINT_ERROR => EXIT;
50
               END;
51
               FAILED ("WRONG CONTROL FLOW 2");
52
               EXIT;
53
          END LOOP;
54
 
55
          FOR AAA IN 1..1 LOOP
56
               FOR BBB IN 1..1 LOOP
57
                    FOR I IN 1 .. 10 LOOP
58
                         BEGIN
59
                              IF I = 1 THEN
60
                                   RAISE CONSTRAINT_ERROR;
61
                              END IF;
62
                              FAILED ("WRONG CONTROL FLOW A1");
63
                         EXCEPTION
64
                              WHEN CONSTRAINT_ERROR => EXIT;
65
                         END;
66
                         FAILED ("WRONG CONTROL FLOW A2");
67
                         EXIT;
68
                    END LOOP;
69
 
70
                    FLOW_INDEX := FLOW_INDEX + 1 ;
71
               END LOOP;
72
          END LOOP;
73
 
74
          LOOP1 :
75
          FOR AAA IN 1..1 LOOP
76
               LOOP2 :
77
               FOR BBB IN 1..1 LOOP
78
                    LOOP3 :
79
                    FOR I IN 1 .. 10 LOOP
80
                         BEGIN
81
                              IF I = 1 THEN
82
                                   RAISE CONSTRAINT_ERROR;
83
                              END IF;
84
                              FAILED ("WRONG CONTROL FLOW B1");
85
                         EXCEPTION
86
                              WHEN CONSTRAINT_ERROR => EXIT LOOP2 ;
87
                         END;
88
                         FAILED ("WRONG CONTROL FLOW B2");
89
                         EXIT LOOP2 ;
90
                    END LOOP  LOOP3 ;
91
 
92
                    FAILED ("WRONG CONTROL FLOW B3");
93
               END LOOP  LOOP2 ;
94
 
95
               FLOW_INDEX := FLOW_INDEX + 1 ;
96
          END LOOP  LOOP1 ;
97
 
98
          IF  FLOW_INDEX /= 2  THEN  FAILED( "WRONG FLOW OF CONTROL" );
99
          END IF;
100
 
101
     END ;
102
 
103
     RESULT;
104
END CB2007A;

powered by: WebSVN 2.1.0

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