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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C43204C.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 ARRAY AGGREGATE WITH AN OTHERS CHOICE CAN APPEAR
27
--     (AND BOUNDS ARE DETERMINED CORRECTLY) AS AN ACTUAL PARAMETER OF
28
--     A GENERIC INSTANTIATION WHEN THE GENERIC FORMAL PARAMETER IS
29
--     CONSTRAINED.
30
 
31
-- HISTORY:
32
--     JET 08/15/88  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
PROCEDURE C43204C IS
36
 
37
     TYPE ARR10 IS ARRAY(IDENT_INT(1)..IDENT_INT(0)) OF INTEGER;
38
     TYPE ARR11 IS ARRAY(INTEGER RANGE -3..3) OF INTEGER;
39
     TYPE ARR12 IS ARRAY(IDENT_INT(-3)..IDENT_INT(3)) OF INTEGER;
40
 
41
     TYPE ARR20 IS ARRAY(IDENT_INT(1)..IDENT_INT(0),
42
                         IDENT_INT(0)..IDENT_INT(-1)) OF INTEGER;
43
     TYPE ARR21 IS ARRAY(INTEGER RANGE -1..1,
44
                         INTEGER RANGE -1..1) OF INTEGER;
45
     TYPE ARR22 IS ARRAY(IDENT_INT(-1)..IDENT_INT(1),
46
                         IDENT_INT(-1)..IDENT_INT(1)) OF INTEGER;
47
     TYPE ARR23 IS ARRAY(INTEGER'(-1)..1,
48
                         IDENT_INT(-1)..IDENT_INT(1)) OF INTEGER;
49
 
50
     GENERIC
51
          A : ARR10;
52
     PROCEDURE GPROC10;
53
 
54
     GENERIC
55
          A : ARR11;
56
     PROCEDURE GPROC11;
57
 
58
     GENERIC
59
          A : ARR12;
60
     PROCEDURE GPROC12;
61
 
62
     GENERIC
63
          A : ARR20;
64
     PROCEDURE GPROC20;
65
 
66
     GENERIC
67
          A : ARR21;
68
     PROCEDURE GPROC21 (C : INTEGER);
69
 
70
     GENERIC
71
          A : ARR22;
72
     PROCEDURE GPROC22;
73
 
74
     GENERIC
75
          A : ARR23;
76
     PROCEDURE GPROC23;
77
 
78
     PROCEDURE GPROC10 IS
79
     BEGIN
80
          IF A'LENGTH /= IDENT_INT(0) THEN
81
               FAILED ("PROC10 ARRAY IS NOT NULL");
82
          END IF;
83
     END GPROC10;
84
 
85
     PROCEDURE GPROC11 IS
86
     BEGIN
87
          IF A'LENGTH /= IDENT_INT(7) OR
88
             A'FIRST /= IDENT_INT(-3) OR
89
             A'LAST /= IDENT_INT(3)   THEN
90
               FAILED ("INCORRECT LENGTH IN PROC11");
91
          END IF;
92
 
93
          FOR I IN IDENT_INT(-3)..IDENT_INT(3) LOOP
94
               IF IDENT_INT(A(I)) /= 1 THEN
