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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C35507J.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 THAT THE ATTRIBUTES 'PRED' AND 'SUCC' YIELD THE CORRECT
27
--     RESULTS WHEN THE PREFIX IS A FORMAL DISCRETE TYPE WHOSE ACTUAL
28
--     PARAMETER IS A CHARACTER TYPE WITH AN ENUMERATION REPRESENTATION
29
--     CLAUSE.
30
 
31
-- HISTORY:
32
--     RJW 06/03/86  CREATED ORIGINAL TEST.
33
--     JET 09/22/87  MADE REPRESENTATION VALUES CONSECUTIVE.
34
--     PWB 05/11/89  CHANGED EXTENSION FROM '.DEP' TO '.ADA'.
35
 
36
WITH REPORT; USE REPORT;
37
 
38
PROCEDURE  C35507J  IS
39
 
40
     TYPE CHAR IS ('A', B);
41
     FOR CHAR USE ('A' => 4, B => 5);
42
 
43
     TYPE NEWCHAR IS NEW CHAR;
44
 
45
BEGIN
46
 
47
     TEST( "C35507J" , "CHECK THAT THE ATTRIBUTES 'PRED' AND " &
48
                       "'SUCC' YIELD THE CORRECT RESULTS WHEN THE " &
49
                       "PREFIX IS A FORMAL DISCRETE TYPE WHOSE " &
50
                       "ACTUAL PARAMETER IS A CHARACTER TYPE WITH " &
51
                       "WITH AN ENUMERATION REPRESENTATION CLAUSE" );
52
 
53
 
54
     DECLARE
55
          GENERIC
56
               TYPE CHTYPE IS (<>);
57
               STR : STRING;
58
               I1, I2 : INTEGER;
59
          PROCEDURE P;
60
 
61
          PROCEDURE P IS
62
               SUBTYPE SUBCH IS CHTYPE
63
                         RANGE CHTYPE'VAL (I1) .. CHTYPE'VAL (I2);
64
          BEGIN
65
               FOR CH IN SUBCH'VAL (I1 + 1) .. SUBCH'VAL (I2) LOOP
66
                    IF SUBCH'PRED (CH) /=
67
                       SUBCH'VAL (SUBCH'POS (CH) - 1) THEN
68
                         FAILED ( "INCORRECT VALUE FOR " & STR &
69
                                  "'PRED OF " & SUBCH'IMAGE (CH) );
70
                    END IF;
71
               END LOOP;
72
 
73
               FOR CH IN SUBCH'VAL (I1) .. SUBCH'VAL (I2 - 1) LOOP
74
                    IF SUBCH'SUCC (CH) /=
75
                       SUBCH'VAL (SUBCH'POS (CH) + 1) THEN
76
                         FAILED ( "INCORRECT VALUE FOR " & STR &
77
                                  "'SUCC OF " & SUBCH'IMAGE (CH) );
78
                    END IF;
79
               END LOOP;
80
 
81
          END P;
82
 
83
          PROCEDURE PCHAR IS NEW P (CHAR, "CHAR", 0, 1);
84
          PROCEDURE PNCHAR IS NEW P (NEWCHAR, "NEWCHAR", 0, 1);
85
 
86
     BEGIN
87
          PCHAR;
88
          PNCHAR;
89
 
90
     END;
91
 
92
     RESULT;
93
END C35507J;

powered by: WebSVN 2.1.0

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