Home | History | Annotate | Download | only in src
      1 public class Main {
      2 
      3   static void testI1(int p1) {
      4      System.out.println(p1);
      5   }
      6   static void testI2(int p1, int p2) {
      7      System.out.println(p1+", "+p2);
      8   }
      9   static void testI3(int p1, int p2, int p3) {
     10      System.out.println(p1+", "+p2+", "+p3);
     11   }
     12   static void testI4(int p1, int p2, int p3, int p4) {
     13      System.out.println(p1+", "+p2+", "+p3+", "+p4);
     14   }
     15   static void testI5(int p1, int p2, int p3, int p4, int p5) {
     16      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5);
     17   }
     18   static void testI6(int p1, int p2, int p3, int p4, int p5, int p6) {
     19      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6);
     20   }
     21   static void testI7(int p1, int p2, int p3, int p4, int p5, int p6, int p7) {
     22      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7);
     23   }
     24   static void testI8(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) {
     25      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8);
     26   }
     27   static void testI9(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9) {
     28      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9);
     29   }
     30   static void testI10(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10) {
     31      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9+", "+p10);
     32   }
     33   static void testI11(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10, int p11) {
     34      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9+", "+p10+", "+p11);
     35   }
     36   static void testI12(int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10, int p11, int p12) {
     37      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9+", "+p10+", "+p11+", "+p12);
     38   }
     39   void testI6_nonstatic(int p1, int p2, int p3, int p4, int p5, int p6) {
     40      System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6);
     41   }
     42 
     43   static void testB1(boolean p1) {
     44     System.out.println(p1);
     45   }
     46   static void testB2(boolean p1, boolean p2) {
     47     System.out.println(p1+", "+p2);
     48   }
     49   static void testB3(boolean p1, boolean p2, boolean p3) {
     50     System.out.println(p1+", "+p2+", "+p3);
     51   }
     52   static void testB4(boolean p1, boolean p2, boolean p3, boolean p4) {
     53     System.out.println(p1+", "+p2+", "+p3+", "+p4);
     54   }
     55   static void testB5(boolean p1, boolean p2, boolean p3, boolean p4, boolean p5) {
     56     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5);
     57   }
     58   static void testB6(boolean p1, boolean p2, boolean p3, boolean p4, boolean p5, boolean p6) {
     59     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6);
     60   }
     61   static void testB7(boolean p1, boolean p2, boolean p3, boolean p4, boolean p5, boolean p6, boolean p7) {
     62     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7);
     63   }
     64 
     65   static void testO1(Object p1) {
     66     System.out.println(p1);
     67   }
     68   static void testO2(Object p1, Object p2) {
     69     System.out.println(p1+", "+p2);
     70   }
     71   static void testO3(Object p1, Object p2, Object p3) {
     72     System.out.println(p1+", "+p2+", "+p3);
     73   }
     74   static void testO4(Object p1, Object p2, Object p3, Object p4) {
     75     System.out.println(p1+", "+p2+", "+p3+", "+p4);
     76   }
     77   static void testO5(Object p1, Object p2, Object p3, Object p4, Object p5) {
     78     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5);
     79   }
     80   static void testO6(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) {
     81     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6);
     82   }
     83   static void testO7(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) {
     84     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7);
     85   }
     86 
     87   static void testIOB1(int p1) {
     88     System.out.println(p1);
     89   }
     90   static void testIOB2(int p1, Object p2) {
     91     System.out.println(p1+", "+p2);
     92   }
     93   static void testIOB3(int p1, Object p2, boolean p3) {
     94     System.out.println(p1+", "+p2+", "+p3);
     95   }
     96   static void testIOB4(int p1, Object p2, boolean p3, int p4) {
     97     System.out.println(p1+", "+p2+", "+p3+", "+p4);
     98   }
     99   static void testIOB5(int p1, Object p2, boolean p3, int p4, Object p5) {
    100     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5);
    101   }
    102   static void testIOB6(int p1, Object p2, boolean p3, int p4, Object p5, boolean p6) {
    103     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6);
    104   }
    105   static void testIOB7(int p1, Object p2, boolean p3, int p4, Object p5, boolean p6, int p7) {
    106     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7);
    107   }
    108 
    109   static void testF1(float p1) {
    110     System.out.println(p1);
    111   }
    112   static void testF2(float p1, float p2) {
    113     System.out.println(p1+", "+p2);
    114   }
    115   static void testF3(float p1, float p2, float p3) {
    116     System.out.println(p1+", "+p2+", "+p3);
    117   }
    118   static void testF4(float p1, float p2, float p3, float p4) {
    119     System.out.println(p1+", "+p2+", "+p3+", "+p4);
    120   }
    121   static void testF5(float p1, float p2, float p3, float p4, float p5) {
    122     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5);
    123   }
    124   static void testF6(float p1, float p2, float p3, float p4, float p5, float p6) {
    125     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6);
    126   }
    127   static void testF7(float p1, float p2, float p3, float p4, float p5, float p6, float p7) {
    128     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7);
    129   }
    130   static void testF8(float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8) {
    131     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8);
    132   }
    133   static void testF9(float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8, float p9) {
    134     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9);
    135   }
    136   static void testF10(float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8, float p9, float p10) {
    137     System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9+", "+p10);
    138   }
    139 
    140   static void testD1 (double p1) { System.out.println(p1); }
    141   static void testD2 (double p1, double p2) { System.out.println(p1+", "+p2); }
    142   static void testD3 (double p1, double p2, double p3) { System.out.println(p1+", "+p2+", "+p3); }
    143   static void testD4 (double p1, double p2, double p3, double p4) { System.out.println(p1+", "+p2+", "+p3+", "+p4); }
    144   static void testD5 (double p1, double p2, double p3, double p4, double p5) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5); }
    145   static void testD6 (double p1, double p2, double p3, double p4, double p5, double p6) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6); }
    146   static void testD7 (double p1, double p2, double p3, double p4, double p5, double p6, double p7) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7); }
    147   static void testD8 (double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8); }
    148   static void testD9 (double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8, double p9) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9); }
    149   static void testD9f (float p0, double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8, double p9) { System.out.println(p0+", "+p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9); }
    150   static void testD10(double p1, double p2, double p3, double p4, double p5, double p6, double p7, double p8, double p9, double p10) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9+", "+p10); }
    151 
    152   static void testI() {
    153     testI1(11);
    154     testI2(21, 22);
    155     testI3(31, 32, 33);
    156     testI4(41, 42, 43, 44);
    157     testI5(51, 52, 53, 54, 55);
    158     testI6(61, 62, 63, 64, 65, 66);
    159     testI7(71, 72, 73, 74, 75, 76, 77);
    160     testI8(81, 82, 83, 84, 85, 86, 87, 88);
    161     testI9(91, 92, 93, 94, 95, 96, 97, 98, 99);
    162     testI10(101, 102, 103, 104, 105, 106, 107, 108, 109, 110);
    163     testI11(111, 112, 113, 114, 115, 116, 117, 118, 119, 1110, 1111);
    164     testI12(121, 122, 123, 124, 125, 126, 127, 128, 129, 1210, 1211, 1212);
    165     new Main().testI6_nonstatic(61, 62, 63, 64, 65, 66);
    166   }
    167 
    168   static void testB() {
    169     testB1(true);
    170     testB2(true, false);
    171     testB3(true, false, true);
    172     testB4(true, false, true, false);
    173     testB5(true, false, true, false, true);
    174     testB6(true, false, true, false, true, false);
    175     testB7(true, false, true, false, true, false, true);
    176   }
    177 
    178   static void testO() {
    179     testO1("a");
    180     testO2("a", "b");
    181     testO3("a", "b", "c");
    182     testO4("a", "b", "c", "d");
    183     testO5("a", "b", "c", "d", "e");
    184     testO6("a", "b", "c", "d", "e", "f");
    185     testO7("a", "b", "c", "d", "e", "f", "g");
    186   }
    187 
    188   static void testIOB() {
    189     testIOB1(11);
    190     testIOB2(11, "b");
    191     testIOB3(11, "b", true);
    192     testIOB4(11, "b", true, 12);
    193     testIOB5(11, "b", true, 12, "e");
    194     testIOB6(11, "b", true, 12, "e", false);
    195     testIOB7(11, "b", true, 12, "e", false, 13);
    196   }
    197 
    198   static void testF() {
    199     testF1(1.1f);
    200     testF2(2.1f, 2.2f);
    201     testF3(3.1f, 3.2f, 3.3f);
    202     testF4(4.1f, 4.2f, 4.3f, 4.4f);
    203     testF5(5.1f, 5.2f, 5.3f, 5.4f, 5.5f);
    204     testF6(6.1f, 6.2f, 6.3f, 6.4f, 6.5f, 6.6f);
    205     testF7(7.1f, 7.2f, 7.3f, 7.4f, 7.5f, 7.6f, 7.7f);
    206     testF8(8.1f, 8.2f, 8.3f, 8.4f, 8.5f, 8.6f, 8.7f, 8.8f);
    207     testF9(9.1f, 9.2f, 9.3f, 9.4f, 9.5f, 9.6f, 9.7f, 9.8f, 9.9f);
    208     testF10(10.1f, 10.2f, 10.3f, 10.4f, 10.5f, 10.6f, 10.7f, 10.8f, 10.9f, 10.1f);
    209   }
    210 
    211   static void testD() {
    212 
    213     testD1(1.01);
    214     testD2(2.01, 2.02);
    215     testD3(3.01, 3.02, 3.03);
    216     testD4(4.01, 4.02, 4.03, 4.04);
    217     testD5(5.01, 5.02, 5.03, 5.04, 5.05);
    218     testD6(6.01, 6.02, 6.03, 6.04, 6.05, 6.06);
    219     testD7(7.01, 7.02, 7.03, 7.04, 7.05, 7.06, 7.07);
    220     testD8(8.01, 8.02, 8.03, 8.04, 8.05, 8.06, 8.07, 8.08);
    221     testD9(9.01, 9.02, 9.03, 9.04, 9.05, 9.06, 9.07, 9.08, 9.09);
    222     testD9f(-1.1f, 9.01, 9.02, 9.03, 9.04, 9.05, 9.06, 9.07, 9.08, 9.09);
    223 
    224     // TODO: 10.01 as first arg fails: 10.009994506835938
    225     testD10(10.01, 10.02, 10.03, 10.04, 10.05, 10.06, 10.07, 10.08, 10.09, 10.01);
    226   }
    227 
    228   static void testL1(long p1) { System.out.println(p1); }
    229 //  static void testL2x(long p1, long p2) { testL2(p1+p2, p2); }  // TODO(64) GenAddLong 64BIT_TEMP
    230   static void testL2(long p1, long p2) { System.out.println(p1+", "+p2); }
    231   static void testL3(long p1, long p2, long p3) { System.out.println(p1+", "+p2+", "+p3); }
    232   static void testL4(long p1, long p2, long p3, long p4) { System.out.println(p1+", "+p2+", "+p3+", "+p4); }
    233   static void testL5(long p1, long p2, long p3, long p4, long p5) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5); }
    234   static void testL6(long p1, long p2, long p3, long p4, long p5, long p6) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6); }
    235   static void testL7(long p1, long p2, long p3, long p4, long p5, long p6, long p7) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7); }
    236   static void testL8(long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8); }
    237   static void testL9(long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8, long p9) { System.out.println(p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9); }
    238 
    239   static void testL9i(int p0, long p1, long p2, long p3, long p4, long p5, long p6, long p7, long p8, long p9) { System.out.println(p0+", "+p1+", "+p2+", "+p3+", "+p4+", "+p5+", "+p6+", "+p7+", "+p8+", "+p9); }
    240 
    241   static void testL() {
    242 //        testL2x(100021, 100022);
    243         testL1(100011);
    244         testL2(100021, 100022);
    245         testL3(100031, 100032, 100033);
    246         testL4(100041, 100042, 100043, 100044);
    247         testL5(100051, 100052, 100053, 100054, 100055);
    248         testL6(100061, 100062, 100063, 100064, 100065, 100066);
    249         testL7(100071, 100072, 100073, 100074, 100075, 100076, 100077);
    250         testL8(100081, 100082, 100083, 100084, 100085, 100086, 100087, 100088);
    251         testL9(100091, 100092, 100093, 100094, 100095, 100096, 100097, 100098, 100099);
    252   }
    253 
    254   static void testLL() {
    255         testL1(100100100100011L);
    256 
    257         testL1(-11L);
    258         testL2(-21L, -22L);
    259         testL3(-31L, -32L, -33L);
    260         testL4(-41L, -42L, -43L, -44L);
    261         testL5(-51L, -52L, -53L, -54L, -55L);
    262         testL6(-61L, -62L, -63L, -64L, -65L, -66L);
    263         testL7(-71L, -72L, -73L, -74L, -75L, -76L, -77L);
    264         testL8(-81L, -82L, -83L, -84L, -85L, -86L, -87L, -88L);
    265         testL9(-91L, -92L, -93L, -94L, -95L, -96L, -97L, -98L, -99L);
    266         testL9i(-1, -91L, -92L, -93L, -94L, -95L, -96L, -97L, -98L, -99L);
    267 
    268         // TODO(64) GenAddLong 64BIT_TEMP
    269 //        testL2x(100100100100011L, 1L);
    270 //        testL2x(100100100100011L, 100100100100011L);
    271   }
    272 
    273   static void testMore(int i1, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, int i2, int i3, int i4, int i5, int i6) {
    274     System.out.println(i1+", "+d1+", "+d2+", "+d3+", "+d4+", "+d5+", "+d6+", "+d7+", "+d8+", "+d9+", "+i2+", "+i3+", "+i4+", "+i5+", "+i6);
    275   }
    276 
    277   static void testRefs1(Object o1, Object o2, Object o3, Object o4, Object o5, long l1, long l2, long l3) {
    278     System.out.println(l1 + ", " + l2 + ", " + l3);
    279   }
    280 
    281   static void testRefs(Object o1, Object o2, Object o3, Object o4, Object o5, long l1, long l2, long l3) {
    282     testRefs1(o1, o2, o3, o4, o5, l1, l2, l3);
    283   }
    284 
    285   static public void main(String[] args) throws Exception {
    286     testI();
    287     testB();
    288     testO();
    289     testIOB();
    290     testF();
    291 
    292     testD();
    293 
    294     testL();
    295 
    296     testLL();
    297 
    298     testMore(1, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 2, 3, 4, 5, 6);
    299 
    300     Object obj = new Object();
    301     testRefs(obj, obj, obj, obj, obj, 0x1122334455667788L, 0x8877665544332211L, 0x1122334455667788L);
    302   }
    303 }
    304