AsmPredicateCondsEmission.td 882 B

12345678910111213141516171819202122232425262728293031
  1. // RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s
  2. // Check that we don't generate invalid code of the form "( && Cond2)" when
  3. // emitting AssemblerPredicate conditions. In the example below, the invalid
  4. // code would be: "return ( && (Bits & arch::AssemblerCondition2));".
  5. include "llvm/Target/Target.td"
  6. def archInstrInfo : InstrInfo { }
  7. def arch : Target {
  8. let InstructionSet = archInstrInfo;
  9. }
  10. def Pred1 : Predicate<"Condition1">;
  11. def Pred2 : Predicate<"Condition2">,
  12. AssemblerPredicate<"AssemblerCondition2">;
  13. def foo : Instruction {
  14. let Size = 2;
  15. let OutOperandList = (outs);
  16. let InOperandList = (ins);
  17. field bits<16> Inst;
  18. let Inst = 0xAAAA;
  19. let AsmString = "foo";
  20. field bits<16> SoftFail = 0;
  21. // This is the important bit:
  22. let Predicates = [Pred1, Pred2];
  23. }
  24. // CHECK: return (Bits[arch::AssemblerCondition2]);