Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c5 / c57004b.ada
blob63f5760ca6cc858f4fc2683f50d78722c32dea08
1 -- C57004B.ADA
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.
16 -- DISCLAIMER
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 WITH A LOOP NAME TERMINATES EXECUTION
26 -- OF THE LOOP STATEMENT WHOSE NAME IT MENTIONS, AND OF ALL OTHER
27 -- LOOP STATEMENTS (IF ANY) INTERIOR TO THE FIRST LOOP AND ENCLOSING
28 -- THE EXIT STATEMENT.
30 -- CASE 2 : CONDITIONAL EXITS.
33 -- RM 04/27/81
34 -- SPS 3/7/83
36 WITH REPORT;
37 PROCEDURE C57004B IS
39 USE REPORT ;
41 BEGIN
43 TEST( "C57004B" , "CHECK THAT A NAMING EXIT STATEMENT TERMINATES" &
44 " EXECUTION OF THE NAMED LOOP AND OF ALL LOOPS" &
45 " SITUATED IN-BETWEEN" );
47 DECLARE
49 COUNT : INTEGER := 0 ;
51 BEGIN
53 OUTERMOST :
54 FOR X IN INTEGER RANGE 1..2 LOOP
56 FOR Y IN INTEGER RANGE 1..2 LOOP
58 COMMENT( "BEFORE 1" );
60 LOOP1 :
61 FOR I IN 1..10 LOOP
62 COMMENT( "INSIDE 1" );
63 EXIT LOOP1 WHEN EQUAL(1,1) ;
64 FAILED( "EXIT NOT OBEYED (1)" );
65 FOR J IN 1..10 LOOP
66 FAILED( "OUTER EXIT NOT OBEYED (1)" );
67 EXIT WHEN EQUAL(1,1) ;
68 FAILED( "BOTH EXITS IGNORED (1)" );
69 END LOOP;
70 END LOOP LOOP1 ;
73 COMMENT( "BEFORE 2" );
74 COUNT := COUNT + 1 ;
76 LOOP2 :
77 FOR A IN 1..1 LOOP
78 FOR B IN 1..1 LOOP
80 FOR I IN CHARACTER LOOP
81 COMMENT( "INSIDE 2" );
82 EXIT LOOP2 WHEN EQUAL(1,1) ;
83 FAILED( "EXIT NOT OBEYED (2)" );
84 FOR J IN BOOLEAN LOOP
85 FAILED( "OUTER EXIT NOT " &
86 "OBEYED (2)");
87 EXIT WHEN EQUAL(1,1) ;
88 FAILED( "BOTH EXITS IGNORED " &
89 "(2)");
90 END LOOP;
91 END LOOP;
93 END LOOP;
94 END LOOP LOOP2 ;
97 COMMENT( "BEFORE 3" );
98 COUNT := COUNT + 1 ;
100 LOOP3 :
101 FOR A IN 1..1 LOOP
102 FOR B IN 1..1 LOOP
104 FOR I IN BOOLEAN LOOP
105 COMMENT( "INSIDE 3" );
106 BEGIN
107 EXIT LOOP3 WHEN EQUAL(1,1) ;
108 FAILED( "EXIT NOT OBEYED (3)" );
109 END ;
110 FAILED( "EXIT NOT OBEYED (3BIS)" );
111 END LOOP;
113 END LOOP;
114 END LOOP LOOP3 ;
117 COMMENT( "BEFORE 4" );
118 COUNT := COUNT + 1 ;
120 LOOP4 :
121 FOR A IN 1..1 LOOP
122 FOR B IN 1..1 LOOP
125 FOR I IN INTEGER RANGE 1..10 LOOP
126 COMMENT( "INSIDE 4" );
127 CASE A IS
128 WHEN 1 =>
129 EXIT LOOP4 WHEN EQUAL(1,1);
130 FAILED("EXIT NOT OBEYED " &
131 "(4)" );
132 END CASE;
133 FAILED( "EXIT NOT OBEYED (4BIS)" );
134 END LOOP;
136 END LOOP;
137 END LOOP LOOP4 ;
140 COMMENT( "AFTER 4" );
141 COUNT := COUNT + 1 ;
142 EXIT OUTERMOST ;
144 END LOOP;
146 FAILED( "MISSED FINAL EXIT" );
148 END LOOP OUTERMOST ;
151 IF COUNT /= 4 THEN
152 FAILED( "WRONG FLOW OF CONTROL" );
153 END IF;
156 END ;
159 RESULT ;
162 END C57004B ;