llvm.org GIT mirror llvm / 5367c02
[tblgen][disasm] Emit record names again when decoder conflicts occur. And add a test for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350277 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Sanders 8 months ago
2 changed file(s) with 36 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 // RUN: llvm-tblgen -gen-disassembler -I %p/../../../include %s -o - 2>%t
1 // RUN: FileCheck %s < %t
2
3 include "llvm/Target/Target.td"
4
5 def MyTargetISA : InstrInfo;
6 def MyTarget : Target { let InstructionSet = MyTargetISA; }
7
8 def R0 : Register<"r0"> { let Namespace = "MyTarget"; }
9 def GPR32 : RegisterClass<"MyTarget", [i32], 32, (add R0)>;
10
11 class I Pat>
12 : Instruction {
13 let Namespace = "MyTarget";
14 let OutOperandList = OOps;
15 let InOperandList = IOps;
16 let Pattern = Pat;
17 bits<32> Inst;
18 bits<32> SoftFail;
19 }
20
21 def A : I<(outs GPR32:$dst), (ins GPR32:$src1), []> {
22 let Size = 4;
23 let Inst{31-0} = 0;
24 }
25 def B : I<(outs GPR32:$dst), (ins GPR32:$src1), []> {
26 let Size = 4;
27 let Inst{31-0} = 0;
28 }
29
30 // CHECK: Decoding Conflict:
31 // CHECK: 00000000000000000000000000000000
32 // CHECK: ................................
33 // CHECK: A 00000000000000000000000000000000
34 // CHECK: B 00000000000000000000000000000000
17161716 dumpStack(errs(), "\t\t");
17171717
17181718 for (unsigned i = 0; i < Opcodes.size(); ++i) {
1719 errs() << '\t' << Opcodes[i] << " ";
1719 errs() << '\t' << AllInstructions[Opcodes[i]] << " ";
17201720 dumpBits(errs(),
17211721 getBitsField(*AllInstructions[Opcodes[i]].EncodingDef, "Inst"));
17221722 errs() << '\n';