1 /************************* test/jctest.java ************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 Eine Klasse zum Testen (fast) aller JavaVM-Instruktionen
8 in verschiedenen Konstellationen.
10 Die Ausgabe, die dieses Programm generiert, sollte bei allen
11 verschiedenen Java-Interpreter/Compiler-Systemen gleich
12 sein. Wenn nicht, dann ist wahrscheinlich eines der Systeme
15 Authors: Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
17 Last Change: 1996/12/03
19 *******************************************************************************/
22 public class jctest implements jcinterface {
24 static int linenum = 0;
27 static long l1=123456789,l2=987654321,l3=-99999999999999L;
28 static int i2,i3=-100;
29 static float f1=0.1F,f2=0.2F,f3=0.3F;
30 static double d1=0.001,d2=0.002,d3=0.003;
31 static String s1,s2="der konstante String";
34 long n_l1,n_l2,n_l3,n_l4;
35 float n_f1,n_f2,n_f3,n_f4;
37 double n_d1,n_d2,n_d3,n_d4;
40 public static void main(String[] s) {
41 p ("=================== JavaVM - Tester ========================");
43 p ("------------------- test arguments");
45 for (i=0; i<s.length; i++) p(s[i]);
50 testspecialnullpointers();
53 p ("------------------- test consts");
56 testconst (-24123, -4918923241323L);
57 testconst (-243511, -4423423234231423L);
58 testconst (0x7fffffff, 0x7fffffffffffffffL);
59 testconst (0x80000000, 0x8000000000000000L);
61 p ("------------------- test div and rem consts");
63 testdivremconst(12347);
64 testdivremconst(8893427);
65 testdivremconst(1005234562);
67 testdivremconst(-12347);
68 testdivremconst(-8893427);
69 testdivremconst(-1005234562);
72 testdivremconst(12347L);
73 testdivremconst(8893427L);
74 testdivremconst(1005234562L);
75 testdivremconst(12135005234562L);
76 testdivremconst(2343552355623464626L);
77 testdivremconst(-17L);
78 testdivremconst(-12347L);
79 testdivremconst(-8893427L);
80 testdivremconst(-1005234562L);
81 testdivremconst(-12135005234562L);
82 testdivremconst(-2343552355623464626L);
84 p ("------------------- test rem 0x10001");
90 testrem0x10001(13247);
91 testrem0x10001(563467);
92 testrem0x10001(7456774);
93 testrem0x10001(34523525);
94 testrem0x10001(234523456);
95 testrem0x10001(1005234562);
96 testrem0x10001(2147483647);
100 testrem0x10001(-1234);
101 testrem0x10001(-13247);
102 testrem0x10001(-563467);
103 testrem0x10001(-7456774);
104 testrem0x10001(-34523525);
105 testrem0x10001(-234523456);
106 testrem0x10001(-1005234562);
107 testrem0x10001(-2147483647);
108 testrem0x10001(-2147483648);
113 testrem0x10001(123L);
114 testrem0x10001(1234L);
115 testrem0x10001(13247L);
116 testrem0x10001(563467L);
117 testrem0x10001(7456774L);
118 testrem0x10001(34523525L);
119 testrem0x10001(234523456L);
120 testrem0x10001(1005234562L);
121 testrem0x10001(1983223864L);
122 testrem0x10001(2147483646L);
123 testrem0x10001(2147483647L);
124 testrem0x10001(2147483648L);
125 testrem0x10001(10052234562L);
126 testrem0x10001(561005234562L);
127 testrem0x10001(2100527345962L);
128 testrem0x10001(34600523456287L);
129 testrem0x10001(546805234456882L);
130 testrem0x10001(1360052334734722L);
131 testrem0x10001(23456705569626354L);
132 testrem0x10001(9223372036854775807L);
134 testrem0x10001(-17L);
135 testrem0x10001(-123L);
136 testrem0x10001(-1234L);
137 testrem0x10001(-13247L);
138 testrem0x10001(-563467L);
139 testrem0x10001(-7456774L);
140 testrem0x10001(-34523525L);
141 testrem0x10001(-234523456L);
142 testrem0x10001(-1005234562L);
143 testrem0x10001(-1983223864L);
144 testrem0x10001(-2147483647L);
145 testrem0x10001(-2147483648L);
146 testrem0x10001(-10052234562L);
147 testrem0x10001(-561005234562L);
148 testrem0x10001(-2100527345962L);
149 testrem0x10001(-34600523456287L);
150 testrem0x10001(-546805234456882L);
151 testrem0x10001(-1360052334734722L);
152 testrem0x10001(-23456705569626354L);
153 testrem0x10001(-9223372036854775807L);
154 testrem0x10001(-9223372036854775808L);
156 p ("------------------- test ints");
159 testint (-24351,24123);
160 testint (4918923,-441423);
163 testint (1423487,123444444);
164 testint (0x7fffffff,1);
165 testint (0,0x7fffffff);
166 testint (0x3333,143444);
167 testint (4444441,12342);
168 testint (0x80000000,-1);
170 p ("------------------- test longs");
173 testlong (-24351,24123);
174 testlong (4918923241323L,-4423423234231423L);
177 testlong (1423487,123444442344L);
178 testlong (0x7fffffffffffffffL,1);
179 testlong (0,0x7fffffffffffffffL);
180 testlong (0x3333,143444);
181 testlong (4444441,12342);
182 testlong (0x8000000000000000L,-1);
184 p ("------------------- test floats");
185 testfloat ((float) 1,(float) 2.042);
186 testfloat ((float) -1.234,(float) 17.44);
187 testfloat ((float) -24351,(float) 24123);
188 testfloat ((float) 0.1,(float) 1243);
189 testfloat ((float) 0.0,(float) -555.4132);
190 testfloat ((float) 77.0,(float) -555);
191 testfloat ((float) 2147483000.0,(float) -555234);
193 p ("------------------- test doubles");
194 testdouble (1,2.042);
195 testdouble (-1.234,17.44);
196 testdouble (-24351,24123);
197 testdouble (0.1,1243);
198 testdouble (0.0,-555.4132);
199 testdouble (77.0,-555);
200 testdouble (2147483000.0,-555234);
203 p ("=================== end of test =========================");
208 p ("successful initialisation");
213 public static void testgeneral() {
216 // ******************** basic data types *******************************
218 p ("------------------- test int-PUSH-STORE-LOAD");
220 p(j); p (0); p(2); p(17); p(-100);
221 p (500); p(-32768); p(-32769); p(32767); p(32768);
222 p (90000); p(-1000000000);
224 p ("------------------- test long-PUSH-STORE-LOAD");
226 p ( l ); p ( 0L ); p ( 99L );
227 p (500L); p(-32768L); p(-32769L); p(32767L); p(32768L);
228 p ( 6900000000000L ); p ( 349827389478173274L );
230 p ("------------------- test float-PUSH-STORE-LOAD");
232 p ( f ); p (0.0F); p (1.0F); p (342323423478.2223434234232334F);
234 p ("------------------- test double-PUSH-STORE-LOAD");
235 double d = 99234.42D;
236 p ( d ); p (0.0D); p (1.0D); p (342323423478.2223434234232334D);
239 // ******************** static variables *******************************
241 p ("------------------- test static variables");
245 p (i1); p(i2); p(i3);
246 p (l1); p(l2); p(l3);
247 p (f1); p(f2); p(f3);
248 p (d1); p(d2); p(d3);
250 // ******************** arithmetic test ********************************
252 p ("------------------- test arithmetic");
258 l1 = 0x7fffffffffffffffL;
261 p (l1+0x7fffffffffffffffL);
264 // ******************** test method calls ******************************
266 p ("statische methode");
267 jctest ttt = new jctest ();
268 ttt.p_manyparam (19,18,17,16, 88,77,66,55,
269 0.1F,0.2F,0.3F,0.4F, -2.0D,-3.0D,-4.0D,-5.0D );
270 jcinterface ttt2 = ttt;
271 ttt2.p_nonstatic ("interface method");
277 // ************************ test tables ************************************
279 public static void testtables() {
282 p ("------------------- test tableswitch");
284 for (i = -5; i < 15; i++) {
286 case 2: p ("-> 2"); break;
287 case 3: p ("-> 3"); break;
288 case 5: p ("-> 5"); break;
289 case 6: p ("-> 6"); break;
290 case 7: p ("-> 7"); break;
291 case 8: p ("-> 8"); break;
292 case 10: p ("-> 10"); break;
293 default: p ("default"); break;
297 p ("------------------- test lookupswitch");
299 for (i = -5; i < 15; i++) {
301 case 2: p ("-> 2"); break;
302 case 8: p ("-> 8"); break;
303 case 14: p ("-> 14"); break;
304 case -4: p ("-> -4"); break;
305 default: p ("default"); break;
311 // ****************** test type casts and array stores *********************
313 public static void testcasts() {
314 Object o = new Object();
315 Object oi = new Integer(0);
316 Object[] oa = new Object [1];
317 Object[] oia = new Integer[1];
318 Integer i = new Integer(0);
320 java.io.DataOutput dataout = null;
321 Object od = new java.io.DataOutputStream(
322 (java.io.DataOutputStream)dataout);
324 p ("------------------- test casts");
326 p("Integer is instanceof Object: ", oi instanceof Object);
327 p("Integer is instanceof Integer: ", oi instanceof Integer);
328 p("Object is instanceof Integer: ", o instanceof Integer);
331 p ("type cast check: Integer = Object(Integer)");
333 p ("type cast check: Integer = Object");
335 p ("error: class cast exception not thrown");
337 catch (ClassCastException c) {
338 p ("exception: class cast");
341 p("DataOutputStream is instanceof DataOutput: ",
342 od instanceof java.io.DataOutput);
343 p("Object is instanceof DataOutput: ", o instanceof java.io.DataOutput);
346 p ("type cast check: DataOutput = Object(DataOutputStream)");
347 dataout = (java.io.DataOutput) od;
348 p ("type cast check: DataOutput = Object");
349 dataout = (java.io.DataOutput) o;
350 p ("error: class cast exception not thrown");
352 catch (ClassCastException c) {
353 p ("exception: class cast");
357 p ("type cast check: Integer[] = Object(Integer)[]");
358 ia = (Integer[]) oia;
359 p ("type cast check: Integer[] = Object[]");
361 p ("error: class cast exception not thrown");
363 catch (ClassCastException c) {
364 p ("exception: class cast");
368 p ("array store check: Object(Integer)[0] = Integer");
370 p ("array store check: Object(Integer)[0] = Object");
372 p ("error: array store exception not thrown");
374 catch (ArrayStoreException c) {
375 p ("exception: array store");
380 // ****************** test special null pointers ***************************
382 public static void testspecialnullpointers() {
385 jcinterface f = null;
387 p ("------------------- test special null pointers");
390 p ("null pointer check: put field");
392 p ("error: put field null pointer exception not thrown");
394 catch (NullPointerException x) {
395 p ("exception: null pointer");
399 p ("null pointer check: get field");
401 p ("error: get field null pointer exception not thrown");
403 catch (NullPointerException x) {
404 p ("exception: null pointer");
408 p ("null pointer check: invokevirtual");
409 c.p_nonstatic("invokevirtual");
410 p ("error: invokevirtual null pointer exception not thrown");
412 catch (NullPointerException x) {
413 p ("exception: null pointer");
417 p ("null pointer check: invokeinterface");
418 f.p_nonstatic("invokeinterface");
419 p ("error: invokeinterface null pointer exception not thrown");
421 catch (NullPointerException x) {
422 p ("exception: null pointer");
426 p ("null pointer check: monitorenter");
428 p ("error: monitorenter null pointer exception not thrown");
431 catch (NullPointerException x) {
432 p ("exception: null pointer");
437 // ************************ test array bounds ******************************
439 public static void testarraybounds(byte[] ba, int i) {
440 p ("testarraybounds: " + (i - 10));
442 p ("testarraybounds: " + (i - 5));
444 p ("testarraybounds: " + (i));
446 p ("testarraybounds: " + (i + 5));
448 p ("testarraybounds: " + (i + 10));
453 // ************************ test arrays ************************************
455 public static void testarrays() {
462 p ("------------------- test byte arrays");
467 p ("null pointer check: byte array store");
469 p ("error: null pointer exception not thrown");
471 catch (NullPointerException c) {
472 p ("exception: null pointer");
475 p ("null pointer check: byte array load");
477 p ("error: null pointer exception not thrown");
479 catch (NullPointerException c) {
480 p ("exception: null pointer");
484 p ("negative array size check: byte array");
486 p ("error: negative array size exception not thrown");
488 catch (NegativeArraySizeException c) {
489 p ("exception: negative array size");
496 p ("array bound check: byte array store");
498 p ("error: exception not thrown");
500 catch (ArrayIndexOutOfBoundsException c) {
501 p ("exception_1: out of bounds: "+(-1));
504 p ("array bound check: byte array load");
506 p ("error: exception not thrown");
508 catch (ArrayIndexOutOfBoundsException c) {
509 p ("exception_2: out of bounds: "+(-1));
513 testarraybounds(ba, 5);
515 catch (ArrayIndexOutOfBoundsException c) {
516 p ("exception_3: out of bounds: "+5);
519 testarraybounds(ba, 50);
521 catch (ArrayIndexOutOfBoundsException c) {
522 p ("exception_4: out of bounds: "+50);
525 testarraybounds(ba, 100);
527 catch (ArrayIndexOutOfBoundsException c) {
528 p ("exception_5: out of bounds: "+100);
534 catch (ArrayIndexOutOfBoundsException c) {
535 p ("exception_6: out of bounds: "+(-4));
540 catch (ArrayIndexOutOfBoundsException c) {
541 p ("exception_7: out of bounds: "+(-3));
544 for (i=-2; i<102; i++) {
546 ba[i] = (byte) (i-50);
548 catch (ArrayIndexOutOfBoundsException c) {
549 p ("exception_8: out of bounds: "+i);
556 catch (ArrayIndexOutOfBoundsException c) {
557 p ("exception_9: out of bounds: "+102);
562 catch (ArrayIndexOutOfBoundsException c) {
563 p ("exception_10: out of bounds: "+103);
565 for (i=0; i<100; i++) p (ba[i]);
570 p ("-------- test short arrays");
575 p ("null pointer check: short array store");
577 p ("error: null pointer exception not thrown");
579 catch (NullPointerException c) {
580 p ("exception: null pointer");
583 p ("null pointer check: short array load");
585 p ("error: null pointer exception not thrown");
587 catch (NullPointerException c) {
588 p ("exception: null pointer");
591 sa = new short [100];
594 p ("array bound check: short array store");
596 p ("error: exception not thrown");
598 catch (ArrayIndexOutOfBoundsException c) {
599 p ("exception_11: out of bounds: "+(-1));
602 p ("array bound check: short array load");
604 p ("error: exception not thrown");
606 catch (ArrayIndexOutOfBoundsException c) {
607 p ("exception_12: out of bounds: "+(-1));
610 for (i=0; i<100; i++) sa[i] = (short) (i-50);
611 for (i=0; i<100; i++) p (sa[i]);
615 p ("-------- test int arrays");
620 p ("null pointer check: int array store");
622 p ("error: null pointer exception not thrown");
624 catch (NullPointerException c) {
625 p ("exception: null pointer");
628 p ("null pointer check: int array load");
630 p ("error: null pointer exception not thrown");
632 catch (NullPointerException c) {
633 p ("exception: null pointer");
639 p ("array bound check: int array store");
641 p ("error: exception not thrown");
643 catch (ArrayIndexOutOfBoundsException c) {
644 p ("exception: out of bounds: "+(-1));
647 p ("array bound check: int array load");
649 p ("error: exception not thrown");
651 catch (ArrayIndexOutOfBoundsException c) {
652 p ("exception: out of bounds: "+(-1));
655 for (i=0; i<10; i++) ia[i] = (123456 + i);
656 for (i=0; i<10; i++) p (ia[i]);
660 p ("-------- test long arrays");
665 p ("null pointer check: long array store");
667 p ("error: null pointer exception not thrown");
669 catch (NullPointerException c) {
670 p ("exception: null pointer");
673 p ("null pointer check: long array load");
675 p ("error: null pointer exception not thrown");
677 catch (NullPointerException c) {
678 p ("exception: null pointer");
684 p ("array bound check: long array store");
686 p ("error: exception not thrown");
688 catch (ArrayIndexOutOfBoundsException c) {
689 p ("exception: out of bounds: "+(-1));
692 p ("array bound check: long array load");
694 p ("error: exception not thrown");
696 catch (ArrayIndexOutOfBoundsException c) {
697 p ("exception: out of bounds: "+(-1));
700 for (i=0; i<10; i++) la[i] = (1234567890123L + i);
701 for (i=0; i<10; i++) p (la[i]);
704 p ("-------- test char arrays");
709 p ("null pointer check: char array store");
711 p ("error: null pointer exception not thrown");
713 catch (NullPointerException c) {
714 p ("exception: null pointer");
717 p ("null pointer check: char array load");
719 p ("error: null pointer exception not thrown");
721 catch (NullPointerException c) {
722 p ("exception: null pointer");
728 p ("array bound check: char array store");
730 p ("error: exception not thrown");
732 catch (ArrayIndexOutOfBoundsException c) {
733 p ("exception: out of bounds: "+(-1));
736 p ("array bound check: char array load");
738 p ("error: exception not thrown");
740 catch (ArrayIndexOutOfBoundsException c) {
741 p ("exception: out of bounds: "+(-1));
744 for (i=0; i<50; i++) ca[i] = (char) ('A' + i);
745 for (i=0; i<50; i++) p (ca[i]);
747 p ("-------- test address arrays");
752 p ("null pointer check: address array store");
754 p ("error: null pointer exception not thrown");
756 catch (NullPointerException c) {
757 p ("exception: null pointer");
760 p ("null pointer check: address array load");
762 p ("error: null pointer exception not thrown");
764 catch (NullPointerException c) {
765 p ("exception: null pointer");
769 p ("negative array size check: address array");
770 sta = new String[-3];
771 p ("error: negative array size exception not thrown");
773 catch (NegativeArraySizeException c) {
774 p ("exception: negative array size");
780 p ("array bound check: address array store");
782 p ("error: exception not thrown");
784 catch (ArrayIndexOutOfBoundsException c) {
785 p ("exception: out of bounds: "+(-1));
788 p ("array bound check: address array load");
790 p ("error: exception not thrown");
792 catch (ArrayIndexOutOfBoundsException c) {
793 p ("exception: out of bounds: "+(-1));
796 for (i=0; i<5; i++) sta[i] = Integer.toString(i) + ". Zeile";
797 for (i=0; i<5; i++) p (sta[i]);
799 p ("-------- test multi dimensional arrays");
801 int [][][] iaaa = null;
804 p ("negative array size check: multi dimensional array");
805 iaaa = new int[2][3][-4];
806 p ("error: negative array size exception not thrown");
808 catch (NegativeArraySizeException c) {
809 p ("exception: negative array size");
812 iaaa = new int[2][3][4];
813 long [][][] laaa = new long[2][3][6];
814 float [][][] faaa = new float[2][3][4];
815 double [][][] daaa = new double[3][4][7];
816 for (i=0; i<2; i++) {
817 int i2; for (i2=0; i2<3; i2++) {
818 int i3; for (i3=0; i3<4; i3++) {
819 iaaa[i][i2][i3] = i*i*i + i2*i2 + i3;
820 laaa[i][i2][i3] = i*i*i + i2*i2 + i3 + 7;
821 faaa[i][i2][i3] = i*i*i + i2*i2 + i3 + 0.4F;
822 daaa[i][i2][i3] = i*i*i + i2*i2 + i3 - 47.0001;
835 static public void testconst(int i, long l) {
836 p ("TESTCONST CALLED WITH ", i);
839 if (!(i == (0))) p("not IFEQ: ", (0));
840 if (!(i != (0))) p("not IFNE: ", (0));
841 if (!(i < (0))) p("not IFLT: ", (0));
842 if (!(i <= (0))) p("not IFLE: ", (0));
843 if (!(i > (0))) p("not IFGT: ", (0));
844 if (!(i >= (0))) p("not IFGE: ", (0));
846 if (!(l == (0))) p("not IF_LEQ: ", (0));
847 if (!(l != (0))) p("not IF_LNE: ", (0));
848 if (!(l < (0))) p("not IF_LLT: ", (0));
849 if (!(l <= (0))) p("not IF_LLE: ", (0));
850 if (!(l > (0))) p("not IF_LGT: ", (0));
851 if (!(l >= (0))) p("not IF_LGE: ", (0));
853 p("IADDCONST: ", i + (-1));
854 p("ISUBCONST: ", i - (-1));
855 p("IMULCONST: ", i * (-1));
856 p("ISHLCONST: ", i << (-1));
857 p("ISHRCONST: ", i >> (-1));
858 p("IUSHRCONST: ", i >>> (-1));
859 p("IANDCONST: ", i & (-1));
860 p("IORCONST: ", i | (-1));
861 p("IXORCONST: ", i ^ (-1));
863 if (!(i == (-1))) p("not IFEQ: ", (-1));
864 if (!(i != (-1))) p("not IFNE: ", (-1));
865 if (!(i < (-1))) p("not IFLT: ", (-1));
866 if (!(i <= (-1))) p("not IFLE: ", (-1));
867 if (!(i > (-1))) p("not IFGT: ", (-1));
868 if (!(i >= (-1))) p("not IFGE: ", (-1));
870 p("LADDCONST: ", l + (-1));
871 p("LSUBCONST: ", l - (-1));
872 p("LMULCONST: ", l * (-1));
873 p("LSHLCONST: ", l << (-1));
874 p("LSHRCONST: ", l >> (-1));
875 p("LUSHRCONST: ", l >>> (-1));
876 p("LANDCONST: ", l & (-1));
877 p("LORCONST: ", l | (-1));
878 p("LXORCONST: ", l ^ (-1));
880 if (!(l == (-1))) p("not IF_LEQ: ", (-1));
881 if (!(l != (-1))) p("not IF_LNE: ", (-1));
882 if (!(l < (-1))) p("not IF_LLT: ", (-1));
883 if (!(l <= (-1))) p("not IF_LLE: ", (-1));
884 if (!(l > (-1))) p("not IF_LGT: ", (-1));
885 if (!(l >= (-1))) p("not IF_LGE: ", (-1));
887 p("IADDCONST: ", i + (1));
888 p("ISUBCONST: ", i - (1));
889 p("IMULCONST: ", i * (1));
890 p("ISHLCONST: ", i << (1));
891 p("ISHRCONST: ", i >> (1));
892 p("IUSHRCONST: ", i >>> (1));
893 p("IANDCONST: ", i & (1));
894 p("IORCONST: ", i | (1));
895 p("IXORCONST: ", i ^ (1));
897 if (!(i == (1))) p("not IFEQ: ", (1));
898 if (!(i != (1))) p("not IFNE: ", (1));
899 if (!(i < (1))) p("not IFLT: ", (1));
900 if (!(i <= (1))) p("not IFLE: ", (1));
901 if (!(i > (1))) p("not IFGT: ", (1));
902 if (!(i >= (1))) p("not IFGE: ", (1));
904 p("LADDCONST: ", l + (1));
905 p("LSUBCONST: ", l - (1));
906 p("LMULCONST: ", l * (1));
907 p("LSHLCONST: ", l << (1));
908 p("LSHRCONST: ", l >> (1));
909 p("LUSHRCONST: ", l >>> (1));
910 p("LANDCONST: ", l & (1));
911 p("LORCONST: ", l | (1));
912 p("LXORCONST: ", l ^ (1));
914 if (!(l == (1))) p("not IF_LEQ: ", (1));
915 if (!(l != (1))) p("not IF_LNE: ", (1));
916 if (!(l < (1))) p("not IF_LLT: ", (1));
917 if (!(l <= (1))) p("not IF_LLE: ", (1));
918 if (!(l > (1))) p("not IF_LGT: ", (1));
919 if (!(l >= (1))) p("not IF_LGE: ", (1));
921 p("IADDCONST: ", i + (255));
922 p("ISUBCONST: ", i - (255));
923 p("IMULCONST: ", i * (255));
924 p("ISHLCONST: ", i << (255));
925 p("ISHRCONST: ", i >> (255));
926 p("IUSHRCONST: ", i >>> (255));
927 p("IANDCONST: ", i & (255));
928 p("IORCONST: ", i | (255));
929 p("IXORCONST: ", i ^ (255));
931 if (!(i == (255))) p("not IFEQ: ", (255));
932 if (!(i != (255))) p("not IFNE: ", (255));
933 if (!(i < (255))) p("not IFLT: ", (255));
934 if (!(i <= (255))) p("not IFLE: ", (255));
935 if (!(i > (255))) p("not IFGT: ", (255));
936 if (!(i >= (255))) p("not IFGE: ", (255));
938 p("LADDCONST: ", l + (255));
939 p("LSUBCONST: ", l - (255));
940 p("LMULCONST: ", l * (255));
941 p("LSHLCONST: ", l << (255));
942 p("LSHRCONST: ", l >> (255));
943 p("LUSHRCONST: ", l >>> (255));
944 p("LANDCONST: ", l & (255));
945 p("LORCONST: ", l | (255));
946 p("LXORCONST: ", l ^ (255));
948 if (!(l == (255))) p("not IF_LEQ: ", (255));
949 if (!(l != (255))) p("not IF_LNE: ", (255));
950 if (!(l < (255))) p("not IF_LLT: ", (255));
951 if (!(l <= (255))) p("not IF_LLE: ", (255));
952 if (!(l > (255))) p("not IF_LGT: ", (255));
953 if (!(l >= (255))) p("not IF_LGE: ", (255));
955 p("IADDCONST: ", i + (256));
956 p("ISUBCONST: ", i - (256));
957 p("IMULCONST: ", i * (256));
958 p("ISHLCONST: ", i << (256));
959 p("ISHRCONST: ", i >> (256));
960 p("IUSHRCONST: ", i >>> (256));
961 p("IANDCONST: ", i & (256));
962 p("IORCONST: ", i | (256));
963 p("IXORCONST: ", i ^ (256));
965 if (!(i == (256))) p("not IFEQ: ", (256));
966 if (!(i != (256))) p("not IFNE: ", (256));
967 if (!(i < (256))) p("not IFLT: ", (256));
968 if (!(i <= (256))) p("not IFLE: ", (256));
969 if (!(i > (256))) p("not IFGT: ", (256));
970 if (!(i >= (256))) p("not IFGE: ", (256));
972 p("LADDCONST: ", l + (256));
973 p("LSUBCONST: ", l - (256));
974 p("LMULCONST: ", l * (256));
975 p("LSHLCONST: ", l << (256));
976 p("LSHRCONST: ", l >> (256));
977 p("LUSHRCONST: ", l >>> (256));
978 p("LANDCONST: ", l & (256));
979 p("LORCONST: ", l | (256));
980 p("LXORCONST: ", l ^ (256));
982 if (!(l == (256))) p("not IF_LEQ: ", (256));
983 if (!(l != (256))) p("not IF_LNE: ", (256));
984 if (!(l < (256))) p("not IF_LLT: ", (256));
985 if (!(l <= (256))) p("not IF_LLE: ", (256));
986 if (!(l > (256))) p("not IF_LGT: ", (256));
987 if (!(l >= (256))) p("not IF_LGE: ", (256));
989 p("IADDCONST: ", i + (32767));
990 p("ISUBCONST: ", i - (32767));
991 p("IMULCONST: ", i * (32767));
992 p("ISHLCONST: ", i << (32767));
993 p("ISHRCONST: ", i >> (32767));
994 p("IUSHRCONST: ", i >>> (32767));
995 p("IANDCONST: ", i & (32767));
996 p("IORCONST: ", i | (32767));
997 p("IXORCONST: ", i ^ (32767));
999 if (!(i == (32767))) p("not IFEQ: ", (32767));
1000 if (!(i != (32767))) p("not IFNE: ", (32767));
1001 if (!(i < (32767))) p("not IFLT: ", (32767));
1002 if (!(i <= (32767))) p("not IFLE: ", (32767));
1003 if (!(i > (32767))) p("not IFGT: ", (32767));
1004 if (!(i >= (32767))) p("not IFGE: ", (32767));
1006 p("LADDCONST: ", l + (32767));
1007 p("LSUBCONST: ", l - (32767));
1008 p("LMULCONST: ", l * (32767));
1009 p("LSHLCONST: ", l << (32767));
1010 p("LSHRCONST: ", l >> (32767));
1011 p("LUSHRCONST: ", l >>> (32767));
1012 p("LANDCONST: ", l & (32767));
1013 p("LORCONST: ", l | (32767));
1014 p("LXORCONST: ", l ^ (32767));
1016 if (!(l == (32767))) p("not IF_LEQ: ", (32767));
1017 if (!(l != (32767))) p("not IF_LNE: ", (32767));
1018 if (!(l < (32767))) p("not IF_LLT: ", (32767));
1019 if (!(l <= (32767))) p("not IF_LLE: ", (32767));
1020 if (!(l > (32767))) p("not IF_LGT: ", (32767));
1021 if (!(l >= (32767))) p("not IF_LGE: ", (32767));
1023 p("IADDCONST: ", i + (32768));
1024 p("ISUBCONST: ", i - (32768));
1025 p("IMULCONST: ", i * (32768));
1026 p("ISHLCONST: ", i << (32768));
1027 p("ISHRCONST: ", i >> (32768));
1028 p("IUSHRCONST: ", i >>> (32768));
1029 p("IANDCONST: ", i & (32768));
1030 p("IORCONST: ", i | (32768));
1031 p("IXORCONST: ", i ^ (32768));
1033 if (!(i == (32768))) p("not IFEQ: ", (32768));
1034 if (!(i != (32768))) p("not IFNE: ", (32768));
1035 if (!(i < (32768))) p("not IFLT: ", (32768));
1036 if (!(i <= (32768))) p("not IFLE: ", (32768));
1037 if (!(i > (32768))) p("not IFGT: ", (32768));
1038 if (!(i >= (32768))) p("not IFGE: ", (32768));
1040 p("LADDCONST: ", l + (32768));
1041 p("LSUBCONST: ", l - (32768));
1042 p("LMULCONST: ", l * (32768));
1043 p("LSHLCONST: ", l << (32768));
1044 p("LSHRCONST: ", l >> (32768));
1045 p("LUSHRCONST: ", l >>> (32768));
1046 p("LANDCONST: ", l & (32768));
1047 p("LORCONST: ", l | (32768));
1048 p("LXORCONST: ", l ^ (32768));
1050 if (!(l == (32768))) p("not IF_LEQ: ", (32768));
1051 if (!(l != (32768))) p("not IF_LNE: ", (32768));
1052 if (!(l < (32768))) p("not IF_LLT: ", (32768));
1053 if (!(l <= (32768))) p("not IF_LLE: ", (32768));
1054 if (!(l > (32768))) p("not IF_LGT: ", (32768));
1055 if (!(l >= (32768))) p("not IF_LGE: ", (32768));
1057 p("IADDCONST: ", i + (-32768));
1058 p("ISUBCONST: ", i - (-32768));
1059 p("IMULCONST: ", i * (-32768));
1060 p("ISHLCONST: ", i << (-32768));
1061 p("ISHRCONST: ", i >> (-32768));
1062 p("IUSHRCONST: ", i >>> (-32768));
1063 p("IANDCONST: ", i & (-32768));
1064 p("IORCONST: ", i | (-32768));
1065 p("IXORCONST: ", i ^ (-32768));
1067 if (!(i == (-32768))) p("not IFEQ: ", (-32768));
1068 if (!(i != (-32768))) p("not IFNE: ", (-32768));
1069 if (!(i < (-32768))) p("not IFLT: ", (-32768));
1070 if (!(i <= (-32768))) p("not IFLE: ", (-32768));
1071 if (!(i > (-32768))) p("not IFGT: ", (-32768));
1072 if (!(i >= (-32768))) p("not IFGE: ", (-32768));
1074 p("LADDCONST: ", l + (-32768));
1075 p("LSUBCONST: ", l - (-32768));
1076 p("LMULCONST: ", l * (-32768));
1077 p("LSHLCONST: ", l << (-32768));
1078 p("LSHRCONST: ", l >> (-32768));
1079 p("LUSHRCONST: ", l >>> (-32768));
1080 p("LANDCONST: ", l & (-32768));
1081 p("LORCONST: ", l | (-32768));
1082 p("LXORCONST: ", l ^ (-32768));
1084 if (!(l == (-32768))) p("not IF_LEQ: ", (-32768));
1085 if (!(l != (-32768))) p("not IF_LNE: ", (-32768));
1086 if (!(l < (-32768))) p("not IF_LLT: ", (-32768));
1087 if (!(l <= (-32768))) p("not IF_LLE: ", (-32768));
1088 if (!(l > (-32768))) p("not IF_LGT: ", (-32768));
1089 if (!(l >= (-32768))) p("not IF_LGE: ", (-32768));
1091 p("IADDCONST: ", i + (-32769));
1092 p("ISUBCONST: ", i - (-32769));
1093 p("IMULCONST: ", i * (-32769));
1094 p("ISHLCONST: ", i << (-32769));
1095 p("ISHRCONST: ", i >> (-32769));
1096 p("IUSHRCONST: ", i >>> (-32769));
1097 p("IANDCONST: ", i & (-32769));
1098 p("IORCONST: ", i | (-32769));
1099 p("IXORCONST: ", i ^ (-32769));
1101 if (!(i == (-32769))) p("not IFEQ: ", (-32769));
1102 if (!(i != (-32769))) p("not IFNE: ", (-32769));
1103 if (!(i < (-32769))) p("not IFLT: ", (-32769));
1104 if (!(i <= (-32769))) p("not IFLE: ", (-32769));
1105 if (!(i > (-32769))) p("not IFGT: ", (-32769));
1106 if (!(i >= (-32769))) p("not IFGE: ", (-32769));
1108 p("LADDCONST: ", l + (-32769));
1109 p("LSUBCONST: ", l - (-32769));
1110 p("LMULCONST: ", l * (-32769));
1111 p("LSHLCONST: ", l << (-32769));
1112 p("LSHRCONST: ", l >> (-32769));
1113 p("LUSHRCONST: ", l >>> (-32769));
1114 p("LANDCONST: ", l & (-32769));
1115 p("LORCONST: ", l | (-32769));
1116 p("LXORCONST: ", l ^ (-32769));
1118 if (!(l == (-32769))) p("not IF_LEQ: ", (-32769));
1119 if (!(l != (-32769))) p("not IF_LNE: ", (-32769));
1120 if (!(l < (-32769))) p("not IF_LLT: ", (-32769));
1121 if (!(l <= (-32769))) p("not IF_LLE: ", (-32769));
1122 if (!(l > (-32769))) p("not IF_LGT: ", (-32769));
1123 if (!(l >= (-32769))) p("not IF_LGE: ", (-32769));
1125 p("IADDCONST: ", i + (2147483647));
1126 p("ISUBCONST: ", i - (2147483647));
1127 p("IMULCONST: ", i * (2147483647));
1128 p("ISHLCONST: ", i << (2147483647));
1129 p("ISHRCONST: ", i >> (2147483647));
1130 p("IUSHRCONST: ", i >>> (2147483647));
1131 p("IANDCONST: ", i & (2147483647));
1132 p("IORCONST: ", i | (2147483647));
1133 p("IXORCONST: ", i ^ (2147483647));
1135 if (!(i == (2147483647))) p("not IFEQ: ", (2147483647));
1136 if (!(i != (2147483647))) p("not IFNE: ", (2147483647));
1137 if (!(i < (2147483647))) p("not IFLT: ", (2147483647));
1138 if (!(i <= (2147483647))) p("not IFLE: ", (2147483647));
1139 if (!(i > (2147483647))) p("not IFGT: ", (2147483647));
1140 if (!(i >= (2147483647))) p("not IFGE: ", (2147483647));
1142 p("LADDCONST: ", l + (2147483647));
1143 p("LSUBCONST: ", l - (2147483647));
1144 p("LMULCONST: ", l * (2147483647));
1145 p("LSHLCONST: ", l << (2147483647));
1146 p("LSHRCONST: ", l >> (2147483647));
1147 p("LUSHRCONST: ", l >>> (2147483647));
1148 p("LANDCONST: ", l & (2147483647));
1149 p("LORCONST: ", l | (2147483647));
1150 p("LXORCONST: ", l ^ (2147483647));
1152 if (!(l == (2147483647))) p("not IF_LEQ: ", (2147483647));
1153 if (!(l != (2147483647))) p("not IF_LNE: ", (2147483647));
1154 if (!(l < (2147483647))) p("not IF_LLT: ", (2147483647));
1155 if (!(l <= (2147483647))) p("not IF_LLE: ", (2147483647));
1156 if (!(l > (2147483647))) p("not IF_LGT: ", (2147483647));
1157 if (!(l >= (2147483647))) p("not IF_LGE: ", (2147483647));
1159 p("LADDCONST: ", l + (2147483648L));
1160 p("LSUBCONST: ", l - (2147483648L));
1161 p("LMULCONST: ", l * (2147483648L));
1162 p("LSHLCONST: ", l << (2147483648L));
1163 p("LSHRCONST: ", l >> (2147483648L));
1164 p("LUSHRCONST: ", l >>> (2147483648L));
1165 p("LANDCONST: ", l & (2147483648L));
1166 p("LORCONST: ", l | (2147483648L));
1167 p("LXORCONST: ", l ^ (2147483648L));
1169 if (!(l == (2147483648L))) p("not IF_LEQ: ", (2147483648L));
1170 if (!(l != (2147483648L))) p("not IF_LNE: ", (2147483648L));
1171 if (!(l < (2147483648L))) p("not IF_LLT: ", (2147483648L));
1172 if (!(l <= (2147483648L))) p("not IF_LLE: ", (2147483648L));
1173 if (!(l > (2147483648L))) p("not IF_LGT: ", (2147483648L));
1174 if (!(l >= (2147483648L))) p("not IF_LGE: ", (2147483648L));
1176 p("IADDCONST: ", i + (-2147483648));
1177 p("ISUBCONST: ", i - (-2147483648));
1178 p("IMULCONST: ", i * (-2147483648));
1179 p("ISHLCONST: ", i << (-2147483648));
1180 p("ISHRCONST: ", i >> (-2147483648));
1181 p("IUSHRCONST: ", i >>> (-2147483648));
1182 p("IANDCONST: ", i & (-2147483648));
1183 p("IORCONST: ", i | (-2147483648));
1184 p("IXORCONST: ", i ^ (-2147483648));
1186 if (!(i == (-2147483648))) p("not IFEQ: ", (-2147483648));
1187 if (!(i != (-2147483648))) p("not IFNE: ", (-2147483648));
1188 if (!(i < (-2147483648))) p("not IFLT: ", (-2147483648));
1189 if (!(i <= (-2147483648))) p("not IFLE: ", (-2147483648));
1190 if (!(i > (-2147483648))) p("not IFGT: ", (-2147483648));
1191 if (!(i >= (-2147483648))) p("not IFGE: ", (-2147483648));
1193 p("LADDCONST: ", l + (-2147483648));
1194 p("LSUBCONST: ", l - (-2147483648));
1195 p("LMULCONST: ", l * (-2147483648));
1196 p("LSHLCONST: ", l << (-2147483648));
1197 p("LSHRCONST: ", l >> (-2147483648));
1198 p("LUSHRCONST: ", l >>> (-2147483648));
1199 p("LANDCONST: ", l & (-2147483648));
1200 p("LORCONST: ", l | (-2147483648));
1201 p("LXORCONST: ", l ^ (-2147483648));
1203 if (!(l == (-2147483648))) p("not IF_LEQ: ", (-2147483648));
1204 if (!(l != (-2147483648))) p("not IF_LNE: ", (-2147483648));
1205 if (!(l < (-2147483648))) p("not IF_LLT: ", (-2147483648));
1206 if (!(l <= (-2147483648))) p("not IF_LLE: ", (-2147483648));
1207 if (!(l > (-2147483648))) p("not IF_LGT: ", (-2147483648));
1208 if (!(l >= (-2147483648))) p("not IF_LGE: ", (-2147483648));
1210 p("LADDCONST: ", l + (-2147483649L));
1211 p("LSUBCONST: ", l - (-2147483649L));
1212 p("LMULCONST: ", l * (-2147483649L));
1213 p("LSHLCONST: ", l << (-2147483649L));
1214 p("LSHRCONST: ", l >> (-2147483649L));
1215 p("LUSHRCONST: ", l >>> (-2147483649L));
1216 p("LANDCONST: ", l & (-2147483649L));
1217 p("LORCONST: ", l | (-2147483649L));
1218 p("LXORCONST: ", l ^ (-2147483649L));
1220 if (!(l == (-2147483649L))) p("not IF_LEQ: ", (-2147483649L));
1221 if (!(l != (-2147483649L))) p("not IF_LNE: ", (-2147483649L));
1222 if (!(l < (-2147483649L))) p("not IF_LLT: ", (-2147483649L));
1223 if (!(l <= (-2147483649L))) p("not IF_LLE: ", (-2147483649L));
1224 if (!(l > (-2147483649L))) p("not IF_LGT: ", (-2147483649L));
1225 if (!(l >= (-2147483649L))) p("not IF_LGE: ", (-2147483649L));
1228 static public void testrem0x10001(int a) {
1229 p("IREM0X10001 (" + a + " % 0x10001): ", a % 0x10001);
1232 static public void testrem0x10001(long a) {
1233 p("LREM0X10001 (" + a + " % 0x10001): ", a % 0x10001L);
1236 static public void testdivremconst(int a) {
1237 p("IDIVPOW2 (" + a + " / 0x00000002): ", a / 0x00000002);
1238 p("IDIVPOW2 (" + a + " / 0x00000004): ", a / 0x00000004);
1239 p("IDIVPOW2 (" + a + " / 0x00000008): ", a / 0x00000008);
1240 p("IDIVPOW2 (" + a + " / 0x00000010): ", a / 0x00000010);
1241 p("IDIVPOW2 (" + a + " / 0x00000020): ", a / 0x00000020);
1242 p("IDIVPOW2 (" + a + " / 0x00000040): ", a / 0x00000040);
1243 p("IDIVPOW2 (" + a + " / 0x00000080): ", a / 0x00000080);
1244 p("IDIVPOW2 (" + a + " / 0x00000100): ", a / 0x00000100);
1245 p("IDIVPOW2 (" + a + " / 0x00000200): ", a / 0x00000200);
1246 p("IDIVPOW2 (" + a + " / 0x00000400): ", a / 0x00000400);
1247 p("IDIVPOW2 (" + a + " / 0x00000800): ", a / 0x00000800);
1248 p("IDIVPOW2 (" + a + " / 0x00001000): ", a / 0x00001000);
1249 p("IDIVPOW2 (" + a + " / 0x00002000): ", a / 0x00002000);
1250 p("IDIVPOW2 (" + a + " / 0x00004000): ", a / 0x00004000);
1251 p("IDIVPOW2 (" + a + " / 0x00008000): ", a / 0x00008000);
1252 p("IDIVPOW2 (" + a + " / 0x00010000): ", a / 0x00010000);
1253 p("IDIVPOW2 (" + a + " / 0x00020000): ", a / 0x00020000);
1254 p("IDIVPOW2 (" + a + " / 0x00040000): ", a / 0x00040000);
1255 p("IDIVPOW2 (" + a + " / 0x00080000): ", a / 0x00080000);
1256 p("IDIVPOW2 (" + a + " / 0x00100000): ", a / 0x00100000);
1257 p("IDIVPOW2 (" + a + " / 0x00200000): ", a / 0x00200000);
1258 p("IDIVPOW2 (" + a + " / 0x00400000): ", a / 0x00400000);
1259 p("IDIVPOW2 (" + a + " / 0x00800000): ", a / 0x00800000);
1260 p("IDIVPOW2 (" + a + " / 0x01000000): ", a / 0x01000000);
1261 p("IDIVPOW2 (" + a + " / 0x02000000): ", a / 0x02000000);
1262 p("IDIVPOW2 (" + a + " / 0x04000000): ", a / 0x04000000);
1263 p("IDIVPOW2 (" + a + " / 0x08000000): ", a / 0x08000000);
1264 p("IDIVPOW2 (" + a + " / 0x10000000): ", a / 0x10000000);
1265 p("IDIVPOW2 (" + a + " / 0x20000000): ", a / 0x20000000);
1266 p("IDIVPOW2 (" + a + " / 0x40000000): ", a / 0x40000000);
1267 p("IDIVPOW2 (" + a + " / 0x80000000): ", a / 0x80000000);
1269 p("IREMPOW2 (" + a + " % 0x00000002): ", a % 0x00000002);
1270 p("IREMPOW2 (" + a + " % 0x00000004): ", a % 0x00000004);
1271 p("IREMPOW2 (" + a + " % 0x00000008): ", a % 0x00000008);
1272 p("IREMPOW2 (" + a + " % 0x00000010): ", a % 0x00000010);
1273 p("IREMPOW2 (" + a + " % 0x00000020): ", a % 0x00000020);
1274 p("IREMPOW2 (" + a + " % 0x00000040): ", a % 0x00000040);
1275 p("IREMPOW2 (" + a + " % 0x00000080): ", a % 0x00000080);
1276 p("IREMPOW2 (" + a + " % 0x00000100): ", a % 0x00000100);
1277 p("IREMPOW2 (" + a + " % 0x00000200): ", a % 0x00000200);
1278 p("IREMPOW2 (" + a + " % 0x00000400): ", a % 0x00000400);
1279 p("IREMPOW2 (" + a + " % 0x00000800): ", a % 0x00000800);
1280 p("IREMPOW2 (" + a + " % 0x00001000): ", a % 0x00001000);
1281 p("IREMPOW2 (" + a + " % 0x00002000): ", a % 0x00002000);
1282 p("IREMPOW2 (" + a + " % 0x00004000): ", a % 0x00004000);
1283 p("IREMPOW2 (" + a + " % 0x00008000): ", a % 0x00008000);
1284 p("IREMPOW2 (" + a + " % 0x00010000): ", a % 0x00010000);
1285 p("IREMPOW2 (" + a + " % 0x00020000): ", a % 0x00020000);
1286 p("IREMPOW2 (" + a + " % 0x00040000): ", a % 0x00040000);
1287 p("IREMPOW2 (" + a + " % 0x00080000): ", a % 0x00080000);
1288 p("IREMPOW2 (" + a + " % 0x00100000): ", a % 0x00100000);
1289 p("IREMPOW2 (" + a + " % 0x00200000): ", a % 0x00200000);
1290 p("IREMPOW2 (" + a + " % 0x00400000): ", a % 0x00400000);
1291 p("IREMPOW2 (" + a + " % 0x00800000): ", a % 0x00800000);
1292 p("IREMPOW2 (" + a + " % 0x01000000): ", a % 0x01000000);
1293 p("IREMPOW2 (" + a + " % 0x02000000): ", a % 0x02000000);
1294 p("IREMPOW2 (" + a + " % 0x04000000): ", a % 0x04000000);
1295 p("IREMPOW2 (" + a + " % 0x08000000): ", a % 0x08000000);
1296 p("IREMPOW2 (" + a + " % 0x10000000): ", a % 0x10000000);
1297 p("IREMPOW2 (" + a + " % 0x20000000): ", a % 0x20000000);
1298 p("IREMPOW2 (" + a + " % 0x40000000): ", a % 0x40000000);
1299 p("IREMPOW2 (" + a + " % 0x80000000): ", a % 0x80000000);
1302 static public void testdivremconst(long a) {
1303 p("LDIVPOW2 (" + a + " / 0x00000002): ", a / 0x00000002);
1304 p("LDIVPOW2 (" + a + " / 0x00000004): ", a / 0x00000004);
1305 p("LDIVPOW2 (" + a + " / 0x00000008): ", a / 0x00000008);
1306 p("LDIVPOW2 (" + a + " / 0x00000010): ", a / 0x00000010);
1307 p("LDIVPOW2 (" + a + " / 0x00000020): ", a / 0x00000020);
1308 p("LDIVPOW2 (" + a + " / 0x00000040): ", a / 0x00000040);
1309 p("LDIVPOW2 (" + a + " / 0x00000080): ", a / 0x00000080);
1310 p("LDIVPOW2 (" + a + " / 0x00000100): ", a / 0x00000100);
1311 p("LDIVPOW2 (" + a + " / 0x00000200): ", a / 0x00000200);
1312 p("LDIVPOW2 (" + a + " / 0x00000400): ", a / 0x00000400);
1313 p("LDIVPOW2 (" + a + " / 0x00000800): ", a / 0x00000800);
1314 p("LDIVPOW2 (" + a + " / 0x00001000): ", a / 0x00001000);
1315 p("LDIVPOW2 (" + a + " / 0x00002000): ", a / 0x00002000);
1316 p("LDIVPOW2 (" + a + " / 0x00004000): ", a / 0x00004000);
1317 p("LDIVPOW2 (" + a + " / 0x00008000): ", a / 0x00008000);
1318 p("LDIVPOW2 (" + a + " / 0x00010000): ", a / 0x00010000);
1319 p("LDIVPOW2 (" + a + " / 0x00020000): ", a / 0x00020000);
1320 p("LDIVPOW2 (" + a + " / 0x00040000): ", a / 0x00040000);
1321 p("LDIVPOW2 (" + a + " / 0x00080000): ", a / 0x00080000);
1322 p("LDIVPOW2 (" + a + " / 0x00100000): ", a / 0x00100000);
1323 p("LDIVPOW2 (" + a + " / 0x00200000): ", a / 0x00200000);
1324 p("LDIVPOW2 (" + a + " / 0x00400000): ", a / 0x00400000);
1325 p("LDIVPOW2 (" + a + " / 0x00800000): ", a / 0x00800000);
1326 p("LDIVPOW2 (" + a + " / 0x01000000): ", a / 0x01000000);
1327 p("LDIVPOW2 (" + a + " / 0x02000000): ", a / 0x02000000);
1328 p("LDIVPOW2 (" + a + " / 0x04000000): ", a / 0x04000000);
1329 p("LDIVPOW2 (" + a + " / 0x08000000): ", a / 0x08000000);
1330 p("LDIVPOW2 (" + a + " / 0x10000000): ", a / 0x10000000);
1331 p("LDIVPOW2 (" + a + " / 0x20000000): ", a / 0x20000000);
1332 p("LDIVPOW2 (" + a + " / 0x40000000): ", a / 0x40000000);
1333 p("LDIVPOW2 (" + a + " / 0x80000000): ", a / 0x80000000);
1335 p("LREMPOW2 (" + a + " % 0x00000002): ", a % 0x00000002L);
1336 p("LREMPOW2 (" + a + " % 0x00000004): ", a % 0x00000004L);
1337 p("LREMPOW2 (" + a + " % 0x00000008): ", a % 0x00000008L);
1338 p("LREMPOW2 (" + a + " % 0x00000010): ", a % 0x00000010L);
1339 p("LREMPOW2 (" + a + " % 0x00000020): ", a % 0x00000020L);
1340 p("LREMPOW2 (" + a + " % 0x00000040): ", a % 0x00000040L);
1341 p("LREMPOW2 (" + a + " % 0x00000080): ", a % 0x00000080L);
1342 p("LREMPOW2 (" + a + " % 0x00000100): ", a % 0x00000100L);
1343 p("LREMPOW2 (" + a + " % 0x00000200): ", a % 0x00000200L);
1344 p("LREMPOW2 (" + a + " % 0x00000400): ", a % 0x00000400L);
1345 p("LREMPOW2 (" + a + " % 0x00000800): ", a % 0x00000800L);
1346 p("LREMPOW2 (" + a + " % 0x00001000): ", a % 0x00001000L);
1347 p("LREMPOW2 (" + a + " % 0x00002000): ", a % 0x00002000L);
1348 p("LREMPOW2 (" + a + " % 0x00004000): ", a % 0x00004000L);
1349 p("LREMPOW2 (" + a + " % 0x00008000): ", a % 0x00008000L);
1350 p("LREMPOW2 (" + a + " % 0x00010000): ", a % 0x00010000L);
1351 p("LREMPOW2 (" + a + " % 0x00020000): ", a % 0x00020000L);
1352 p("LREMPOW2 (" + a + " % 0x00040000): ", a % 0x00040000L);
1353 p("LREMPOW2 (" + a + " % 0x00080000): ", a % 0x00080000L);
1354 p("LREMPOW2 (" + a + " % 0x00100000): ", a % 0x00100000L);
1355 p("LREMPOW2 (" + a + " % 0x00200000): ", a % 0x00200000L);
1356 p("LREMPOW2 (" + a + " % 0x00400000): ", a % 0x00400000L);
1357 p("LREMPOW2 (" + a + " % 0x00800000): ", a % 0x00800000L);
1358 p("LREMPOW2 (" + a + " % 0x01000000): ", a % 0x01000000L);
1359 p("LREMPOW2 (" + a + " % 0x02000000): ", a % 0x02000000L);
1360 p("LREMPOW2 (" + a + " % 0x04000000): ", a % 0x04000000L);
1361 p("LREMPOW2 (" + a + " % 0x08000000): ", a % 0x08000000L);
1362 p("LREMPOW2 (" + a + " % 0x10000000): ", a % 0x10000000L);
1363 p("LREMPOW2 (" + a + " % 0x20000000): ", a % 0x20000000L);
1364 p("LREMPOW2 (" + a + " % 0x40000000): ", a % 0x40000000L);
1365 p("LREMPOW2 (" + a + " % 0x80000000): ", a % 0x80000000L);
1369 static public void testint(int a, int b) {
1370 p ("TESTINT CALLED WITH ", a);
1376 try { p("IDIV: ", a/b); }
1377 catch (ArithmeticException e) { p("divison by zero"); }
1378 try { p("IREM: ", a%b); }
1379 catch (ArithmeticException e) { p("divison by zero"); }
1383 p("IUSHR: ", a>>>b);
1388 p("I2L: ", (long) a);
1389 p("I2F: ", (float) a);
1390 p("I2D: ", (double) a);
1391 p("INT2BYTE: ", (byte) a);
1392 p("INT2CHAR: ", (char) a);
1393 p("INT2SHORT: ", (short) a);
1395 if (!(a==0)) p("not IFEQ");
1396 if (!(a!=0)) p("not IFNE");
1397 if (!(a<0)) p("not IFLT");
1398 if (!(a<=0)) p("not IFLE");
1399 if (!(a>0)) p("not IFGT");
1400 if (!(a>=0)) p("not IFGE");
1402 if (!(a==b)) p("not IF_ICMPEQ");
1403 if (!(a!=b)) p("not IF_ICMPNE");
1404 if (!(a<b)) p("not IF_ICMPLT");
1405 if (!(a<=b)) p("not IF_ICMPLE");
1406 if (!(a>b)) p("not IF_ICMPGT");
1407 if (!(a>=b)) p("not IF_ICMPGE");
1409 p("COND_ICMPEQ " + a + " == 0: " + ((a == 0) ? 0 : 1));
1410 p("COND_ICMPNE " + a + " != 0: " + ((a != 0) ? 0 : 1));
1411 p("COND_ICMPLT " + a + " < 0: " + ((a < 0) ? 0 : 1));
1412 p("COND_ICMPLE " + a + " <= 0: " + ((a <= 0) ? 0 : 1));
1413 p("COND_ICMPGT " + a + " > 0: " + ((a > 0) ? 0 : 1));
1414 p("COND_ICMPGE " + a + " >= 0: " + ((a >= 0) ? 0 : 1));
1416 p("COND_ICMPEQ " + a + " == 0: " + ((a == 0) ? 1 : 0));
1417 p("COND_ICMPNE " + a + " != 0: " + ((a != 0) ? 1 : 0));
1418 p("COND_ICMPLT " + a + " < 0: " + ((a < 0) ? 1 : 0));
1419 p("COND_ICMPLE " + a + " <= 0: " + ((a <= 0) ? 1 : 0));
1420 p("COND_ICMPGT " + a + " > 0: " + ((a > 0) ? 1 : 0));
1421 p("COND_ICMPGE " + a + " >= 0: " + ((a >= 0) ? 1 : 0));
1423 p("COND_ICMPEQ " + a + " == 0: " + ((a == 0) ? 2 : 3));
1424 p("COND_ICMPNE " + a + " != 0: " + ((a != 0) ? 2 : 3));
1425 p("COND_ICMPLT " + a + " < 0: " + ((a < 0) ? 2 : 3));
1426 p("COND_ICMPLE " + a + " <= 0: " + ((a <= 0) ? 2 : 3));
1427 p("COND_ICMPGT " + a + " > 0: " + ((a > 0) ? 2 : 3));
1428 p("COND_ICMPGE " + a + " >= 0: " + ((a >= 0) ? 2 : 3));
1430 p("COND_ICMPEQ " + a + " == " + b + ": " + (a == b));
1431 p("COND_ICMPNE " + a + " != " + b + ": " + (a != b));
1432 p("COND_ICMPLT " + a + " < " + b + ": " + (a < b));
1433 p("COND_ICMPLE " + a + " <= " + b + ": " + (a <= b));
1434 p("COND_ICMPGT " + a + " > " + b + ": " + (a > b));
1435 p("COND_ICMPGE " + a + " >= " + b + ": " + (a >= b));
1439 static public void testlong(long a, long b) {
1440 p ("TESTLONG called with ", a);
1446 try { p("LDIV: ", a / b); }
1447 catch (ArithmeticException e) { p("divison by zero"); }
1448 try { p("LREM: ", a % b); }
1449 catch (ArithmeticException e) { p("divison by zero"); }
1451 p("LSHL: ", a << b);
1452 p("LSHR: ", a >> b);
1453 p("LUSHR: ", a >>>b);
1458 p("L2I: ", (int) a);
1459 p("L2F: ", (float) a);
1460 p("L2D: ", (double) a);
1462 p("LCMP a == b : ", a == b);
1463 p("LCMP a != b : ", a != b);
1464 p("LCMP a < b : ", a < b);
1465 p("LCMP a <= b : ", a <= b);
1466 p("LCMP a > b : ", a > b);
1467 p("LCMP a >= b : ", a >= b);
1469 if ((a==b)) p("not IF_LCMPEQ");
1470 if ((a!=b)) p("not IF_LCMPNE");
1471 if ((a<b)) p("not IF_LCMPLT");
1472 if ((a<=b)) p("not IF_LCMPLE");
1473 if ((a>b)) p("not IF_LCMPGT");
1474 if ((a>=b)) p("not IF_LCMPGE");
1477 static public void testfloat(float a, float b) {
1478 p ("TESTFLOAT called with ", a);
1487 p("F2I: ", (int) a);
1488 p("F2L: ", (long) a);
1489 p("F2D: ", (double) a);
1491 if ((a==b)) p("FCMP a=b");
1492 if ((a!=b)) p("FCMP a!=b");
1493 if ((a<b)) p("FCMP a<b");
1494 if ((a<=b)) p("FCMP a<=b");
1495 if ((a>b)) p("FCMP a>b");
1496 if ((a>=b)) p("FCMP a>=b");
1499 static public void testdouble(double a, double b) {
1500 p ("TESTDOUBLE called with ", a);
1509 p("D2I: ", (int) a);
1510 p("D2L: ", (long) a);
1511 p("D2F: ", (float) a);
1513 if ((a==b)) p("DCMP a=b");
1514 if ((a!=b)) p("DCMP a!=b");
1515 if ((a<b)) p("DCMP a<b");
1516 if ((a<=b)) p("DCMP a<=b");
1517 if ((a>b)) p("DCMP a>b");
1518 if ((a>=b)) p("DCMP a>=b");
1522 // ********************* output methods ****************************
1524 public static void pnl() {
1525 System.out.println ();
1526 System.out.print (linenum);
1527 System.out.print (". ");
1531 public static void p(String a) { System.out.print(a); pnl(); }
1532 public static void p(boolean a) {System.out.print(a);
1534 public static void p(int a) { System.out.print ("int: ");
1535 System.out.print(a);
1537 public static void p(long a) { System.out.print ("long: ");
1538 System.out.print(a);
1540 public static void p(short a) { System.out.print ("short: ");
1541 System.out.print(a);
1543 public static void p(byte a) { System.out.print ("byte: ");
1544 System.out.print(a);
1546 public static void p(char a) { System.out.print ("char: ");
1547 System.out.print((int)a);
1549 public static void p(float a) { System.out.print ("float: ");
1550 System.out.print ( java.lang.Float.floatToIntBits(a) );
1552 public static void p(double a) { System.out.print ("double: ");
1553 System.out.print( java.lang.Double.doubleToLongBits(a) );
1556 public static void p(String s,boolean i) {
1557 System.out.print(s); p(i);
1559 public static void p(String s,int i) {
1560 System.out.print(s); p(i);
1562 public static void p(String s,byte i) {
1563 System.out.print(s); p(i);
1565 public static void p(String s,char i) {
1566 System.out.print(s); p(i);
1568 public static void p(String s,short i) {
1569 System.out.print(s); p(i);
1571 public static void p(String s,long l) {
1572 System.out.print(s); p(l);
1574 public static void p(String s,float f) {
1575 System.out.print(s); p(f);
1577 public static void p(String s,double d) {
1578 System.out.print(s); p(d);
1584 // methods for testing interface and method calls
1586 public void jctest() { p (" <init> wird aktiviert"); };
1587 public void p_manyparam (int p_i1,int p_i2,
1589 long p_l1,long p_l2,
1590 long p_l3,long p_l4,
1591 float p_f1, float p_f2,
1592 float p_f3, float p_f4,
1593 double p_d1, double p_d2,
1594 double p_d3, double p_d4) {
1613 public void p_nonstatic (String a) {
1637 interface jcinterface {
1638 public void p_nonstatic (String a);