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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C43105B.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
--     IN A RECORD AGGREGATE (X => E, Y => E), WHERE E IS AN OVERLOADED
27
--     FUNCTION CALL, OVERLOADING RESOLUTION OCCURS SEPARATELY FOR THE
28
--     DIFFERENT OCCURRENCES OF E.
29
 
30
-- HISTORY:
31
--     DHH 09/07/88  CREATED ORIGINAL TEST.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C43105B IS
35
BEGIN
36
     TEST ("C43105B", "IN A RECORD AGGREGATE (X => E, Y => E), WHERE " &
37
                      "E IS AN OVERLOADED FUNCTION CALL, OVERLOADING " &
38
                      "RESOLUTION OCCURS SEPARATELY FOR THE " &
39
                      "DIFFERENT OCCURRENCES OF E");
40
 
41
     DECLARE
42
          TYPE COLOR IS (RED, YELLOW, GREEN);
43
          TYPE PALETTE IS (GREEN, YELLOW, RED);
44
 
45
          TYPE REC IS
46
               RECORD
47
                    X : COLOR;
48
                    Y : PALETTE;
49
               END RECORD;
50
 
51
          TYPE RECD IS
52
               RECORD
53
                    X : PALETTE;
54
                    Y : COLOR;
55
               END RECORD;
56
 
57
          REC1 : REC;
58
          REC2 : RECD;
59
 
60
          FUNCTION IDENT_C(C : COLOR) RETURN COLOR IS
61
          BEGIN
62
               IF EQUAL(3,3) THEN
63
                    RETURN C;
64
               ELSE
65
                    RETURN GREEN;
66
               END IF;
67
          END IDENT_C;
68
 
69
          FUNCTION IDENT_C(P : PALETTE) RETURN PALETTE IS
70
          BEGIN
71
               IF EQUAL(3,3) THEN
72
                    RETURN P;
73
               ELSE
74
                    RETURN RED;
75
               END IF;
76
          END IDENT_C;
77
 
78
     BEGIN
79
          REC1 := (X => IDENT_C(YELLOW), Y => IDENT_C(YELLOW));
80
          REC2 := (X => IDENT_C(YELLOW), Y => IDENT_C(YELLOW));
81
 
82
          IF REC1.X /= REC2.Y THEN
83
               FAILED("COLOR FUNCTION RESOLUTION FAILED");
84
          END IF;
85
 
86
          IF REC1.Y /= REC2.X THEN
87
               FAILED("PALETTE FUNCTION RESOLUTION FAILED");
88
          END IF;
89
     EXCEPTION
90
          WHEN OTHERS =>
91
               FAILED("EXCEPTION RAISED");
92
     END;
93
     RESULT;
94
END C43105B;

powered by: WebSVN 2.1.0

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