Lines Matching refs:results

161      * We pass in the arguments and return the results so the compiler
167 int[] results = new int[10];
170 results[0] = x + y;
171 results[1] = x - y;
172 results[2] = x * y;
173 results[3] = x * x;
174 results[4] = x / y;
175 results[5] = x % -y;
176 results[6] = x & y;
177 results[7] = x | y;
178 results[8] = x ^ y;
181 results[9] = x + ((((((((x + y) - y) * y) / y) % y) & y) | y) ^ y);
183 return results;
185 static void intOperCheck(int[] results) {
190 int negOne = -results[5];
195 Main.assertTrue(results[0] == 69997);
196 Main.assertTrue(results[1] == 70003);
197 Main.assertTrue(results[2] == -210000);
198 Main.assertTrue(results[3] == 605032704); // overflow / truncate
199 Main.assertTrue(results[4] == -23333);
200 Main.assertTrue(results[5] == 1);
201 Main.assertTrue(results[6] == 70000);
202 Main.assertTrue(results[7] == -3);
203 Main.assertTrue(results[8] == -70003);
204 Main.assertTrue(results[9] == 70000);
213 int[] results = new int[8];
216 results[0] = x + 1000;
217 results[1] = 1000 - x;
218 results[2] = x * 1000;
219 results[3] = x / 1000;
220 results[4] = x % 1000;
221 results[5] = x & 1000;
222 results[6] = x | -1000;
223 results[7] = x ^ -1000;
224 return results;
226 static void lit16Check(int[] results) {
227 Main.assertTrue(results[0] == 78777);
228 Main.assertTrue(results[1] == -76777);
229 Main.assertTrue(results[2] == 77777000);
230 Main.assertTrue(results[3] == 77);
231 Main.assertTrue(results[4] == 777);
232 Main.assertTrue(results[5] == 960);
233 Main.assertTrue(results[6] == -39);
234 Main.assertTrue(results[7] == -76855);
243 int[] results = new int[8];
246 results[0] = x + 10;
247 results[1] = 10 - x;
248 results[2] = x * 10;
249 results[3] = x / 10;
250 results[4] = x % 10;
251 results[5] = x & 10;
252 results[6] = x | -10;
253 results[7] = x ^ -10;
254 return results;
256 static void lit8Check(int[] results) {
257 //for (int i = 0; i < results.length; i++)
258 // System.out.println(" " + i + ": " + results[i]);
265 Main.assertTrue(results[0] == -55545);
266 Main.assertTrue(results[1] == 55565);
267 Main.assertTrue(results[2] == -555550);
268 Main.assertTrue(results[3] == -5555);
269 Main.assertTrue(results[4] == -5);
270 Main.assertTrue(results[5] == 8);
271 Main.assertTrue(results[6] == -1);
272 Main.assertTrue(results[7] == 55563);
356 int results[] = new int[4];
358 results[0] = value << dist;
359 results[1] = value >> dist;
360 results[2] = value >>> dist;
362 results[3] = (((value << dist) >> dist) >>> dist) << dist;
363 return results;
365 static void intShiftCheck(int[] results) {
368 Main.assertTrue(results[0] == 0x00aa0100);
369 Main.assertTrue(results[1] == 0xffff00aa);
370 Main.assertTrue(results[2] == 0x00ff00aa);
371 Main.assertTrue(results[3] == 0xaa00);
375 * We pass in the arguments and return the results so the compiler
381 long[] results = new long[10];
384 results[0] = x + y;
385 results[1] = x - y;
386 results[2] = x * y;
387 results[3] = x * x;
388 results[4] = x / y;
389 results[5] = x % -y;
390 results[6] = x & y;
391 results[7] = x | y;
392 results[8] = x ^ y;
395 results[9] = x + ((((((((x + y) - y) * y) / y) % y) & y) | y) ^ y);
397 return results;
399 static void longOperCheck(long[] results) {
404 long negOne = -results[5];
409 Main.assertTrue(results[0] == 69999999997L);
410 Main.assertTrue(results[1] == 70000000003L);
411 Main.assertTrue(results[2] == -210000000000L);
412 Main.assertTrue(results[3] == -6833923606740729856L); // overflow
413 Main.assertTrue(results[4] == -23333333333L);
414 Main.assertTrue(results[5] == 1);
415 Main.assertTrue(results[6] == 70000000000L);
416 Main.assertTrue(results[7] == -3);
417 Main.assertTrue(results[8] == -70000000003L);
418 Main.assertTrue(results[9] == 70000000000L);
420 Main.assertTrue(results.length == 10);
429 long results[] = new long[4];
431 results[0] = value << dist;
432 results[1] = value >> dist;
433 results[2] = value >>> dist;
435 results[3] = (((value << dist) >> dist) >>> dist) << dist;
436 return results;
438 static long longShiftCheck(long[] results) {
441 Main.assertTrue(results[0] == 0x96deff00aa010000L);
442 Main.assertTrue(results[1] == 0xffffd5aa96deff00L);
443 Main.assertTrue(results[2] == 0x0000d5aa96deff00L);
444 Main.assertTrue(results[3] == 0xffff96deff000000L);
446 Main.assertTrue(results.length == 4);
448 return results[0]; // test return-long