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 long l1=123456789,l2=987654321,l3=-99999999999999L;
25 static int i2,i3=-100;
26 static float f1=0.1F,f2=0.2F,f3=0.3F;
27 static double d1=0.001,d2=0.002,d3=0.003;
28 static String s1,s2="der konstante String";
31 long n_l1,n_l2,n_l3,n_l4;
32 float n_f1,n_f2,n_f3,n_f4;
34 double n_d1,n_d2,n_d3,n_d4;
37 public static void main(String[] s) {
38 p ("=================== JavaVM - Tester ========================");
40 p ("------------------- test arguments");
42 for (i=0; i<s.length; i++) p(s[i]);
47 testspecialnullpointers();
50 p ("------------------- test consts");
53 testconst (-24123, -4918923241323L);
54 testconst (-243511, -4423423234231423L);
55 testconst (0x7fffffff, 0x7fffffffffffffffL);
56 testconst (0x80000000, 0x8000000000000000L);
58 p ("------------------- test div and rem consts");
60 testdivremconst(12347);
61 testdivremconst(8893427);
62 testdivremconst(1005234562);
64 testdivremconst(-12347);
65 testdivremconst(-8893427);
66 testdivremconst(-1005234562);
69 testdivremconst(12347L);
70 testdivremconst(8893427L);
71 testdivremconst(1005234562L);
72 testdivremconst(12135005234562L);
73 testdivremconst(2343552355623464626L);
74 testdivremconst(-17L);
75 testdivremconst(-12347L);
76 testdivremconst(-8893427L);
77 testdivremconst(-1005234562L);
78 testdivremconst(-12135005234562L);
79 testdivremconst(-2343552355623464626L);
81 p ("------------------- test rem 0x10001");
87 testrem0x10001(13247);
88 testrem0x10001(563467);
89 testrem0x10001(7456774);
90 testrem0x10001(34523525);
91 testrem0x10001(234523456);
92 testrem0x10001(1005234562);
93 testrem0x10001(2147483647);
97 testrem0x10001(-1234);
98 testrem0x10001(-13247);
99 testrem0x10001(-563467);
100 testrem0x10001(-7456774);
101 testrem0x10001(-34523525);
102 testrem0x10001(-234523456);
103 testrem0x10001(-1005234562);
104 testrem0x10001(-2147483647);
105 testrem0x10001(-2147483648);
110 testrem0x10001(123L);
111 testrem0x10001(1234L);
112 testrem0x10001(13247L);
113 testrem0x10001(563467L);
114 testrem0x10001(7456774L);
115 testrem0x10001(34523525L);
116 testrem0x10001(234523456L);
117 testrem0x10001(1005234562L);
118 testrem0x10001(1983223864L);
119 testrem0x10001(2147483646L);
120 testrem0x10001(2147483647L);
121 testrem0x10001(2147483648L);
122 testrem0x10001(10052234562L);
123 testrem0x10001(561005234562L);
124 testrem0x10001(2100527345962L);
125 testrem0x10001(34600523456287L);
126 testrem0x10001(546805234456882L);
127 testrem0x10001(1360052334734722L);
128 testrem0x10001(23456705569626354L);
129 testrem0x10001(9223372036854775807L);
131 testrem0x10001(-17L);
132 testrem0x10001(-123L);
133 testrem0x10001(-1234L);
134 testrem0x10001(-13247L);
135 testrem0x10001(-563467L);
136 testrem0x10001(-7456774L);
137 testrem0x10001(-34523525L);
138 testrem0x10001(-234523456L);
139 testrem0x10001(-1005234562L);
140 testrem0x10001(-1983223864L);
141 testrem0x10001(-2147483647L);
142 testrem0x10001(-2147483648L);
143 testrem0x10001(-10052234562L);
144 testrem0x10001(-561005234562L);
145 testrem0x10001(-2100527345962L);
146 testrem0x10001(-34600523456287L);
147 testrem0x10001(-546805234456882L);
148 testrem0x10001(-1360052334734722L);
149 testrem0x10001(-23456705569626354L);
150 testrem0x10001(-9223372036854775807L);
151 testrem0x10001(-9223372036854775808L);
153 p ("------------------- test ints");
156 testint (-24351,24123);
157 testint (4918923,-441423);
160 testint (1423487,123444444);
161 testint (0x7fffffff,1);
162 testint (0,0x7fffffff);
163 testint (0x3333,143444);
164 testint (4444441,12342);
166 p ("------------------- test longs");
169 testlong (-24351,24123);
170 testlong (4918923241323L,-4423423234231423L);
173 testlong (1423487,123444442344L);
174 testlong (0x7fffffffffffffffL,1);
175 testlong (0,0x7fffffffffffffffL);
176 testlong (0x3333,143444);
177 testlong (4444441,12342);
179 p ("------------------- test floats");
180 testfloat ((float) 1,(float) 2.042);
181 testfloat ((float) -1.234,(float) 17.44);
182 testfloat ((float) -24351,(float) 24123);
183 testfloat ((float) 0.1,(float) 1243);
184 testfloat ((float) 0.0,(float) -555.4132);
185 testfloat ((float) 77.0,(float) -555);
186 testfloat ((float) 2147483000.0,(float) -555234);
188 p ("------------------- test doubles");
189 testdouble (1,2.042);
190 testdouble (-1.234,17.44);
191 testdouble (-24351,24123);
192 testdouble (0.1,1243);
193 testdouble (0.0,-555.4132);
194 testdouble (77.0,-555);
195 testdouble (2147483000.0,-555234);
198 p ("=================== end of test =========================");
203 p ("successful initialisation");
208 public static void testgeneral() {
211 // ******************** basic data types *******************************
213 p ("------------------- test int-PUSH-STORE-LOAD");
215 p(j); p (0); p(2); p(17); p(-100);
216 p (500); p(-32768); p(-32769); p(32767); p(32768);
217 p (90000); p(-1000000000);
219 p ("------------------- test long-PUSH-STORE-LOAD");
221 p ( l ); p ( 0L ); p ( 99L );
222 p (500L); p(-32768L); p(-32769L); p(32767L); p(32768L);
223 p ( 6900000000000L ); p ( 349827389478173274L );
225 p ("------------------- test float-PUSH-STORE-LOAD");
227 p ( f ); p (0.0F); p (1.0F); p (342323423478.2223434234232334F);
229 p ("------------------- test double-PUSH-STORE-LOAD");
230 double d = 99234.42D;
231 p ( d ); p (0.0D); p (1.0D); p (342323423478.2223434234232334D);
234 // ******************** static variables *******************************
236 p ("------------------- test static variables");
240 p (i1); p(i2); p(i3);
241 p (l1); p(l2); p(l3);
242 p (f1); p(f2); p(f3);
243 p (d1); p(d2); p(d3);
245 // ******************** arithmetic test ********************************
247 p ("------------------- test arithmetic");
253 l1 = 0x7fffffffffffffffL;
256 p (l1+0x7fffffffffffffffL);
259 // ******************** test method calls ******************************
261 p ("statische methode");
262 jctest ttt = new jctest ();
263 ttt.p_manyparam (19,18,17,16, 88,77,66,55,
264 0.1F,0.2F,0.3F,0.4F, -2.0D,-3.0D,-4.0D,-5.0D );
265 jcinterface ttt2 = ttt;
266 ttt2.p_nonstatic ("interface method");
272 // ************************ test tables ************************************
274 public static void testtables() {
277 p ("------------------- test tableswitch");
279 for (i = -5; i < 15; i++) {
281 case 2: p ("-> 2"); break;
282 case 3: p ("-> 3"); break;
283 case 5: p ("-> 5"); break;
284 case 6: p ("-> 6"); break;
285 case 7: p ("-> 7"); break;
286 case 8: p ("-> 8"); break;
287 case 10: p ("-> 10"); break;
288 default: p ("default"); break;
292 p ("------------------- test lookupswitch");
294 for (i = -5; i < 15; i++) {
296 case 2: p ("-> 2"); break;
297 case 8: p ("-> 8"); break;
298 case 14: p ("-> 14"); break;
299 case -4: p ("-> -4"); break;
300 default: p ("default"); break;
306 // ****************** test type casts and array stores *********************
308 public static void testcasts() {
309 Object o = new Object();
310 Object oi = new Integer(0);
311 Object[] oa = new Object [1];
312 Object[] oia = new Integer[1];
313 Integer i = new Integer(0);
316 p ("------------------- test casts");
319 p ("type cast check: Integer = Object(Integer)");
321 p ("type cast check: Integer = Object");
323 p ("error: class cast exception not thrown");
325 catch (ClassCastException c) {
326 p ("exception: class cast");
330 p ("type cast check: Integer[] = Object(Integer)[]");
331 ia = (Integer[]) oia;
332 p ("type cast check: Integer[] = Object[]");
334 p ("error: class cast exception not thrown");
336 catch (ClassCastException c) {
337 p ("exception: class cast");
341 p ("array store check: Object(Integer)[0] = Integer");
343 p ("array store check: Object(Integer)[0] = Object");
345 p ("error: array store exception not thrown");
347 catch (ArrayStoreException c) {
348 p ("exception: array store");
353 // ****************** test special null pointers ***************************
355 public static void testspecialnullpointers() {
358 jcinterface f = null;
360 p ("------------------- test special null pointers");
363 p ("null pointer check: put field");
365 p ("error: put field null pointer exception not thrown");
367 catch (NullPointerException x) {
368 p ("exception: null pointer");
372 p ("null pointer check: get field");
374 p ("error: get field null pointer exception not thrown");
376 catch (NullPointerException x) {
377 p ("exception: null pointer");
381 p ("null pointer check: invokevirtual");
382 c.p_nonstatic("invokevirtual");
383 p ("error: invokevirtual null pointer exception not thrown");
385 catch (NullPointerException x) {
386 p ("exception: null pointer");
390 p ("null pointer check: invokeinterface");
391 f.p_nonstatic("invokeinterface");
392 p ("error: invokeinterface null pointer exception not thrown");
394 catch (NullPointerException x) {
395 p ("exception: null pointer");
399 p ("null pointer check: monitorenter");
401 p ("error: monitorenter null pointer exception not thrown");
404 catch (NullPointerException x) {
405 p ("exception: null pointer");
410 // ************************ test array bounds ******************************
412 public static void testarraybounds(byte[] ba, int i) {
414 p ("testarraybounds: " + (i - 10));
416 p ("testarraybounds: " + (i - 5));
418 p ("testarraybounds: " + (i));
420 p ("testarraybounds: " + (i + 5));
422 p ("testarraybounds: " + (i + 10));
427 // ************************ test arrays ************************************
429 public static void testarrays() {
436 p ("------------------- test byte arrays");
441 p ("null pointer check: byte array store");
443 p ("error: null pointer exception not thrown");
445 catch (NullPointerException c) {
446 p ("exception: null pointer");
449 p ("null pointer check: byte array load");
451 p ("error: null pointer exception not thrown");
453 catch (NullPointerException c) {
454 p ("exception: null pointer");
458 p ("negative array size check: byte array");
460 p ("error: negative array size exception not thrown");
462 catch (NegativeArraySizeException c) {
463 p ("exception: negative array size");
470 p ("array bound check: byte array store");
472 p ("error: exception not thrown");
474 catch (ArrayIndexOutOfBoundsException c) {
475 p ("exception: out of bounds: "+(-1));
478 p ("array bound check: byte array load");
480 p ("error: exception not thrown");
482 catch (ArrayIndexOutOfBoundsException c) {
483 p ("exception: out of bounds: "+(-1));
487 testarraybounds(ba, 5);
489 catch (ArrayIndexOutOfBoundsException c) {
490 p ("exception: out of bounds: "+5);
493 testarraybounds(ba, 50);
495 catch (ArrayIndexOutOfBoundsException c) {
496 p ("exception: out of bounds: "+50);
499 testarraybounds(ba, 100);
501 catch (ArrayIndexOutOfBoundsException c) {
502 p ("exception: out of bounds: "+100);
508 catch (ArrayIndexOutOfBoundsException c) {
509 p ("exception: out of bounds: "+(-4));
514 catch (ArrayIndexOutOfBoundsException c) {
515 p ("exception: out of bounds: "+(-3));
517 for (i=-2; i<102; i++) {
519 ba[i] = (byte) (i-50);
521 catch (ArrayIndexOutOfBoundsException c) {
522 p ("exception: out of bounds: "+i);
528 catch (ArrayIndexOutOfBoundsException c) {
529 p ("exception: out of bounds: "+102);
534 catch (ArrayIndexOutOfBoundsException c) {
535 p ("exception: out of bounds: "+103);
537 for (i=0; i<100; i++) p (ba[i]);
540 p ("-------- test short arrays");
545 p ("null pointer check: short array store");
547 p ("error: null pointer exception not thrown");
549 catch (NullPointerException c) {
550 p ("exception: null pointer");
553 p ("null pointer check: short array load");
555 p ("error: null pointer exception not thrown");
557 catch (NullPointerException c) {
558 p ("exception: null pointer");
561 sa = new short [100];
564 p ("array bound check: short array store");
566 p ("error: exception not thrown");
568 catch (ArrayIndexOutOfBoundsException c) {
569 p ("exception: out of bounds: "+(-1));
572 p ("array bound check: short array load");
574 p ("error: exception not thrown");
576 catch (ArrayIndexOutOfBoundsException c) {
577 p ("exception: out of bounds: "+(-1));
580 for (i=0; i<100; i++) sa[i] = (short) (i-50);
581 for (i=0; i<100; i++) p (sa[i]);
584 p ("-------- test int arrays");
589 p ("null pointer check: int array store");
591 p ("error: null pointer exception not thrown");
593 catch (NullPointerException c) {
594 p ("exception: null pointer");
597 p ("null pointer check: int array load");
599 p ("error: null pointer exception not thrown");
601 catch (NullPointerException c) {
602 p ("exception: null pointer");
608 p ("array bound check: int array store");
610 p ("error: exception not thrown");
612 catch (ArrayIndexOutOfBoundsException c) {
613 p ("exception: out of bounds: "+(-1));
616 p ("array bound check: int array load");
618 p ("error: exception not thrown");
620 catch (ArrayIndexOutOfBoundsException c) {
621 p ("exception: out of bounds: "+(-1));
624 for (i=0; i<10; i++) ia[i] = (123456 + i);
625 for (i=0; i<10; i++) p (ia[i]);
629 p ("-------- test long arrays");
634 p ("null pointer check: long array store");
636 p ("error: null pointer exception not thrown");
638 catch (NullPointerException c) {
639 p ("exception: null pointer");
642 p ("null pointer check: long array load");
644 p ("error: null pointer exception not thrown");
646 catch (NullPointerException c) {
647 p ("exception: null pointer");
653 p ("array bound check: long array store");
655 p ("error: exception not thrown");
657 catch (ArrayIndexOutOfBoundsException c) {
658 p ("exception: out of bounds: "+(-1));
661 p ("array bound check: long array load");
663 p ("error: exception not thrown");
665 catch (ArrayIndexOutOfBoundsException c) {
666 p ("exception: out of bounds: "+(-1));
669 for (i=0; i<10; i++) la[i] = (1234567890123L + i);
670 for (i=0; i<10; i++) p (la[i]);
673 p ("-------- test char arrays");
678 p ("null pointer check: char array store");
680 p ("error: null pointer exception not thrown");
682 catch (NullPointerException c) {
683 p ("exception: null pointer");
686 p ("null pointer check: char array load");
688 p ("error: null pointer exception not thrown");
690 catch (NullPointerException c) {
691 p ("exception: null pointer");
697 p ("array bound check: char array store");
699 p ("error: exception not thrown");
701 catch (ArrayIndexOutOfBoundsException c) {
702 p ("exception: out of bounds: "+(-1));
705 p ("array bound check: char array load");
707 p ("error: exception not thrown");
709 catch (ArrayIndexOutOfBoundsException c) {
710 p ("exception: out of bounds: "+(-1));
713 for (i=0; i<50; i++) ca[i] = (char) ('A' + i);
714 for (i=0; i<50; i++) p (ca[i]);
716 p ("-------- test address arrays");
721 p ("null pointer check: address array store");
723 p ("error: null pointer exception not thrown");
725 catch (NullPointerException c) {
726 p ("exception: null pointer");
729 p ("null pointer check: address array load");
731 p ("error: null pointer exception not thrown");
733 catch (NullPointerException c) {
734 p ("exception: null pointer");
738 p ("negative array size check: address array");
739 sta = new String[-3];
740 p ("error: negative array size exception not thrown");
742 catch (NegativeArraySizeException c) {
743 p ("exception: negative array size");
749 p ("array bound check: address array store");
751 p ("error: exception not thrown");
753 catch (ArrayIndexOutOfBoundsException c) {
754 p ("exception: out of bounds: "+(-1));
757 p ("array bound check: address array load");
759 p ("error: exception not thrown");
761 catch (ArrayIndexOutOfBoundsException c) {
762 p ("exception: out of bounds: "+(-1));
765 for (i=0; i<5; i++) sta[i] = Integer.toString(i) + ". Zeile";
766 for (i=0; i<5; i++) p (sta[i]);
768 p ("-------- test multi dimensional arrays");
770 int [][][] iaaa = null;
773 p ("negative array size check: multi dimensional array");
774 iaaa = new int[2][3][-4];
775 p ("error: negative array size exception not thrown");
777 catch (NegativeArraySizeException c) {
778 p ("exception: negative array size");
781 iaaa = new int[2][3][4];
782 long [][][] laaa = new long[2][3][6];
783 float [][][] faaa = new float[2][3][4];
784 double [][][] daaa = new double[3][4][7];
785 for (i=0; i<2; i++) {
786 int i2; for (i2=0; i2<3; i2++) {
787 int i3; for (i3=0; i3<4; i3++) {
788 iaaa[i][i2][i3] = i*i*i + i2*i2 + i3;
789 laaa[i][i2][i3] = i*i*i + i2*i2 + i3 + 7;
790 faaa[i][i2][i3] = i*i*i + i2*i2 + i3 + 0.4F;
791 daaa[i][i2][i3] = i*i*i + i2*i2 + i3 - 47.0001;
805 static public void testconst(int i, long l) {
806 p ("TESTCONST CALLED WITH ", i);
809 if (!(i == (0))) p("not IF_ICMPEQ", (0));
810 if (!(i != (0))) p("not IF_ICMPNE", (0));
811 if (!(i < (0))) p("not IF_ICMPLT", (0));
812 if (!(i <= (0))) p("not IF_ICMPLE", (0));
813 if (!(i > (0))) p("not IF_ICMPGT", (0));
814 if (!(i >= (0))) p("not IF_ICMPGE", (0));
816 if (!(l == (0))) p("not IF_LCMPEQ", (0));
817 if (!(l != (0))) p("not IF_LCMPNE", (0));
818 if (!(l < (0))) p("not IF_LCMPLT", (0));
819 if (!(l <= (0))) p("not IF_LCMPLE", (0));
820 if (!(l > (0))) p("not IF_LCMPGT", (0));
821 if (!(l >= (0))) p("not IF_LCMPGE", (0));
823 p("IADDCONST: ", i + (-1));
824 p("ISUBCONST: ", i - (-1));
825 p("IMULCONST: ", i * (-1));
826 p("ISHLCONST: ", i << (-1));
827 p("ISHRCONST: ", i >> (-1));
828 p("IUSHRCONST: ", i >>> (-1));
829 p("IANDCONST: ", i & (-1));
830 p("IORCONST: ", i | (-1));
831 p("IXORCONST: ", i ^ (-1));
833 if (!(i == (-1))) p("not IF_ICMPEQ", (-1));
834 if (!(i != (-1))) p("not IF_ICMPNE", (-1));
835 if (!(i < (-1))) p("not IF_ICMPLT", (-1));
836 if (!(i <= (-1))) p("not IF_ICMPLE", (-1));
837 if (!(i > (-1))) p("not IF_ICMPGT", (-1));
838 if (!(i >= (-1))) p("not IF_ICMPGE", (-1));
840 p("LADDCONST: ", l + (-1));
841 p("LSUBCONST: ", l - (-1));
842 p("LMULCONST: ", l * (-1));
843 p("LSHLCONST: ", l << (-1));
844 p("LSHRCONST: ", l >> (-1));
845 p("LUSHRCONST: ", l >>> (-1));
846 p("LANDCONST: ", l & (-1));
847 p("LORCONST: ", l | (-1));
848 p("LXORCONST: ", l ^ (-1));
850 if (!(l == (-1))) p("not IF_LCMPEQ", (-1));
851 if (!(l != (-1))) p("not IF_LCMPNE", (-1));
852 if (!(l < (-1))) p("not IF_LCMPLT", (-1));
853 if (!(l <= (-1))) p("not IF_LCMPLE", (-1));
854 if (!(l > (-1))) p("not IF_LCMPGT", (-1));
855 if (!(l >= (-1))) p("not IF_LCMPGE", (-1));
857 p("IADDCONST: ", i + (1));
858 p("ISUBCONST: ", i - (1));
859 p("IMULCONST: ", i * (1));
860 p("ISHLCONST: ", i << (1));
861 p("ISHRCONST: ", i >> (1));
862 p("IUSHRCONST: ", i >>> (1));
863 p("IANDCONST: ", i & (1));
864 p("IORCONST: ", i | (1));
865 p("IXORCONST: ", i ^ (1));
867 if (!(i == (1))) p("not IF_ICMPEQ", (1));
868 if (!(i != (1))) p("not IF_ICMPNE", (1));
869 if (!(i < (1))) p("not IF_ICMPLT", (1));
870 if (!(i <= (1))) p("not IF_ICMPLE", (1));
871 if (!(i > (1))) p("not IF_ICMPGT", (1));
872 if (!(i >= (1))) p("not IF_ICMPGE", (1));
874 p("LADDCONST: ", l + (1));
875 p("LSUBCONST: ", l - (1));
876 p("LMULCONST: ", l * (1));
877 p("LSHLCONST: ", l << (1));
878 p("LSHRCONST: ", l >> (1));
879 p("LUSHRCONST: ", l >>> (1));
880 p("LANDCONST: ", l & (1));
881 p("LORCONST: ", l | (1));
882 p("LXORCONST: ", l ^ (1));
884 if (!(l == (1))) p("not IF_LCMPEQ", (1));
885 if (!(l != (1))) p("not IF_LCMPNE", (1));
886 if (!(l < (1))) p("not IF_LCMPLT", (1));
887 if (!(l <= (1))) p("not IF_LCMPLE", (1));
888 if (!(l > (1))) p("not IF_LCMPGT", (1));
889 if (!(l >= (1))) p("not IF_LCMPGE", (1));
891 p("IADDCONST: ", i + (255));
892 p("ISUBCONST: ", i - (255));
893 p("IMULCONST: ", i * (255));
894 p("ISHLCONST: ", i << (255));
895 p("ISHRCONST: ", i >> (255));
896 p("IUSHRCONST: ", i >>> (255));
897 p("IANDCONST: ", i & (255));
898 p("IORCONST: ", i | (255));
899 p("IXORCONST: ", i ^ (255));
901 if (!(i == (255))) p("not IF_ICMPEQ", (255));
902 if (!(i != (255))) p("not IF_ICMPNE", (255));
903 if (!(i < (255))) p("not IF_ICMPLT", (255));
904 if (!(i <= (255))) p("not IF_ICMPLE", (255));
905 if (!(i > (255))) p("not IF_ICMPGT", (255));
906 if (!(i >= (255))) p("not IF_ICMPGE", (255));
908 p("LADDCONST: ", l + (255));
909 p("LSUBCONST: ", l - (255));
910 p("LMULCONST: ", l * (255));
911 p("LSHLCONST: ", l << (255));
912 p("LSHRCONST: ", l >> (255));
913 p("LUSHRCONST: ", l >>> (255));
914 p("LANDCONST: ", l & (255));
915 p("LORCONST: ", l | (255));
916 p("LXORCONST: ", l ^ (255));
918 if (!(l == (255))) p("not IF_LCMPEQ", (255));
919 if (!(l != (255))) p("not IF_LCMPNE", (255));
920 if (!(l < (255))) p("not IF_LCMPLT", (255));
921 if (!(l <= (255))) p("not IF_LCMPLE", (255));
922 if (!(l > (255))) p("not IF_LCMPGT", (255));
923 if (!(l >= (255))) p("not IF_LCMPGE", (255));
925 p("IADDCONST: ", i + (256));
926 p("ISUBCONST: ", i - (256));
927 p("IMULCONST: ", i * (256));
928 p("ISHLCONST: ", i << (256));
929 p("ISHRCONST: ", i >> (256));
930 p("IUSHRCONST: ", i >>> (256));
931 p("IANDCONST: ", i & (256));
932 p("IORCONST: ", i | (256));
933 p("IXORCONST: ", i ^ (256));
935 if (!(i == (256))) p("not IF_ICMPEQ", (256));
936 if (!(i != (256))) p("not IF_ICMPNE", (256));
937 if (!(i < (256))) p("not IF_ICMPLT", (256));
938 if (!(i <= (256))) p("not IF_ICMPLE", (256));
939 if (!(i > (256))) p("not IF_ICMPGT", (256));
940 if (!(i >= (256))) p("not IF_ICMPGE", (256));
942 p("LADDCONST: ", l + (256));
943 p("LSUBCONST: ", l - (256));
944 p("LMULCONST: ", l * (256));
945 p("LSHLCONST: ", l << (256));
946 p("LSHRCONST: ", l >> (256));
947 p("LUSHRCONST: ", l >>> (256));
948 p("LANDCONST: ", l & (256));
949 p("LORCONST: ", l | (256));
950 p("LXORCONST: ", l ^ (256));
952 if (!(l == (256))) p("not IF_LCMPEQ", (256));
953 if (!(l != (256))) p("not IF_LCMPNE", (256));
954 if (!(l < (256))) p("not IF_LCMPLT", (256));
955 if (!(l <= (256))) p("not IF_LCMPLE", (256));
956 if (!(l > (256))) p("not IF_LCMPGT", (256));
957 if (!(l >= (256))) p("not IF_LCMPGE", (256));
959 p("IADDCONST: ", i + (32767));
960 p("ISUBCONST: ", i - (32767));
961 p("IMULCONST: ", i * (32767));
962 p("ISHLCONST: ", i << (32767));
963 p("ISHRCONST: ", i >> (32767));
964 p("IUSHRCONST: ", i >>> (32767));
965 p("IANDCONST: ", i & (32767));
966 p("IORCONST: ", i | (32767));
967 p("IXORCONST: ", i ^ (32767));
969 if (!(i == (32767))) p("not IF_ICMPEQ", (32767));
970 if (!(i != (32767))) p("not IF_ICMPNE", (32767));
971 if (!(i < (32767))) p("not IF_ICMPLT", (32767));
972 if (!(i <= (32767))) p("not IF_ICMPLE", (32767));
973 if (!(i > (32767))) p("not IF_ICMPGT", (32767));
974 if (!(i >= (32767))) p("not IF_ICMPGE", (32767));
976 p("LADDCONST: ", l + (32767));
977 p("LSUBCONST: ", l - (32767));
978 p("LMULCONST: ", l * (32767));
979 p("LSHLCONST: ", l << (32767));
980 p("LSHRCONST: ", l >> (32767));
981 p("LUSHRCONST: ", l >>> (32767));
982 p("LANDCONST: ", l & (32767));
983 p("LORCONST: ", l | (32767));
984 p("LXORCONST: ", l ^ (32767));
986 if (!(l == (32767))) p("not IF_LCMPEQ", (32767));
987 if (!(l != (32767))) p("not IF_LCMPNE", (32767));
988 if (!(l < (32767))) p("not IF_LCMPLT", (32767));
989 if (!(l <= (32767))) p("not IF_LCMPLE", (32767));
990 if (!(l > (32767))) p("not IF_LCMPGT", (32767));
991 if (!(l >= (32767))) p("not IF_LCMPGE", (32767));
993 p("IADDCONST: ", i + (32768));
994 p("ISUBCONST: ", i - (32768));
995 p("IMULCONST: ", i * (32768));
996 p("ISHLCONST: ", i << (32768));
997 p("ISHRCONST: ", i >> (32768));
998 p("IUSHRCONST: ", i >>> (32768));
999 p("IANDCONST: ", i & (32768));
1000 p("IORCONST: ", i | (32768));
1001 p("IXORCONST: ", i ^ (32768));
1003 if (!(i == (32768))) p("not IF_ICMPEQ", (32768));
1004 if (!(i != (32768))) p("not IF_ICMPNE", (32768));
1005 if (!(i < (32768))) p("not IF_ICMPLT", (32768));
1006 if (!(i <= (32768))) p("not IF_ICMPLE", (32768));
1007 if (!(i > (32768))) p("not IF_ICMPGT", (32768));
1008 if (!(i >= (32768))) p("not IF_ICMPGE", (32768));
1010 p("LADDCONST: ", l + (32768));
1011 p("LSUBCONST: ", l - (32768));
1012 p("LMULCONST: ", l * (32768));
1013 p("LSHLCONST: ", l << (32768));
1014 p("LSHRCONST: ", l >> (32768));
1015 p("LUSHRCONST: ", l >>> (32768));
1016 p("LANDCONST: ", l & (32768));
1017 p("LORCONST: ", l | (32768));
1018 p("LXORCONST: ", l ^ (32768));
1020 if (!(l == (32768))) p("not IF_LCMPEQ", (32768));
1021 if (!(l != (32768))) p("not IF_LCMPNE", (32768));
1022 if (!(l < (32768))) p("not IF_LCMPLT", (32768));
1023 if (!(l <= (32768))) p("not IF_LCMPLE", (32768));
1024 if (!(l > (32768))) p("not IF_LCMPGT", (32768));
1025 if (!(l >= (32768))) p("not IF_LCMPGE", (32768));
1027 p("IADDCONST: ", i + (-32768));
1028 p("ISUBCONST: ", i - (-32768));
1029 p("IMULCONST: ", i * (-32768));
1030 p("ISHLCONST: ", i << (-32768));
1031 p("ISHRCONST: ", i >> (-32768));
1032 p("IUSHRCONST: ", i >>> (-32768));
1033 p("IANDCONST: ", i & (-32768));
1034 p("IORCONST: ", i | (-32768));
1035 p("IXORCONST: ", i ^ (-32768));
1037 if (!(i == (-32768))) p("not IF_ICMPEQ", (-32768));
1038 if (!(i != (-32768))) p("not IF_ICMPNE", (-32768));
1039 if (!(i < (-32768))) p("not IF_ICMPLT", (-32768));
1040 if (!(i <= (-32768))) p("not IF_ICMPLE", (-32768));
1041 if (!(i > (-32768))) p("not IF_ICMPGT", (-32768));
1042 if (!(i >= (-32768))) p("not IF_ICMPGE", (-32768));
1044 p("LADDCONST: ", l + (-32768));
1045 p("LSUBCONST: ", l - (-32768));
1046 p("LMULCONST: ", l * (-32768));
1047 p("LSHLCONST: ", l << (-32768));
1048 p("LSHRCONST: ", l >> (-32768));
1049 p("LUSHRCONST: ", l >>> (-32768));
1050 p("LANDCONST: ", l & (-32768));
1051 p("LORCONST: ", l | (-32768));
1052 p("LXORCONST: ", l ^ (-32768));
1054 if (!(l == (-32768))) p("not IF_LCMPEQ", (-32768));
1055 if (!(l != (-32768))) p("not IF_LCMPNE", (-32768));
1056 if (!(l < (-32768))) p("not IF_LCMPLT", (-32768));
1057 if (!(l <= (-32768))) p("not IF_LCMPLE", (-32768));
1058 if (!(l > (-32768))) p("not IF_LCMPGT", (-32768));
1059 if (!(l >= (-32768))) p("not IF_LCMPGE", (-32768));
1061 p("IADDCONST: ", i + (-32769));
1062 p("ISUBCONST: ", i - (-32769));
1063 p("IMULCONST: ", i * (-32769));
1064 p("ISHLCONST: ", i << (-32769));
1065 p("ISHRCONST: ", i >> (-32769));
1066 p("IUSHRCONST: ", i >>> (-32769));
1067 p("IANDCONST: ", i & (-32769));
1068 p("IORCONST: ", i | (-32769));
1069 p("IXORCONST: ", i ^ (-32769));
1071 if (!(i == (-32769))) p("not IF_ICMPEQ", (-32769));
1072 if (!(i != (-32769))) p("not IF_ICMPNE", (-32769));
1073 if (!(i < (-32769))) p("not IF_ICMPLT", (-32769));
1074 if (!(i <= (-32769))) p("not IF_ICMPLE", (-32769));
1075 if (!(i > (-32769))) p("not IF_ICMPGT", (-32769));
1076 if (!(i >= (-32769))) p("not IF_ICMPGE", (-32769));
1078 p("LADDCONST: ", l + (-32769));
1079 p("LSUBCONST: ", l - (-32769));
1080 p("LMULCONST: ", l * (-32769));
1081 p("LSHLCONST: ", l << (-32769));
1082 p("LSHRCONST: ", l >> (-32769));
1083 p("LUSHRCONST: ", l >>> (-32769));
1084 p("LANDCONST: ", l & (-32769));
1085 p("LORCONST: ", l | (-32769));
1086 p("LXORCONST: ", l ^ (-32769));
1088 if (!(l == (-32769))) p("not IF_LCMPEQ", (-32769));
1089 if (!(l != (-32769))) p("not IF_LCMPNE", (-32769));
1090 if (!(l < (-32769))) p("not IF_LCMPLT", (-32769));
1091 if (!(l <= (-32769))) p("not IF_LCMPLE", (-32769));
1092 if (!(l > (-32769))) p("not IF_LCMPGT", (-32769));
1093 if (!(l >= (-32769))) p("not IF_LCMPGE", (-32769));
1097 static public void testrem0x10001(int a) {
1098 p("IREM0X10001 (" + a + " % 0x10001): ", a % 0x10001);
1101 static public void testrem0x10001(long a) {
1102 p("LREM0X10001 (" + a + " % 0x10001): ", a % 0x10001L);
1105 static public void testdivremconst(int a) {
1106 p("IDIVPOW2 (" + a + " / 0x00000002): ", a / 0x00000002);
1107 p("IDIVPOW2 (" + a + " / 0x00000004): ", a / 0x00000004);
1108 p("IDIVPOW2 (" + a + " / 0x00000008): ", a / 0x00000008);
1109 p("IDIVPOW2 (" + a + " / 0x00000010): ", a / 0x00000010);
1110 p("IDIVPOW2 (" + a + " / 0x00000020): ", a / 0x00000020);
1111 p("IDIVPOW2 (" + a + " / 0x00000040): ", a / 0x00000040);
1112 p("IDIVPOW2 (" + a + " / 0x00000080): ", a / 0x00000080);
1113 p("IDIVPOW2 (" + a + " / 0x00000100): ", a / 0x00000100);
1114 p("IDIVPOW2 (" + a + " / 0x00000200): ", a / 0x00000200);
1115 p("IDIVPOW2 (" + a + " / 0x00000400): ", a / 0x00000400);
1116 p("IDIVPOW2 (" + a + " / 0x00000800): ", a / 0x00000800);
1117 p("IDIVPOW2 (" + a + " / 0x00001000): ", a / 0x00001000);
1118 p("IDIVPOW2 (" + a + " / 0x00002000): ", a / 0x00002000);
1119 p("IDIVPOW2 (" + a + " / 0x00004000): ", a / 0x00004000);
1120 p("IDIVPOW2 (" + a + " / 0x00008000): ", a / 0x00008000);
1121 p("IDIVPOW2 (" + a + " / 0x00010000): ", a / 0x00010000);
1122 p("IDIVPOW2 (" + a + " / 0x00020000): ", a / 0x00020000);
1123 p("IDIVPOW2 (" + a + " / 0x00040000): ", a / 0x00040000);
1124 p("IDIVPOW2 (" + a + " / 0x00080000): ", a / 0x00080000);
1125 p("IDIVPOW2 (" + a + " / 0x00100000): ", a / 0x00100000);
1126 p("IDIVPOW2 (" + a + " / 0x00200000): ", a / 0x00200000);
1127 p("IDIVPOW2 (" + a + " / 0x00400000): ", a / 0x00400000);
1128 p("IDIVPOW2 (" + a + " / 0x00800000): ", a / 0x00800000);
1129 p("IDIVPOW2 (" + a + " / 0x01000000): ", a / 0x01000000);
1130 p("IDIVPOW2 (" + a + " / 0x02000000): ", a / 0x02000000);
1131 p("IDIVPOW2 (" + a + " / 0x04000000): ", a / 0x04000000);
1132 p("IDIVPOW2 (" + a + " / 0x08000000): ", a / 0x08000000);
1133 p("IDIVPOW2 (" + a + " / 0x10000000): ", a / 0x10000000);
1134 p("IDIVPOW2 (" + a + " / 0x20000000): ", a / 0x20000000);
1135 p("IDIVPOW2 (" + a + " / 0x40000000): ", a / 0x40000000);
1136 p("IDIVPOW2 (" + a + " / 0x80000000): ", a / 0x80000000);
1138 p("IREMPOW2 (" + a + " % 0x00000002): ", a % 0x00000002);
1139 p("IREMPOW2 (" + a + " % 0x00000004): ", a % 0x00000004);
1140 p("IREMPOW2 (" + a + " % 0x00000008): ", a % 0x00000008);
1141 p("IREMPOW2 (" + a + " % 0x00000010): ", a % 0x00000010);
1142 p("IREMPOW2 (" + a + " % 0x00000020): ", a % 0x00000020);
1143 p("IREMPOW2 (" + a + " % 0x00000040): ", a % 0x00000040);
1144 p("IREMPOW2 (" + a + " % 0x00000080): ", a % 0x00000080);
1145 p("IREMPOW2 (" + a + " % 0x00000100): ", a % 0x00000100);
1146 p("IREMPOW2 (" + a + " % 0x00000200): ", a % 0x00000200);
1147 p("IREMPOW2 (" + a + " % 0x00000400): ", a % 0x00000400);
1148 p("IREMPOW2 (" + a + " % 0x00000800): ", a % 0x00000800);
1149 p("IREMPOW2 (" + a + " % 0x00001000): ", a % 0x00001000);
1150 p("IREMPOW2 (" + a + " % 0x00002000): ", a % 0x00002000);
1151 p("IREMPOW2 (" + a + " % 0x00004000): ", a % 0x00004000);
1152 p("IREMPOW2 (" + a + " % 0x00008000): ", a % 0x00008000);
1153 p("IREMPOW2 (" + a + " % 0x00010000): ", a % 0x00010000);
1154 p("IREMPOW2 (" + a + " % 0x00020000): ", a % 0x00020000);
1155 p("IREMPOW2 (" + a + " % 0x00040000): ", a % 0x00040000);
1156 p("IREMPOW2 (" + a + " % 0x00080000): ", a % 0x00080000);
1157 p("IREMPOW2 (" + a + " % 0x00100000): ", a % 0x00100000);
1158 p("IREMPOW2 (" + a + " % 0x00200000): ", a % 0x00200000);
1159 p("IREMPOW2 (" + a + " % 0x00400000): ", a % 0x00400000);
1160 p("IREMPOW2 (" + a + " % 0x00800000): ", a % 0x00800000);
1161 p("IREMPOW2 (" + a + " % 0x01000000): ", a % 0x01000000);
1162 p("IREMPOW2 (" + a + " % 0x02000000): ", a % 0x02000000);
1163 p("IREMPOW2 (" + a + " % 0x04000000): ", a % 0x04000000);
1164 p("IREMPOW2 (" + a + " % 0x08000000): ", a % 0x08000000);
1165 p("IREMPOW2 (" + a + " % 0x10000000): ", a % 0x10000000);
1166 p("IREMPOW2 (" + a + " % 0x20000000): ", a % 0x20000000);
1167 p("IREMPOW2 (" + a + " % 0x40000000): ", a % 0x40000000);
1168 p("IREMPOW2 (" + a + " % 0x80000000): ", a % 0x80000000);
1171 static public void testdivremconst(long a) {
1172 p("LDIVPOW2 (" + a + " / 0x00000002): ", a / 0x00000002);
1173 p("LDIVPOW2 (" + a + " / 0x00000004): ", a / 0x00000004);
1174 p("LDIVPOW2 (" + a + " / 0x00000008): ", a / 0x00000008);
1175 p("LDIVPOW2 (" + a + " / 0x00000010): ", a / 0x00000010);
1176 p("LDIVPOW2 (" + a + " / 0x00000020): ", a / 0x00000020);
1177 p("LDIVPOW2 (" + a + " / 0x00000040): ", a / 0x00000040);
1178 p("LDIVPOW2 (" + a + " / 0x00000080): ", a / 0x00000080);
1179 p("LDIVPOW2 (" + a + " / 0x00000100): ", a / 0x00000100);
1180 p("LDIVPOW2 (" + a + " / 0x00000200): ", a / 0x00000200);
1181 p("LDIVPOW2 (" + a + " / 0x00000400): ", a / 0x00000400);
1182 p("LDIVPOW2 (" + a + " / 0x00000800): ", a / 0x00000800);
1183 p("LDIVPOW2 (" + a + " / 0x00001000): ", a / 0x00001000);
1184 p("LDIVPOW2 (" + a + " / 0x00002000): ", a / 0x00002000);
1185 p("LDIVPOW2 (" + a + " / 0x00004000): ", a / 0x00004000);
1186 p("LDIVPOW2 (" + a + " / 0x00008000): ", a / 0x00008000);
1187 p("LDIVPOW2 (" + a + " / 0x00010000): ", a / 0x00010000);
1188 p("LDIVPOW2 (" + a + " / 0x00020000): ", a / 0x00020000);
1189 p("LDIVPOW2 (" + a + " / 0x00040000): ", a / 0x00040000);
1190 p("LDIVPOW2 (" + a + " / 0x00080000): ", a / 0x00080000);
1191 p("LDIVPOW2 (" + a + " / 0x00100000): ", a / 0x00100000);
1192 p("LDIVPOW2 (" + a + " / 0x00200000): ", a / 0x00200000);
1193 p("LDIVPOW2 (" + a + " / 0x00400000): ", a / 0x00400000);
1194 p("LDIVPOW2 (" + a + " / 0x00800000): ", a / 0x00800000);
1195 p("LDIVPOW2 (" + a + " / 0x01000000): ", a / 0x01000000);
1196 p("LDIVPOW2 (" + a + " / 0x02000000): ", a / 0x02000000);
1197 p("LDIVPOW2 (" + a + " / 0x04000000): ", a / 0x04000000);
1198 p("LDIVPOW2 (" + a + " / 0x08000000): ", a / 0x08000000);
1199 p("LDIVPOW2 (" + a + " / 0x10000000): ", a / 0x10000000);
1200 p("LDIVPOW2 (" + a + " / 0x20000000): ", a / 0x20000000);
1201 p("LDIVPOW2 (" + a + " / 0x40000000): ", a / 0x40000000);
1202 p("LDIVPOW2 (" + a + " / 0x80000000): ", a / 0x80000000);
1204 p("LREMPOW2 (" + a + " % 0x00000002): ", a % 0x00000002L);
1205 p("LREMPOW2 (" + a + " % 0x00000004): ", a % 0x00000004L);
1206 p("LREMPOW2 (" + a + " % 0x00000008): ", a % 0x00000008L);
1207 p("LREMPOW2 (" + a + " % 0x00000010): ", a % 0x00000010L);
1208 p("LREMPOW2 (" + a + " % 0x00000020): ", a % 0x00000020L);
1209 p("LREMPOW2 (" + a + " % 0x00000040): ", a % 0x00000040L);
1210 p("LREMPOW2 (" + a + " % 0x00000080): ", a % 0x00000080L);
1211 p("LREMPOW2 (" + a + " % 0x00000100): ", a % 0x00000100L);
1212 p("LREMPOW2 (" + a + " % 0x00000200): ", a % 0x00000200L);
1213 p("LREMPOW2 (" + a + " % 0x00000400): ", a % 0x00000400L);
1214 p("LREMPOW2 (" + a + " % 0x00000800): ", a % 0x00000800L);
1215 p("LREMPOW2 (" + a + " % 0x00001000): ", a % 0x00001000L);
1216 p("LREMPOW2 (" + a + " % 0x00002000): ", a % 0x00002000L);
1217 p("LREMPOW2 (" + a + " % 0x00004000): ", a % 0x00004000L);
1218 p("LREMPOW2 (" + a + " % 0x00008000): ", a % 0x00008000L);
1219 p("LREMPOW2 (" + a + " % 0x00010000): ", a % 0x00010000L);
1220 p("LREMPOW2 (" + a + " % 0x00020000): ", a % 0x00020000L);
1221 p("LREMPOW2 (" + a + " % 0x00040000): ", a % 0x00040000L);
1222 p("LREMPOW2 (" + a + " % 0x00080000): ", a % 0x00080000L);
1223 p("LREMPOW2 (" + a + " % 0x00100000): ", a % 0x00100000L);
1224 p("LREMPOW2 (" + a + " % 0x00200000): ", a % 0x00200000L);
1225 p("LREMPOW2 (" + a + " % 0x00400000): ", a % 0x00400000L);
1226 p("LREMPOW2 (" + a + " % 0x00800000): ", a % 0x00800000L);
1227 p("LREMPOW2 (" + a + " % 0x01000000): ", a % 0x01000000L);
1228 p("LREMPOW2 (" + a + " % 0x02000000): ", a % 0x02000000L);
1229 p("LREMPOW2 (" + a + " % 0x04000000): ", a % 0x04000000L);
1230 p("LREMPOW2 (" + a + " % 0x08000000): ", a % 0x08000000L);
1231 p("LREMPOW2 (" + a + " % 0x10000000): ", a % 0x10000000L);
1232 p("LREMPOW2 (" + a + " % 0x20000000): ", a % 0x20000000L);
1233 p("LREMPOW2 (" + a + " % 0x40000000): ", a % 0x40000000L);
1234 p("LREMPOW2 (" + a + " % 0x80000000): ", a % 0x80000000L);
1238 static public void testint(int a, int b) {
1239 p ("TESTINT CALLED WITH ", a);
1245 try { p("IDIV: ", a/b); }
1246 catch (ArithmeticException e) { p("divison by zero"); }
1247 try { p("IREM: ", a%b); }
1248 catch (ArithmeticException e) { p("divison by zero"); }
1252 p("IUSHR: ", a>>>b);
1257 p("I2L: ", (long) a);
1258 p("I2F: ", (float) a);
1259 p("I2D: ", (double) a);
1260 p("INT2BYTE: ", (byte) a);
1261 p("INT2CHAR: ", (char) a);
1262 p("INT2SHORT: ", (short) a);
1264 if (!(a==0)) p("not IFEQ");
1265 if (!(a!=0)) p("not IFNE");
1266 if (!(a<0)) p("not IFLT");
1267 if (!(a<=0)) p("not IFLE");
1268 if (!(a>0)) p("not IFGT");
1269 if (!(a>=0)) p("not IFGE");
1271 if (!(a==b)) p("not IF_ICMPEQ");
1272 if (!(a!=b)) p("not IF_ICMPNE");
1273 if (!(a<b)) p("not IF_ICMPLT");
1274 if (!(a<=b)) p("not IF_ICMPLE");
1275 if (!(a>b)) p("not IF_ICMPGT");
1276 if (!(a>=b)) p("not IF_ICMPGE");
1278 p("COND_ICMPEQ " + a + " == 0: " + ((a == 0) ? 0 : 1));
1279 p("COND_ICMPNE " + a + " != 0: " + ((a != 0) ? 0 : 1));
1280 p("COND_ICMPLT " + a + " < 0: " + ((a < 0) ? 0 : 1));
1281 p("COND_ICMPLE " + a + " <= 0: " + ((a <= 0) ? 0 : 1));
1282 p("COND_ICMPGT " + a + " > 0: " + ((a > 0) ? 0 : 1));
1283 p("COND_ICMPGE " + a + " >= 0: " + ((a >= 0) ? 0 : 1));
1285 p("COND_ICMPEQ " + a + " == 0: " + ((a == 0) ? 1 : 0));
1286 p("COND_ICMPNE " + a + " != 0: " + ((a != 0) ? 1 : 0));
1287 p("COND_ICMPLT " + a + " < 0: " + ((a < 0) ? 1 : 0));
1288 p("COND_ICMPLE " + a + " <= 0: " + ((a <= 0) ? 1 : 0));
1289 p("COND_ICMPGT " + a + " > 0: " + ((a > 0) ? 1 : 0));
1290 p("COND_ICMPGE " + a + " >= 0: " + ((a >= 0) ? 1 : 0));
1292 p("COND_ICMPEQ " + a + " == 0: " + ((a == 0) ? 2 : 3));
1293 p("COND_ICMPNE " + a + " != 0: " + ((a != 0) ? 2 : 3));
1294 p("COND_ICMPLT " + a + " < 0: " + ((a < 0) ? 2 : 3));
1295 p("COND_ICMPLE " + a + " <= 0: " + ((a <= 0) ? 2 : 3));
1296 p("COND_ICMPGT " + a + " > 0: " + ((a > 0) ? 2 : 3));
1297 p("COND_ICMPGE " + a + " >= 0: " + ((a >= 0) ? 2 : 3));
1299 p("COND_ICMPEQ " + a + " == " + b + ": " + (a == b));
1300 p("COND_ICMPNE " + a + " != " + b + ": " + (a != b));
1301 p("COND_ICMPLT " + a + " < " + b + ": " + (a < b));
1302 p("COND_ICMPLE " + a + " <= " + b + ": " + (a <= b));
1303 p("COND_ICMPGT " + a + " > " + b + ": " + (a > b));
1304 p("COND_ICMPGE " + a + " >= " + b + ": " + (a >= b));
1308 static public void testlong(long a, long b) {
1309 p ("TESTLONG called with ", a);
1315 try { p("LDIV: ", a / b); }
1316 catch (ArithmeticException e) { p("divison by zero"); }
1317 try { p("LREM: ", a % b); }
1318 catch (ArithmeticException e) { p("divison by zero"); }
1320 p("LSHL: ", a << b);
1321 p("LSHR: ", a >> b);
1322 p("LUSHR: ", a >>>b);
1327 p("L2I: ", (int) a);
1328 p("L2F: ", (float) a);
1329 p("L2D: ", (double) a);
1331 p("LCMP a == b : ", a == b);
1332 p("LCMP a != b : ", a != b);
1333 p("LCMP a < b : ", a < b);
1334 p("LCMP a <= b : ", a <= b);
1335 p("LCMP a > b : ", a > b);
1336 p("LCMP a >= b : ", a >= b);
1338 if ((a==b)) p("not IF_LCMPEQ");
1339 if ((a!=b)) p("not IF_LCMPNE");
1340 if ((a<b)) p("not IF_LCMPLT");
1341 if ((a<=b)) p("not IF_LCMPLE");
1342 if ((a>b)) p("not IF_LCMPGT");
1343 if ((a>=b)) p("not IF_LCMPGE");
1346 static public void testfloat(float a, float b) {
1347 p ("TESTFLOAT called with ", a);
1356 p("F2I: ", (int) a);
1357 p("F2L: ", (long) a);
1358 p("F2D: ", (double) a);
1360 if ((a==b)) p("FCMP a=b");
1361 if ((a!=b)) p("FCMP a!=b");
1362 if ((a<b)) p("FCMP a<b");
1363 if ((a<=b)) p("FCMP a<=b");
1364 if ((a>b)) p("FCMP a>b");
1365 if ((a>=b)) p("FCMP a>=b");
1368 static public void testdouble(double a, double b) {
1369 p ("TESTDOUBLE called with ", a);
1378 p("D2I: ", (int) a);
1379 p("D2L: ", (long) a);
1380 p("D2F: ", (float) a);
1382 if ((a==b)) p("DCMP a=b");
1383 if ((a!=b)) p("DCMP a!=b");
1384 if ((a<b)) p("DCMP a<b");
1385 if ((a<=b)) p("DCMP a<=b");
1386 if ((a>b)) p("DCMP a>b");
1387 if ((a>=b)) p("DCMP a>=b");
1391 // ********************* output methods ****************************
1393 public static int linenum = 0;
1394 public static void pnl() {
1395 System.out.println ();
1396 System.out.print (linenum);
1397 System.out.print (". ");
1401 public static void p(String a) { System.out.print(a); pnl(); }
1402 public static void p(boolean a) {System.out.print(a);
1404 public static void p(int a) { System.out.print ("int: ");
1405 System.out.print(a);
1407 public static void p(long a) { System.out.print ("long: ");
1408 System.out.print(a);
1410 public static void p(short a) { System.out.print ("short: ");
1411 System.out.print(a);
1413 public static void p(byte a) { System.out.print ("byte: ");
1414 System.out.print(a);
1416 public static void p(char a) { System.out.print ("char: ");
1417 System.out.print((int)a);
1419 public static void p(float a) { System.out.print ("float: ");
1420 System.out.print ( java.lang.Float.floatToIntBits(a) );
1422 public static void p(double a) { System.out.print ("double: ");
1423 System.out.print( java.lang.Double.doubleToLongBits(a) );
1426 public static void p(String s,boolean i) {
1427 System.out.print(s); p(i);
1429 public static void p(String s,int i) {
1430 System.out.print(s); p(i);
1432 public static void p(String s,byte i) {
1433 System.out.print(s); p(i);
1435 public static void p(String s,char i) {
1436 System.out.print(s); p(i);
1438 public static void p(String s,short i) {
1439 System.out.print(s); p(i);
1441 public static void p(String s,long l) {
1442 System.out.print(s); p(l);
1444 public static void p(String s,float f) {
1445 System.out.print(s); p(f);
1447 public static void p(String s,double d) {
1448 System.out.print(s); p(d);
1454 // methods for testing interface and method calls
1456 public void jctest() { p (" <init> wird aktiviert"); };
1457 public void p_manyparam (int p_i1,int p_i2,
1459 long p_l1,long p_l2,
1460 long p_l3,long p_l4,
1461 float p_f1, float p_f2,
1462 float p_f3, float p_f4,
1463 double p_d1, double p_d2,
1464 double p_d3, double p_d4) {
1483 public void p_nonstatic (String a) {
1507 interface jcinterface {
1508 public void p_nonstatic (String a);