[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / test / TableGen / get-operand-type-no-expand.td
blob9dfcbfaec76af1e6284f82f6de07a1b68873b9f2
1 // Test -instr-info-expand-mi-operand-info=0 mode which keeps complex operands
2 // that contain a DAG of basic operands unexpanded (the default is to expand).
4 include "llvm/Target/Target.td"
6 def archInstrInfo : InstrInfo { }
8 def arch : Target {
9   let InstructionSet = archInstrInfo;
12 def Reg : Register<"reg">;
13 def RegClass : RegisterClass<"foo", [i32], 0, (add Reg)>;
15 class ComplexOperand<int size> : Operand<iPTR> {
16   let MIOperandInfo = (ops i8imm, i32imm);
17   int Size = size;
20 def i8complex : ComplexOperand<8>;
21 def i512complex: ComplexOperand<512>;
23 def InstA : Instruction {
24   let Size = 1;
25   let OutOperandList = (outs i512complex:$a);
26   let InOperandList = (ins i8complex:$b, i32imm:$c);
27   field bits<8> Inst;
28   field bits<8> SoftFail = 0;
29   let Namespace = "MyNamespace";
32 // RUN: llvm-tblgen -gen-instr-info -I %p/../../include %s \
33 // RUN:   -instr-info-expand-mi-operand-info=1 \
34 // RUN:   | FileCheck %s --check-prefix=CHECK-EXPAND
35 // CHECK-EXPAND: #ifdef GET_INSTRINFO_OPERAND_TYPE
36 // CHECK-EXPAND: OpcodeOperandTypes[] = {
37 // CHECK-EXPAND:        /* InstA */
38 // CHECK-EXPAND-NEXT:   i8imm, i32imm, i8imm, i32imm, i32imm,
39 // CHECK-EXPAND: #endif // GET_INSTRINFO_OPERAND_TYPE
41 // RUN: llvm-tblgen -gen-instr-info -I %p/../../include %s \
42 // RUN:   -instr-info-expand-mi-operand-info=0 \
43 // RUN:   | FileCheck %s --check-prefix=CHECK-NOEXPAND
44 // CHECK-NOEXPAND: #ifdef GET_INSTRINFO_OPERAND_TYPE
45 // CHECK-NOEXPAND: OpcodeOperandTypes[] = {
46 // CHECK-NOEXPAND:        /* InstA */
47 // CHECK-NOEXPAND-NEXT:   i512complex, i8complex, i32imm,
48 // CHECK-NOEXPAND: #endif // GET_INSTRINFO_OPERAND_TYPE