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/] [cc/] [cc3601c.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
-- CC3601C.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 "/=" MAY BE PASSED AS A GENERIC ACTUAL FUNCTION
26
-- PARAMETER.
27
 
28
-- DAT 10/6/81
29
-- SPS 10/27/82
30
-- JRK 2/9/83
31
 
32
WITH REPORT; USE REPORT;
33
 
34
PROCEDURE CC3601C IS
35
BEGIN
36
     TEST ("CC3601C", "/= AS GENERIC ACTUAL PARAMETER");
37
 
38
     DECLARE
39
          PACKAGE PK IS
40
               TYPE LP IS LIMITED PRIVATE;
41
               FUNCTION "=" (X, Y : LP) RETURN BOOLEAN;-- RETURNS FALSE.
42
               TYPE INT IS NEW INTEGER;
43
          PRIVATE
44
               TASK TYPE LP;
45
          END PK;
46
          USE PK;
47
 
48
          V1, V2 : LP;
49
 
50
          TYPE REC IS RECORD
51
               C : LP;
52
          END RECORD;
53
 
54
          R1, R2 : REC;
55
 
56
          TYPE INT IS NEW INTEGER;
57
 
58
          B1 : BOOLEAN := TRUE;
59
          B2 : BOOLEAN := TRUE;
60
          INTEGER_3 : INTEGER := 3;
61
          INTEGER_4 : INTEGER := 4;
62
          INT_3     : INT := 3;
63
          INT_4     : INT := 4;
64
          INT_5     : INT := 5;
65
          PK_INT_M1 : PK.INT := -1;
66
          PK_INT_M2 : PK.INT := -2;
67
          PK_INT_1  : PK.INT := 1;
68
          PK_INT_2  : PK.INT := 2;
69
          PK_INT_3  : PK.INT := 3;
70
 
71
          FUNCTION "=" (Q, R : LP) RETURN BOOLEAN;-- RETURNS TRUE.
72
 
73
          GENERIC
74
               TYPE T IS LIMITED PRIVATE;
75
               V1, V2 : IN OUT T;
76
               WITH FUNCTION NE (ZA : IN T; ZB : T) RETURN BOOLEAN;
77
               VALUE : IN BOOLEAN; -- SHOULD BE VALUE OF NE(V1,V2).
78
               STR : STRING;
79
          PACKAGE GP IS END GP;
80
 
81
          FUNCTION "=" (Q, R : IN REC) RETURN BOOLEAN;
82
 
83
          FUNCTION NE (Q : INT; R : IN INT) RETURN BOOLEAN
84
               RENAMES "/=";
85
 
86
          FUNCTION NE (Q : PK.INT; R : IN PK.INT) RETURN BOOLEAN
87
               RENAMES "/=";
88
 
89
          PACKAGE BODY GP IS
90
          BEGIN
91
               IF IDENT_BOOL(VALUE) /= NE (V1, V2) THEN
92
                    FAILED ("WRONG /= ACTUAL GENERIC PARAMETER "
93
                    & STR);
94
               END IF;
95
          END GP;
96
 
97
          FUNCTION "=" (Q, R : IN REC) RETURN BOOLEAN IS
98
          BEGIN
99
               RETURN FALSE;
100
          END "=";
101
 
102
          FUNCTION "=" (Q, R : LP) RETURN BOOLEAN IS
103
          BEGIN
104
               RETURN TRUE;
105
          END "=";
106
 
107
          PACKAGE BODY PK IS
108
               FUNCTION "=" (X, Y : LP) RETURN BOOLEAN IS
109
               BEGIN
110
                    RETURN R1 = R1;     -- FALSE.
111
               END "=";
112
               TASK BODY LP IS BEGIN NULL; END;
113
          END PK;
114
 
115
          PACKAGE P1 IS NEW GP (LP, V1, V2, "/=", FALSE, "1");
116
 
117
          FUNCTION "NOT" (X : BOOLEAN) RETURN BOOLEAN IS
118
          BEGIN RETURN X; END "NOT"; -- ENSURES USE OF PREDEFINED "NOT"
119
 
120
          PACKAGE P2 IS NEW GP (LP,      V1, V2, "/=", FALSE, "2");
121
          PACKAGE P3 IS NEW GP (LP, V1, V2, PK."/=", TRUE, "3");
122
          PACKAGE P4 IS NEW GP (PK.LP, V1, V2, "/=", FALSE, "4");
123
          PACKAGE P5 IS NEW GP (PK.LP, V1, V2, PK."/=", TRUE, "5");
124
          PACKAGE P6 IS NEW GP (REC, R1, R2, "/=", TRUE, "6");
125
          PACKAGE P7 IS NEW GP (INTEGER, INTEGER_3, INTEGER_4, "/=",
126
                                TRUE, "7");
127
          PACKAGE P8 IS NEW GP (BOOLEAN, B1, B2, "/=", FALSE,"8");
128
          PACKAGE P9 IS NEW GP (INT, INT_3, INT_5, "/=", TRUE, "9");
129
          PACKAGE P10 IS NEW GP (INT, INT_3, INT_3, "/=", FALSE, "10");
130
          PACKAGE P11 IS NEW GP (INT, INT_3, INT_4, NE, TRUE, "11");
131
          PACKAGE P12 IS NEW GP (INT, INT_3, INT_3, NE, FALSE, "12");
132
          PACKAGE P13 IS NEW GP (PK.INT, PK_INT_3, PK_INT_3, NE,
133
                                 FALSE, "13");
134
          PACKAGE P14 IS NEW GP (PK.INT, PK_INT_M1, PK_INT_M2, NE,
135
                                 TRUE,  "14");
136
          PACKAGE P15 IS NEW GP (PK.INT, PK_INT_1, PK_INT_1, "/=",
137
                                 FALSE, "15");
138
          PACKAGE P16 IS NEW GP (PK.INT, PK_INT_1, PK_INT_2, "/=",
139
                                 TRUE,  "16");
140
          PACKAGE P17 IS NEW GP (PK.INT, PK_INT_1, PK_INT_1, PK."/=",
141
                                 FALSE, "17");
142
          PACKAGE P18 IS NEW GP (PK.INT, PK_INT_1, PK_INT_2, PK."/=",
143
                                 TRUE,  "18");
144
     BEGIN
145
          NULL;
146
     END;
147
 
148
     RESULT;
149
END CC3601C;

powered by: WebSVN 2.1.0

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