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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C83022G0M.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 A DECLARATION IN A SUBPROGRAM FORMAL PART OR BODY
27
--     HIDES AN OUTER DECLARATION OF A HOMOGRAPH. ALSO CHECK THAT THE
28
--     OUTER DECLARATION IS DIRECTLY VISIBLE IN BOTH DECLARATIVE
29
--     REGIONS BEFORE THE DECLARATION OF THE INNER HOMOGRAPH AND THE
30
--     OUTER DECLARATION IS VISIBLE BY SELECTION AFTER THE INNER
31
--     HOMOGRAPH DECLARATION, IF THE SUBPROGRAM BODY IS COMPILED
32
--     SEPARATELY AS A SUBUNIT.
33
 
34
-- SEPARATE FILES ARE:
35
--     C83022G0M.ADA - (THIS FILE) MAIN PROGRAM.
36
--     C83022G1.ADA -- SUBPROGRAM BODIES.
37
 
38
-- HISTORY:
39
--     BCB 08/26/88  CREATED ORIGINAL TEST.
40
 
41
WITH REPORT; USE REPORT;
42
 
43
PROCEDURE C83022G0M IS
44
 
45
     GENERIC
46
          TYPE T IS PRIVATE;
47
          X : T;
48
     FUNCTION GEN_FUN RETURN T;
49
 
50
     A : INTEGER := IDENT_INT(2);
51
     B : INTEGER := A;
52
 
53
     OBJ : INTEGER := IDENT_INT(3);
54
 
55
     FLO : FLOAT := 5.0;
56
 
57
     PROCEDURE TEMPLATE (X : IN INTEGER := A;
58
                         Y : IN OUT INTEGER);
59
 
60
     PROCEDURE INNER4 (Z : IN INTEGER := A;
61
                       A : IN OUT INTEGER) RENAMES TEMPLATE;
62
 
63
     PROCEDURE INNER (X : IN OUT INTEGER) IS SEPARATE;
64
 
65
     PROCEDURE INNER2 (X : IN INTEGER := A;
66
                       A : IN OUT INTEGER) IS SEPARATE;
67
 
68
     FUNCTION INNER3 (X : INTEGER) RETURN INTEGER IS SEPARATE;
69
 
70
     PROCEDURE TEMPLATE (X : IN INTEGER := A;
71
                         Y : IN OUT INTEGER) IS SEPARATE;
72
 
73
     PROCEDURE INNER5 (X : IN OUT INTEGER) IS SEPARATE;
74
 
75
     GENERIC
76
          WITH PROCEDURE SUBPR (Y : IN OUT INTEGER) IS <>;
77
     PACKAGE P IS
78
          PAC_VAR : INTEGER := 1;
79
     END P;
80
 
81
     PACKAGE BODY P IS
82
     BEGIN
83
          SUBPR (A);
84
 
85
          IF A /= IDENT_INT(3) THEN
86
               FAILED ("INCORRECT VALUE PASSED OUT - 1");
87
          END IF;
88
 
89
          IF PAC_VAR /= IDENT_INT(1) THEN
90
               FAILED ("INCORRECT VALUE FOR PAC_VAR - 2");
91
          END IF;
92
     END P;
93
 
94
     PACKAGE NEW_P IS NEW P (INNER5);
95
 
96
     FUNCTION GEN_FUN RETURN T IS
97
     BEGIN
98
          RETURN X;
99
     END GEN_FUN;
100
 
101
     FUNCTION F IS NEW GEN_FUN (INTEGER, OBJ);
102
 
103
     PROCEDURE INNER6 (X : IN OUT INTEGER; F : IN FLOAT);
104
 
105
     FUNCTION F IS NEW GEN_FUN (FLOAT, FLO);
106
 
107
     PROCEDURE INNER6 (X : IN OUT INTEGER; F : IN FLOAT) IS SEPARATE;
108
 
109
BEGIN
110
     TEST ("C83022G", "CHECK THAT A DECLARATION IN A SUBPROGRAM " &
111
                      "FORMAL PART OR BODY HIDES AN OUTER " &
112
                      "DECLARATION OF A HOMOGRAPH");
113
 
114
     A := IDENT_INT(2);
115
     B := A;
116
 
117
     INNER (A);
118
 
119
     IF A /= IDENT_INT(3) THEN
120
          FAILED ("INCORRECT VALUE PASSED OUT - 3");
121
     END IF;
122
 
123
     A := IDENT_INT(2);
124
 
125
     INNER2 (A => OBJ);
126
 
127
     IF OBJ /= IDENT_INT(4) THEN
128
          FAILED ("INCORRECT VALUE PASSED OUT - 4");
129
     END IF;
130
 
131
     A := IDENT_INT(2);
132
 
133
     B := A;
134
 
135
     IF INNER3(A) /= IDENT_INT(3) THEN
136
          FAILED ("INCORRECT VALUE PASSED OUT - 5");
137
     END IF;
138
 
139
     A := IDENT_INT(2);
140
 
141
     B := A;
142
     OBJ := 5;
143
 
144
     IF B /= IDENT_INT(2) THEN
145
          FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 6");
146
     END IF;
147
 
148
     INNER4 (A => OBJ);
149
 
150
     IF OBJ /= IDENT_INT(4) THEN
151
          FAILED ("INCORRECT VALUE PASSED OUT - 7");
152
     END IF;
153
 
154
     OBJ := 1;
155
 
156
     FLO := 6.25;
157
 
158
     INNER6 (OBJ, FLO);
159
 
160
     IF OBJ /= IDENT_INT(6) THEN
161
          FAILED ("INCORRECT VALUE RETURNED FROM FUNCTION - 8");
162
     END IF;
163
 
164
     RESULT;
165
END C83022G0M;

powered by: WebSVN 2.1.0

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