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

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


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


        "Wrong number of instructions in sequence: " + seq.getInstructions().length,
        3, seq.getInstructions().length);
    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

    TACInstruction instr = tac.instruction(init);
    Assert.assertNotNull(instr);
    Assert.assertTrue(instr instanceof LoadLiteralInstruction);
   
    LoadLiteralInstruction load = (LoadLiteralInstruction) instr;
    Assert.assertEquals(load.getTarget(), store.getSourceOperand());
   
    Assignment write = (Assignment) ((ExpressionStatement) EclipseTACSimpleTestDriver.getLastStatement(c)).getExpression();
    TACInstruction again = tac.instruction(write);
    Assert.assertNotNull(again);
    Assert.assertTrue(again instanceof StoreFieldInstruction);
View Full Code Here

TOP

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

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.