1 // RUN: not mlir-pdll %s -split-input-file 2>&1 | FileCheck %s
3 // CHECK: expected `{` or `=>` to start pattern body
8 // CHECK: :6:9: error: `Foo` has already been defined
9 // CHECK: :5:9: note: see previous definition here
10 Pattern Foo { erase root: Op; }
11 Pattern Foo { erase root: Op; }
15 // CHECK: `return` statements are only permitted within a `Constraint` or `Rewrite` body
22 // CHECK: expected Pattern body to terminate with an operation rewrite statement
29 // CHECK: Pattern body was terminated by an operation rewrite statement, but found trailing statements
37 // CHECK: expected Pattern lambda body to contain a single operation rewrite statement, such as `erase`, `replace`, or `rewrite`
42 Rewrite SomeRewrite();
44 // CHECK: unable to invoke `Rewrite` within a match section
51 //===----------------------------------------------------------------------===//
53 //===----------------------------------------------------------------------===//
55 // CHECK: expected pattern metadata identifier
60 // CHECK: unknown pattern metadata
61 Pattern with unknown {}
65 // CHECK: expected `(` before pattern benefit
66 Pattern with benefit) {}
70 // CHECK: expected integral pattern benefit
71 Pattern with benefit(foo) {}
75 // CHECK: expected pattern benefit to fit within a 16-bit integer
76 Pattern with benefit(65536) {}
80 // CHECK: expected `)` after pattern benefit
81 Pattern with benefit(1( {}
85 // CHECK: pattern benefit has already been specified
86 // CHECK: see previous definition here
87 Pattern with benefit(1), benefit(1) {}
91 // CHECK: pattern recursion metadata has already been specified
92 // CHECK: see previous definition here
93 Pattern with recursion, recursion {}