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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- A54B01A.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 CONSTANT, VARIABLE,
26
--    TYPE CONVERSION, OR QUALIFIED EXPRESSION,
27
--    AND THE SUBTYPE OF THE
28
--    EXPRESSION IS STATIC, AN  'OTHERS'  CAN BE OMITTED IF ALL
29
--    VALUES IN THE SUBTYPE'S RANGE ARE COVERED.
30
 
31
 
32
-- RM 01/23/80
33
-- SPS 10/26/82
34
-- SPS 2/1/83
35
 
36
WITH REPORT ;
37
PROCEDURE  A54B01A  IS
38
 
39
     USE REPORT ;
40
 
41
BEGIN
42
 
43
     TEST("A54B01A" , "CHECK THAT IF" &
44
                      " THE SUBTYPE OF A CASE EXPRESSION IS STATIC," &
45
                      " AN  'OTHERS'  CAN BE OMITTED IF ALL" &
46
                      " VALUES IN THE SUBTYPE'S RANGE ARE COVERED" );
47
 
48
     -- THE TEST CASES APPEAR IN THE FOLLOWING ORDER:
49
     --
50
     --    I.   CONSTANTS
51
     --
52
     --    II.  STATIC SUBRANGES
53
     --
54
     --         (A)    VARIABLES (INTEGER , BOOLEAN)
55
     --         (B)    QUALIFIED EXPRESSIONS
56
     --         (C)    TYPE CONVERSIONS
57
 
58
     DECLARE  -- CONSTANTS
59
          T : CONSTANT BOOLEAN := TRUE;
60
          FIVE : CONSTANT INTEGER := IDENT_INT(5);
61
     BEGIN
62
 
63
          CASE  FIVE  IS
64
               WHEN  INTEGER'FIRST..4  =>  NULL ;
65
               WHEN  5                 =>  NULL ;
66
               WHEN  6 .. INTEGER'LAST =>  NULL ;
67
          END CASE;
68
 
69
          CASE  T  IS
70
               WHEN  TRUE              =>  NULL ;
71
               WHEN  FALSE             =>  NULL ;
72
          END CASE;
73
 
74
     END ;
75
 
76
 
77
     DECLARE   --  STATIC SUBRANGES
78
 
79
          SUBTYPE  STAT  IS  INTEGER RANGE 1..5 ;
80
          I   : INTEGER RANGE 1..5 ;
81
          J   : STAT ;
82
          BOOL: BOOLEAN := FALSE ;
83
          CHAR: CHARACTER := 'U' ;
84
          TYPE  ENUMERATION  IS  ( FIRST,SECOND,THIRD,FOURTH,FIFTH );
85
          ENUM: ENUMERATION := THIRD ;
86
 
87
 
88
     BEGIN
89
 
90
          I  :=  IDENT_INT( 2 );
91
          J  :=  IDENT_INT( 2 );
92
 
93
          CASE  I  IS
94
               WHEN  1 | 3 | 5  =>  NULL ;
95
               WHEN  2 | 4      =>  NULL ;
96
          END CASE;
97
 
98
          CASE  BOOL  IS
99
               WHEN  TRUE   =>  NULL ;
100
               WHEN  FALSE  =>  NULL ;
101
          END CASE;
102
 
103
          CASE  STAT'( 2 )  IS
104
               WHEN  5 | 2..4  =>  NULL ;
105
               WHEN  1         =>  NULL ;
106
          END CASE;
107
 
108
          CASE  STAT( J )  IS
109
               WHEN  5 | 2..4  =>  NULL ;
110
               WHEN  1         =>  NULL ;
111
          END CASE;
112
 
113
 
114
     END ;     --  STATIC SUBRANGES
115
 
116
     RESULT ;
117
 
118
 
119
END A54B01A ;

powered by: WebSVN 2.1.0

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