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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C85004B.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 RENAMED CONSTANT OBJECT, "IN" PARAMETER OF A
27
--     SUBPROGRAM OR ENTRY, "IN" FORMAL GENERIC, RECORD DISCRIMINANT,
28
--     LOOP PARAMETER, DEFERRED CONSTANT, OR RENAMED CONSTANT HAS THE
29
--     CORRECT VALUE.
30
 
31
-- HISTORY:
32
--     JET 07/25/88  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
PROCEDURE C85004B IS
36
 
37
     TYPE A IS ARRAY (POSITIVE RANGE <>) OF INTEGER;
38
     SUBTYPE P IS POSITIVE RANGE 1 .. 10;
39
 
40
     C1 : CONSTANT INTEGER := 1;
41
     X1 : INTEGER RENAMES C1;
42
     X2 : INTEGER RENAMES X1;
43
 
44
     TYPE REC (D : P := 1) IS
45
          RECORD
46
               I : A(1..D);
47
          END RECORD;
48
     TYPE ACCREC1 IS ACCESS REC;
49
     TYPE ACCREC2 IS ACCESS REC(10);
50
 
51
     R1 : REC;
52
     R2 : REC(10);
53
     AR1 : ACCREC1 := NEW REC;
54
     AR2 : ACCREC2 := NEW REC(10);
55
 
56
     X3 : P RENAMES R1.D;
57
     X4 : P RENAMES R2.D;
58
     X5 : P RENAMES AR1.D;
59
     X6 : P RENAMES AR2.D;
60
 
61
     C2 : CONSTANT A(1..3) := (1, 2, 3);
62
     X7 : INTEGER RENAMES C2(1);
63
 
64
     GENERIC
65
          K1 : IN INTEGER;
66
     PACKAGE GENPKG IS
67
          TYPE K IS PRIVATE;
68
          K2 : CONSTANT K;
69
     PRIVATE
70
          TYPE K IS RANGE 1..100;
71
          K2 : CONSTANT K := 5;
72
     END GENPKG;
73
 
74
     TASK FOOEY IS
75
          ENTRY ENT1 (I : IN INTEGER);
76
     END FOOEY;
77
 
78
     TASK BODY FOOEY IS
79
     BEGIN
80
          ACCEPT ENT1 (I : IN INTEGER) DO
81
               DECLARE
82
                    TX1 : INTEGER RENAMES I;
83
               BEGIN
84
                    IF TX1 /= IDENT_INT(2) THEN
85
                         FAILED ("INCORRECT VALUE");
86
                    END IF;
87
               END;
88
          END ENT1;
89
     END FOOEY;
90
 
91
     PACKAGE BODY GENPKG IS
92
          KX1 : INTEGER RENAMES K1;
93
          KX2 : K RENAMES K2;
94
     BEGIN
95
          IF KX1 /= IDENT_INT(4) THEN
96
               FAILED ("INCORRECT VALUE OF KX1");
97
          END IF;
98
 
99
          IF KX2 /= K(IDENT_INT(5)) THEN
100
               FAILED ("INCORRECT VALUE OF KX2");
101
          END IF;
102
     END GENPKG;
103
 
104
     PROCEDURE PROC (I : IN INTEGER) IS
105
          PX1 : INTEGER RENAMES I;
106
     BEGIN
107
          IF PX1 /= IDENT_INT(3) THEN
108
               FAILED ("INCORRECT VALUE OF PX1");
109
          END IF;
110
     END PROC;
111
 
112
     PACKAGE PKG IS NEW GENPKG(4);
113
 
114
BEGIN
115
     TEST ("C85004B", "CHECK THAT A RENAMED CONSTANT OBJECT, 'IN' " &
116
           "PARAMETER OF A SUBPROGRAM OR ENTRY, 'IN' FORMAL GENERIC, " &
117
           "RECORD DISCRIMINANT, LOOP PARAMETER, DEFERRED CONSTANT, " &
118
           "OR RENAMED CONSTANT HAS THE CORRECT VALUE");
119
 
120
     FOOEY.ENT1(2);
121
 
122
     PROC(3);
123
 
124
     IF X1 /= IDENT_INT(1) THEN
125
          FAILED ("INCORRECT VALUE OF X1");
126
     END IF;
127
 
128
     IF X2 /= IDENT_INT(1) THEN
129
          FAILED ("INCORRECT VALUE OF X2");
130
     END IF;
131
 
132
     IF X3 /= IDENT_INT(1) THEN
133
          FAILED ("INCORRECT VALUE OF X3");
134
     END IF;
135
 
136
     IF X4 /= IDENT_INT(10) THEN
137
          FAILED ("INCORRECT VALUE OF X4");
138
     END IF;
139
 
140
     IF X5 /= IDENT_INT(1) THEN
141
          FAILED ("INCORRECT VALUE OF X5");
142
     END IF;
143
 
144
     IF X6 /= IDENT_INT(10) THEN
145
          FAILED ("INCORRECT VALUE OF X6");
146
     END IF;
147
 
148
     IF X7 /= IDENT_INT(1) THEN
149
          FAILED ("INCORRECT VALUE OF X7");
150
     END IF;
151
 
152
     FOR I IN 1..IDENT_INT(2) LOOP
153
          DECLARE
154
               X8 : INTEGER RENAMES I;
155
          BEGIN
156
               IF X8 /= IDENT_INT(I) THEN
157
                    FAILED ("INCORRECT VALUE OF X8");
158
               END IF;
159
          END;
160
     END LOOP;
161
 
162
     RESULT;
163
 
164
END C85004B;

powered by: WebSVN 2.1.0

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