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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CD5011Q.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 AN ADDRESS CLAUSE CAN BE GIVEN FOR A VARIABLE OF A
27
--     PRIVATE TYPE IN THE DECLARATIVE PART OF A BLOCK STATEMENT.
28
 
29
-- HISTORY:
30
--     JET 09/15/87  CREATED ORIGINAL TEST.
31
--     PWB 05/11/89  CHANGED EXTENSION FROM '.DEP' TO '.ADA'.
32
 
33
WITH SYSTEM; USE SYSTEM;
34
WITH REPORT; USE REPORT;
35
WITH SPPRT13;
36
 
37
PROCEDURE CD5011Q IS
38
 
39
     PACKAGE P IS
40
          TYPE PRIV_TYPE IS PRIVATE;
41
          FUNCTION INT_TO_PRIV (I : INTEGER) RETURN PRIV_TYPE;
42
          FUNCTION EQUAL (P : PRIV_TYPE; I : INTEGER) RETURN BOOLEAN;
43
     PRIVATE
44
          TYPE PRIV_TYPE IS NEW INTEGER;
45
     END P;
46
 
47
     PACKAGE BODY P IS
48
 
49
          FUNCTION INT_TO_PRIV (I : INTEGER) RETURN PRIV_TYPE IS
50
               BEGIN
51
                    RETURN PRIV_TYPE(I);
52
               END;
53
 
54
          FUNCTION EQUAL (P : PRIV_TYPE; I : INTEGER) RETURN BOOLEAN IS
55
               BEGIN
56
                    RETURN (P = PRIV_TYPE(I));
57
               END;
58
 
59
     END P;
60
 
61
     USE P;
62
 
63
BEGIN
64
 
65
     TEST ("CD5011Q", "AN ADDRESS CLAUSE CAN BE " &
66
                      "GIVEN FOR A VARIABLE OF A PRIVATE " &
67
                      "TYPE IN THE DECLARATIVE PART OF A " &
68
                      "BLOCK STATEMENT");
69
 
70
     DECLARE
71
 
72
          PRIV : PRIV_TYPE := INT_TO_PRIV (12);
73
          FOR PRIV USE
74
               AT SPPRT13.VARIABLE_ADDRESS;
75
 
76
     BEGIN
77
          PRIV := INT_TO_PRIV (17);
78
 
79
          IF NOT EQUAL (PRIV, IDENT_INT (17)) THEN
80
               FAILED ("INCORRECT VALUE FOR VARIABLE OF PRIVATE TYPE");
81
          END IF;
82
 
83
          IF PRIV'ADDRESS /= SPPRT13.VARIABLE_ADDRESS THEN
84
               FAILED ("INCORRECT ADDRESS FOR VARIABLE OF " &
85
                       "PRIVATE TYPE");
86
          END IF;
87
     END;
88
 
89
     RESULT;
90
 
91
END CD5011Q;

powered by: WebSVN 2.1.0

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