|
1 |
| -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common < %s | FileCheck %s |
| 1 | +// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns \ |
| 2 | +// RUN: -I %p/../../include -I %p/Common %s 2> %t | FileCheck %s |
| 3 | +// RUN: FileCheck -DFILE=%s -check-prefix=ERR %s < %t |
2 | 4 |
|
3 | 5 | include "llvm/Target/Target.td"
|
4 | 6 | include "GlobalISelEmitterCommon.td"
|
@@ -35,3 +37,20 @@ def tst2 : I<(outs GPR32:$rd, s_cc_out:$s), (ins GPR32:$rs1, GPR32:$rs2),
|
35 | 37 | // TODO: There should be more tests, but any attempt to write something
|
36 | 38 | // more complex results in tablegen crashing somewhere in
|
37 | 39 | // TreePatternNode::UpdateNodeType.
|
| 40 | + |
| 41 | + |
| 42 | +def not_leaf : OptionalDefOperand<i32, (ops GPR8), (ops (i8 imm))>; |
| 43 | +def not_rec : OptionalDefOperand<i32, (ops GPR8), (ops (i8 0))>; |
| 44 | +def not_reg : OptionalDefOperand<i32, (ops GPR8), (ops GPR8)>; |
| 45 | + |
| 46 | +// ERR: [[#@LINE+1]]:5: warning: Skipped pattern: optional def is not a leaf |
| 47 | +def tst_not_leaf : I<(outs GPR32:$rd, not_leaf:$s), (ins i32imm:$imm), |
| 48 | + [(set GPR32:$rd, imm:$imm)]>; |
| 49 | + |
| 50 | +// ERR: [[#@LINE+1]]:5: warning: Skipped pattern: optional def is not a record |
| 51 | +def tst_not_rec : I<(outs GPR32:$rd, not_rec:$s), (ins i32imm:$imm), |
| 52 | + [(set GPR32:$rd, imm:$imm)]>; |
| 53 | + |
| 54 | +// ERR: [[#@LINE+1]]:5: warning: Skipped pattern: optional def is not a register |
| 55 | +def tst_not_reg : I<(outs GPR32:$rd, not_reg:$s), (ins i32imm:$imm), |
| 56 | + [(set GPR32:$rd, imm:$imm)]>; |
0 commit comments