1 // RUN: not llvm-tblgen -gen-disassembler -I %p/../../../include %s 2>&1 | FileCheck %s --implicit-check-not=error:
3 include "llvm/Target/Target.td"
5 def ArchInstrInfo : InstrInfo { }
8 let InstructionSet = ArchInstrInfo;
11 def Reg : Register<"reg">;
13 def Regs : RegisterClass<"foo", [i32], 0, (add Reg)>;
15 def complex_nodec : Operand<i32> {
16 let MIOperandInfo = (ops Regs, Regs);
19 def complex_withdec : Operand<i32> {
20 let MIOperandInfo = (ops Regs, Regs);
21 let DecoderMethod = "DecodeComplex";
24 class ArchInstr : Instruction {
29 // This definition is broken in both directions:
30 // 1. Uses a complex operand without a decoder, and without named sub-ops.
31 // 2. Uses a complex operand with named sub-ops, but with a decoder as well.
33 // CHECK: error: DecoderEmitter: operand "r1c" uses MIOperandInfo with multiple ops, but doesn't have a custom decoder!
34 // CHECK: note: Dumping record for previous error:
35 // CHECK: error: DecoderEmitter: operand "r1ab" has type "complex_withdec" with a custom DecoderMethod, but also named sub-operands.
36 def foo1 : ArchInstr {
46 let OutOperandList = (outs complex_nodec:$r1c);
47 let InOperandList = (ins (complex_withdec $r1a, $r1b):$r1ab);
50 // This definition has no errors.
51 def foo2 : ArchInstr {
61 let OutOperandList = (outs complex_withdec:$r2c);
62 let InOperandList = (ins (complex_nodec $r2a, $r2b):$r2ab);