llvm.org GIT mirror llvm / f8fba90
[TRE][DebugInfo] Preserve Debug Location in new branch instruction There are two branch instructions created so the new test covers them both. Differential Revision: https://reviews.llvm.org/D50263 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338917 91177308-0d34-0410-b5e6-96231b3b80d8 Anastasis Grammenos 1 year, 1 month ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
565565 BasicBlock *NewEntry = BasicBlock::Create(F->getContext(), "", F, OldEntry);
566566 NewEntry->takeName(OldEntry);
567567 OldEntry->setName("tailrecurse");
568 BranchInst::Create(OldEntry, NewEntry);
568 BranchInst *BI = BranchInst::Create(OldEntry, NewEntry);
569 BI->setDebugLoc(CI->getDebugLoc());
569570
570571 // If this tail call is marked 'tail' and if there are any allocas in the
571572 // entry block, move them up to the new entry block.
0 ; RUN: opt < %s -debugify -tailcallelim -S | FileCheck %s
1
2 define void @foo() {
3 entry:
4 ; CHECK-LABEL: entry:
5 ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc:[0-9]+]]
6
7 call void @foo() ;; line 1
8 ret void
9
10 ; CHECK-LABEL: tailrecurse:
11 ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc]]
12 }
13
14 ;; Make sure tailrecurse has the call instruction's DL
15 ; CHECK: ![[DbgLoc]] = !DILocation(line: 1