OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [a/] [a38106e.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- A38106E.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 FOR AN ACCESS TYPE WHOSE DESIGNATED TYPE IS AN INCOMPLETE
26
-- TYPE, ADDITIONAL OPERATIONS FOR THE ACCESS TYPE WHICH DEPEND ON
27
-- CHARACTERISTICS OF THE FULL DECLARATION OF THE TYPE ARE MADE
28
-- AVAILABLE AT THE EARLIEST PLACE WITHIN THE IMMEDIATE SCOPE OF THE
29
-- ACCESS TYPE DECLARATION AND AFTER THE FULL DECLARATION OF THE
30
-- INCOMPLETE TYPE.
31
 
32
-- (1) CHECK FOR COMPONENT SELECTION WITH RECORD TYPES
33
-- (2) CHECK FOR INDEXED COMPONENTS AND SLICES WITH ARRAY TYPES
34
-- (3) CHECK FOR USE OF 'FIRST, 'LAST, 'RANGE, AND 'LENGTH WITH ARRAY
35
--     TYPES
36
 
37
-- PART 2 : FULL DECLARATION OF INCOMPLETE TYPE IN PACKAGE BODY
38
 
39
-- DSJ  5/05/83
40
-- SPS 10/18/83
41
-- EG  12/19/83
42
 
43
WITH REPORT ;
44
PROCEDURE A38106E IS
45
 
46
     USE REPORT ;
47
 
48
BEGIN
49
 
50
     TEST("A38106E", "CHECK THAT ADDITIONAL OPERATIONS OF ACCESS " &
51
                    "TYPES OF INCOMPLETE TYPES ARE AVAILABLE AT THE " &
52
                    "EARLIEST PLACE IN THE IMMEDIATE SCOPE OF THE "   &
53
                    "ACCESS TYPE AND AFTER THE FULL DECLARATION "     &
54
                    "(WHICH IS IN THE PACKAGE BODY)");
55
 
56
     DECLARE
57
 
58
          PACKAGE PACK1 IS
59
          PRIVATE
60
               TYPE T1 ;
61
               TYPE T2 ;
62
               PACKAGE PACK2 IS
63
                    TYPE ACC1 IS ACCESS T1 ;
64
                    TYPE ACC2 IS ACCESS T2 ;
65
               END PACK2 ;
66
          END PACK1 ;
67
 
68
          PACKAGE BODY PACK1 IS
69
               TYPE T1 IS ARRAY ( 1 .. 2 ) OF INTEGER ;
70
               TYPE T2 IS
71
                    RECORD
72
                         C1, C2 : INTEGER ;
73
                    END RECORD ;
74
 
75
               A1 : PACK2.ACC1 := NEW T1'(2,4) ;  -- LEGAL
76
               A2 : PACK2.ACC1 := NEW T1'(6,8) ;  -- LEGAL
77
               R1 : PACK2.ACC2 := NEW T2'(3,5) ;  -- LEGAL
78
               R2 : PACK2.ACC2 := NEW T2'(7,9) ;  -- LEGAL
79
 
80
               PACKAGE BODY PACK2 IS
81
                    X1 : INTEGER := A1(1) ;            -- LEGAL
82
                    X2 : INTEGER := A1'FIRST ;         -- LEGAL
83
                    X3 : INTEGER := A1'LAST ;          -- LEGAL
84
                    X4 : INTEGER := A1'LENGTH ;        -- LEGAL
85
                    B1 : BOOLEAN := 3 IN A1'RANGE ;    -- LEGAL
86
                    X5 : INTEGER := R1.C1 ;            -- LEGAL
87
               END PACK2 ;
88
 
89
          END PACK1 ;
90
 
91
     BEGIN
92
 
93
          NULL ;
94
 
95
     END ;
96
 
97
     RESULT ;
98
 
99
END A38106E ;

powered by: WebSVN 2.1.0

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