Skip to content

Commit 126ea5c

Browse files
committed
fix interpreter test
1 parent 5c457ff commit 126ea5c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mlir/test/Rewrite/pdl-bytecode.mlir

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,14 @@ module @ir attributes { test.apply_constraint_3 } {
106106
// Test support for negated constraints.
107107
module @patterns {
108108
pdl_interp.func @matcher(%root : !pdl.operation) {
109-
pdl_interp.apply_constraint "single_entity_constraint"(%root : !pdl.operation) {isNegated = true} -> ^pat, ^end
109+
%test_attr = pdl_interp.create_attribute unit
110+
%attr = pdl_interp.get_attribute "test_attr" of %root
111+
pdl_interp.are_equal %test_attr, %attr : !pdl.attribute -> ^pat, ^end
110112

111113
^pat:
114+
pdl_interp.apply_constraint "single_entity_constraint"(%root : !pdl.operation) {isNegated = true} -> ^pat1, ^end
115+
116+
^pat1:
112117
pdl_interp.record_match @rewriters::@success(%root : !pdl.operation) : benefit(1), loc([%root]) -> ^end
113118

114119
^end:
@@ -129,8 +134,8 @@ module @patterns {
129134
// CHECK: "test.replaced_by_pattern"
130135

131136
module @ir attributes { test.apply_constraint_4 } {
132-
"test.op"() : () -> ()
133-
"test.foo"() : () -> ()
137+
"test.op"() { test_attr } : () -> ()
138+
"test.foo"() { test_attr } : () -> ()
134139
}
135140

136141
// -----

0 commit comments

Comments
 (0)