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

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

Line No. Rev Author Line
1 294 jeremybenn
-- C67005A.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 IF A RENAMING DECLARATION DECLARES AN EQUALITY OPERATOR, THE
26
-- TYPES OF THE PARAMETERS NEED NOT BE LIMITED TYPES. 
27
 
28
-- JBG 9/28/83
29
 
30
WITH REPORT; USE REPORT;
31
PROCEDURE C67005A IS
32
BEGIN
33
     TEST ("C67005A", "CHECK THAT AN EQUALITY OPERATOR DECLARED BY " &
34
                      "A RENAMING DECLARATION NEED NOT HAVE " &
35
                      "PARAMETERS OF A LIMITED TYPE");
36
     DECLARE
37
          GENERIC
38
               TYPE LP IS LIMITED PRIVATE;
39
               WITH FUNCTION EQUAL (L, R : LP) RETURN BOOLEAN;
40
          PACKAGE EQUALITY_OPERATOR IS
41
               FUNCTION "=" (L, R : LP) RETURN BOOLEAN;
42
          END EQUALITY_OPERATOR;
43
 
44
          PACKAGE BODY EQUALITY_OPERATOR IS
45
               FUNCTION "=" (L, R : LP) RETURN BOOLEAN IS
46
               BEGIN
47
                    RETURN EQUAL(L, R);
48
               END "=";
49
          END EQUALITY_OPERATOR;
50
 
51
          PACKAGE POLAR_COORDINATES IS
52
               TYPE POLAR_COORD IS
53
                    RECORD
54
                         R     : INTEGER;
55
                         THETA : INTEGER;
56
                    END RECORD;
57
               FUNCTION EQUAL (L, R : POLAR_COORD) RETURN BOOLEAN;
58
               PACKAGE POLAR_EQUAL IS NEW EQUALITY_OPERATOR
59
                         (POLAR_COORD, EQUAL);
60
               FUNCTION "=" (L, R : POLAR_COORD) RETURN BOOLEAN
61
                         RENAMES POLAR_EQUAL."=";
62
          END POLAR_COORDINATES;
63
 
64
          PACKAGE BODY POLAR_COORDINATES IS
65
               FUNCTION EQUAL (L, R : POLAR_COORD) RETURN BOOLEAN IS
66
               BEGIN
67
                    RETURN (L.THETA MOD 360) = (R.THETA MOD 360) AND
68
                           L.R = R.R;
69
               END EQUAL;
70
          END POLAR_COORDINATES;
71
 
72
          USE POLAR_COORDINATES;
73
 
74
          PACKAGE VARIABLES IS
75
               P270 : POLAR_COORD := (R => 3, THETA => 270);
76
               P360 : POLAR_COORD := (R => 3, THETA => IDENT_INT(360));
77
          END VARIABLES;
78
 
79
          USE VARIABLES;
80
 
81
     BEGIN
82
 
83
          IF P270 /= (3, -90) THEN
84
               FAILED ("INCORRECT INEQUALITY OPERATOR");
85
          END IF;
86
 
87
          IF P360 = (3, 0) THEN
88
               NULL;
89
          ELSE
90
               FAILED ("INCORRECT EQUALITY OPERATOR");
91
          END IF;
92
 
93
          RESULT;
94
 
95
     END;
96
END C67005A;

powered by: WebSVN 2.1.0

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