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/] [a/] [a54b02a.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
-- A54B02A.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 IF A CASE EXPRESSION IS A VARIABLE, CONSTANT, TYPE 
26
--    CONVERSION, ATTRIBUTE (IN PARTICULAR 'FIRST AND 'LAST),
27
--    FUNCTION INVOCATION, QUALIFIED EXPRESSION, OR A PARENTHESIZED
28
--    EXPRESSION HAVING ONE OF THESE FORMS, AND THE SUBTYPE OF THE
29
--    EXPRESSION IS NON-STATIC, AN  'OTHERS'  CAN BE OMITTED IF ALL
30
--    VALUES IN THE BASE TYPE'S RANGE ARE COVERED.
31
 
32
-- RM 01/27/80
33
-- SPS 10/26/82
34
-- SPS 2/2/83
35
-- PWN 11/30/94 SUBTYPE QUALIFIED LITERALS FOR ADA 9X.
36
 
37
WITH REPORT ;
38
PROCEDURE  A54B02A  IS
39
 
40
     USE REPORT ;
41
 
42
BEGIN
43
 
44
     TEST("A54B02A" , "CHECK THAT IF THE" &
45
                      " SUBTYPE OF A CASE EXPRESSION IS NON-STATIC," &
46
                      " AN  'OTHERS'  CAN BE OMITTED IF ALL" &
47
                      " VALUES IN THE BASE TYPE'S RANGE ARE COVERED" );
48
 
49
     -- THE TEST CASES APPEAR IN THE FOLLOWING ORDER:
50
     --
51
     --         (A)    VARIABLES (INTEGER , BOOLEAN)
52
     --         (B)    CONSTANTS (INTEGER, BOOLEAN)
53
     --         (C)    ATTRIBUTES ('FIRST, 'LAST)    
54
     --         (D)    FUNCTION CALLS
55
     --         (E)    QUALIFIED EXPRESSIONS
56
     --         (F)    TYPE CONVERSIONS
57
     --         (G)    PARENTHESIZED EXPRESSIONS OF THE ABOVE KINDS
58
 
59
 
60
     DECLARE   --  NON-STATIC RANGES
61
 
62
          SUBTYPE  STAT   IS  INTEGER RANGE 1..50 ;
63
          SUBTYPE  DYN    IS  STAT    RANGE 1..IDENT_INT( 5 ) ;
64
          I   : STAT RANGE 1..IDENT_INT( 5 );
65
          J   : DYN ;
66
          SUBTYPE  DYNCHAR  IS
67
                CHARACTER RANGE ASCII.NUL .. IDENT_CHAR('Q');
68
          SUBTYPE  STATCHAR  IS
69
                DYNCHAR RANGE 'A' .. 'C' ;
70
          CHAR: DYNCHAR := 'F' ;
71
          TYPE  ENUMERATION  IS  ( A,B,C,D,E,F,G,H,K,L,M,N );
72
          SUBTYPE  STATENUM  IS
73
                ENUMERATION RANGE  A .. L ;
74
          SUBTYPE  DYNENUM  IS
75
                STATENUM  RANGE  A .. ENUMERATION'VAL(IDENT_INT(5));
76
          ENUM: DYNENUM := B ;
77
          CONS : CONSTANT DYN := 3;
78
 
79
          FUNCTION  FF  RETURN DYN  IS
80
          BEGIN
81
               RETURN  2 ;
82
          END  FF ;
83
 
84
     BEGIN
85
 
86
          I  :=  IDENT_INT( 2 );
87
          J  :=  IDENT_INT( 2 );
88
 
89
          CASE  I  IS
90
               WHEN  1 | 3 | 5  =>  NULL ;
91
               WHEN  2 | 4      =>  NULL ;
92
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
93
          END CASE;
94
 
95
          CASE  J  IS
96
               WHEN  1 | 3 | 5  =>  NULL ;
97
               WHEN  2 | 4      =>  NULL ;
98
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
99
          END CASE;
100
 
101
          CASE CONS IS
102
               WHEN  INTEGER'FIRST..INTEGER'LAST  =>  NULL;
103
          END CASE;
104
 
105
          CASE DYN'FIRST IS
106
               WHEN INTEGER'FIRST..0  =>  NULL;
107
               WHEN 1..INTEGER'LAST  =>  NULL;
108
          END CASE;
109
 
110
          CASE STATCHAR'LAST IS
111
               WHEN CHARACTER'FIRST..'A'  =>  NULL;
112
               WHEN 'B'..CHARACTER'LAST  =>  NULL;
113
          END CASE;
114
 
115
          CASE  FF  IS
116
               WHEN  4..5  =>  NULL ;
117
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
118
               WHEN  1..3  =>  NULL ;
119
          END CASE;
120
 
121
          CASE  DYN'( 2 )  IS
122
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
123
               WHEN  5 | 2..4  =>  NULL ;
124
               WHEN  1         =>  NULL ;
125
          END CASE;
126
 
127
          CASE  DYN( J )  IS
128
               WHEN  5 | 2..4  =>  NULL ;
129
               WHEN  1         =>  NULL ;
130
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
131
          END CASE;
132
 
133
 
134
          CASE  ( CHAR )  IS
135
               WHEN  ASCII.NUL .. 'P'  =>  NULL ;
136
               WHEN  'Q'               =>  NULL ;
137
               WHEN  'R' .. 'Y'        =>  NULL ;
138
               WHEN  'Z' .. CHARACTER'LAST  =>  NULL ;
139
          END CASE;
140
 
141
          CASE  ( ENUM )  IS
142
               WHEN  A | C | E  =>  NULL ;
143
               WHEN  B | D      =>  NULL ;
144
               WHEN  F .. L     =>  NULL ;
145
               WHEN  M .. N     =>  NULL ;
146
          END CASE;
147
 
148
          CASE  ( FF )  IS
149
               WHEN  1 | 3 | 5  =>  NULL ;
150
               WHEN  2 | 4      =>  NULL ;
151
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
152
          END CASE;
153
 
154
          CASE  ( DYN'( I ) )  IS
155
               WHEN  4..5  =>  NULL ;
156
               WHEN  1..3  =>  NULL ;
157
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
158
          END CASE;
159
 
160
          CASE  ( DYN( 2 ) )  IS
161
               WHEN  5 | 2..4  =>  NULL ;
162
               WHEN  1         =>  NULL ;
163
               WHEN  INTEGER'FIRST..0 | 6..INTEGER'LAST  =>  NULL ;
164
          END CASE;
165
 
166
          CASE (CONS) IS
167
               WHEN 1..100  =>  NULL;
168
               WHEN INTEGER'FIRST..0  =>  NULL;
169
               WHEN 101..INTEGER'LAST  =>  NULL;
170
          END CASE;
171
 
172
          CASE (DYNCHAR'LAST) IS
173
               WHEN 'B'..'Y'  =>  NULL;
174
               WHEN CHARACTER'FIRST..'A'  =>  NULL;
175
               WHEN 'Z'..CHARACTER'LAST  =>  NULL;
176
          END CASE;
177
 
178
     END;
179
 
180
 
181
     RESULT ;
182
 
183
 
184
END A54B02A ;

powered by: WebSVN 2.1.0

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