1 package dot.junit.opcodes.shl_int_lit8; 2 3 import dot.junit.DxTestCase; 4 import dot.junit.DxUtil; 5 import dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_1; 6 import dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_2; 7 import dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_3; 8 import dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_4; 9 import dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_5; 10 import dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_6; 11 12 public class Test_shl_int_lit8 extends DxTestCase { 13 14 /** 15 * @title 15 << 1 16 */ testN1()17 public void testN1() { 18 T_shl_int_lit8_1 t = new T_shl_int_lit8_1(); 19 assertEquals(30, t.run(15)); 20 } 21 22 /** 23 * @title 33 << 2 24 */ testN2()25 public void testN2() { 26 T_shl_int_lit8_2 t = new T_shl_int_lit8_2(); 27 assertEquals(132, t.run(33)); 28 } 29 30 /** 31 * @title -15 << 1 32 */ testN3()33 public void testN3() { 34 T_shl_int_lit8_1 t = new T_shl_int_lit8_1(); 35 assertEquals(-30, t.run(-15)); 36 } 37 38 /** 39 * @title Arguments = 1 & -1 40 */ testN4()41 public void testN4() { 42 T_shl_int_lit8_3 t = new T_shl_int_lit8_3(); 43 assertEquals(0x80000000, t.run(1)); 44 } 45 46 /** 47 * @title Verify that shift distance is actually in range 0 to 32. 48 */ testN5()49 public void testN5() { 50 T_shl_int_lit8_4 t = new T_shl_int_lit8_4(); 51 assertEquals(66, t.run(33)); 52 } 53 54 55 56 /** 57 * @title Arguments = 0 & -1 58 */ testB1()59 public void testB1() { 60 T_shl_int_lit8_3 t = new T_shl_int_lit8_3(); 61 assertEquals(0, t.run(0)); 62 } 63 64 /** 65 * @title Arguments = Integer.MAX_VALUE & 1 66 */ testB2()67 public void testB2() { 68 T_shl_int_lit8_1 t = new T_shl_int_lit8_1(); 69 assertEquals(0xfffffffe, t.run(Integer.MAX_VALUE)); 70 } 71 72 /** 73 * @title Arguments = Integer.MIN_VALUE & 1 74 */ testB3()75 public void testB3() { 76 T_shl_int_lit8_1 t = new T_shl_int_lit8_1(); 77 assertEquals(0, t.run(Integer.MIN_VALUE)); 78 } 79 80 /** 81 * @title Arguments = 1 & 0 82 */ testB4()83 public void testB4() { 84 T_shl_int_lit8_5 t = new T_shl_int_lit8_5(); 85 assertEquals(1, t.run(1)); 86 } 87 88 /** 89 * @constraint A23 90 * @title number of registers 91 */ testVFE1()92 public void testVFE1() { 93 load("dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_7", VerifyError.class); 94 } 95 96 97 98 /** 99 * @constraint B1 100 * @title types of arguments - double & int 101 */ testVFE2()102 public void testVFE2() { 103 load("dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_8", VerifyError.class); 104 } 105 106 /** 107 * @constraint B1 108 * @title types of arguments - long & int 109 */ testVFE3()110 public void testVFE3() { 111 load("dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_9", VerifyError.class); 112 } 113 114 /** 115 * @constraint B1 116 * @title types of arguments - reference & int 117 */ testVFE4()118 public void testVFE4() { 119 load("dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_10", VerifyError.class); 120 } 121 122 /** 123 * @constraint B1 124 * @title Type of argument - float. The verifier checks that ints 125 * and floats are not used interchangeably. 126 */ testVFE5()127 public void testVFE5() { 128 load("dot.junit.opcodes.shl_int_lit8.d.T_shl_int_lit8_6", VerifyError.class); 129 } 130 } 131