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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C48004E.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 THE FORM "NEW T" IS PERMITTED IF T IS A CONSTRAINED ARRAY
26
-- TYPE.
27
 
28
-- RM  01/12/80
29
-- JBG 03/03/83
30
-- EG  07/05/84
31
 
32
WITH REPORT;
33
 
34
PROCEDURE  C48004E  IS
35
 
36
     USE REPORT;
37
 
38
BEGIN
39
 
40
     TEST("C48004E","CHECK THAT THE FORM 'NEW T' IS PERMITTED IF T " &
41
                    "IS A CONSTRAINED ARRAY TYPE");
42
 
43
     DECLARE
44
 
45
          TYPE ARR0 IS ARRAY( INTEGER RANGE <> ) OF BOOLEAN;
46
          SUBTYPE ARR IS ARR0(1 .. 10);
47
          TYPE  A_ARR  IS  ACCESS ARR;
48
          VARR : A_ARR;
49
 
50
          PACKAGE P IS
51
               TYPE LPRIV IS LIMITED PRIVATE;
52
               FUNCTION CHECK (X : LPRIV) RETURN INTEGER;
53
          PRIVATE
54
               TYPE LPRIV IS
55
                    RECORD
56
                         Q : INTEGER := 20;
57
                    END RECORD;
58
          END P;
59
 
60
          TYPE LPARR IS ARRAY(1 .. 2) OF P.LPRIV;
61
          TYPE A_LPARR IS ACCESS LPARR;
62
 
63
          V_A_LPARR : A_LPARR;
64
 
65
          PACKAGE BODY P IS
66
               FUNCTION CHECK (X : LPRIV) RETURN INTEGER IS
67
               BEGIN
68
                    RETURN X.Q;
69
               END CHECK;
70
          END P;
71
 
72
     BEGIN
73
 
74
          VARR := NEW ARR;
75
          IF  ( VARR'FIRST /= IDENT_INT(1)  OR
76
                VARR'LAST /= 10 )  THEN FAILED("WRONG BOUNDS - CASE 1");
77
          END IF;
78
 
79
          V_A_LPARR := NEW LPARR;
80
          IF ( P.CHECK(V_A_LPARR.ALL(1)) /= IDENT_INT(20) OR
81
               P.CHECK(V_A_LPARR.ALL(2)) /= IDENT_INT(20) ) THEN
82
               FAILED ("WRONG VALUES - CASE 2");
83
          END IF;
84
 
85
     END;
86
 
87
     RESULT;
88
 
89
END C48004E;

powered by: WebSVN 2.1.0

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