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/] [c6/] [c61009a.ada] - Blame information for rev 309

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C61009A.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 A STATIC EXPRESSION, CONSTANT NAME, ATTRIBUTE NAME,
26
--   VARIABLE, DEREFERENCED ACCESS, USER-DEFINED OPERATOR, USER-
27
--   DEFINED FUNCTION, OR ALLOCATOR CAN BE USED IN THE INITIALIZATION
28
--   EXPRESSION OF A FORMAL PARAMETER, AND THAT THE APPROPRIATE
29
--   VALUE IS USED AS A DEFAULT PARAMETER VALUE WHEN THE SUBPROGRAM
30
--   IS CALLED.
31
 
32
-- DAS  1/21/81
33
-- ABW  7/20/82
34
-- SPS  12/10/82
35
 
36
WITH REPORT;
37
PROCEDURE C61009A IS
38
 
39
     USE REPORT;
40
 
41
     TYPE INT IS RANGE 1 .. 10;
42
 
43
     TYPE ARR IS ARRAY (INTEGER RANGE <>) OF INTEGER;
44
 
45
     TYPE RECTYPE (CONSTRAINT : INTEGER) IS
46
          RECORD
47
               A : ARR (0..CONSTRAINT);
48
          END RECORD;
49
 
50
     C7   : CONSTANT INTEGER  := 7;
51
     V7   : INTEGER  := 7;
52
 
53
     TYPE  A_INT IS ACCESS INTEGER;
54
     C_A  : CONSTANT A_INT  := NEW INTEGER'(7);
55
 
56
     SUBTYPE RECTYPE1 IS RECTYPE (2 + 5);
57
     SUBTYPE RECTYPE2 IS RECTYPE (C7);
58
     SUBTYPE RECTYPE3 IS RECTYPE (V7);
59
 
60
     FUNCTION "&" (X,Y : INTEGER) RETURN INTEGER IS
61
     BEGIN
62
          RETURN 10;
63
     END "&";
64
 
65
     FUNCTION FUNC (X : INTEGER) RETURN INTEGER IS
66
     BEGIN
67
          RETURN X;
68
     END FUNC;
69
 
70
     -- STATIC EXPRESSION
71
 
72
     PROCEDURE PROC1 (REC : RECTYPE1 := (3+4,(0,1,2,3,4,5,6,7))) IS
73
     BEGIN
74
          IF (REC /= (7,(0,1,2,3,4,5,6,7))) THEN
75
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC1 PARAMETER");
76
          END IF;
77
     END PROC1;
78
 
79
     -- CONSTANT NAME
80
 
81
     PROCEDURE PROC2 (REC : RECTYPE2 := (C7,(0,1,2,3,4,5,6,7))) IS
82
     BEGIN
83
          IF (REC /= (C7,(0,1,2,3,4,5,6,7))) THEN
84
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC2 PARAMETER");
85
          END IF;
86
     END PROC2;
87
 
88
     -- ATTRIBUTE NAME
89
 
90
     PROCEDURE PROC3 (P1 : INT := INT'LAST) IS
91
     BEGIN
92
          IF (P1 /= INT (10)) THEN
93
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC3 PARAMETER");
94
          END IF;
95
     END PROC3;
96
 
97
     -- VARIABLE
98
 
99
     PROCEDURE PROC4 (P4 : RECTYPE3 := (V7,(0,1,2,3,4,5,6,7))) IS
100
     BEGIN
101
          IF (P4 /= (V7,(0,1,2,3,4,5,6,7))) THEN
102
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC4 PARAMETER");
103
               END IF;
104
          END PROC4;
105
 
106
     --DEREFERENCED ACCESS
107
 
108
     PROCEDURE PROC5 (P5 : INTEGER := C_A.ALL) IS
109
     BEGIN
110
          IF(P5 /= C_A.ALL) THEN
111
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC5 PARAMETER");
112
          END IF;
113
     END PROC5;
114
 
115
     --USER-DEFINED OPERATOR
116
 
117
     PROCEDURE PROC6 (P6 : INTEGER := 6&4) IS
118
     BEGIN
119
          IF (P6 /= IDENT_INT(10)) THEN
120
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC6 PARAMETER");
121
          END IF;
122
     END PROC6;
123
 
124
     --USER-DEFINED FUNCTION
125
 
126
     PROCEDURE PROC7 (P7 : INTEGER := FUNC(10)) IS
127
     BEGIN
128
          IF (P7 /= IDENT_INT(10)) THEN
129
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC7 PARAMETER");
130
          END IF;
131
     END PROC7;
132
 
133
     -- ALLOCATOR
134
 
135
     PROCEDURE PROC8 (P8 : A_INT := NEW INTEGER'(7)) IS
136
     BEGIN
137
          IF (P8.ALL /= IDENT_INT(7)) THEN
138
               FAILED ("INCORRECT DEFAULT VALUE FOR PROC8 PARAMETER");
139
          END IF;
140
     END PROC8;
141
 
142
BEGIN
143
     TEST ("C61009A", "CHECK USE OF STATIC EXPRESSIONS, CONSTANT " &
144
                      "NAMES, ATTRIBUTE NAMES, VARIABLES, USER- " &
145
                      "DEFINED OPERATORS, USER-DEFINED FUNCTIONS " &
146
                      "DEREFERENCED ACCESSES, AND ALLOCATORS IN " &
147
                      "THE FORMAL PART OF A SUBPROGRAM SPECIFICATION");
148
 
149
     PROC1;
150
     PROC2;
151
     PROC3;
152
     PROC4;
153
     PROC5;
154
     PROC6;
155
     PROC7;
156
     PROC8;
157
 
158
     RESULT;
159
 
160
END C61009A;

powered by: WebSVN 2.1.0

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