33 lines · plain
1// RUN: mlir-opt -allow-unregistered-dialect -snapshot-op-locations='filename=%/t' -mlir-print-local-scope -mlir-print-debuginfo %s | FileCheck %s -DFILE=%/t2// 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=%/t3// 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=DBGFILE4 5// CHECK: func @function(6// CHECK-NEXT: loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})7// CHECK-NEXT: loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})8// CHECK-NEXT: } loc("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})9 10// TAG: func @function(11// TAG-NEXT: loc(fused["original", "tagged"("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})])12// TAG-NEXT: loc(fused["original", "tagged"("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})])13// TAG-NEXT: } loc(fused["original", "tagged"("[[FILE]]":{{[0-9]+}}:{{[0-9]+}})])14 15func.func @function() -> i32 {16 %1 = "foo"() : () -> i32 loc("original")17 return %1 : i32 loc("original")18} 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 30func.func @function2() -> i32 {31 %1 = "foo"() : () -> i3232 return %1 : i3233}