Shan Huang 912e2c4758
[Debuginfo][TailCallElim] Fix #86262: drop the debug location of entry branch (#86269)
This pr fixes #86262.

---------

Co-authored-by: Stephen Tozer <Melamoto@gmail.com>
2024-03-28 17:37:33 +08:00

18 lines
508 B
LLVM

; RUN: opt < %s -passes=debugify,tailcallelim -S | FileCheck %s
; RUN: opt < %s -passes=debugify,tailcallelim -S --try-experimental-debuginfo-iterators | FileCheck %s
define void @foo() {
entry:
; CHECK-LABEL: entry:
; CHECK: br label %tailrecurse{{$}}
call void @foo() ;; line 1
ret void
; CHECK-LABEL: tailrecurse:
; CHECK: br label %tailrecurse, !dbg ![[DbgLoc:[0-9]+]]
}
;; Make sure tailrecurse has the call instruction's DL
; CHECK: ![[DbgLoc]] = !DILocation(line: 1