95
                    FAILED ("INCORRECT VALUE OF COMPONENT " &
96
                            INTEGER'IMAGE(I) & ", PROC11");
97
               END IF;
98
          END LOOP;
99
     END GPROC11;
100
 
101
     PROCEDURE GPROC12 IS
102
     BEGIN
103
          IF A'LENGTH /= IDENT_INT(7) THEN
104
               FAILED ("INCORRECT LENGTH IN PROC12");
105
          END IF;
106
 
107
          FOR I IN IDENT_INT(-3)..IDENT_INT(3) LOOP
108
               IF IDENT_INT(A(I)) /= 2 THEN
109
                    FAILED ("INCORRECT VALUE OF COMPONENT " &
110
                            INTEGER'IMAGE(I) & ", PROC12");
111
               END IF;
112
          END LOOP;
113
     END GPROC12;
114
 
115
     PROCEDURE GPROC20 IS
116
     BEGIN
117
          IF A'LENGTH(1) /= IDENT_INT(0) OR
118
             A'LENGTH(2) /= IDENT_INT(0) THEN
119
               FAILED ("GPROC20 ARRAY IS NOT NULL");
120
          END IF;
121
     END GPROC20;
122
 
123
     PROCEDURE GPROC21 (C : INTEGER) IS
124
     BEGIN
125
          FOR I IN INTEGER'(-1)..1 LOOP
126
               FOR J IN INTEGER'(-1)..1 LOOP
127
                    IF IDENT_INT(A(I,J)) /= C THEN
128
                         FAILED ("INCORRECT VALUE OF COMPONENT (" &
129
                                 INTEGER'IMAGE(I) & "," &
130
                                 INTEGER'IMAGE(J) & "), GPROC21 CALL " &
131
                                 "NUMBER" & INTEGER'IMAGE(C));
132
                    END IF;
133
               END LOOP;
134
          END LOOP;
135
     END GPROC21;
136
 
137
     PROCEDURE GPROC22 IS
138
     BEGIN
139
          FOR I IN INTEGER'(-1)..1 LOOP
140
               FOR J IN INTEGER'(-1)..1 LOOP
141
                    IF IDENT_INT(A(I,J)) /= 3 THEN
142
                         FAILED ("INCORRECT VALUE OF COMPONENT (" &
143
                                 INTEGER'IMAGE(I) & "," &
144
                                 INTEGER'IMAGE(J) & "), GPROC22");
145
                    END IF;
146
               END LOOP;
147
          END LOOP;
148
     END GPROC22;
149
 
150
     PROCEDURE GPROC23 IS
151
     BEGIN
152
          FOR I IN INTEGER'(-1)..1 LOOP
153
               FOR J IN INTEGER'(-1)..1 LOOP
154
                    IF IDENT_INT(A(I,J)) /= 4 THEN
155
                         FAILED ("INCORRECT VALUE OF COMPONENT (" &
156
                                 INTEGER'IMAGE(I) & "," &
157
                                 INTEGER'IMAGE(J) & "), GPROC23");
158
                    END IF;
159
               END LOOP;
160
          END LOOP;
161
     END GPROC23;
162
 
163
     PROCEDURE PROC11 IS NEW GPROC11((1,1,1, OTHERS => 1));
164
     PROCEDURE PROC12 IS NEW GPROC12((OTHERS => 2));
165
     PROCEDURE PROC10 IS NEW GPROC10((OTHERS => 3));
166
 
167
     PROCEDURE PROC21 IS NEW GPROC21(((1,1,1), OTHERS => (1,1,1)));
168
     PROCEDURE PROC22 IS NEW GPROC21(((2,OTHERS => 2), (2,OTHERS => 2),
169
                                      (2,2,OTHERS => 2)));
170
     PROCEDURE PROC23 IS NEW GPROC22((OTHERS => (OTHERS => 3)));
171
     PROCEDURE PROC24 IS NEW GPROC23((OTHERS => (4,4,4)));
172
     PROCEDURE PROC20 IS NEW GPROC20((OTHERS => (OTHERS => 5)));
173
 
174
BEGIN
175
     TEST ("C43204C", "CHECK THAT AN ARRAY AGGREGATE WITH AN OTHERS " &
176
                      "CHOICE CAN APPEAR (AND BOUNDS ARE DETERMINED " &
177
                      "CORRECTLY) AS AN ACTUAL PARAMETER OF A " &
178
                      "SUBPROGRAM CALL WHEN THE FORMAL PARAMETER IS " &
179
                      "CONSTRAINED");
180
 
181
     PROC11;
182
     PROC12;
183
     PROC10;
184
 
185
     PROC21(1);
186
     PROC22(2);
187
     PROC23;
188
     PROC24;
189
     PROC20;
190
 
191
     RESULT;
192
END C43204C;

powered by: WebSVN 2.1.0

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