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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C83028A.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 BLOCK STATEMENT HIDES AN OUTER
27
--     DECLARATION OF A HOMOGRAPH. ALSO CHECK THAT THE OUTER DECLARATION
28
--     IS DIRECTLY VISIBLE IN BOTH DECLARATIVE REGIONS BEFORE THE
29
--     DECLARATION OF THE INNER HOMOGRAPH AND THE OUTER DECLARATION IS
30
--     VISIBLE BY SELECTION AFTER THE INNER HOMOGRAPH DECLARATION.
31
 
32
-- HISTORY:
33
--     BCB 09/06/88  CREATED ORIGINAL TEST.
34
 
35
WITH REPORT; USE REPORT;
36
PROCEDURE C83028A IS
37
 
38
     GENERIC
39
          TYPE T IS PRIVATE;
40
          X : T;
41
     FUNCTION GEN_FUN RETURN T;
42
 
43
     FUNCTION GEN_FUN RETURN T IS
44
     BEGIN
45
          RETURN X;
46
     END GEN_FUN;
47
 
48
BEGIN
49
     TEST ("C83028A", "CHECK THAT A DECLARATION IN A BLOCK " &
50
                      "STATEMENT HIDES AN OUTER " &
51
                      "DECLARATION OF A HOMOGRAPH");
52
 
53
     ONE:
54
     DECLARE
55
          A : INTEGER := IDENT_INT(2);
56
          B : INTEGER := A;
57
 
58
     BEGIN  -- ONE
59
          DECLARE
60
               C : INTEGER := A;
61
               A : INTEGER := IDENT_INT(3);
62
          BEGIN
63
               IF A /= IDENT_INT(3) THEN
64
                    FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH - 1");
65
               END IF;
66
 
67
               IF ONE.A /= IDENT_INT(2) THEN
68
                    FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 2");
69
               END IF;
70
 
71
               IF ONE.B /= IDENT_INT(2) THEN
72
                    FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 3");
73
               END IF;
74
 
75
               IF C /= IDENT_INT(2) THEN
76
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 4");
77
               END IF;
78
 
79
               IF EQUAL(1,1) THEN
80
                    ONE.A := A;
81
               END IF;
82
          END;
83
 
84
          IF A /= IDENT_INT(3) THEN
85
               FAILED ("INCORRECT VALUE PASSED OUT - 6");
86
          END IF;
87
     END ONE;
88
 
89
     TWO:
90
     DECLARE
91
          A : INTEGER := IDENT_INT(2);
92
          B : INTEGER := A;
93
          OBJ : INTEGER := IDENT_INT(3);
94
 
95
     BEGIN  -- TWO
96
          DECLARE
97
               X : INTEGER := A;
98
               A : INTEGER := OBJ;
99
               C : INTEGER := A;
100
          BEGIN
101
               IF A /= IDENT_INT(3) THEN
102
                    FAILED ("INCORRECT VALUE FOR INNER HOMOGRAPH -10");
103
               END IF;
104
 
105
               IF TWO.A /= IDENT_INT(2) THEN
106
                    FAILED ("INCORRECT VALUE FOR OUTER HOMOGRAPH - 11");
107
               END IF;
108
 
109
               IF TWO.B /= IDENT_INT(2) THEN
110
                    FAILED ("INCORRECT VALUE FOR OUTER VARIABLE - 12");
111
               END IF;
112
 
113
               IF C /= IDENT_INT(3) THEN
114
                    FAILED ("INCORRECT VALUE FOR INNER VARIABLE - 13");
115
               END IF;
116
 
117
               IF X /= IDENT_INT(2) THEN
118
                    FAILED ("INCORRECT VALUE PASSED IN - 14");
119
               END IF;
120
 
121
               IF EQUAL(1,1) THEN
122
                    TWO.OBJ := IDENT_INT(4);
123
               ELSE
124
                    TWO.OBJ := 1;
125
               END IF;
126
          END;
127
 
128
          IF OBJ /= IDENT_INT(4) THEN
129
               FAILED ("INCORRECT VALUE PASSED OUT - 15");
130
          END IF;
131
     END TWO;
132
 
133
     THREE:
134
     DECLARE                 --  OVERLOADING OF FUNCTIONS.
135
 
136
          OBJ : INTEGER := 1;
137
          FLO : FLOAT := 5.0;
138
 
139
          FUNCTION F IS NEW GEN_FUN (INTEGER, OBJ);
140
 
141
          FUNCTION F IS NEW GEN_FUN (FLOAT, FLO);
142
 
143
     BEGIN
144
          DECLARE
145
               F : FLOAT := 6.25;
146
          BEGIN
147
               THREE.OBJ := INTEGER(F);
148
          END;
149
 
150
          IF OBJ /= IDENT_INT(6) THEN
151
               FAILED ("INCORRECT VALUE RETURNED FROM FUNCTION - 20");
152
          END IF;
153
     END THREE;
154
 
155
     RESULT;
156
END C83028A;

powered by: WebSVN 2.1.0

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