Package edu.cmu.cs.crystal.tac.model

Examples of edu.cmu.cs.crystal.tac.model.StoreArrayInstruction


    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    Assignment write = (Assignment) ((ExpressionStatement) EclipseTACSimpleTestDriver.getLastStatement(m)).getExpression();
    TACInstruction instr = tac.instruction(write);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof StoreArrayInstruction);
    StoreArrayInstruction store = (StoreArrayInstruction) instr;

    EclipseTACSimpleTestDriver.assertMethodParameter(store.getDestinationArray(), m, 0, tac);
    EclipseTACSimpleTestDriver.assertMethodParameter(store.getArrayIndex(), m, 1, tac);   
   
    Assert.assertEquals(tac.variable(write.getRightHandSide()), store.getSourceOperand());
    EclipseTACSimpleTestDriver.assertMethodParameter(store.getSourceOperand(), m, 2, tac);   
   
    // Make sure there's no ArrayLoad generated for the assigned-to array
    Assert.assertNull("Load generated for array assignment", tac.instruction(write.getLeftHandSide()));
  }
View Full Code Here


    Assert.assertTrue(seq.getInstructions()[0] instanceof LoadLiteralInstruction);
    Assert.assertTrue(seq.getInstructions()[1] instanceof BinaryOperation);
    Assert.assertTrue(seq.getInstructions()[2] instanceof StoreArrayInstruction);
    LoadLiteralInstruction one = (LoadLiteralInstruction) seq.getInstructions()[0];
    BinaryOperation add = (BinaryOperation) seq.getInstructions()[1];
    StoreArrayInstruction store = (StoreArrayInstruction) seq.getInstructions()[2];
    Assert.assertEquals(load.getTarget(), add.getOperand1());
    Assert.assertEquals(one.getTarget(), add.getOperand2());
    Assert.assertEquals(add.getTarget(), store.getSourceOperand());
    Assert.assertEquals(add.getTarget(), seq.getResultVariable());
    Assert.assertFalse(add.getTarget().equals(load.getTarget()));
  }
View Full Code Here

   
    Assignment write = (Assignment) inv.arguments().get(0);
    instr = tac.instruction(write);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof StoreArrayInstruction);
    StoreArrayInstruction store = (StoreArrayInstruction) instr;

    Assert.assertEquals(tac.variable(write.getRightHandSide()), store.getSourceOperand());
    Assert.assertEquals(tac.variable(write), store.getSourceOperand());
    Assert.assertEquals(args.get(0), store.getSourceOperand());
   
    // Make sure there's no ArrayLoad generated for the assigned-to array
    Assert.assertNull("Load generated for array assignment", tac.instruction(write.getLeftHandSide()));
  }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.crystal.tac.model.StoreArrayInstruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.