Files
clang-p2996/flang/test/Integration/debug-variable-array-dim.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

20 lines
915 B
Fortran

! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
subroutine foo(a, n, m, p)
integer n, m, p
integer :: a(n:m, p)
a(1, 2) = 10
print *, a
end subroutine foo
! CHECK-DAG: ![[VAR0:.*]] = !DILocalVariable(name: "._QFfooEa3"{{.*}}scope: ![[SCOPE:[0-9]+]]{{.*}}flags: DIFlagArtificial)
! CHECK-DAG: ![[VAR1:.*]] = !DILocalVariable(name: "._QFfooEa1"{{.*}}scope: ![[SCOPE]]{{.*}}flags: DIFlagArtificial)
! CHECK-DAG: ![[VAR2:.*]] = !DILocalVariable(name: "._QFfooEa2"{{.*}}scope: ![[SCOPE]]{{.*}}flags: DIFlagArtificial)
! CHECK-DAG: ![[SR1:.*]] = !DISubrange(count: ![[VAR1]], lowerBound: ![[VAR0]])
! CHECK-DAG: ![[SR2:.*]] = !DISubrange(count: ![[VAR2]])
! CHECK-DAG: ![[SR:.*]] = !{![[SR1]], ![[SR2]]}
! CHECK-DAG: ![[TY:.*]] = !DICompositeType(tag: DW_TAG_array_type{{.*}}elements: ![[SR]])
! CHECK-DAG: !DILocalVariable(name: "a"{{.*}}scope: ![[SCOPE]]{{.*}}type: ![[TY]])