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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C54A42D.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 A FEW ALTERNATIVES
26
--    COVERING A LARGE RANGE OF INTEGERS.
27
 
28
 
29
-- (OPTIMIZATION TEST.)
30
 
31
 
32
-- RM 03/30/81
33
 
34
 
35
WITH REPORT;
36
PROCEDURE  C54A42D  IS
37
 
38
     USE  REPORT ;
39
 
40
BEGIN
41
 
42
     TEST( "C54A42D" , "TEST THAT A  CASE_STATEMENT CORRECTLY HANDLES" &
43
                       " A FEW ALTERNATIVES COVERING A LARGE RANGE" &
44
                       " OF INTEGERS" );
45
 
46
     DECLARE
47
 
48
          NUMBER  : CONSTANT          := 2000 ;
49
          LITEXPR : CONSTANT          := NUMBER + 2000 ;
50
          STATCON : CONSTANT INTEGER  := 2001 ;
51
          DYNVAR  :          INTEGER  := IDENT_INT( 0 );
52
          DYNCON  : CONSTANT INTEGER  := IDENT_INT( 1 );
53
 
54
     BEGIN
55
 
56
          CASE  INTEGER'(-4000)  IS
57
               WHEN  1..2000         =>  FAILED("WRONG ALTERNATIVE F1");
58
               WHEN  INTEGER'FIRST..0=>  NULL ;
59
               WHEN  2001            =>  FAILED("WRONG ALTERNATIVE F3");
60
               WHEN  2002..INTEGER'LAST=>FAILED("WRONG ALTERNATIVE F4");
61
          END CASE;
62
 
63
          CASE  INTEGER'(NUMBER)   IS
64
               WHEN  1..2000         =>  NULL ;
65
               WHEN  INTEGER'FIRST..0=>  FAILED("WRONG ALTERNATIVE G2");
66
               WHEN  2001            =>  FAILED("WRONG ALTERNATIVE G3");
67
               WHEN  2002..INTEGER'LAST=>FAILED("WRONG ALTERNATIVE G4");
68
          END CASE;
69
 
70
          CASE  IDENT_INT(LITEXPR)  IS
71
               WHEN  1..2000         =>  FAILED("WRONG ALTERNATIVE H1");
72
               WHEN  INTEGER'FIRST..0=>  FAILED("WRONG ALTERNATIVE H2");
73
               WHEN  2001            =>  FAILED("WRONG ALTERNATIVE H3");
74
               WHEN  2002..INTEGER'LAST=>NULL ;
75
          END CASE;
76
 
77
          CASE  STATCON  IS
78
               WHEN  1..2000         =>  FAILED("WRONG ALTERNATIVE I1");
79
               WHEN  INTEGER'FIRST..0=>  FAILED("WRONG ALTERNATIVE I2");
80
               WHEN  2001            =>  NULL ;
81
               WHEN  2002..INTEGER'LAST=>FAILED("WRONG ALTERNATIVE I4");
82
          END CASE;
83
 
84
          CASE  DYNVAR   IS
85
               WHEN  1..2000         =>  FAILED("WRONG ALTERNATIVE J1");
86
               WHEN  INTEGER'FIRST..0=>  NULL ;
87
               WHEN  2001            =>  FAILED("WRONG ALTERNATIVE J3");
88
               WHEN  2002..INTEGER'LAST=>FAILED("WRONG ALTERNATIVE J4");
89
          END CASE;
90
 
91
          CASE  DYNCON   IS
92
               WHEN  1..2000         =>  NULL ;
93
               WHEN  INTEGER'FIRST..0=>  FAILED("WRONG ALTERNATIVE K2");
94
               WHEN  2001            =>  FAILED("WRONG ALTERNATIVE K3");
95
               WHEN  2002..INTEGER'LAST=>FAILED("WRONG ALTERNATIVE K4");
96
          END CASE;
97
 
98
     END ;
99
 
100
 
101
     RESULT ;
102
 
103
 
104
END  C54A42D ;

powered by: WebSVN 2.1.0

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