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/] [cc/] [cc3011a.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CC3011A.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 SUBPROGRAMS THAT WOULD HAVE THE SAME SPECIFICATION
26
-- AFTER GENERIC INSTANTIATION MAY BE DECLARED IN THE SAME
27
-- DECLARATIVE PART, AND THAT CALLS WITHIN THE INSTANTIATED UNIT ARE
28
-- UNAMBIGUOUS.  CHECK THAT CALLS FROM OUTSIDE THE UNIT ARE UNAMBIGUOUS
29
-- IF FORMAL PARAMETER NAMES ARE USED OR IF ONLY ONE OF THE EQUIVALENT
30
-- PROGRAMS APPEARS IN THE VISIBLE PART OF THE PACKAGE.
31
 
32
-- DAT 9/18/81
33
-- SPS 10/19/82
34
 
35
WITH REPORT; USE REPORT;
36
 
37
PROCEDURE CC3011A IS
38
BEGIN
39
     TEST ("CC3011A", "CHECK SUBPROGRAMS IN GENERIC PACKAGES WITH SAME"
40
          & " SPECIFICATION AFTER GENERIC PARAMETER SUBSTITUTION");
41
 
42
     DECLARE
43
          C : INTEGER := 0;
44
 
45
          GENERIC
46
               TYPE S IS ( <> );
47
               TYPE T IS PRIVATE;
48
               TYPE U IS RANGE <> ;
49
               VT : T;
50
          PACKAGE PKG IS
51
               PROCEDURE P1 (X : S);
52
          PRIVATE
53
               PROCEDURE P1 (X : T);
54
               VS : S := S'FIRST;
55
               VU : U := U'FIRST;
56
          END PKG;
57
 
58
          GENERIC
59
               TYPE S IS (<>);
60
               TYPE T IS RANGE <>;
61
          PACKAGE PP IS
62
               PROCEDURE P1 (D: S);
63
               PROCEDURE P1 (X: T);
64
          END PP;
65
 
66
          PACKAGE BODY PKG IS
67
               PROCEDURE P1 (X : S) IS
68
               BEGIN
69
                    C := C + 1;
70
               END P1;
71
               PROCEDURE P1 (X : T) IS
72
               BEGIN
73
                    C := C + 2;
74
               END P1;
75
               PROCEDURE P1 (X : U) IS
76
               BEGIN
77
                    C := C + 4;
78
               END P1;
79
          BEGIN
80
               C := 0;
81
               P1 (VS);
82
               IF C /= IDENT_INT (1) THEN
83
                    FAILED ("WRONG P1 CALLED -S");
84
               END IF;
85
               C := 0;
86
               P1 (VT);
87
               IF C /= IDENT_INT (2) THEN
88
                    FAILED ("WRONG P1 CALLED -T");
89
               END IF;
90
               C := 0;
91
               P1 (VU);
92
               IF C /= IDENT_INT (4) THEN
93
                    FAILED ("WRONG P1 CALLED -U");
94
               END IF;
95
               C := 0;
96
          END PKG;
97
 
98
          PACKAGE BODY PP IS
99
               PROCEDURE P1 (D: S) IS
100
               BEGIN
101
                    C := C + 3;
102
               END P1;
103
               PROCEDURE P1 (X: T) IS
104
               BEGIN
105
                    C := C + 5;
106
               END P1;
107
          BEGIN
108
               NULL;
109
          END PP;
110
 
111
          PACKAGE NP IS NEW PKG (INTEGER, INTEGER, INTEGER, 7);
112
          PACKAGE NPP IS NEW PP (INTEGER, INTEGER);
113
     BEGIN
114
          NP.P1 (4);
115
          IF C /= IDENT_INT (1) THEN
116
               FAILED ("INCORRECT OVERLOADING ON FORMAL TYPES");
117
          END IF;
118
          C := 0;
119
          NPP.P1 (D => 3);
120
          IF C /= IDENT_INT (3) THEN
121
               FAILED ("INCORRECT CALL TO P1 WITH D PARAMETER");
122
          END IF;
123
          C := 0;
124
          NPP.P1 (X => 7);
125
          IF C /= IDENT_INT (5) THEN
126
               FAILED ("INCORRECT CALL TO P1 WITH X PARAMETER");
127
          END IF;
128
     END;
129
 
130
     RESULT;
131
END CC3011A;

powered by: WebSVN 2.1.0

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