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);
}
Aggregations