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