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/] [c83f01b.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
-- C83F01B.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 INSIDE A PACKAGE BODY NESTED WITHIN ANOTHER PACKAGE BODY
26
--    AN ATTEMPT TO REFERENCE AN IDENTIFIER DECLARED IN THE
27
--    CORRESPONDING PACKAGE SPECIFICATION
28
--    IS SUCCESSFUL EVEN IF THE SAME IDENTIFIER IS DECLARED IN THE
29
--    OUTER PACKAGE (SPECIFICATION OR BODY)  OR  IN THE
30
--    ENVIRONMENT SURROUNDING THE OUTER PACKAGE BODY.
31
 
32
-- INTERACTIONS WITH SEPARATE COMPILATION ARE TESTED IN  C83F01C ,
33
--    C83F01D .
34
 
35
 
36
--    RM    08 AUGUST 1980
37
--    JRK   13 NOV    1980
38
 
39
 
40
WITH REPORT;
41
PROCEDURE  C83F01B  IS
42
 
43
     USE REPORT;
44
 
45
     X1 , X2 : INTEGER RANGE 1..23 := 17 ;
46
 
47
     TYPE  T1  IS  ( A , B , C) ;
48
 
49
     Z : T1 := A ;
50
 
51
 
52
BEGIN
53
 
54
     TEST( "C83F01B" , "CHECK THAT INSIDE A NESTED PACKAGE BODY" &
55
                       " AN ATTEMPT TO REFERENCE AN IDENTIFIER" &
56
                       " DECLARED IN THE CORRESPONDING PACKAGE SPECI" &
57
                       "FICATION  IS SUCCESSFUL EVEN IF THE SAME IDEN" &
58
                       "TIFIER IS DECLARED IN THE ENVIRONMENT SURROUND"&
59
                       "ING THE PACKAGE BODY" ) ;
60
 
61
     COMMENT("SEPARATELY COMPILED PACKAGES ARE TESTED IN  C83F01C, -D");
62
 
63
 
64
     DECLARE
65
 
66
 
67
          Y1 , Y2 : INTEGER := 100 ;
68
 
69
 
70
          PACKAGE  OUTER  IS
71
 
72
               Y3 : INTEGER := 100 ;
73
 
74
               PACKAGE  P  IS
75
 
76
                    X1 : BOOLEAN := FALSE ;
77
                    X2 : INTEGER RANGE 1..23 := 11 ;
78
                    Y1 , Y3 : BOOLEAN := TRUE ;
79
                    Y2 , Y4 : INTEGER := 5 ;
80
                    T1 : INTEGER := 6 ;
81
                    Z  : INTEGER := 7 ;
82
 
83
               END  P ;
84
 
85
          END  OUTER ;
86
 
87
 
88
          X2 : INTEGER := 100 ;
89
 
90
 
91
          PACKAGE BODY  OUTER  IS
92
 
93
               Y4 : INTEGER := 200 ;
94
 
95
               PACKAGE BODY  P  IS
96
               BEGIN
97
 
98
                    X1 :=  NOT X1  AND  Y1  AND  Y3 ;
99
                    Z  :=  Z + T1 ;
100
                    Y2 := X2 * Y2 ;
101
                    Y4 := X2 * Y4 ;
102
 
103
                    -- INCORRECT INTERPRETATIONS IN THE FIRST TWO
104
                    --    ASSIGNMENTS  MANIFEST THEMSELVES AT
105
                    --    COMPILE TIME AS TYPE ERRORS
106
 
107
               END P ;
108
 
109
          END OUTER ;
110
 
111
 
112
     BEGIN
113
 
114
          IF  X1 /= 17   OR
115
              Z  /= A    OR
116
              Y2 /= 100  OR
117
              NOT OUTER.P.X1    OR
118
              OUTER.P.Z  /= 13  OR
119
              OUTER.P.Y2 /= 55  OR
120
              OUTER.P.Y4 /= 55
121
          THEN FAILED( "INCORRECT ACCESSING" );
122
          END IF;
123
 
124
     END ;
125
 
126
 
127
     RESULT;   --  POSSIBLE ERROR DURING ELABORATION OF  P
128
 
129
END C83F01B;

powered by: WebSVN 2.1.0

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