1 // RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s
3 include "llvm/Target/Target.td"
5 def archInstrInfo : InstrInfo { }
8 let InstructionSet = archInstrInfo;
11 class TestInstruction : Instruction {
13 let OutOperandList = (outs);
14 let InOperandList = (ins);
16 field bits<8> SoftFail = 0;
19 def InstA : TestInstruction {
20 let Inst = {0,0,0,0,0,0,?,?};
21 let AsmString = "InstA";
22 let DecoderMethod = "DecodeInstA";
23 let hasCompleteDecoder = 0;
26 def InstB : TestInstruction {
27 let Inst = {0,0,0,?,?,0,1,1};
28 let AsmString = "InstB";
29 let DecoderMethod = "DecodeInstB";
30 let hasCompleteDecoder = 0;
33 // CHECK: /* 0 */ MCD::OPC_ExtractField, 2, 1, // Inst{2} ...
34 // CHECK-NEXT: /* 3 */ MCD::OPC_FilterValue, 0, 36, 0, 0, // Skip to: 44
35 // CHECK-NEXT: /* 8 */ MCD::OPC_ExtractField, 5, 3, // Inst{7-5} ...
36 // CHECK-NEXT: /* 11 */ MCD::OPC_FilterValue, 0, 28, 0, 0, // Skip to: 44
37 // CHECK-NEXT: /* 16 */ MCD::OPC_CheckField, 0, 2, 3, 7, 0, 0, // Skip to: 30
38 // CHECK-NEXT: /* 23 */ MCD::OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 0, 0, 0, 0, // Opcode: InstB, skip to: 30
39 // CHECK-NEXT: /* 30 */ MCD::OPC_CheckField, 3, 2, 0, 7, 0, 0, // Skip to: 44
40 // CHECK-NEXT: /* 37 */ MCD::OPC_TryDecode, {{[0-9]+}}, {{[0-9]+}}, 1, 0, 0, 0, // Opcode: InstA, skip to: 44
41 // CHECK-NEXT: /* 44 */ MCD::OPC_Fail,
43 // CHECK: if (!Check(S, DecodeInstB(MI, insn, Address, Decoder))) { DecodeComplete = false; return MCDisassembler::Fail; }
44 // CHECK: if (!Check(S, DecodeInstA(MI, insn, Address, Decoder))) { DecodeComplete = false; return MCDisassembler::Fail; }