llvm-project/mlir/test/mlir-tblgen/expect-symbol.td
River Riddle 1d7120c69a [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td
OpBase.td has formed into a huge monolith of all ODS constructs. This
commits starts to rectify that by splitting out some constructs to their
own .td files.

Differential Revision: https://reviews.llvm.org/D118636
2022-03-15 00:18:03 -07:00

20 lines
538 B
TableGen

// RUN: not mlir-tblgen -gen-rewriters -I %S/../../include %s 2>&1 | FileCheck %s
include "mlir/IR/OpBase.td"
include "mlir/IR/PatternBase.td"
def Test_Dialect : Dialect {
let name = "test";
}
def OpA : Op<Test_Dialect, "a"> {
let arguments = (ins I32Attr:$attr);
}
def OpB : Op<Test_Dialect, "b"> {
let arguments = (ins I32Attr:$attr);
}
def : Pat<(OpA $attr), (OpB $attr),
// CHECK: operands to additional constraints can only be symbol references
[(Constraint<CPred<"$0->getValue() == $1">> $attr, 42)]>;