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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C83F01A.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,  AN ATTEMPT TO REFERENCE AN IDENTI-
26
--    FIER DECLARED IN THE CORRESPONDING PACKAGE SPECIFICATION
27
--    IS SUCCESSFUL, EVEN IF THE SAME IDENTIFIER IS DECLARED IN THE
28
--    ENVIRONMENT SURROUNDING THE PACKAGE BODY.
29
 
30
-- NESTED PACKAGE BODIES ARE TESTED IN  C83F01B , C83F01C , C83F01D
31
 
32
 
33
--    RM    05 AUGUST 1980
34
--    JRK   13 NOV    1980
35
 
36
 
37
WITH REPORT;
38
PROCEDURE  C83F01A  IS
39
 
40
     USE REPORT;
41
 
42
     X1 , X2 : INTEGER RANGE 1..23 := 17 ;
43
 
44
     TYPE  T1  IS  ( A , B , C) ;
45
 
46
     Z : T1 := A ;
47
 
48
 
49
BEGIN
50
 
51
     TEST( "C83F01A" , "CHECK THAT INSIDE A PACKAGE BODY, " &
52
                       "AN ATTEMPT TO REFERENCE AN IDENTIFIER " &
53
                       "DECLARED IN THE CORRESPONDING PACKAGE SPECI" &
54
                       "FICATION IS SUCCESSFUL EVEN IF THE SAME IDEN" &
55
                       "TIFIER IS DECLARED IN THE ENVIRONMENT SURROUND"&
56
                       "ING THE PACKAGE BODY" ) ;
57
 
58
     COMMENT( "NESTED PACKAGE BODIES ARE TESTED IN  C83F01B , -C , -D");
59
 
60
 
61
     DECLARE
62
 
63
 
64
          PACKAGE  P  IS
65
 
66
               X1 : BOOLEAN := FALSE ;
67
               X2 : INTEGER RANGE 1..23 := 11 ;
68
               Y1 : BOOLEAN := TRUE ;
69
               Y2 : INTEGER := 5 ;
70
               T1 : INTEGER := 6 ;
71
               Z  : INTEGER := 7 ;
72
 
73
          END  P ;
74
 
75
 
76
          Y1 , Y2 : INTEGER := 13 ;
77
 
78
 
79
          PACKAGE BODY  P  IS
80
          BEGIN
81
 
82
               X1 := X1 OR Y1 ;
83
               Z  :=  Z + T1 ;
84
               Y2 := X2 * Y2 ;
85
 
86
               -- INCORRECT INTERPRETATIONS IN THE FIRST TWO
87
               --    ASSIGNMENTS  MANIFEST THEMSELVES AT
88
               --    COMPILE TIME AS TYPE ERRORS.
89
 
90
          END P ;
91
 
92
 
93
     BEGIN
94
 
95
          IF  X1 /= 17  OR
96
              Z  /= A   OR
97
              Y2 /= 13   OR
98
              NOT P.X1    OR
99
              P.Z  /= 13  OR
100
              P.Y2 /= 55
101
          THEN  FAILED( "INCORRECT ACCESSING" );
102
          END IF;
103
 
104
     END ;
105
 
106
 
107
     RESULT;   --  POSS. ERROR DURING ELABORATION OF  P
108
 
109
END C83F01A;

powered by: WebSVN 2.1.0

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