aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/mlir-tblgen/expect-symbol.td
blob: 809a1c79a48e7dc1d1c4eb6541ee2ca2a9189ae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: not mlir-tblgen -gen-rewriters -I %S/../../include %s 2>&1 | FileCheck %s

include "mlir/IR/OpBase.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)]>;