1; RUN: llc -stop-after=early-tailduplication < %s | FileCheck %s 2; 3; Check that DebugLoc attached to the branch instruction of 4; 'while.cond1.preheader.lr.ph' survives after tailduplication pass. 5; 6; CHECK: [[DLOC:![0-9]+]] = !DILocation(line: 9, column: 5, scope: !{{[0-9]+}}) 7; CHECK: [[VREG:%[^ ]+]]:gr64 = COPY $rdi 8; CHECK: TEST64rr [[VREG]], [[VREG]] 9; CHECK-NEXT: JCC_1 {{.+}}, debug-location [[DLOC]] 10; CHECK-NEXT: JMP_1 {{.+}}, debug-location [[DLOC]] 11 12target triple = "x86_64-unknown-linux-gnu" 13 14%struct.Node = type { ptr } 15 16define i32 @foo(ptr readonly %node, ptr readnone %root) !dbg !6 { 17entry: 18 %cmp = icmp eq ptr %node, %root, !dbg !8 19 br i1 %cmp, label %while.end4, label %while.cond1.preheader.lr.ph, !dbg !10 20 21while.cond1.preheader.lr.ph: ; preds = %entry 22 %tobool = icmp eq ptr %node, null 23 br i1 %tobool, label %while.cond1.preheader.us.preheader, label %while.body2.preheader, !dbg !11 24 25while.body2.preheader: ; preds = %while.cond1.preheader.lr.ph 26 br label %while.body2, !dbg !11 27 28while.cond1.preheader.us.preheader: ; preds = %while.cond1.preheader.lr.ph 29 br label %while.cond1.preheader.us, !dbg !10 30 31while.cond1.preheader.us: ; preds = %while.cond1.preheader.us.preheader, %while.cond1.preheader.us 32 br label %while.cond1.preheader.us, !dbg !10 33 34while.body2: ; preds = %while.body2.preheader, %while.body2 35 br label %while.body2, !dbg !11 36 37while.end4: ; preds = %entry 38 ret i32 0, !dbg !12 39} 40 41!llvm.dbg.cu = !{!0} 42!llvm.module.flags = !{!3, !4} 43 44!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, emissionKind: LineTablesOnly) 45!1 = !DIFile(filename: "foo.c", directory: "b/") 46!2 = !{} 47!3 = !{i32 2, !"Dwarf Version", i32 4} 48!4 = !{i32 2, !"Debug Info Version", i32 3} 49!5 = !{} 50!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, type: !7, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2) 51!7 = !DISubroutineType(types: !2) 52!8 = !DILocation(line: 7, column: 15, scope: !9) 53!9 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2) 54!10 = !DILocation(line: 7, column: 3, scope: !9) 55!11 = !DILocation(line: 9, column: 5, scope: !9) 56!12 = !DILocation(line: 14, column: 3, scope: !6) 57