use of com.googlecode.dex2jar.ir.stmt.UnopStmt in project dex2jar by pxb1988.
the class ConstTransformerTest method test03.
@Test
public void test03() {
// test local loop
IrMethod jm = new IrMethod();
Local a = nLocal("a");
Local b = nLocal("b");
Local p = nLocal("p");
jm.locals.add(a);
jm.locals.add(b);
jm.locals.add(p);
jm.stmts.add(nAssign(a, nString("a String")));
jm.stmts.add(nAssign(b, nString("b String")));
jm.stmts.add(nAssign(p, Exprs.nPhi(a, b)));
UnopStmt retStmt = nReturn(p);
jm.stmts.add(retStmt);
new ConstTransformer().transform(jm);
Assert.assertTrue(jm.locals.size() == 3);
Assert.assertTrue(jm.stmts.getSize() == 4);
Assert.assertEquals(p, retStmt.op.trim());
}
Aggregations