changes to adjust for lack of null instruction at index 0

This commit is contained in:
Manu Sridharan 2013-04-29 20:34:08 -07:00
parent 516d1522b9
commit 5f18830c3f
1 changed files with 5 additions and 5 deletions

View File

@ -220,7 +220,7 @@ public abstract class JavaIRTests extends IRTests {
MethodReference mref = descriptorToMethodRef("Source#ArrayLiteral1#main#([Ljava/lang/String;)V", cg.getClassHierarchy());
CGNode node = cg.getNodes(mref).iterator().next();
SSAInstruction s = node.getIR().getInstructions()[3];
SSAInstruction s = node.getIR().getInstructions()[2];
Assert.assertTrue("Did not find new array instruction.", s instanceof SSANewInstruction);
Assert.assertTrue("", ((SSANewInstruction) s).getNewSite().getDeclaredType().isArrayType());
}
@ -245,7 +245,7 @@ public abstract class JavaIRTests extends IRTests {
final SSAInstruction[] instructions = node.getIR().getInstructions();
// test 1
{
SSAInstruction s1 = instructions[3];
SSAInstruction s1 = instructions[2];
if (s1 instanceof SSANewInstruction) {
Assert.assertTrue("", ((SSANewInstruction) s1).getNewSite().getDeclaredType().isArrayType());
} else {
@ -254,7 +254,7 @@ public abstract class JavaIRTests extends IRTests {
}
// test 2
{
SSAInstruction s2 = instructions[4];
SSAInstruction s2 = instructions[3];
if (s2 instanceof SSANewInstruction) {
Assert.assertTrue("", ((SSANewInstruction) s2).getNewSite().getDeclaredType().isArrayType());
} else {
@ -264,7 +264,7 @@ public abstract class JavaIRTests extends IRTests {
// test 3: the last 4 instructions are of the form y[i] = i+1;
{
final SymbolTable symbolTable = node.getIR().getSymbolTable();
for (int i = 5; i <= 8; i++) {
for (int i = 4; i <= 7; i++) {
Assert.assertTrue("Expected only array stores.", instructions[i] instanceof SSAArrayStoreInstruction);
SSAArrayStoreInstruction as = (SSAArrayStoreInstruction) instructions[i];
@ -302,7 +302,7 @@ public abstract class JavaIRTests extends IRTests {
MethodReference mref = descriptorToMethodRef("Source#QualifiedStatic#main#([Ljava/lang/String;)V", cg.getClassHierarchy());
CGNode node = cg.getNodes(mref).iterator().next();
SSAInstruction s = node.getIR().getInstructions()[5];
SSAInstruction s = node.getIR().getInstructions()[4];
Assert.assertTrue("Did not find a getstatic instruction.", s instanceof SSAGetInstruction
&& ((SSAGetInstruction) s).isStatic());