-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugInfo] Debug support for module array variables with pointer/all…
…ocatable attribute
- Loading branch information
1 parent
5be7b0c
commit ba5d2c9
Showing
3 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
!RUN: %flang -gdwarf-4 -S -emit-llvm %s -o - | FileCheck %s | ||
|
||
!CHECK-LABEL: distinct !DIGlobalVariable(name: "alc_arr" | ||
!CHECK-SAME: type: [[TYPE:![0-9]+]] | ||
!CHECK: [[TYPE]] = !DICompositeType(tag: DW_TAG_array_type, | ||
!CHECK-SAME: elements: [[ELEMENTS:![0-9]+]], dataLocation: !DIExpression(DW_OP_push_object_address, DW_OP_deref), allocated: !DIExpression(DW_OP_push_object_address, DW_OP_deref) | ||
!CHECK: [[ELEMENTS]] = !{[[ELEMENT:![0-9]+]]} | ||
!CHECK: [[ELEMENT]] = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 96, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 136, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 128, DW_OP_deref, DW_OP_push_object_address, DW_OP_plus_uconst, 40, DW_OP_deref, DW_OP_mul)) | ||
|
||
module mod_allocatable_arr | ||
integer, allocatable :: alc_arr(:) | ||
end module | ||
|
||
program main | ||
use mod_allocatable_arr | ||
allocate (alc_arr(10)) | ||
alc_arr = 99 | ||
print *, alc_arr | ||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
!RUN: %flang -gdwarf-4 -S -emit-llvm %s -o - | FileCheck %s | ||
|
||
!CHECK-LABEL: distinct !DIGlobalVariable(name: "ptr_arr" | ||
!CHECK-SAME: type: [[TYPE:![0-9]+]] | ||
!CHECK: [[TYPE]] = !DICompositeType(tag: DW_TAG_array_type, | ||
!CHECK-SAME: elements: [[ELEMENTS:![0-9]+]], dataLocation: !DIExpression(DW_OP_push_object_address, DW_OP_deref), associated: !DIExpression(DW_OP_push_object_address, DW_OP_deref) | ||
!CHECK: [[ELEMENTS]] = !{[[ELEMENT:![0-9]+]]} | ||
!CHECK: [[ELEMENT]] = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 96, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 136, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 128, DW_OP_deref, DW_OP_push_object_address, DW_OP_plus_uconst, 40, DW_OP_deref, DW_OP_mul)) | ||
|
||
module mod_pointer_arr | ||
integer, pointer :: ptr_arr(:) | ||
end module | ||
|
||
program main | ||
use mod_pointer_arr | ||
integer, target :: tgtarr(20) | ||
tgtarr(1:20:2) = 22 | ||
tgtarr(2:20:2) = 33 | ||
ptr_arr => tgtarr(1:20:2) | ||
print *, ptr_arr | ||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters