1 // RUN: not llvm-tblgen -gen-instr-info -I %p/../../include %s 2>&1 | FileCheck %s 2 3 // This test verifies that TableGen is displaying an error when mapped instruction 4 // does not contain a field listed under RowFields. 5 6 include "llvm/Target/Target.td" 7 8 class SimpleReg<string n> : Register<n> { 9 let Namespace = "Simple"; 10 } 11 def R0 : SimpleReg<"r0">; 12 def SimpleRegClass : RegisterClass<"Simple",[i32],0,(add R0)>; 13 def SimpleInstrInfo : InstrInfo; 14 15 def SimpleTarget : Target { 16 let InstructionSet = SimpleInstrInfo; 17 } 18 19 class SimpleRel; 20 21 def REL_DEF : InstrMapping { 22 let FilterClass = "SimpleRel"; 23 let RowFields = ["BaseName"]; 24 let ColFields = ["Col"]; 25 let KeyCol = ["KeyCol"]; 26 let ValueCols = [["ValCol"]]; 27 } 28 29 class INSTR_DEF : Instruction { 30 let Namespace = "Simple"; 31 let OutOperandList = (outs); 32 let InOperandList = (ins); 33 string Basename = ""; 34 string Col = ""; 35 } 36 37 def SimpleInstr : SimpleRel, INSTR_DEF; 38 39 // CHECK: error: No value "BaseName" found in "SimpleInstr" instruction description. 40 // CHECK: def SimpleInstr : SimpleRel, INSTR_DEF; 41