[Facades] Use the Open.snk key for the System.ValueTuple facade (#4173)
[mono-project.git] / mono / mini / basic-long.cs
blob82eb5befe7dd3b2b3a6b1153bf7cc70d65beee1f
1 using System;
2 using System.Reflection;
4 /*
5 * Regression tests for the mono JIT.
7 * Each test needs to be of the form:
9 * public static int test_<result>_<name> ();
11 * where <result> is an integer (the value that needs to be returned by
12 * the method to make it pass.
13 * <name> is a user-displayed name used to identify the test.
15 * The tests can be driven in two ways:
16 * *) running the program directly: Main() uses reflection to find and invoke
17 * the test methods (this is useful mostly to check that the tests are correct)
18 * *) with the --regression switch of the jit (this is the preferred way since
19 * all the tests will be run with optimizations on and off)
21 * The reflection logic could be moved to a .dll since we need at least another
22 * regression test file written in IL code to have better control on how
23 * the IL code looks.
26 #if __MOBILE__
27 class LongTests
28 #else
29 class Tests
30 #endif
33 #if !__MOBILE__
34 public static int Main (string[] args) {
35 return TestDriver.RunTests (typeof (Tests), args);
37 #endif
39 public static int test_10_simple_cast () {
40 long a = 10;
41 return (int)a;
44 public static int test_1_bigmul1 () {
45 int a;
46 int b;
47 long c;
48 a = 10;
49 b = 10;
50 c = (long)a * (long)b;
51 if (c == 100)
52 return 1;
53 return 0;
56 public static int test_1_bigmul2 () {
57 int a = System.Int32.MaxValue, b = System.Int32.MaxValue;
58 long s = System.Int64.MinValue;
59 long c;
60 c = s + (long) a * (long) b;
61 if (c == -4611686022722355199)
62 return 1;
63 return 0;
66 public static int test_1_bigmul3 () {
67 int a = 10, b = 10;
68 ulong c;
69 c = (ulong) a * (ulong) b;
70 if (c == 100)
71 return 1;
72 return 0;
75 public static int test_1_bigmul4 () {
76 int a = System.Int32.MaxValue, b = System.Int32.MaxValue;
77 ulong c;
78 c = (ulong) a * (ulong) b;
79 if (c == 4611686014132420609)
80 return 1;
81 return 0;
84 public static int test_1_bigmul5 () {
85 int a = System.Int32.MaxValue, b = System.Int32.MinValue;
86 long c;
87 c = (long) a * (long) b;
88 if (c == -4611686016279904256)
89 return 1;
90 return 0;
93 public static int test_1_bigmul6 () {
94 uint a = System.UInt32.MaxValue, b = System.UInt32.MaxValue/(uint)2;
95 ulong c;
96 c = (ulong) a * (ulong) b;
97 if (c == 9223372030412324865)
98 return 1;
99 return 0;
102 public static int test_0_beq () {
103 long a = 0xffffffffff;
104 if (a != 0xffffffffff)
105 return 1;
106 return 0;
109 public static int test_0_bne_un () {
110 long a = 0xffffffffff;
111 if (a == 0xfffffffffe)
112 return 1;
113 if (a == 0xfeffffffff)
114 return 2;
115 return 0;
118 public static int test_0_ble () {
119 long a = 0xffffffffff;
120 if (a > 0xffffffffff)
121 return 1;
123 if (a > 0x1ffffffffff)
124 return 2;
126 if (a > 0xff00000000) {} else
127 return 3;
129 if (a > 0xfeffffffff) {} else
130 return 4;
132 a = 0xff00000000;
133 if (a > 0xffffffffff)
134 return 5;
136 return 0;
139 public static int test_0_ble_un () {
140 ulong a = 0xffffffffff;
141 if (a > 0xffffffffff)
142 return 1;
144 if (a > 0x1ffffffffff)
145 return 2;
147 if (a > 0xff00000000) {} else
148 return 3;
150 if (a > 0xfeffffffff) {} else
151 return 4;
153 a = 0xff00000000;
154 if (a > 0xffffffffff)
155 return 5;
157 return 0;
160 public static int test_0_bge () {
161 long a = 0xffffffffff;
162 if (a < 0xffffffffff)
163 return 1;
165 if (a < 0x1ffffffffff) {} else
166 return 2;
168 if (a < 0xff00000000)
169 return 3;
171 if (a < 0xfeffffffff)
172 return 4;
174 a = 0xff00000000;
175 if (a < 0xffffffffff) {} else
176 return 5;
178 return 0;
181 public static int test_0_bge_un () {
182 ulong a = 0xffffffffff;
183 if (a < 0xffffffffff)
184 return 1;
186 if (a < 0x1ffffffffff) {} else
187 return 2;
189 if (a < 0xff00000000)
190 return 3;
192 if (a < 0xfeffffffff)
193 return 4;
195 a = 0xff00000000;
196 if (a < 0xffffffffff) {} else
197 return 5;
199 return 0;
202 public static int test_0_blt () {
203 long a = 0xfffffffffe;
204 if (a >= 0xffffffffff)
205 return 1;
207 if (a >= 0x1fffffffffe)
208 return 2;
210 if (a >= 0xff00000000) {} else
211 return 3;
213 if (a >= 0xfefffffffe) {} else
214 return 4;
216 a = 0xff00000000;
217 if (a >= 0xffffffffff)
218 return 5;
220 return 0;
223 public static int test_0_blt_un () {
224 ulong a = 0xfffffffffe;
225 if (a >= 0xffffffffff)
226 return 1;
228 if (a >= 0x1fffffffffe)
229 return 2;
231 if (a >= 0xff00000000) {} else
232 return 3;
234 if (a >= 0xfefffffffe) {} else
235 return 4;
237 a = 0xff00000000;
238 if (a >= 0xffffffffff)
239 return 5;
241 return 0;
244 public static int test_0_bgt () {
245 long a = 0xffffffffff;
246 if (a <= 0xfffffffffe)
247 return 1;
249 if (a <= 0x1ffffffffff) {} else
250 return 2;
252 if (a <= 0xff00000000)
253 return 3;
255 if (a <= 0xfeffffffff)
256 return 4;
258 a = 0xff00000000;
259 if (a <= 0xffffffffff) {} else
260 return 5;
262 return 0;
265 public static int test_0_bgt_un () {
266 ulong a = 0xffffffffff;
267 if (a <= 0xfffffffffe)
268 return 1;
270 if (a <= 0x1ffffffffff) {} else
271 return 2;
273 if (a <= 0xff00000000)
274 return 3;
276 if (a <= 0xfeffffffff)
277 return 4;
279 a = 0xff00000000;
280 if (a <= 0xffffffffff) {} else
281 return 5;
283 return 0;
286 public static int test_0_conv_to_i4 () {
287 long a = 0;
289 return (int)a;
292 public static int test_32_conv_to_u4 () {
293 long a = 32;
295 return (int)(uint)a;
298 public static int test_15_conv_to_u4_2 () {
299 long a = 0x10000000f;
301 return (int)(uint)a;
304 public static int test_0_conv_from_i4 () {
305 long a = 2;
306 if (a != 2)
307 return 1;
309 int b = 2;
311 if (a != b)
312 return 2;
313 return 0;
316 public static int test_0_conv_from_i4_negative () {
317 long a = -2;
318 if (a != -2)
319 return 1;
321 int b = -2;
323 if (a != b)
324 return 2;
325 return 0;
329 public static int test_0_conv_from_r8 () {
330 double b = 2.0;
331 long a = (long)b;
333 if (a != 2)
334 return 1;
335 return 0;
338 public static int test_0_conv_from_r4 () {
339 float b = 2.0F;
340 long a = (long)b;
342 if (a != 2)
343 return 1;
344 return 0;
348 public static int test_8_and () {
349 long a = 0xffffffffff;
350 long b = 8;
351 return (int)(a & b);
354 public static int test_8_and_imm () {
355 long a = 0xffffffffff;
356 return (int)(a & 8);
359 public static int get_high_bit (ulong a) {
360 if ((a & 0x8000000000000000) != 0)
361 return 1;
362 return 0;
365 public static int test_1_and () {
366 ulong a = 0xabcd1234deadbeef;
367 return get_high_bit (a);
370 public static int test_10_or () {
371 long a = 8;
372 long b = 2;
373 return (int)(a | b);
376 public static int test_10_or_imm () {
377 long a = 8;
378 return (int)(a | 2);
381 public static int test_5_xor () {
382 long a = 7;
383 long b = 2;
384 return (int)(a ^ b);
387 public static int test_5_xor_imm () {
388 long a = 7;
389 return (int)(a ^ 2);
392 public static int test_5_add () {
393 long a = 2;
394 long b = 3;
395 return (int)(a + b);
398 public static int test_5_add_imm () {
399 long a = 2;
400 return (int)(a + 3);
403 public static int test_0_add_imm_carry () {
404 long a = -1;
405 return (int)(a + 1);
408 public static int test_0_add_imm_no_inc () {
409 // we can't blindly convert an add x, 1 to an inc x
410 long a = 0x1ffffffff;
411 long c;
412 c = a + 2;
413 if (c == ((a + 1) + 1))
414 return 0;
415 return 1;
418 public static int test_4_addcc_imm () {
419 long a = 3;
420 long b = 0;
421 return (int)(a - b + 1);
424 public static int test_5_sub () {
425 long a = 8;
426 long b = 3;
427 return (int)(a - b);
430 public static int test_5_sub_imm () {
431 long a = 8;
432 return (int)(a - 3);
435 public static int test_0_sub_imm_carry () {
436 long a = 0;
437 return (int)((a - 1) + 1);
440 public static int test_0_add_ovf () {
441 long i, j, k;
443 checked {
444 i = System.Int64.MinValue;
445 j = 0;
446 k = i + j;
449 if (k != System.Int64.MinValue)
450 return 1;
452 checked {
453 i = System.Int64.MaxValue;
454 j = 0;
455 k = i + j;
458 if (k != System.Int64.MaxValue)
459 return 2;
461 checked {
462 i = System.Int64.MinValue;
463 j = System.Int64.MaxValue;
464 k = i + j;
467 if (k != -1)
468 return 3;
470 checked {
471 i = System.Int64.MaxValue;
472 j = System.Int64.MinValue;
473 k = i + j;
476 if (k != -1)
477 return 4;
479 checked {
480 i = System.Int64.MinValue + 1234;
481 j = -1234;
482 k = i + j;
485 if (k != System.Int64.MinValue)
486 return 5;
488 checked {
489 i = System.Int64.MaxValue - 1234;
490 j = 1234;
491 k = i + j;
494 if (k != System.Int64.MaxValue)
495 return 6;
497 return 0;
500 public static int test_0_add_un_ovf () {
501 ulong n = (ulong)134217728 * 16;
502 ulong number = checked (n + (uint)0);
504 return number == n ? 0 : 1;
507 public static int test_0_sub_ovf () {
508 long i, j, k;
510 checked {
511 i = System.Int64.MinValue;
512 j = 0;
513 k = i - j;
516 if (k != System.Int64.MinValue)
517 return 1;
519 checked {
520 i = System.Int64.MaxValue;
521 j = 0;
522 k = i - j;
525 if (k != System.Int64.MaxValue)
526 return 2;
528 checked {
529 i = System.Int64.MinValue;
530 j = System.Int64.MinValue + 1234;
531 k = i - j;
534 if (k != -1234)
535 return 3;
537 checked {
538 i = System.Int64.MaxValue;
539 j = 1234;
540 k = i - j;
543 if (k != System.Int64.MaxValue - 1234)
544 return 4;
546 checked {
547 i = System.Int64.MaxValue - 1234;
548 j = -1234;
549 k = i - j;
552 if (k != System.Int64.MaxValue)
553 return 5;
555 checked {
556 i = System.Int64.MinValue + 1234;
557 j = 1234;
558 k = i - j;
561 if (k != System.Int64.MinValue)
562 return 6;
564 return 0;
567 public static int test_0_sub_ovf_un () {
568 ulong i, j, k;
570 checked {
571 i = System.UInt64.MaxValue;
572 j = 0;
573 k = i - j;
576 if (k != System.UInt64.MaxValue)
577 return 1;
579 checked {
580 i = System.UInt64.MaxValue;
581 j = System.UInt64.MaxValue;
582 k = i - j;
585 if (k != 0)
586 return 2;
588 return 0;
591 public static int test_2_neg () {
592 long a = -2;
593 return (int)(-a);
596 public static int test_0_neg_large () {
597 long min = -9223372036854775808;
598 unchecked {
599 ulong ul = (ulong)min;
600 return (min == -(long)ul) ? 0 : 1;
604 public static int test_5_shift ()
606 long a = 9;
607 int b = 1;
608 int count = 0;
610 if ((a >> b) != 4)
611 return count;
612 count++;
614 if ((a >> 63) != 0)
615 return count;
616 count++;
618 if ((a << 1) != 18)
619 return count;
620 count++;
622 if ((a << b) != 18)
623 return count;
624 count++;
626 a = -9;
627 if ((a >> b) != -5)
628 return count;
629 count++;
631 return count;
634 public static int test_1_shift_u ()
636 ulong a;
637 int count = 0;
639 // The JIT optimizes this
640 a = 8589934592UL;
641 if ((a >> 32) != 2)
642 return 0;
643 count ++;
645 return count;
648 public static int test_1_shift_u_32 ()
650 ulong a;
651 int count = 0;
653 a = UInt64.MaxValue;
654 // Avoid constant folding
655 for (int i = 0; i < 32; ++i)
656 count ++;
658 if ((a >> count) != 0xFFFFFFFFUL)
659 return 0;
660 else
661 return 1;
664 public static int test_1_simple_neg () {
665 long a = 9;
667 if (-a != -9)
668 return 0;
669 return 1;
672 public static int test_2_compare () {
673 long a = 1;
674 long b = 1;
676 if (a != b)
677 return 0;
678 return 2;
681 public static int test_9_alu ()
683 long a = 9, b = 6;
684 int count = 0;
686 if ((a + b) != 15)
687 return count;
688 count++;
690 if ((a - b) != 3)
691 return count;
692 count++;
694 if ((a & 8) != 8)
695 return count;
696 count++;
698 if ((a | 2) != 11)
699 return count;
700 count++;
702 if ((a * b) != 54)
703 return count;
704 count++;
706 if ((a / 4) != 2)
707 return count;
708 count++;
710 if ((a % 4) != 1)
711 return count;
712 count++;
714 if (-a != -9)
715 return count;
716 count++;
718 b = -1;
719 if (~b != 0)
720 return count;
721 count++;
723 return count;
726 public static int test_24_mul () {
727 long a = 8;
728 long b = 3;
729 return (int)(a * b);
732 public static int test_24_mul_ovf () {
733 long a = 8;
734 long b = 3;
735 long res;
737 checked {
738 res = a * b;
740 return (int)res;
743 public static int test_24_mul_un () {
744 ulong a = 8;
745 ulong b = 3;
746 return (int)(a * b);
749 public static int test_24_mul_ovf_un () {
750 ulong a = 8;
751 ulong b = 3;
752 ulong res;
754 checked {
755 res = a * b;
757 return (int)res;
760 public static int test_0_mul_imm () {
761 long i = 4;
763 if ((i * 0) != 0)
764 return 1;
765 if ((i * 1) != 4)
766 return 2;
767 if ((i * 2) != 8)
768 return 3;
769 if ((i * 3) != 12)
770 return 4;
771 if ((i * 1234) != 4936)
772 return 5;
773 if ((i * -1) != -4)
774 return 6;
775 if ((i * -2) != -8)
776 return 7;
777 if ((i * -3) != -12)
778 return 8;
779 if ((i * -1234) != -4936)
780 return 9;
782 return 0;
785 public static int test_0_mul_imm_opt ()
787 long i;
789 i = 1;
790 if ((i * 2) != 2)
791 return 1;
792 i = -1;
793 if ((i * 2) != -2)
794 return 2;
795 i = 1;
796 if ((i * 3) != 3)
797 return 3;
798 i = -1;
799 if ((i * 3) != -3)
800 return 4;
801 i = 1;
802 if ((i * 5) != 5)
803 return 5;
804 i = -1;
805 if ((i * 5) != -5)
806 return 6;
807 i = 1;
808 if ((i * 6) != 6)
809 return 7;
810 i = -1;
811 if ((i * 6) != -6)
812 return 8;
813 i = 1;
814 if ((i * 9) != 9)
815 return 9;
816 i = -1;
817 if ((i * 9) != -9)
818 return 10;
819 i = 1;
820 if ((i * 10) != 10)
821 return 11;
822 i = -1;
823 if ((i * 10) != -10)
824 return 12;
825 i = 1;
826 if ((i * 12) != 12)
827 return 13;
828 i = -1;
829 if ((i * 12) != -12)
830 return 14;
831 i = 1;
832 if ((i * 25) != 25)
833 return 15;
834 i = -1;
835 if ((i * 25) != -25)
836 return 16;
837 i = 1;
838 if ((i * 100) != 100)
839 return 17;
840 i = -1;
841 if ((i * 100) != -100)
842 return 18;
844 return 0;
847 public static int test_4_divun () {
848 uint b = 12;
849 int a = 3;
850 return (int)(b / a);
853 public static int test_1431655764_bigdivun_imm () {
854 unchecked {
855 uint b = (uint)-2;
856 return (int)(b / 3);
860 public static int test_1431655764_bigdivun () {
861 unchecked {
862 uint b = (uint)-2;
863 int a = 3;
864 return (int)(b / a);
868 public static int test_1_remun () {
869 uint b = 13;
870 int a = 3;
871 return (int)(b % a);
874 public static int test_2_bigremun () {
875 unchecked {
876 uint b = (uint)-2;
877 int a = 3;
878 return (int)(b % a);
882 public static int test_0_ceq () {
883 long a = 2;
884 long b = 2;
885 long c = 3;
886 long d = 0xff00000002;
888 bool val = (a == b); // this should produce a ceq
889 if (!val)
890 return 1;
892 val = (a == c); // this should produce a ceq
893 if (val)
894 return 2;
896 val = (a == d); // this should produce a ceq
897 if (val)
898 return 3;
900 return 0;
903 public static int test_0_ceq_complex () {
904 long l = 1, ll = 2;
906 if (l < 0 != ll < 0)
907 return 1;
909 return 0;
912 public static int test_0_clt () {
913 long a = 2;
914 long b = 2;
915 long c = 3;
916 long d = 0xff00000002L;
917 long e = -1;
919 bool val = (a < b); // this should produce a clt
920 if (val)
921 return 1;
923 val = (a < c); // this should produce a clt
924 if (!val)
925 return 2;
927 val = (c < a); // this should produce a clt
928 if (val)
929 return 3;
931 val = (e < d); // this should produce a clt
932 if (!val)
933 return 4;
935 val = (d < e); // this should produce a clt
936 if (val)
937 return 5;
939 return 0;
942 public static int test_0_clt_un () {
943 ulong a = 2;
944 ulong b = 2;
945 ulong c = 3;
946 ulong d = 0xff00000002;
947 ulong e = 0xffffffffffffffff;
949 bool val = (a < b); // this should produce a clt_un
950 if (val)
951 return 1;
953 val = (a < c); // this should produce a clt_un
954 if (!val)
955 return 1;
957 val = (d < e); // this should produce a clt_un
958 if (!val)
959 return 1;
961 val = (e < d); // this should produce a clt_un
962 if (val)
963 return 1;
965 return 0;
968 public static int test_0_cgt () {
969 long a = 2;
970 long b = 2;
971 long c = 3;
972 long d = 0xff00000002L;
973 long e = -1;
975 bool val = (a > b); // this should produce a cgt
976 if (val)
977 return 1;
979 val = (a > c); // this should produce a cgt
980 if (val)
981 return 2;
983 val = (c > a); // this should produce a cgt
984 if (!val)
985 return 3;
987 val = (e > d); // this should produce a cgt
988 if (val)
989 return 4;
991 val = (d > e); // this should produce a cgt
992 if (!val)
993 return 5;
995 return 0;
998 public static int test_0_cgt_un () {
999 ulong a = 2;
1000 ulong b = 2;
1001 ulong c = 3;
1002 ulong d = 0xff00000002;
1003 ulong e = 0xffffffffffffffff;
1005 bool val = (a > b); // this should produce a cgt_un
1006 if (val)
1007 return 1;
1009 val = (a > c); // this should produce a cgt_un
1010 if (val)
1011 return 1;
1013 val = (d > e); // this should produce a cgt_un
1014 if (val)
1015 return 1;
1017 val = (e > d); // this should produce a cgt_un
1018 if (!val)
1019 return 1;
1021 return 0;
1024 public static int test_3_byte_cast () {
1025 ulong val = 0xff00ff00f0f0f0f0;
1026 byte b;
1027 b = (byte) (val & 0xFF);
1028 if (b != 0xf0)
1029 return 1;
1031 return 3;
1034 public static int test_4_ushort_cast () {
1035 ulong val = 0xff00ff00f0f0f0f0;
1036 ushort b;
1037 b = (ushort) (val & 0xFFFF);
1038 if (b != 0xf0f0)
1039 return 1;
1040 return 4;
1043 public static int test_500_mul_div () {
1044 long val = 1000;
1045 long exp = 10;
1046 long maxexp = 20;
1047 long res = val * exp / maxexp;
1049 return (int)res;
1052 public static int test_3_checked_cast_un () {
1053 ulong i = 2;
1054 long j;
1056 checked { j = (long)i; }
1058 if (j != 2)
1059 return 0;
1060 return 3;
1063 public static int test_4_checked_cast () {
1064 long i = 3;
1065 ulong j;
1067 checked { j = (ulong)i; }
1069 if (j != 3)
1070 return 0;
1071 return 4;
1074 public static int test_12_checked_i1_cast () {
1075 long l = 12;
1077 checked {
1078 return (sbyte)l;
1082 public static int test_127_checked_i1_cast_un () {
1083 ulong l = 127;
1085 checked {
1086 return (sbyte)l;
1090 public static int test_1234_checked_i2_cast () {
1091 long l = 1234;
1093 checked {
1094 return (short)l;
1098 public static int test_32767_checked_i2_cast_un () {
1099 ulong l = 32767;
1101 checked {
1102 return (ushort)l;
1106 public static int test_1234_checked_i4_cast () {
1107 ulong ul = 1234;
1109 checked {
1110 return (int)ul;
1114 public static int test_10_int_uint_compare () {
1115 uint size = 10;
1116 int j = 0;
1117 for (int i = 0; i < size; ++i) {
1118 j++;
1120 return j;
1123 public static int test_0_ulong_regress () {
1124 ulong u = 4257145737;
1125 u --;
1126 return (u == 4257145736) ? 0 : 1;
1129 public static int test_0_ulong_regress2 () {
1130 int p2 = 31;
1131 ulong sum_p = 2897079476 + (ulong) (1 << p2);
1132 return (sum_p == 749595828) ? 0 : 1;
1135 public static int test_0_assemble_long ()
1137 uint a = 5;
1138 ulong x = 0x12345678;
1139 ulong y = 1;
1142 ulong z = ((x - y) << 32) | a;
1144 if (z != 0x1234567700000005)
1145 return 1;
1147 return 0;
1150 public static int test_0_hash ()
1152 ulong x = 0x1234567887654321;
1153 int h = (int)(x & 0xffffffff) ^ (int)(x >> 32);
1154 if (h != unchecked ((int)(0x87654321 ^ 0x12345678)))
1155 return h;
1156 return 0;
1160 public static int test_0_shift_regress () {
1161 long a = 0;
1162 int b = 6;
1163 UInt16 c = 3;
1165 return ((a >> (b - c)) == 0) ? 0 : 1;
1168 public static int test_1234_conv_ovf_u8 () {
1169 int i = 1234;
1171 checked {
1172 ulong l = (ulong)i;
1173 return (int)l;
1177 public static int test_0_regress_cprop_80738 () {
1178 int hours = Int32.MinValue;
1179 int hrssec = (hours * 3600);
1180 long t = ((long)(hrssec) * 1000L);
1182 return t == 0 ? 0 : 1;
1185 public static int test_0_conv_u () {
1186 unsafe {
1187 int** dead = (int**) 0xdeadbeaf;
1188 long i = (long)dead;
1189 return (i == 0xdeadbeaf) ? 0 : 1;
1193 public static int test_0_lconv_to_u2 () {
1194 unchecked {
1195 ulong value = (ulong)(short)-10;
1196 value = (ushort)value;
1197 return (value == 65526) ? 0 : 1;
1201 public static int test_0_lneg_regress_10320 () {
1202 long a = 0x100000000;
1203 ulong c = ((ulong) (-(-a))) >> 32;
1204 return c == 1 ? 0 : 1;
1207 public static int test_6_lrem_un () {
1208 ulong r2 = 4294967296;
1209 uint d = 10;
1210 ulong res = r2 % d;
1212 return (int)res;
1215 public static int test_0_lrem_imm_1 () {
1216 long b = 12L;
1217 return (int)(b % 1L);
1220 public static int test_0_lrem_imm_1_neg () {
1221 long b = -2L;
1222 return (int)(b % 1L);
1225 public static int test_0_lrem_imm_2 ()
1227 long x = 245345634L;
1228 return (int)(x % 2L);
1231 public static int test_1_lrem_imm_2 ()
1233 long x = 24534553245L;
1234 return (int)(x % 2L);
1237 public static int test_1_lrem_imm_2_neg ()
1239 long x = -24534553245L;
1240 return -(int)(x % 2L);
1243 public static int test_13_lrem_imm_32 ()
1245 long x = 17389L;
1246 return (int)(x % 32L);
1249 public static int test_27_lrem_imm_32_neg ()
1251 long x = -2435323L;
1252 return -(int)(x % 32L);
1255 public static int test_5_lrem_imm_large ()
1257 long x = 0x1000000005L;
1258 return (int)(x % 0x40000000L);
1261 public static int test_5_lrem_imm_too_large ()
1263 long x = 0x1000000005L;
1264 return (int)(x % 0x80000000L);