Skip to content

Commit 98c1fae

Browse files
committed
Add test for passing OpPrintingFlags to LocationSnapshotPass in mlir-opt
1 parent f336b31 commit 98c1fae

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mlir/test/Transforms/location-snapshot.mlir

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: mlir-opt -allow-unregistered-dialect -snapshot-op-locations='filename=%/t' -mlir-print-local-scope -mlir-print-debuginfo %s | FileCheck %s -DFILE=%/t
22
// RUN: mlir-opt -allow-unregistered-dialect -snapshot-op-locations='filename=%/t tag='tagged'' -mlir-print-local-scope -mlir-print-debuginfo %s | FileCheck %s --check-prefix=TAG -DFILE=%/t
3+
// RUN: mlir-opt -allow-unregistered-dialect -snapshot-op-locations='filename=%/t print-debuginfo' -mlir-print-local-scope -mlir-print-debuginfo %s | FileCheck %s --check-prefix=DBG -DFILE=%/t && cat %/t | FileCheck %s --check-prefix=DBGFILE
34

45
// CHECK: func @function(
56
// CHECK-NEXT: loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})
@@ -15,3 +16,18 @@ func.func @function() -> i32 {
1516
%1 = "foo"() : () -> i32 loc("original")
1617
return %1 : i32 loc("original")
1718
} loc("original")
19+
20+
// DBG: func @function2(
21+
// DBG-NEXT: loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})
22+
// DBG-NEXT: loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})
23+
// DBG-NEXT: } loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})
24+
25+
// DBGFILE: func @function2(
26+
// DBGFILE-NEXT: loc("{{.*}}location-snapshot.mlir":{{[0-9]+}}:{{[0-9]+}})
27+
// DBGFILE-NEXT: loc("{{.*}}location-snapshot.mlir":{{[0-9]+}}:{{[0-9]+}})
28+
// DBGFILE-NEXT: } loc("{{.*}}location-snapshot.mlir":{{[0-9]+}}:{{[0-9]+}})
29+
30+
func.func @function2() -> i32 {
31+
%1 = "foo"() : () -> i32
32+
return %1 : i32
33+
}

0 commit comments

Comments
 (0)