Files
clang-p2996/flang/test/Integration/debug-assumed-size-array.f90
Abid Qadeer fc4b1a303b [flang][debug] Handle array types with variable size/bounds. (#110686)
The debug information generated by flang did not handle the cases where
dimension or lower bounds of the arrays were variable. This PR fixes
this issue. It will help distinguish assumed size arrays from cases
where array size are variable. It also handles the variable lower bounds
for assumed shape arrays.
    
Fixes #98879.
2024-10-03 21:29:47 +01:00

21 lines
818 B
Fortran

! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
module helper
implicit none
contains
subroutine fn (a1, a2)
integer a1(5, *), a2(*)
print *, a1(1,1)
print *, a2(2)
end subroutine fn
end module helper
! CHECK-DAG: ![[TY1:[0-9]+]] = !DICompositeType(tag: DW_TAG_array_type{{.*}}elements: ![[ELEMS1:[0-9]+]]{{.*}})
! CHECK-DAG: ![[ELEMS1]] = !{![[ELM1:[0-9]+]], ![[EMPTY:[0-9]+]]}
! CHECK-DAG: ![[ELM1]] = !DISubrange(count: 5)
! CHECK-DAG: ![[EMPTY]] = !DISubrange()
! CHECK-DAG: ![[TY2:[0-9]+]] = !DICompositeType(tag: DW_TAG_array_type{{.*}}elements: ![[ELEMS2:[0-9]+]]{{.*}})
! CHECK-DAG: ![[ELEMS2]] = !{![[EMPTY:[0-9]+]]}
! CHECK-DAG: !DILocalVariable(name: "a1"{{.*}}type: ![[TY1:[0-9]+]])
! CHECK-DAG: !DILocalVariable(name: "a2"{{.*}}type: ![[TY2:[0-9]+]])