OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c5/] [c57004b.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C57004B.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 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.
29
 
30
-- CASE 2 :  CONDITIONAL EXITS.
31
 
32
 
33
-- RM 04/27/81
34
-- SPS 3/7/83
35
 
36
WITH REPORT;
37
PROCEDURE  C57004B  IS
38
 
39
     USE  REPORT ;
40
 
41
BEGIN
42
 
43
     TEST( "C57004B" , "CHECK THAT A NAMING EXIT STATEMENT TERMINATES" &
44
                       " EXECUTION OF THE NAMED LOOP AND OF ALL LOOPS" &
45
                       " SITUATED IN-BETWEEN"                         );
46
 
47
     DECLARE
48
 
49
          COUNT : INTEGER     := 0   ;
50
 
51
     BEGIN
52
 
53
          OUTERMOST :
54
          FOR  X  IN  INTEGER RANGE 1..2  LOOP
55
 
56
               FOR  Y  IN  INTEGER RANGE 1..2  LOOP
57
 
58
                    COMMENT( "BEFORE 1" );
59
 
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 ;
71
 
72
 
73
                    COMMENT( "BEFORE 2" );
74
                    COUNT := COUNT + 1 ;
75
 
76
                    LOOP2 :
77
                    FOR  A  IN  1..1  LOOP
78
                         FOR  B  IN  1..1  LOOP
79
 
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;
92
 
93
                         END LOOP;
94
                    END LOOP  LOOP2 ;
95
 
96
 
97
                    COMMENT( "BEFORE 3" );
98
                    COUNT := COUNT + 1 ;
99
 
100
                    LOOP3 :
101
                    FOR  A  IN  1..1  LOOP
102
                         FOR  B  IN  1..1  LOOP
103
 
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;
112
 
113
                         END LOOP;
114
                    END LOOP  LOOP3 ;
115
 
116
 
117
                    COMMENT( "BEFORE 4" );
118
                    COUNT := COUNT + 1 ;
119
 
120
                    LOOP4 :
121
                    FOR  A  IN  1..1  LOOP
122
                         FOR  B  IN  1..1  LOOP
123
 
124
 
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;
135
 
136
                         END LOOP;
137
                    END LOOP  LOOP4 ;
138
 
139
 
140
                    COMMENT( "AFTER 4" );
141
                    COUNT := COUNT + 1 ;
142
                    EXIT  OUTERMOST ;
143
 
144
               END LOOP;
145
 
146
               FAILED( "MISSED FINAL EXIT" );
147
 
148
          END LOOP  OUTERMOST ;
149
 
150
 
151
          IF  COUNT /= 4  THEN
152
               FAILED( "WRONG FLOW OF CONTROL" );
153
          END IF;
154
 
155
 
156
     END ;
157
 
158
 
159
     RESULT ;
160
 
161
 
162
END  C57004B ;

powered by: WebSVN 2.1.0

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