use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method test2arrayF.
@Test
public void test2arrayF() {
initMethod(true, "V");
Local b = addLocal("b");
Local c = addLocal("c");
addStmt(nAssign(b, nNewMutiArray("F", 1, new Value[] { nInt(2) })));
addStmt(nFillArrayData(b, nConstant(new int[] { 5, 6 })));
addStmt(nAssign(c, nArray(b, nInt(3), TypeClass.IF.name)));
addStmt(nReturnVoid());
transform();
Assert.assertEquals("", b.valueType, "[F");
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method test00Base.
/**
* base test
*/
@Test
public void test00Base() {
initMethod(true, "Ljava/lang/Object;");
Local b = addLocal("b");
addStmt(nAssign(b, nString("123")));
addStmt(nReturn(b));
transform();
Assert.assertEquals("", "L", b.valueType.substring(0, 1));
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method test3.
// @Ignore("type b to Int is ok to this context")
@Test
public void test3() {
initMethod(true, "V");
Local b = addLocal("b");
addStmt(nAssign(b, nInt(456)));
LabelStmt L0 = newLabel();
addStmt(nIf(nEq(b, nInt(0), TypeClass.ZIFL.name), L0));
addStmt(L0);
addStmt(nReturnVoid());
transform();
Assert.assertEquals("", "I", b.valueType);
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class TypeTransformerTest method test1Const.
@Test
public void test1Const() {
initMethod(true, "F");
Local b = addLocal("b");
AssignStmt st1 = addStmt(nAssign(b, nInt(0)));
UnopStmt st3 = addStmt(nReturn(b));
transform();
Assert.assertEquals("", b.valueType, "F");
}
use of com.googlecode.dex2jar.ir.expr.Local in project dex2jar by pxb1988.
the class UnSSATransformerTransformerTest method test02_3branches.
@Test
public void test02_3branches() {
initMethod(true, "I");
Local a = addLocal("a");
Local b = addLocal("b");
Local c = addLocal("c");
Local d = addLocal("d");
Local phi = addLocal("p");
LabelStmt L0 = newLabel();
LabelStmt L1 = newLabel();
addStmt(nAssign(a, nInt(2)));
addStmt(nIf(niGt(nInt(100), nInt(0)), L1));
addStmt(nAssign(b, nInt(3)));
addStmt(nIf(niGt(nInt(100), nInt(0)), L0));
addStmt(nAssign(c, nInt(4)));
addStmt(nLock(c));
addStmt(nGoto(L1));
addStmt(L0);
addStmt(nAssign(d, nInt(5)));
addStmt(nLock(d));
addStmt(L1);
attachPhi(L1, nAssign(phi, nPhi(a, b)));
addStmt(nReturn(phi));
transform();
}
Aggregations