• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6include "llvm/Target/Target.td"
7
8class SimpleReg<string n> : Register<n> {
9  let Namespace = "Simple";
10}
11def R0 : SimpleReg<"r0">;
12def SimpleRegClass : RegisterClass<"Simple",[i32],0,(add R0)>;
13def SimpleInstrInfo : InstrInfo;
14
15def SimpleTarget : Target {
16  let InstructionSet = SimpleInstrInfo;
17}
18
19class SimpleRel;
20
21def 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
29class INSTR_DEF : Instruction {
30  let Namespace = "Simple";
31  let OutOperandList = (outs);
32  let InOperandList = (ins);
33  string Basename = "";
34  string Col = "";
35}
36
37def SimpleInstr : SimpleRel, INSTR_DEF;
38
39// CHECK: error: No value "BaseName" found in "SimpleInstr" instruction description.
40// CHECK: def SimpleInstr : SimpleRel, INSTR_DEF;
41