Skip to content

Commit ed693d8

Browse files
committed
add lit test
1 parent 1aa1842 commit ed693d8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: mlir-opt %s --test-walk-pattern-rewrite-driver \
2+
// RUN: --allow-unregistered-dialect --debug-only=pattern-logging-listener 2>&1 | FileCheck %s
3+
4+
// Check that when replacing an op with a new op, we get appropriate
5+
// pattern-logging lines
6+
// CHECK: [pattern-logging-listener] (anonymous namespace)::ReplaceWithNewOp | notifyOperationInserted | test.new_op
7+
// CHECK: [pattern-logging-listener] (anonymous namespace)::ReplaceWithNewOp | notifyOperationReplaced (with values) | test.replace_with_new_op
8+
// CHECK: [pattern-logging-listener] (anonymous namespace)::ReplaceWithNewOp | notifyOperationModified | arith.addi
9+
// CHECK: [pattern-logging-listener] (anonymous namespace)::ReplaceWithNewOp | notifyOperationModified | arith.addi
10+
// CHECK: [pattern-logging-listener] (anonymous namespace)::ReplaceWithNewOp | notifyOperationErased | test.replace_with_new_op
11+
func.func @replace_with_new_op() -> i32 {
12+
%a = "test.replace_with_new_op"() : () -> (i32)
13+
%res = arith.addi %a, %a : i32
14+
return %res : i32
15+
}

0 commit comments

Comments
 (0)