OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cc/] [cc3121a.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CC3121A.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 AN UNCONSTRAINED FORMAL GENERIC PARAMETER OF MODE "IN"
26
-- HAVING AN ARRAY TYPE OR A TYPE WITH DISCRIMINANTS HAS THE CONSTRAINTS
27
-- OF THE ACTUAL PARAMETER.
28
 
29
-- TBN  9/29/86
30
 
31
WITH REPORT; USE REPORT;
32
PROCEDURE CC3121A IS
33
 
34
     SUBTYPE INT IS INTEGER RANGE 1 .. 10;
35
 
36
     TYPE ARRAY1 IS ARRAY (INT RANGE <>) OF INTEGER;
37
 
38
     TYPE REC1 (D : INT) IS
39
          RECORD
40
               VAR1 : INTEGER := 1;
41
          END RECORD;
42
 
43
     TYPE REC2 (D : INT := 2) IS
44
          RECORD
45
               A : ARRAY1 (D .. IDENT_INT(4));
46
               B : REC1 (D);
47
               C : INTEGER := 1;
48
          END RECORD;
49
 
50
     TYPE ARRAY2 IS ARRAY (INT RANGE <>) OF REC2;
51
 
52
BEGIN
53
     TEST ("CC3121A", "CHECK THAT AN UNCONSTRAINED FORMAL GENERIC " &
54
                      "PARAMETER OF MODE 'IN' HAVING AN ARRAY TYPE " &
55
                      "OR A TYPE WITH DISCRIMINANTS HAS THE " &
56
                      "CONSTRAINTS OF THE ACTUAL PARAMETER");
57
 
58
     DECLARE
59
          OBJ_ARA1 : ARRAY1 (IDENT_INT(2) .. 5);
60
 
61
          GENERIC
62
               VAR : ARRAY1;
63
          PROCEDURE PROC;
64
 
65
          PROCEDURE PROC IS
66
          BEGIN
67
               IF VAR'FIRST /= IDENT_INT(2) THEN
68
                    FAILED ("INCORRECT RESULTS FOR VAR'FIRST");
69
               END IF;
70
               IF VAR'LAST /= IDENT_INT(5) THEN
71
                    FAILED ("INCORRECT RESULTS FOR VAR'LAST");
72
               END IF;
73
          END PROC;
74
 
75
          PROCEDURE PROC1 IS NEW PROC (OBJ_ARA1);
76
     BEGIN
77
          PROC1;
78
     END;
79
 
80
     -------------------------------------------------------------------
81
     DECLARE
82
          OBJ_REC2 : REC2;
83
 
84
          GENERIC
85
               VAR : REC2;
86
          FUNCTION FUNC RETURN INTEGER;
87
 
88
          FUNCTION FUNC RETURN INTEGER IS
89
          BEGIN
90
               IF VAR.D /= IDENT_INT(2) THEN
91
                    FAILED ("INCORRECT RESULTS FROM VAR.D");
92
               END IF;
93
               IF VAR.A'FIRST /= IDENT_INT(2) THEN
94
                    FAILED ("INCORRECT RESULTS FROM VAR.A'FIRST");
95
               END IF;
96
               IF VAR.A'LAST /= IDENT_INT(4) THEN
97
                    FAILED ("INCORRECT RESULTS FROM VAR.A'LAST");
98
               END IF;
99
               IF VAR.B.D /= IDENT_INT(2) THEN
100
                    FAILED ("INCORRECT RESULTS FROM VAR.B.D");
101
               END IF;
102
               RETURN IDENT_INT(1);
103
          END FUNC;
104
 
105
          FUNCTION FUNC1 IS NEW FUNC (OBJ_REC2);
106
 
107
     BEGIN
108
          IF FUNC1 /= IDENT_INT(1) THEN
109
               FAILED ("INCORRECT RESULTS FROM FUNC1 CALL");
110
          END IF;
111
     END;
112
 
113
     -------------------------------------------------------------------
114
     DECLARE
115
          OBJ_ARA2 : ARRAY2 (IDENT_INT(6) .. 8);
116
 
117
          GENERIC
118
               VAR : ARRAY2;
119
          PROCEDURE PROC;
120
 
121
          PROCEDURE PROC IS
122
          BEGIN
123
               IF VAR'FIRST /= IDENT_INT(6) THEN
124
                    FAILED ("INCORRECT RESULTS FOR VAR'FIRST");
125
               END IF;
126
               IF VAR'LAST /= IDENT_INT(8) THEN
127
                    FAILED ("INCORRECT RESULTS FOR VAR'LAST");
128
               END IF;
129
               IF VAR(6).D /= IDENT_INT(2) THEN
130
                    FAILED ("INCORRECT RESULTS FROM VAR(6).D");
131
               END IF;
132
               IF VAR(6).A'FIRST /= IDENT_INT(2) THEN
133
                    FAILED ("INCORRECT RESULTS FROM VAR(6).A'FIRST");
134
               END IF;
135
               IF VAR(6).A'LAST /= IDENT_INT(4) THEN
136
                    FAILED ("INCORRECT RESULTS FROM VAR(6).A'LAST");
137
               END IF;
138
               IF VAR(6).B.D /= IDENT_INT(2) THEN
139
                    FAILED ("INCORRECT RESULTS FROM VAR(6).B.D");
140
               END IF;
141
          END PROC;
142
 
143
          PROCEDURE PROC2 IS NEW PROC (OBJ_ARA2);
144
     BEGIN
145
          PROC2;
146
     END;
147
 
148
     -------------------------------------------------------------------
149
     DECLARE
150
          OBJ_REC3 : REC2 (3);
151
 
152
          GENERIC
153
               VAR : REC2;
154
          PACKAGE PAC IS
155
               PAC_VAR : INTEGER := 1;
156
          END PAC;
157
 
158
          PACKAGE BODY PAC IS
159
          BEGIN
160
               IF VAR.D /= IDENT_INT(3) THEN
161
                    FAILED ("INCORRECT RESULTS FROM VAR.D");
162
               END IF;
163
               IF VAR.A'FIRST /= IDENT_INT(3) THEN
164
                    FAILED ("INCORRECT RESULTS FROM VAR.A'FIRST");
165
               END IF;
166
               IF VAR.A'LAST /= IDENT_INT(4) THEN
167
                    FAILED ("INCORRECT RESULTS FROM VAR.A'LAST");
168
               END IF;
169
               IF VAR.B.D /= IDENT_INT(3) THEN
170
                    FAILED ("INCORRECT RESULTS FROM VAR.B.D");
171
               END IF;
172
          END PAC;
173
 
174
          PACKAGE PAC1 IS NEW PAC (OBJ_REC3);
175
 
176
     BEGIN
177
          NULL;
178
     END;
179
 
180
     -------------------------------------------------------------------
181
 
182
     RESULT;
183
END CC3121A;

powered by: WebSVN 2.1.0

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