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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C95095A.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 AND ENTRY DECLARATIONS
26
-- ARE PERMITTED IN WHICH THERE IS A MINIMAL
27
-- DIFFERENCE BETWEEN THE DECLARATIONS.
28
 
29
--     (A) A FUNCTION AND AN ENTRY.
30
 
31
-- JWC 7/24/85
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C95095A IS
35
 
36
BEGIN
37
     TEST ("C95095A", "SUBPROGRAM/ENTRY OVERLOADING WITH " &
38
                      "MINIMAL DIFFERENCES");
39
 
40
     --------------------------------------------------
41
 
42
     -- BOTH PARAMETERIZED AND PARAMETERLESS SUBPROGRAMS AND ENTRIES
43
     -- ARE TESTED.
44
 
45
     DECLARE
46
          I, J, K : INTEGER := 0;
47
          S : STRING (1..2) := "12";
48
 
49
          TASK T IS
50
               ENTRY E1 (I1, I2 : INTEGER);
51
               ENTRY E2;
52
          END T;
53
 
54
          TASK BODY T IS
55
          BEGIN
56
               LOOP
57
                    SELECT
58
                         ACCEPT E1 (I1, I2 : INTEGER) DO
59
                              S (1) := 'A';
60
                         END E1;
61
                    OR
62
                         ACCEPT E2 DO
63
                              S (1) := 'C';
64
                         END E2;
65
                    OR
66
                         TERMINATE;
67
                    END SELECT;
68
               END LOOP;
69
          END T;
70
 
71
          FUNCTION E1 (I1, I2 : INTEGER) RETURN INTEGER IS
72
          BEGIN
73
               S (2) := 'B';
74
               RETURN I1; -- RETURNED VALUE IS IRRELEVENT.
75
          END E1;
76
 
77
 
78
          FUNCTION E2 RETURN INTEGER IS
79
          BEGIN
80
               S (2) := 'D';
81
               RETURN I; -- RETURNED VALUE IS IRRELEVENT.
82
          END E2;
83
 
84
     BEGIN
85
          T.E1 (I, J);
86
          K := E1 (I, J);
87
 
88
          IF S /= "AB" THEN
89
               FAILED ("PARAMETERIZED OVERLOADED " &
90
                       "SUBPROGRAM AND ENTRY " &
91
                       "CAUSED CONFUSION");
92
          END IF;
93
 
94
          S := "12";
95
          T.E2;
96
          K := E2;
97
 
98
          IF S /= "CD" THEN
99
               FAILED ("PARAMETERLESS OVERLOADED " &
100
                       "SUBPROGRAM AND ENTRY " &
101
                       "CAUSED CONFUSION");
102
          END IF;
103
     END;
104
 
105
     --------------------------------------------------
106
 
107
     RESULT;
108
END C95095A;

powered by: WebSVN 2.1.0

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