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/] [c8/] [c87b16a.ada] - Blame information for rev 316

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C87B16A.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 OVERLOADING RESOLUTION USES THE RULE THAT:
26
--
27
-- FOR A DEFAULT RECORD COMPONENT, THE TYPE OF THE INITIALIZATION
28
-- EXPRESSION MUST MATCH THE COMPONENTS'S EXPLICIT TYPEMARK.
29
--      
30
-- THE FOUR KINDS OF EXPRESSIONS TESTED HERE ARE:
31
-- 
32
--    (A): A CALL TO AN OVERLOADED FUNCTION.
33
--    (B): AN OVERLOADED OPERATOR SYMBOL.
34
--    (C): AN OVERLOADED (INFIX) OPERATOR.
35
--    (D): AN OVERLOADED ENUMERATION LITERAL.
36
 
37
-- TRH  23 JUNE 82
38
 
39
WITH REPORT; USE REPORT;
40
 
41
PROCEDURE C87B16A IS
42
 
43
     TYPE WHOLE  IS NEW INTEGER RANGE 0..INTEGER'LAST;
44
     TYPE CITRUS IS (LEMON, LIME, ORANGE);
45
     TYPE HUE    IS (RED, ORANGE, YELLOW);
46
 
47
     FUNCTION F1 (X, Y : INTEGER) RETURN INTEGER IS
48
     BEGIN
49
          RETURN -1;
50
     END F1;
51
 
52
     FUNCTION F1 (X, Y : WHOLE) RETURN WHOLE IS
53
     BEGIN
54
          RETURN 0;
55
     END F1;
56
 
57
     FUNCTION F1 (X, Y : INTEGER) RETURN HUE IS
58
     BEGIN
59
          RETURN ORANGE;
60
     END F1;
61
 
62
     FUNCTION F1 (X, Y : INTEGER) RETURN CITRUS IS
63
     BEGIN
64
          RETURN ORANGE;
65
     END F1;
66
 
67
BEGIN
68
     TEST ("C87B16A","OVERLOADED INITIALIZATION EXPRESSIONS" &
69
           " IN DEFAULT RECORD COMPONENTS");
70
     DECLARE
71
 
72
          FUNCTION "-" (X, Y : INTEGER) RETURN INTEGER
73
               RENAMES F1;
74
 
75
          FUNCTION "-" (X, Y : WHOLE)   RETURN WHOLE
76
               RENAMES F1;
77
 
78
          FUNCTION "-" (X, Y : INTEGER) RETURN HUE
79
               RENAMES F1;
80
 
81
          FUNCTION "-" (X, Y : INTEGER) RETURN CITRUS
82
               RENAMES F1;
83
 
84
          TYPE REC IS
85
               RECORD
86
                    I1 : INTEGER := F1  (0, 0);
87
                    W1 : WHOLE   := F1  (0, 0);
88
                    C1 : CITRUS  := F1  (0, 0);
89
                    H1 : HUE     := F1  (0, 0);
90
 
91
                    I2 : INTEGER := "-" (0, 0);
92
                    W2 : WHOLE   := "-" (0, 0);
93
                    C2 : CITRUS  := "-" (0, 0);
94
                    H2 : HUE     := "-" (0, 0);
95
 
96
                    I3 : INTEGER := (0 - 0);
97
                    W3 : WHOLE   := (0 - 0);
98
                    C3 : CITRUS  := (0 - 0);
99
                    H3 : HUE     := (0 - 0);
100
 
101
                    C4 : CITRUS  := ORANGE;
102
                    H4 : HUE     := ORANGE;
103
               END RECORD;
104
 
105
          R1 : REC;
106
 
107
     BEGIN
108
          IF R1.I1              /= -1 OR R1.W1           /= 0 OR
109
             CITRUS'POS (R1.C1) /=  2 OR HUE'POS (R1.H1) /= 1 THEN
110
             FAILED ("(A): RESOLUTION INCORRECT - FUNCTION CALL");
111
          END IF;
112
 
113
          IF R1.I2              /= -1 OR R1.W2           /= 0 OR
114
             CITRUS'POS (R1.C2) /=  2 OR HUE'POS (R1.H2) /= 1 THEN
115
             FAILED ("(B): RESOLUTION INCORRECT - OPERATOR SYMBOL");
116
          END IF;
117
 
118
          IF R1.I3              /= -1 OR R1.W3           /= 0 OR
119
             CITRUS'POS (R1.C3) /=  2 OR HUE'POS (R1.H3) /= 1 THEN
120
             FAILED ("(C): RESOLUTION INCORRECT - INFIX OPERATOR");
121
          END IF;
122
 
123
          IF CITRUS'POS (R1.C4) /=  2 OR HUE'POS (R1.H4) /= 1 THEN
124
             FAILED ("(D): RESOLUTION INCORRECT - ENUMERATION LITERAL");
125
          END IF;
126
     END;
127
 
128
     RESULT;
129
END C87B16A;

powered by: WebSVN 2.1.0

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