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

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

Line No. Rev Author Line
1 294 jeremybenn
-- C67002B.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 OPERATOR SYMBOLS CAN BE USED IN (OVERLOADED)
26
--   FUNCTION SPECIFICATIONS WITH THE REQUIRED NUMBER OF PARAMETERS.
27
--   THIS TEST CHECKS THE CASE OF CERTAIN OPERATOR SYMBOLS.
28
--   SUBTESTS ARE:
29
--        (A) THROUGH (E): "AND", "OR", "XOR", "MOD", "REM"
30
--            RESPECTIVELY.  ALL OF THESE HAVE TWO PARAMETERS.
31
--        (F) AND (G): "NOT" AND "ABS", RESPECTIVELY,
32
--             WITH ONE PARAMETER.
33
 
34
-- CPP 6/26/84
35
 
36
WITH REPORT;
37
PROCEDURE C67002B IS
38
 
39
     USE REPORT;
40
 
41
BEGIN
42
     TEST ("C67002B", "USE OF OPERATOR SYMBOLS IN " &
43
           "(OVERLOADED) FUNCTION SPECIFICATIONS");
44
 
45
     -------------------------------------------------
46
 
47
     DECLARE -- (A)
48
          FUNCTION "And" (I1, I2 : INTEGER) RETURN CHARACTER IS
49
          BEGIN
50
               IF I1 > I2 THEN
51
                    RETURN 'G';
52
               ELSE RETURN 'L';
53
               END IF;
54
          END "And";
55
 
56
     BEGIN -- (A)
57
          IF (IDENT_INT (10) AND 1) /= 'G' OR
58
             (5 AnD 10) /= 'L' THEN
59
               FAILED ("OVERLOADING OF ""And"" OPERATOR DEFECTIVE");
60
          END IF;
61
     END; -- (A)
62
 
63
     -------------------------------------------------
64
 
65
     DECLARE -- (B)
66
          FUNCTION "or" (I1, I2 : INTEGER) RETURN CHARACTER IS
67
          BEGIN
68
               IF I1 > I2 THEN
69
                    RETURN 'G';
70
               ELSE RETURN 'L';
71
               END IF;
72
          END "or";
73
 
74
     BEGIN -- (B)
75
          IF (IDENT_INT (10) Or 1) /= 'G' OR
76
             (5 OR 10) /= 'L' THEN
77
               FAILED ("OVERLOADING OF ""or"" OPERATOR DEFECTIVE");
78
          END IF;
79
     END; -- (B)
80
 
81
     -------------------------------------------------
82
 
83
     DECLARE -- (C)
84
          FUNCTION "xOR" (I1, I2 : INTEGER) RETURN CHARACTER IS
85
          BEGIN
86
               IF I1 > I2 THEN
87
                    RETURN 'G';
88
               ELSE RETURN 'L';
89
               END IF;
90
          END "xOR";
91
 
92
     BEGIN -- (C)
93
          IF (IDENT_INT (10) XoR 1) /= 'G' OR
94
             (5 xOR 10) /= 'L' THEN
95
               FAILED ("OVERLOADING OF ""xOR"" OPERATOR DEFECTIVE");
96
          END IF;
97
     END; -- (C)
98
 
99
     -------------------------------------------------
100
 
101
     DECLARE -- (D)
102
          FUNCTION "mOd" (I1, I2 : INTEGER) RETURN CHARACTER IS
103
          BEGIN
104
               IF I1 > I2 THEN
105
                    RETURN 'G';
106
               ELSE RETURN 'L';
107
               END IF;
108
          END "mOd";
109
 
110
     BEGIN -- (D)
111
          IF (IDENT_INT (10) MoD 1) /= 'G' OR
112
             (5 moD 10) /= 'L' THEN
113
               FAILED ("OVERLOADING OF ""mOd"" OPERATOR DEFECTIVE");
114
          END IF;
115
     END; -- (D)
116
 
117
     -------------------------------------------------
118
 
119
     DECLARE -- (E)
120
          FUNCTION "REM" (I1, I2 : INTEGER) RETURN CHARACTER IS
121
          BEGIN
122
               IF I1 > I2 THEN
123
                    RETURN 'G';
124
               ELSE RETURN 'L';
125
               END IF;
126
          END "REM";
127
 
128
     BEGIN -- (E)
129
          IF (IDENT_INT (10) rem 1) /= 'G' OR
130
             (5 Rem 10) /= 'L' THEN
131
               FAILED ("OVERLOADING OF ""REM"" OPERATOR DEFECTIVE");
132
          END IF;
133
     END; -- (E)
134
 
135
     -------------------------------------------------
136
 
137
     DECLARE -- (F)
138
          FUNCTION "NOT" (I1 : INTEGER) RETURN CHARACTER IS
139
          BEGIN
140
               IF I1 < IDENT_INT (0) THEN
141
                    RETURN 'N';
142
               ELSE RETURN 'P';
143
               END IF;
144
          END "NOT";
145
 
146
     BEGIN -- (F)
147
          IF (Not IDENT_INT(25) /= 'P') OR
148
             (noT (0-25) /= 'N') THEN
149
               FAILED ("OVERLOADING OF ""NOT"" " &
150
                       "OPERATOR (ONE OPERAND) DEFECTIVE");
151
          END IF;
152
     END; -- (F)
153
 
154
     -------------------------------------------------
155
 
156
     DECLARE -- (G)
157
          FUNCTION "ABS" (I1 : INTEGER) RETURN CHARACTER IS
158
          BEGIN
159
               IF I1 < IDENT_INT (0) THEN
160
                    RETURN 'N';
161
               ELSE RETURN 'P';
162
               END IF;
163
          END "ABS";
164
 
165
     BEGIN -- (G)
166
          IF (abs IDENT_INT(25) /= 'P') OR
167
             (Abs (0-25) /= 'N') THEN
168
               FAILED ("OVERLOADING OF ""ABS"" " &
169
                       "OPERATOR (ONE OPERAND) DEFECTIVE");
170
          END IF;
171
     END; -- (T)
172
 
173
     -------------------------------------------------
174
 
175
     RESULT;
176
END C67002B;

powered by: WebSVN 2.1.0

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