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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CC3606A.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 DEFAULT EXPRESSIONS OF A FORMAL SUBPROGRAM'S
27
--     FORMAL PARAMETERS ARE USED WHEN THE FORMAL SUBPROGRAM IS
28
--     CALLED IN THE INSTANTIATED UNIT (RATHER THAN ANY DEFAULT
29
--     ASSOCIATED WITH ACTUAL SUBPROGRAM'S PARAMETERS).
30
 
31
-- HISTORY:
32
--     BCB 09/29/87  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
 
36
PROCEDURE CC3606A IS
37
 
38
     X : BOOLEAN;
39
     Y : BOOLEAN;
40
 
41
     FUNCTION FUNC (A : INTEGER := 35) RETURN BOOLEAN IS
42
     BEGIN
43
          RETURN (A = 7);
44
     END FUNC;
45
 
46
     PROCEDURE PROC (B : INTEGER := 35) IS
47
     BEGIN
48
          IF B /= 7 THEN
49
               FAILED ("DEFAULT EXPRESSION OF FORMAL PARAMETER " &
50
                       "PROCEDURE NOT USED - 1");
51
          END IF;
52
     END PROC;
53
 
54
     FUNCTION FUNC1 (C : INTEGER := 35) RETURN BOOLEAN IS
55
     BEGIN
56
          RETURN (C = 7);
57
     END FUNC1;
58
 
59
     PROCEDURE PROC3 (D : INTEGER := 35) IS
60
     BEGIN
61
          IF D /= 7 THEN
62
               FAILED ("DEFAULT EXPRESSION OF FORMAL PARAMETER " &
63
                       "PROCEDURE NOT USED - 2");
64
          END IF;
65
     END PROC3;
66
 
67
     GENERIC
68
          WITH FUNCTION FUNC (A : INTEGER := 7) RETURN BOOLEAN;
69
     FUNCTION GENFUNC RETURN BOOLEAN;
70
 
71
     FUNCTION GENFUNC RETURN BOOLEAN IS
72
     BEGIN
73
          IF NOT FUNC THEN
74
               FAILED ("DEFAULT EXPRESSION OF FORMAL PARAMETER " &
75
                       "FUNCTION NOT USED - 1");
76
          END IF;
77
          RETURN TRUE;
78
     END GENFUNC;
79
 
80
     GENERIC
81
          WITH PROCEDURE PROC (B : INTEGER := 7);
82
     PACKAGE PKG IS
83
     END PKG;
84
 
85
     PACKAGE BODY PKG IS
86
     BEGIN
87
          PROC;
88
     END PKG;
89
 
90
     GENERIC
91
          WITH FUNCTION FUNC1 (C : INTEGER := 7) RETURN BOOLEAN;
92
     PROCEDURE PROC2;
93
 
94
     PROCEDURE PROC2 IS
95
     BEGIN
96
          IF NOT FUNC1 THEN
97
               FAILED ("DEFAULT EXPRESSION OF FORMAL PARAMETER " &
98
                       "FUNCTION NOT USED - 2");
99
          END IF;
100
     END PROC2;
101
 
102
     GENERIC
103
          WITH PROCEDURE PROC3 (D : INTEGER := 7) IS <>;
104
     FUNCTION GENFUNC1 RETURN BOOLEAN;
105
 
106
     FUNCTION GENFUNC1 RETURN BOOLEAN IS
107
     BEGIN
108
          PROC3;
109
          RETURN TRUE;
110
     END GENFUNC1;
111
 
112
     FUNCTION NEWFUNC IS NEW GENFUNC(FUNC);
113
 
114
     PACKAGE PACK IS NEW PKG(PROC);
115
 
116
     PROCEDURE PROC4 IS NEW PROC2(FUNC1);
117
 
118
     FUNCTION NEWFUNC1 IS NEW GENFUNC1;
119
 
120
BEGIN
121
 
122
     TEST ("CC3606A", "CHECK THAT THE DEFAULT EXPRESSIONS OF A " &
123
                      "FORMAL SUBPROGRAM'S FORMAL PARAMETERS ARE " &
124
                      "USED WHEN THE FORMAL SUBPROGRAM IS CALLED IN " &
125
                      "THE INSTANTIATED UNIT (RATHER THAN ANY " &
126
                      "DEFAULT ASSOCIATED WITH ACTUAL SUBPROGRAM'S " &
127
                      "PARAMETERS)");
128
 
129
     X := NEWFUNC;
130
     Y := NEWFUNC1;
131
     PROC4;
132
 
133
     RESULT;
134
END CC3606A;

powered by: WebSVN 2.1.0

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