2013-09-14 19:04:47 +01:00
|
|
|
/* /nodynamiccopyright/ */
|
|
|
|
|
|
|
|
public class TestCaseIfElse {
|
|
|
|
|
|
|
|
@AliveRange(varName="o", bytecodeStart=9, bytecodeLength=8)
|
|
|
|
@AliveRange(varName="o", bytecodeStart=20, bytecodeLength=9)
|
|
|
|
void m0(String[] args) {
|
|
|
|
Object o;
|
|
|
|
if (args[0] != null) {
|
|
|
|
o = "then";
|
|
|
|
o.hashCode();
|
|
|
|
} else {
|
|
|
|
o = "else";
|
|
|
|
o.hashCode();
|
|
|
|
}
|
|
|
|
o = "finish";
|
|
|
|
}
|
|
|
|
|
|
|
|
@AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
|
|
|
|
@AliveRange(varName="o", bytecodeStart=21, bytecodeLength=9)
|
|
|
|
void m1() {
|
|
|
|
Object o;
|
|
|
|
int i = 5;
|
|
|
|
if (i == 5) {
|
|
|
|
o = "then";
|
|
|
|
o.hashCode();
|
|
|
|
} else {
|
|
|
|
o = "else";
|
|
|
|
o.hashCode();
|
|
|
|
}
|
|
|
|
o = "finish";
|
|
|
|
}
|
|
|
|
|
|
|
|
@AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
|
|
|
|
@AliveRange(varName="o", bytecodeStart=21, bytecodeLength=9)
|
2014-05-29 15:28:01 +01:00
|
|
|
void m2() {
|
2013-09-14 19:04:47 +01:00
|
|
|
Object o;
|
|
|
|
int i = 5;
|
|
|
|
if (i != 5) {
|
|
|
|
o = "then";
|
|
|
|
o.hashCode();
|
|
|
|
} else {
|
|
|
|
o = "else";
|
|
|
|
o.hashCode();
|
|
|
|
}
|
|
|
|
o = "finish";
|
|
|
|
}
|
2014-05-29 15:28:01 +01:00
|
|
|
|
|
|
|
@AliveRange(varName="o", bytecodeStart=11, bytecodeLength=3)
|
|
|
|
@AliveRange(varName="o", bytecodeStart=17, bytecodeLength=2)
|
|
|
|
Object m3(boolean cond1, boolean cond2) {
|
|
|
|
Object o;
|
|
|
|
if (cond1) {
|
|
|
|
if (cond2) {
|
|
|
|
o = "then";
|
|
|
|
} else {
|
|
|
|
o = "else";
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2015-01-05 17:35:48 -08:00
|
|
|
|
|
|
|
@AliveRange(varName="i", bytecodeStart=6, bytecodeLength=2)
|
|
|
|
int m4(boolean flag) {
|
|
|
|
int i;
|
|
|
|
label:
|
|
|
|
{
|
|
|
|
if (flag) {
|
|
|
|
i = 1;
|
|
|
|
} else {
|
|
|
|
break label;
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
2013-09-14 19:04:47 +01:00
|
|
|
}
|