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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C66002C.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 OVERLOADED SUBPROGRAM DECLARATIONS
26
-- ARE PERMITTED IN WHICH THERE IS A MINIMAL
27
-- DIFFERENCE BETWEEN THE DECLARATIONS.
28
 
29
--     (C) ONE SUBPROGRAM HAS ONE LESS PARAMETER THAN THE OTHER.
30
 
31
-- CVP 5/4/81
32
-- JRK 5/8/81
33
-- NL 10/13/81
34
 
35
WITH REPORT;
36
PROCEDURE C66002C IS
37
 
38
     USE REPORT;
39
 
40
BEGIN
41
     TEST ("C66002C", "SUBPROGRAM OVERLOADING WITH " &
42
           "MINIMAL DIFFERENCES ALLOWED");
43
 
44
     --------------------------------------------------
45
 
46
     -- ONE PROCEDURE HAS ONE MORE PARAMETER
47
     -- THAN THE OTHER.  THIS IS TESTED IN THE
48
     -- CASE IN WHICH THAT PARAMETER HAS A DEFAULT
49
     -- VALUE, AND THE CASE IN WHICH IT DOES NOT.
50
 
51
     DECLARE
52
          I, J : INTEGER := 0;
53
          B : BOOLEAN := TRUE;
54
          S : STRING (1..2) := "12";
55
 
56
          PROCEDURE P1 (I1, I2 : INTEGER; B1 : IN OUT BOOLEAN) IS
57
          BEGIN
58
               S(1) := 'A';
59
          END P1;
60
 
61
          PROCEDURE P1 (I1, I2 : INTEGER) IS
62
          BEGIN
63
               S(2) := 'B';
64
          END P1;
65
 
66
          PROCEDURE P2 (B1 : IN OUT BOOLEAN; I1 : INTEGER := 0) IS
67
          BEGIN
68
               S(1) := 'C';
69
          END P2;
70
 
71
          PROCEDURE P2 (B1 : IN OUT BOOLEAN) IS
72
          BEGIN
73
               S(2) := 'D';
74
          END P2;
75
 
76
     BEGIN
77
          P1 (I, J, B);
78
          P1 (I, J);
79
 
80
          IF S /= "AB" THEN
81
               FAILED ("PROCEDURES DIFFERING ONLY IN " &
82
                       "NUMBER OF PARAMETERS (NO DEFAULTS) " &
83
                       "CAUSED CONFUSION");
84
          END IF;
85
 
86
          S := "12";
87
          P2 (B, I);
88
          -- NOTE THAT A CALL TO P2 WITH ONLY
89
          -- ONE PARAMETER IS AMBIGUOUS.
90
 
91
          IF S /= "C2" THEN
92
               FAILED ("PROCEDURES DIFFERING ONLY IN " &
93
                       "EXISTENCE OF ONE PARAMETER (WITH " &
94
                       "DEFAULT) CAUSED CONFUSION");
95
          END IF;
96
     END;
97
 
98
     --------------------------------------------------
99
 
100
     RESULT;
101
 
102
END C66002C;

powered by: WebSVN 2.1.0

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