-
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] Flang should generate debug location for limited instruct…
…ions in prolog (#940) * Flang should not generate debug location for instructions in prolog Due to this wrong debug_line section entry is created with wrong instruction marked as 'prologue_end'. More details in commited test cases. * Minor modifications are done. - to match coding style of newly added functions to rest of the file. - to reduce optimization option to -O0 in test case.
- Loading branch information
1 parent
ed3ed0d
commit 2eab099
Showing
5 changed files
with
129 additions
and
4 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,30 @@ | ||
!RUN: %flang -g -O0 %s -o %t | ||
!RUN: llvm-dwarfdump --debug-line %t -o - | FileCheck %s | ||
|
||
!CHECK: name: "dwarfdump_prolog.f90" | ||
!CHECK: Address Line Column File ISA Discriminator Flags | ||
!CHECK: {{0x[0-9a-f]+}} 13 1 1 0 0 is_stmt prologue_end | ||
!CHECK: {{0x[0-9a-f]+}} 29 1 1 0 0 is_stmt prologue_end | ||
|
||
subroutine show (message, array) | ||
character (len=*) :: message | ||
integer :: array(:) | ||
|
||
print *, message | ||
print *, array | ||
|
||
end subroutine show | ||
|
||
program prolog | ||
|
||
interface | ||
subroutine show (message, array) | ||
character (len=*) :: message | ||
integer :: array(:) | ||
end subroutine show | ||
end interface | ||
|
||
integer :: array(10) = (/1,2,3,4,5,6,7,8,9,10/) | ||
|
||
call show ("array", array) | ||
end program prolog |
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,37 @@ | ||
!RUN: %flang -g -S -emit-llvm %s -o - | FileCheck %s | ||
|
||
! check non debug instructions should not have debug location | ||
!CHECK: define void @show_ | ||
!CHECK: call void @llvm.dbg.declare | ||
!CHECK-SAME: , !dbg {{![0-9]+}} | ||
!CHECK-NOT: bitcast i64* %"array$sd" to i8*, !dbg | ||
!CHECK: store i64 {{%[0-9]+}}, i64* %z_b_3_{{[0-9]+}}, align 8 | ||
!CHECK: br label | ||
!CHECK: ret void, !dbg {{![0-9]+}} | ||
subroutine show (message, array) | ||
character (len=*) :: message | ||
integer :: array(:) | ||
|
||
print *, message | ||
print *, array | ||
|
||
end subroutine show | ||
|
||
!CHECK: define void @MAIN_ | ||
!CHECK-NOT: bitcast void (...)* @fort_init to void (i8*, ...)*, !dbg {{![0-9]+}} | ||
!CHECK: call void @llvm.dbg.declare | ||
!CHECK-SAME: , !dbg {{![0-9]+}} | ||
!CHECK: ret void, !dbg | ||
program prolog | ||
|
||
interface | ||
subroutine show (message, array) | ||
character (len=*) :: message | ||
integer :: array(:) | ||
end subroutine show | ||
end interface | ||
|
||
integer :: array(10) = (/1,2,3,4,5,6,7,8,9,10/) | ||
|
||
call show ("array", array) | ||
end program prolog |
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
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
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