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/] [c5/] [c59002b.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C59002B.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 JUMPS OUT OF COMPOUND STATEMENTS (OTHER THAN
26
--    ACCEPT STATEMENTS) ARE POSSIBLE AND ARE CORRECTLY PERFORMED.
27
 
28
 
29
-- FLOW OF CONTROL:   A ->  B ->  C ->  D ->   E ->  F ->  G ->  H .
30
--                    |     |     |     |      |     |     |
31
--                    IF   LOOP   CASE  BLOCK  IF   LOOP   CASE
32
--                                             LOOP CASE   BLOCK
33
 
34
 
35
--          A : GOTO B              L111 -> L311
36
--          FAILURE                 L121
37
--          E : GOTO F              L131 -> L331
38
 
39
--          FAILURE                 L100
40
 
41
--          C : GOTO D              L211 -> L411
42
--          FAILURE                 L221
43
--          G : GOTO H              L231
44
 
45
--          FAILURE                 L200
46
 
47
--          B : GOTO C              L311 -> L211
48
--          FAILURE                 L321
49
--          F : GOTO G              L331
50
 
51
--          FAILURE                 L300
52
 
53
--          D : GOTO E              L411 -> L131
54
--          FAILURE                 L421
55
--          H :                     L431 -> (OUT)
56
 
57
--          PRINT RESULTS
58
 
59
 
60
-- RM 06/05/81
61
-- SPS 3/8/83
62
 
63
WITH REPORT;
64
PROCEDURE  C59002B  IS
65
 
66
     USE  REPORT ;
67
 
68
BEGIN
69
 
70
     TEST( "C59002B" , "CHECK THAT ONE CAN JUMP OUT OF COMPOUND STATE" &
71
                       "MENTS" );
72
 
73
 
74
     DECLARE
75
 
76
          FLOW_STRING : STRING(1..8) := "XXXXXXXX" ;
77
          INDEX       : INTEGER      :=  1 ;
78
 
79
     BEGIN
80
 
81
          << L111 >>
82
 
83
          FLOW_STRING(INDEX) := 'A' ;
84
          INDEX              := INDEX + 1 ;
85
 
86
          IF  FALSE  THEN
87
               FAILED( "WRONG 'IF' BRANCH" );
88
          ELSE
89
               GOTO  L311 ;
90
          END IF;
91
 
92
          << L121 >>
93
 
94
          FAILED( "AT L121  -  WRONGLY" );
95
 
96
          << L131 >>
97
 
98
          FLOW_STRING(INDEX) := 'E' ;
99
          INDEX              := INDEX + 1 ;
100
 
101
          IF  FALSE  THEN
102
               FAILED( "WRONG 'IF' BRANCH" );
103
          ELSE
104
               FOR  J  IN  1..1  LOOP
105
                    GOTO  L331 ;
106
               END LOOP;
107
          END IF;
108
 
109
          << L100 >>
110
 
111
          FAILED( "AT L100  -  WRONGLY" );
112
 
113
          << L211 >>
114
 
115
          FLOW_STRING(INDEX) := 'C' ;
116
          INDEX              := INDEX + 1 ;
117
 
118
          CASE  2  IS
119
               WHEN  1  =>
120
                    FAILED( "WRONG 'CASE' BRANCH" );
121
               WHEN  OTHERS  =>
122
                    GOTO  L411 ;
123
          END CASE;
124
 
125
          << L221 >>
126
 
127
          FAILED( "AT L221  -  WRONGLY" );
128
 
129
          << L231 >>
130
 
131
          FLOW_STRING(INDEX) := 'G' ;
132
          INDEX              := INDEX + 1 ;
133
 
134
          CASE  2  IS
135
               WHEN  1  =>
136
                    FAILED( "WRONG 'CASE' BRANCH" );
137
               WHEN  OTHERS  =>
138
                    DECLARE
139
                    BEGIN
140
                         GOTO  L431 ;
141
                    END ;
142
          END CASE;
143
 
144
          << L200 >>
145
 
146
          FAILED( "AT L200  -  WRONGLY" );
147
 
148
          << L311 >>
149
 
150
          FLOW_STRING(INDEX) := 'B' ;
151
          INDEX              := INDEX + 1 ;
152
 
153
          FOR  I  IN  1..1  LOOP
154
               GOTO  L211 ;
155
          END LOOP;
156
 
157
          << L321 >>
158
 
159
          FAILED( "AT L321  -  WRONGLY" );
160
 
161
          << L331 >>
162
 
163
          FLOW_STRING(INDEX) := 'F' ;
164
          INDEX              := INDEX + 1 ;
165
 
166
          FOR  I  IN  1..1  LOOP
167
               CASE  2  IS
168
                    WHEN  1  =>
169
                         FAILED( "WRONG 'CASE' BRANCH" );
170
                    WHEN  OTHERS  =>
171
                         GOTO  L231 ;
172
               END CASE;
173
          END LOOP;
174
 
175
          << L300 >>
176
 
177
          FAILED( "AT L300  -  WRONGLY" );
178
 
179
          << L411 >>
180
 
181
          FLOW_STRING(INDEX) := 'D' ;
182
          INDEX              := INDEX + 1 ;
183
 
184
          DECLARE
185
               K : INTEGER := 17 ;
186
          BEGIN
187
               GOTO  L131 ;
188
          END;
189
 
190
          << L421 >>
191
 
192
          FAILED( "AT L421  -  WRONGLY" );
193
 
194
          << L431 >>
195
 
196
          FLOW_STRING(INDEX) := 'H' ;
197
 
198
 
199
          IF  FLOW_STRING /= "ABCDEFGH"  THEN
200
               FAILED("WRONG FLOW OF CONTROL" );
201
          END IF;
202
 
203
     END ;
204
 
205
 
206
     RESULT ;
207
 
208
 
209
END C59002B;

powered by: WebSVN 2.1.0

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