Search in sources :

Example 1 with MemoryConstOp

use of org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer.MemoryConstOp in project graal by oracle.

the class MatchRuleTest method test1.

/**
 * Verifies, if the match rules in AMD64NodeMatchRules do work on the graphs by compiling and
 * checking if the expected LIR instruction show up.
 */
@Test
public void test1() {
    compile(getResolvedJavaMethod("test1Snippet"), null);
    boolean found = false;
    for (LIRInstruction ins : lir.getLIRforBlock(lir.codeEmittingOrder()[0])) {
        if (ins instanceof MemoryConstOp && ((MemoryConstOp) ins).getOpcode().toString().equals("CMP")) {
            assertFalse("MemoryConstOp expected only once in first block", found);
            found = true;
        }
    }
    assertTrue("Memory compare must be in the LIR", found);
}
Also used : LIRInstruction(org.graalvm.compiler.lir.LIRInstruction) MemoryConstOp(org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer.MemoryConstOp) LIRTest(org.graalvm.compiler.lir.jtt.LIRTest) Test(org.junit.Test)

Aggregations

LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)1 MemoryConstOp (org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer.MemoryConstOp)1 LIRTest (org.graalvm.compiler.lir.jtt.LIRTest)1 Test (org.junit.Test)1