OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c8/] [c84005a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C84005A.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 TWO POTENTIALLY VISIBLE HOMOGRAPHS OF A SUBPROGRAM
27
--     IDENTIFIER CAN BE MADE DIRECTLY VISIBLE BY A USE CLAUSE, AND THAT
28
--     WHEN DIFFERENT FORMAL PARAMETER NAMES ARE USED THE SUBPROGRAMS
29
--     ARE REFERENCED CORRECTLY.
30
 
31
-- HISTORY:
32
--     JET 03/10/88  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
PROCEDURE C84005A IS
36
 
37
     PACKAGE PACK1 IS
38
          FUNCTION FUNK(A : INTEGER) RETURN INTEGER;
39
          PROCEDURE PROK(A : INTEGER; B : OUT INTEGER);
40
     END PACK1;
41
 
42
     PACKAGE PACK2 IS
43
          FUNCTION FUNK(X : INTEGER) RETURN INTEGER;
44
          PROCEDURE PROK(X : INTEGER; Y : OUT INTEGER);
45
     END PACK2;
46
 
47
     USE PACK1, PACK2;
48
     VAR1, VAR2 : INTEGER;
49
 
50
     PACKAGE BODY PACK1 IS
51
          FUNCTION FUNK(A : INTEGER) RETURN INTEGER IS
52
          BEGIN
53
               IF EQUAL (A,A) THEN
54
                    RETURN (1);
55
               ELSE
56
                    RETURN (0);
57
               END IF;
58
          END FUNK;
59
 
60
          PROCEDURE PROK(A : INTEGER; B : OUT INTEGER) IS
61
          BEGIN
62
               IF EQUAL (A,A) THEN
63
                    B := 1;
64
               ELSE
65
                    B := 0;
66
               END IF;
67
          END PROK;
68
     END PACK1;
69
 
70
     PACKAGE BODY PACK2 IS
71
          FUNCTION FUNK(X : INTEGER) RETURN INTEGER IS
72
          BEGIN
73
               IF EQUAL (X,X) THEN
74
                    RETURN (2);
75
               ELSE
76
                    RETURN (0);
77
               END IF;
78
          END FUNK;
79
 
80
          PROCEDURE PROK(X : INTEGER; Y : OUT INTEGER) IS
81
          BEGIN
82
               IF EQUAL (X,X) THEN
83
                    Y := 2;
84
               ELSE
85
                    Y := 0;
86
               END IF;
87
          END PROK;
88
     END PACK2;
89
 
90
BEGIN
91
     TEST ("C84005A", "CHECK THAT TWO POTENTIALLY VISIBLE HOMOGRAPHS " &
92
                      "OF A SUBPROGRAM IDENTIFIER CAN BE MADE " &
93
                      "DIRECTLY VISIBLE BY A USE CLAUSE, AND THAT " &
94
                      "WHEN DIFFERENT FORMAL PARAMETER NAMES ARE " &
95
                      "USED, THE SUBPROGRAMS ARE REFERENCED CORRECTLY");
96
 
97
     IF FUNK(A => 3) /= IDENT_INT(1) THEN
98
          FAILED("PACK1.FUNK RETURNS INCORRECT RESULT");
99
     END IF;
100
 
101
     IF FUNK(X => 3) /= IDENT_INT(2) THEN
102
          FAILED("PACK2.FUNK RETURNS INCORRECT RESULT");
103
     END IF;
104
 
105
     PROK(A => 3, B => VAR1);
106
     PROK(X => 3, Y => VAR2);
107
 
108
     IF VAR1 /= IDENT_INT(1) THEN
109
          FAILED("PACK1.PROK RETURNS INCORRECT RESULT");
110
     END IF;
111
 
112
     IF VAR2 /= IDENT_INT(2) THEN
113
          FAILED("PACK2.PROK RETURNS INCORRECT RESULT");
114
     END IF;
115
 
116
     RESULT;
117
END C84005A;

powered by: WebSVN 2.1.0

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