Home | History | Annotate | Download | only in TableGen
      1 // RUN: not llvm-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck %s
      2 
      3 // The HwModeSelect class is intended to serve as a base class for other
      4 // classes that are then used to select a value based on the HW mode.
      5 // It contains a list of HW modes, and a derived class should provide a
      6 // list of corresponding values.
      7 // These two lists must have the same size. Make sure that a violation of
      8 // this requirement is diagnosed.
      9 
     10 include "llvm/Target/Target.td"
     11 
     12 def TestTargetInstrInfo : InstrInfo;
     13 
     14 def TestTarget : Target {
     15   let InstructionSet = TestTargetInstrInfo;
     16 }
     17 
     18 def TestReg : Register<"testreg">;
     19 def TestClass : RegisterClass<"TestTarget", [i32], 32, (add TestReg)>;
     20 
     21 def TestMode1 : HwMode<"+feat1">;
     22 def TestMode2 : HwMode<"+feat2">;
     23 
     24 def BadDef : ValueTypeByHwMode<[TestMode1, TestMode2, DefaultMode],
     25                                [i8, i16, i32, i64]>;
     26 
     27 // CHECK: error: in record BadDef derived from HwModeSelect: the lists Modes and Objects should have the same size
     28