brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 074c7c5 Raw
54 lines · plain
1// RUN: not llvm-tblgen -gen-disassembler -I %p/../../../include %s -DTEST1 2>&1 | FileCheck %s --check-prefix=CHECK-TEST12// RUN: not llvm-tblgen -gen-disassembler -I %p/../../../include %s -DTEST2 2>&1 | FileCheck %s --check-prefix=CHECK-TEST23// RUN: not llvm-tblgen -gen-disassembler -I %p/../../../include %s -DTEST3 2>&1 | FileCheck %s --check-prefix=CHECK-TEST34 5include "llvm/Target/Target.td"6 7def archInstrInfo : InstrInfo { }8 9def arch : Target {10    let InstructionSet = archInstrInfo;11}12 13#ifdef TEST114// CHECK-TEST1: [[#@LINE+1]]:5: error: foo: Size is 16 bits, but Inst bits beyond that are not zero/unset15def foo : Instruction {16  let OutOperandList = (outs);17  let InOperandList = (ins i32imm:$factor);18  let Size = 2;19  field bits<24> Inst;20  field bits<24> SoftFail = 0;21  bits<8> factor;22  let Inst{15...8} = factor{7...0};23  let Inst{20} = 1;24}25#endif26 27#ifdef TEST228// CHECK-TEST2: [[#@LINE+1]]:5: error: foo: Size is 16 bits, but SoftFail bits beyond that are not zero/unset29def foo : Instruction {30  let OutOperandList = (outs);31  let InOperandList = (ins i32imm:$factor);32  let Size = 2;33  field bits<24> Inst;34  field bits<24> SoftFail = 0;35  bits<8> factor;36  let Inst{15...8} = factor{7...0};37  let Inst{23...16} = 0;38  let SoftFail{20} = 1;39}40#endif41 42#ifdef TEST343// CHECK-TEST3: [[#@LINE+1]]:5: error: bar: Size is 16 bits, but Inst specifies only 8 bits44def bar : Instruction {45  let OutOperandList = (outs);46  let InOperandList = (ins i32imm:$factor);47  let Size = 2;48  field bits<8> Inst;49  field bits<8> SoftFail = 0;50  bits<4> factor;51  let Inst{4...1} = factor{3...0};52}53#endif54