OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c5/] [c54a42f.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C54A42F.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 A  CASE_STATEMENT CORRECTLY HANDLES SEVERAL SMALL,
26
--    NON-CONTIGUOUS RANGES OF INTEGERS COVERED BY A SINGLE  'OTHERS'
27
--    ALTERNATIVE.
28
 
29
 
30
-- (OPTIMIZATION TEST.)
31
 
32
 
33
-- RM 03/31/81
34
 
35
 
36
WITH REPORT;
37
PROCEDURE  C54A42F  IS
38
 
39
     USE  REPORT ;
40
 
41
BEGIN
42
 
43
     TEST( "C54A42F" , "TEST THAT A  CASE_STATEMENT CORRECTLY HANDLES" &
44
                       " SEVERAL SMALL, NON-CONTIGUOUS ENUMERATION"    &
45
                       " RANGES COVERED BY A SINGLE  'OTHERS'  "       &
46
                       " ALTERNATIVE"  );
47
 
48
     DECLARE
49
 
50
          TYPE  DAY  IS (SUN , MON , TUE , WED , THU , FRI ,  SAT );
51
 
52
          DYNVAR2 :          DAY  := MON ;
53
          STATVAR :          DAY  := TUE ;
54
          STATCON : CONSTANT DAY  := WED ;
55
          DYNVAR  :          DAY  := THU ;
56
          DYNCON  : CONSTANT DAY  :=     DAY'VAL( IDENT_INT(5) ); -- FRI
57
 
58
     BEGIN
59
 
60
          IF EQUAL(1,289) THEN
61
               DYNVAR  := SUN ;
62
               DYNVAR2 := SUN ;
63
          END IF;
64
 
65
          CASE  SUN  IS        --  SUN
66
               WHEN  THU       =>  FAILED("WRONG ALTERNATIVE F1");
67
               WHEN  SUN       =>  NULL ;
68
               WHEN  SAT       =>  FAILED("WRONG ALTERNATIVE F3");
69
               WHEN  TUE..WED  =>  FAILED("WRONG ALTERNATIVE F4");
70
               WHEN  OTHERS    =>  FAILED("WRONG ALTERNATIVE F5");
71
          END CASE;
72
 
73
          CASE  DYNVAR2   IS   --  MON
74
               WHEN  THU       =>  FAILED("WRONG ALTERNATIVE G1");
75
               WHEN  SUN       =>  FAILED("WRONG ALTERNATIVE G2");
76
               WHEN  SAT       =>  FAILED("WRONG ALTERNATIVE G3");
77
               WHEN  TUE..WED  =>  FAILED("WRONG ALTERNATIVE G4");
78
               WHEN  OTHERS    =>  NULL ;
79
          END CASE;
80
 
81
          CASE  STATVAR  IS    --  TUE
82
               WHEN  THU       =>  FAILED("WRONG ALTERNATIVE H1");
83
               WHEN  SUN       =>  FAILED("WRONG ALTERNATIVE H2");
84
               WHEN  SAT       =>  FAILED("WRONG ALTERNATIVE H3");
85
               WHEN  TUE..WED  =>  NULL ;
86
               WHEN  OTHERS    =>  FAILED("WRONG ALTERNATIVE H5");
87
          END CASE;
88
 
89
          CASE  STATCON  IS    --  WED
90
               WHEN  THU       =>  FAILED("WRONG ALTERNATIVE I1");
91
               WHEN  SUN       =>  FAILED("WRONG ALTERNATIVE I2");
92
               WHEN  SAT       =>  FAILED("WRONG ALTERNATIVE I3");
93
               WHEN  TUE..WED  =>  NULL ;
94
               WHEN  OTHERS    =>  FAILED("WRONG ALTERNATIVE I5");
95
          END CASE;
96
 
97
          CASE  DYNVAR   IS    --  THU
98
               WHEN  THU       =>  NULL ;
99
               WHEN  SUN       =>  FAILED("WRONG ALTERNATIVE J2");
100
               WHEN  SAT       =>  FAILED("WRONG ALTERNATIVE J3");
101
               WHEN  TUE..WED  =>  FAILED("WRONG ALTERNATIVE J4");
102
               WHEN  OTHERS    =>  FAILED("WRONG ALTERNATIVE J5");
103
          END CASE;
104
 
105
          CASE  DYNCON   IS    --  FRI
106
               WHEN  THU       =>  FAILED("WRONG ALTERNATIVE K1");
107
               WHEN  SUN       =>  FAILED("WRONG ALTERNATIVE K2");
108
               WHEN  SAT       =>  FAILED("WRONG ALTERNATIVE K3");
109
               WHEN  TUE..WED  =>  FAILED("WRONG ALTERNATIVE K4");
110
               WHEN  OTHERS    =>  NULL ;
111
          END CASE;
112
 
113
          CASE  DAY'SUCC( DYNCON )  IS   --  SAT
114
               WHEN THU       =>  FAILED("WRONG ALTERNATIVE L1");
115
               WHEN SUN       =>  FAILED("WRONG ALTERNATIVE L2");
116
               WHEN SAT       =>  NULL ;
117
               WHEN TUE..WED  =>  FAILED("WRONG ALTERNATIVE L4");
118
               WHEN OTHERS    =>  FAILED("WRONG ALTERNATIVE L5");
119
          END CASE;
120
     END ;
121
 
122
 
123
     RESULT ;
124
 
125
 
126
END  C54A42F ;

powered by: WebSVN 2.1.0

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