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/] [c55b16a.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
-- C55B16A.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
-- OBJECTIVE:
26
--     CHECK THE PROCESSING OF ITERATIONS OVER AN ENUMERATION TYPE
27
--     WHOSE (USER-DEFINED) REPRESENTATION CONSISTS OF A NON-CONTIGUOUS
28
--     SET OF INTEGERS.
29
--
30
--     (INHERITANCE (AND SUBSEQUENT OVERRIDING) OF REPRESENTATION
31
--     SPECIFICATIONS WILL BE TESTED ELSEWHERE.)
32
 
33
-- HISTORY:
34
--     RM  08/06/82  CREATED ORIGINAL TEST.
35
--     BCB 01/04/88  MODIFIED HEADER.
36
--     PWB 05/11/89  CHANGED EXTENSION FROM '.DEP' TO '.ADA'.
37
 
38
 
39
WITH REPORT; USE REPORT;
40
PROCEDURE  C55B16A  IS
41
 
42
     I1  :  INTEGER := 0 ;
43
 
44
     TYPE  ENUM  IS  ( 'A' , 'B' , 'D' , 'C' , Z , X , D , A , C );
45
     FOR   ENUM  USE ( -15 , -14 , -11 , -10 ,
46
                         1 , 3 , 4 , 8 , 9 );
47
 
48
BEGIN
49
 
50
     TEST ("C55B16A" , "TEST LOOPING OVER ENUMERATION TYPES WITH"  &
51
                       " NON-CONTIGUOUS REPRESENTATION"            );
52
 
53
     I1 := IDENT_INT(0) ;
54
 
55
     FOR  X  IN ENUM LOOP
56
 
57
          IF  X /= ENUM'VAL(I1)  OR
58
              ENUM'POS(X) /= I1                               -- 0..8
59
          THEN
60
               FAILED ( "LOOP_PARAMETER ASCENDING INCORRECTLY (1)" );
61
          END IF;
62
 
63
          I1 := I1 + IDENT_INT(1) ;
64
 
65
     END LOOP;
66
 
67
 
68
     I1 := IDENT_INT(6) ;
69
 
70
     FOR  X  IN ENUM RANGE D .. C LOOP
71
 
72
          IF  X /= ENUM'VAL(I1)  OR
73
              ENUM'POS(X) /= I1                               -- 6..8
74
          THEN
75
               FAILED ( "LOOP_PARAMETER ASCENDING INCORRECTLY (2)" );
76
          END IF;
77
 
78
          I1 := I1 + IDENT_INT(1) ;
79
 
80
     END LOOP;
81
 
82
 
83
     I1 := IDENT_INT(4) ;
84
 
85
     FOR  X  IN REVERSE 'A'..ENUM'(Z) LOOP
86
 
87
          IF  X /= ENUM'VAL(I1)  OR
88
              ENUM'POS(X) /= I1                               -- 4..0
89
          THEN
90
               FAILED ( "LOOP_PARAMETER DESCENDING INCORRECTLY (3)" );
91
          END IF;
92
 
93
          I1 := I1 - IDENT_INT(1) ;
94
 
95
     END LOOP;
96
 
97
 
98
     RESULT ;
99
 
100
 
101
END  C55B16A ;

powered by: WebSVN 2.1.0

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