Files
clang-p2996/flang/test/Transforms/debug-line-table-existing.fir
Kiran Chandramohan 3af9dfe464 [Flang][Debug] Use pathnames from location of functions
This ensures that functions in included files have the correct path
in their file metadata.

Note: This patch also sets all locations to have the full path names.

Reviewed By: vzakhari, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D142263
2023-01-25 13:49:21 +00:00

29 lines
1.6 KiB
Plaintext

// RUN: fir-opt --add-debug-foundation --mlir-print-debuginfo %s | FileCheck %s
// REQUIRES: linux
// Test that there are no changes to a function with existed fused loc debug
module {
func.func @_QPs1() {
return loc(#loc1)
} loc(#loc2)
} loc(#loc)
#di_basic_type = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "void", encoding = DW_ATE_address>
#di_file = #llvm.di_file<"simple.f90" in "/home/user01/llvm-project/build_release">
#loc = loc("/home/user01/llvm-project/build_release/simple.f90":0:0)
#loc1 = loc("/home/user01/llvm-project/build_release/simple.f90":1:1)
#di_compile_unit = #llvm.di_compile_unit<sourceLanguage = DW_LANG_Fortran95, file = #di_file, producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly>
#di_subroutine_type = #llvm.di_subroutine_type<callingConvention = DW_CC_normal, types = #di_basic_type, #di_basic_type>
#di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #di_file, name = "_QPs1", linkageName = "_QPs1", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = Definition, type = #di_subroutine_type>
#loc2 = loc(fused<#di_subprogram>[#loc1])
module {
func.func @_QPs1() {
return loc(#loc1)
} loc(#loc2)
} loc(#loc)
// CHECK: #loc = loc("/home/user01/llvm-project/build_release/simple.f90":0:0)
// CHECK: #loc1 = loc("/home/user01/llvm-project/build_release/simple.f90":1:1)
// CHECK: #di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #di_file, name = "_QPs1", linkageName = "_QPs1", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = Definition, type = #di_subroutine_type>
// CHECK: #loc2 = loc(fused<#di_subprogram>[#loc1])