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