1-- C45503A.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 'REM' AND 'MOD' YIELD CORRECT RESULTS WHEN THE OPERANDS
26-- ARE OF PREDEFINED TYPE INTEGER.
27
28-- R.WILLIAMS 9/1/86
29
30WITH REPORT; USE REPORT;
31PROCEDURE C45503A IS
32
33BEGIN
34     TEST ( "C45503A", "CHECK THAT 'REM' AND 'MOD' YIELD CORRECT " &
35                       "RESULTS WHEN THE OPERANDS ARE OF PREDEFINED " &
36                       "TYPE INTEGER" );
37
38     DECLARE
39          I0  : INTEGER := 0;
40          I1  : INTEGER := 1;
41          I2  : INTEGER := 2;
42          I3  : INTEGER := 3;
43          I4  : INTEGER := 4;
44          I5  : INTEGER := 5;
45          I10 : INTEGER := 10;
46          I11 : INTEGER := 11;
47          I12 : INTEGER := 12;
48          I13 : INTEGER := 13;
49          I14 : INTEGER := 14;
50          N1  : INTEGER := -1;
51          N2  : INTEGER := -2;
52          N3  : INTEGER := -3;
53          N4  : INTEGER := -4;
54          N5  : INTEGER := -5;
55          N10 : INTEGER := -10;
56          N11 : INTEGER := -11;
57          N12 : INTEGER := -12;
58          N13 : INTEGER := -13;
59          N14 : INTEGER := -14;
60
61     BEGIN
62          IF I10 REM I5 /= I0 THEN
63               FAILED ( "INCORRECT RESULT FOR I10 REM I5" );
64          END IF;
65
66          IF IDENT_INT (I11) REM IDENT_INT (I5) /= I1 THEN
67               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I11) REM " &
68                        "IDENT_INT (I5)" );
69          END IF;
70
71          IF I12 REM I5 /= I2 THEN
72               FAILED ( "INCORRECT RESULT FOR I12 REM I5" );
73          END IF;
74
75          IF "REM" (LEFT => I12, RIGHT => I5) /= I2 THEN
76               FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => I12, " &
77                        "RIGHT => I5)" );
78          END IF;
79
80          IF IDENT_INT (I13) REM IDENT_INT (I5) /= I3 THEN
81               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I13) REM " &
82                        "IDENT_INT (I5)" );
83          END IF;
84
85          IF I14 REM I5 /= I4 THEN
86               FAILED ( "INCORRECT RESULT FOR I14 REM I5" );
87          END IF;
88
89          IF IDENT_INT (I10) REM IDENT_INT (N5) /= I0 THEN
90               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I10) REM " &
91                        "IDENT_INT (N5)" );
92          END IF;
93
94          IF "REM" (LEFT => IDENT_INT (I10), RIGHT => IDENT_INT (N5))
95                   /= I0 THEN
96               FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => " &
97                        "IDENT_INT (I10), RIGHT => IDENT_INT (N5))" );
98          END IF;
99
100          IF I11 REM N5 /= I1 THEN
101               FAILED ( "INCORRECT RESULT FOR I11 REM N5" );
102          END IF;
103
104          IF IDENT_INT (I12) REM IDENT_INT (N5) /= I2 THEN
105               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I12) REM " &
106                        "IDENT_INT (N5)" );
107          END IF;
108
109          IF I13 REM N5 /= I3 THEN
110               FAILED ( "INCORRECT RESULT FOR I13 REM N5" );
111          END IF;
112
113          IF "REM" (LEFT => I13, RIGHT => N5) /= I3 THEN
114               FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => I13, " &
115                        "RIGHT => N5)" );
116          END IF;
117
118          IF IDENT_INT (I14) REM IDENT_INT (N5) /= I4 THEN
119               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I14) REM " &
120                        "IDENT_INT (N5)" );
121          END IF;
122
123          IF N10 REM I5 /= I0 THEN
124               FAILED ( "INCORRECT RESULT FOR N10 REM I5" );
125          END IF;
126
127          IF IDENT_INT (N11) REM IDENT_INT (I5) /= N1 THEN
128               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N11) REM " &
129                        "IDENT_INT (I5)" );
130          END IF;
131
132          IF "REM" (LEFT => IDENT_INT (N11), RIGHT => IDENT_INT (I5))
133                   /= N1 THEN
134               FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => " &
135                        "IDENT_INT (N11), RIGHT => IDENT_INT (I5))" );
136          END IF;
137
138          IF N12 REM I5 /= N2 THEN
139               FAILED ( "INCORRECT RESULT FOR N12 REM I5" );
140          END IF;
141
142          IF IDENT_INT (N13) REM IDENT_INT (I5) /= N3 THEN
143               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N13) REM " &
144                        "IDENT_INT (I5)" );
145          END IF;
146
147          IF N14 REM I5 /= N4 THEN
148               FAILED ( "INCORRECT RESULT FOR N14 REM I5" );
149          END IF;
150
151          IF "REM" (LEFT => N14, RIGHT => I5) /= N4 THEN
152               FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => N14, " &
153                        "RIGHT => I5)" );
154          END IF;
155
156          IF IDENT_INT (N10) REM IDENT_INT (N5) /= I0 THEN
157               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N10) REM " &
158                        "IDENT_INT (N5)" );
159          END IF;
160
161          IF N11 REM N5 /= N1 THEN
162               FAILED ( "INCORRECT RESULT FOR N11 REM N5" );
163          END IF;
164
165          IF IDENT_INT (N12) REM IDENT_INT (N5) /= N2 THEN
166               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N12) REM " &
167                        "IDENT_INT (N5)" );
168          END IF;
169
170          IF "REM" (LEFT => IDENT_INT (N12), RIGHT => IDENT_INT (N5))
171                   /= N2 THEN
172               FAILED ( "INCORRECT RESULT FOR ""REM"" (LEFT => " &
173                        "IDENT_INT (N12), RIGHT => IDENT_INT (N5))" );
174          END IF;
175
176          IF N13 REM N5 /= N3 THEN
177               FAILED ( "INCORRECT RESULT FOR N13 REM N5" );
178          END IF;
179
180          IF IDENT_INT (N14) REM IDENT_INT (N5) /= N4 THEN
181               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N14) REM " &
182                        "IDENT_INT (N5)" );
183          END IF;
184
185          IF I10 MOD I5 /= I0 THEN
186               FAILED ( "INCORRECT RESULT FOR I10 MOD I5" );
187          END IF;
188
189          IF IDENT_INT (I11) MOD IDENT_INT (I5) /= I1 THEN
190               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I11) MOD " &
191                        "IDENT_INT (I5)" );
192          END IF;
193
194          IF I12 MOD I5 /= I2 THEN
195               FAILED ( "INCORRECT RESULT FOR I12 MOD I5" );
196          END IF;
197
198          IF "MOD" (LEFT => I12, RIGHT => I5) /= I2 THEN
199               FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => I12, " &
200                        "RIGHT => I5)" );
201          END IF;
202
203          IF IDENT_INT (I13) MOD IDENT_INT (I5) /= I3 THEN
204               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I13) MOD " &
205                        "IDENT_INT (I5)" );
206          END IF;
207
208          IF I14 MOD I5 /= I4 THEN
209               FAILED ( "INCORRECT RESULT FOR I14 MOD I5" );
210          END IF;
211
212          IF IDENT_INT (I10) MOD IDENT_INT (N5) /= I0 THEN
213               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I10) MOD " &
214                        "IDENT_INT (N5)" );
215          END IF;
216
217          IF "MOD" (LEFT => IDENT_INT (I10), RIGHT => IDENT_INT (N5))
218                   /= I0 THEN
219               FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => " &
220                        "IDENT_INT (I10), RIGHT => IDENT_INT (N5))" );
221          END IF;
222
223          IF I11 MOD N5 /= N4 THEN
224               FAILED ( "INCORRECT RESULT FOR I11 MOD N5" );
225          END IF;
226
227          IF IDENT_INT (I12) MOD IDENT_INT (N5) /= N3 THEN
228               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I12) MOD " &
229                        "IDENT_INT (N5)" );
230          END IF;
231
232          IF I13 MOD N5 /= N2 THEN
233               FAILED ( "INCORRECT RESULT FOR I13 MOD N5" );
234          END IF;
235
236          IF "MOD" (LEFT => I13, RIGHT => N5) /= N2 THEN
237               FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => I13, " &
238                        "RIGHT => N5)" );
239          END IF;
240
241          IF IDENT_INT (I14) MOD IDENT_INT (N5) /=  N1 THEN
242               FAILED ( "INCORRECT RESULT FOR IDENT_INT (I14) MOD " &
243                        "IDENT_INT (N5)" );
244          END IF;
245
246          IF N10 MOD I5 /= I0 THEN
247               FAILED ( "INCORRECT RESULT FOR N10 MOD I5" );
248          END IF;
249
250          IF IDENT_INT (N11) MOD IDENT_INT (I5) /= I4 THEN
251               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N11) MOD " &
252                        "IDENT_INT (I5)" );
253          END IF;
254
255          IF "MOD" (LEFT => IDENT_INT (N11), RIGHT => IDENT_INT (I5))
256                   /= I4 THEN
257               FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => " &
258                        "IDENT_INT (N11), RIGHT => IDENT_INT (I5))" );
259          END IF;
260
261          IF N12 MOD I5 /= I3 THEN
262               FAILED ( "INCORRECT RESULT FOR N12 MOD I5" );
263          END IF;
264
265          IF IDENT_INT (N13) MOD IDENT_INT (I5) /= I2 THEN
266               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N13) MOD " &
267                        "IDENT_INT (I5)" );
268          END IF;
269
270          IF N14 MOD I5 /= I1 THEN
271               FAILED ( "INCORRECT RESULT FOR N14 MOD I5" );
272          END IF;
273
274          IF "MOD" (LEFT => N14, RIGHT => I5) /= I1 THEN
275               FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => I14, " &
276                        "RIGHT => I5)" );
277          END IF;
278
279          IF IDENT_INT (N10) MOD IDENT_INT (N5) /= I0 THEN
280               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N10) MOD " &
281                        "IDENT_INT (N5)" );
282          END IF;
283
284          IF N11 MOD N5 /= N1 THEN
285               FAILED ( "INCORRECT RESULT FOR N11 MOD N5" );
286          END IF;
287
288          IF IDENT_INT (N12) MOD IDENT_INT (N5) /= N2 THEN
289               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N12) MOD " &
290                        "IDENT_INT (N5)" );
291          END IF;
292
293          IF "MOD" (LEFT => IDENT_INT (N12), RIGHT => IDENT_INT (N5))
294                   /= N2 THEN
295               FAILED ( "INCORRECT RESULT FOR ""MOD"" (LEFT => " &
296                        "IDENT_INT (N12), RIGHT => IDENT_INT (N5))" );
297          END IF;
298
299          IF N13 MOD N5 /= N3 THEN
300               FAILED ( "INCORRECT RESULT FOR N13 MOD N5" );
301          END IF;
302
303          IF IDENT_INT (N14) MOD IDENT_INT (N5) /= N4 THEN
304               FAILED ( "INCORRECT RESULT FOR IDENT_INT (N14) MOD " &
305                        "IDENT_INT (N5)" );
306          END IF;
307     END;
308
309     RESULT;
310END C45503A;
311