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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C83031C.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 AN IMPLICIT DECLARATION OF A PREDEFINED OPERATOR OR
27
--     ENUMERATION LITERAL IS HIDDEN BY A GENERIC INSTANTIATION WHICH
28
--     DECLARES A HOMOGRAPH OF THE OPERATOR OR LITERAL.
29
 
30
-- HISTORY:
31
--     BCB 09/15/88  CREATED ORIGINAL TEST.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C83031C IS
35
 
36
BEGIN
37
     TEST ("C83031C", "CHECK THAT AN IMPLICIT DECLARATION OF A " &
38
                      "PREDEFINED OPERATOR OR ENUMERATION LITERAL IS " &
39
                      "HIDDEN BY A GENERIC INSTANTIATION WHICH " &
40
                      "DECLARES A HOMOGRAPH OF THE OPERATOR OR " &
41
                      "LITERAL");
42
 
43
     DECLARE             -- CHECK SUBPROGRAM DECLARATIONS OF OPERATORS
44
          PACKAGE P IS
45
               TYPE INT IS RANGE -20 .. 20;
46
 
47
               GENERIC
48
                    TYPE X IS RANGE <>;
49
               FUNCTION GEN_FUN (LEFT, RIGHT : X) RETURN X;
50
          END P;
51
          USE P;
52
 
53
          PACKAGE BODY P IS
54
               FUNCTION GEN_FUN (LEFT, RIGHT : X) RETURN X IS
55
               BEGIN
56
                    RETURN LEFT / RIGHT;
57
               END GEN_FUN;
58
 
59
               FUNCTION "*" IS NEW GEN_FUN (INT);
60
          BEGIN
61
               IF 2 * INT(IDENT_INT(2)) /= 1 THEN
62
                    FAILED ("INCORRECT VALUE RETURNED IN CALL TO " &
63
                            "EXPLICIT '*' OPERATOR - 1");
64
               END IF;
65
          END P;
66
     BEGIN
67
          NULL;
68
     END;
69
 
70
     DECLARE   -- CHECK SUBPROGRAM DECLARATIONS OF ENUMERATION LITERALS.
71
 
72
          PACKAGE P1 IS
73
               TYPE ENUM1 IS (E11, E12, E13);
74
               TYPE PRIV1 IS PRIVATE;
75
 
76
               GENERIC
77
                    TYPE X IS (<>);
78
               FUNCTION GEN_FUN RETURN X;
79
          PRIVATE
80
               TYPE PRIV1 IS NEW ENUM1;
81
          END P1;
82
          USE P1;
83
 
84
          PACKAGE BODY P1 IS
85
               FUNCTION GEN_FUN RETURN X IS
86
               BEGIN
87
                    RETURN X'LAST;
88
               END GEN_FUN;
89
 
90
               FUNCTION E11 IS NEW GEN_FUN (PRIV1);
91
          BEGIN
92
               IF PRIV1'(E11) /= E13 THEN
93
                    FAILED ("INCORRECT VALUE FOR E11");
94
               END IF;
95
          END P1;
96
     BEGIN
97
          NULL;
98
     END;
99
 
100
     RESULT;
101
END C83031C;

powered by: WebSVN 2.1.0

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