63 lines · plain
1;; Checks that when an instruction at the start of a BasicBlock has the same2;; DebugLoc as the instruction at the end of the previous BasicBlock, we add3;; is_stmt to the new line, to ensure that we still step on it if we arrive from4;; a BasicBlock other than the immediately preceding one, unless all known5;; predecessor BasicBlocks end with the same line.6 7; RUN: %llc_dwarf -mtriple=x86_64-unknown-linux -O0 -filetype=obj < %s | llvm-dwarfdump --debug-line - | FileCheck %s8 9; CHECK: {{0x[0-9a-f]+}} 13 5 {{.+}} is_stmt10; CHECK-NEXT: {{0x[0-9a-f]+}} 13 5 {{.+}} is_stmt11 12define void @_Z1fi(i1 %cond) !dbg !21 {13entry:14 br i1 %cond, label %if.then2, label %if.else415 16if.then2: ; preds = %entry17 br label %if.end8, !dbg !2418 19if.else4: ; preds = %entry20 %0 = load i32, ptr null, align 4, !dbg !2421 %call5 = call i1 null(i32 %0)22 ret void23 24if.end8: ; preds = %if.then225 ret void26}27 28; CHECK: {{0x[0-9a-f]+}} 113 5 {{.+}} is_stmt29; CHECK-NOT: {{0x[0-9a-f]+}} 113 530 31define void @_Z1gi(i1 %cond) !dbg !31 {32entry:33 br i1 %cond, label %if.then2, label %if.else4, !dbg !3434 35if.then2: ; preds = %entry36 br label %if.end8, !dbg !3437 38if.else4: ; preds = %entry39 %0 = load i32, ptr null, align 4, !dbg !3440 %call5 = call i1 null(i32 %0)41 ret void42 43if.end8: ; preds = %if.then244 ret void45}46 47!llvm.dbg.cu = !{!0}48!llvm.module.flags = !{!20}49 50!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 20.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)51!1 = !DIFile(filename: "test.cpp", directory: "/home/gbtozers/dev/upstream-llvm")52!20 = !{i32 2, !"Debug Info Version", i32 3}53!21 = distinct !DISubprogram(name: "f", linkageName: "_Z1fi", scope: !1, file: !1, line: 7, type: !22, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)54!22 = distinct !DISubroutineType(types: !23)55!23 = !{null}56!24 = !DILocation(line: 13, column: 5, scope: !25)57!25 = distinct !DILexicalBlock(scope: !21, file: !1, line: 11, column: 27)58!31 = distinct !DISubprogram(name: "g", linkageName: "_Z1gi", scope: !1, file: !1, line: 107, type: !32, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)59!32 = distinct !DISubroutineType(types: !33)60!33 = !{null}61!34 = !DILocation(line: 113, column: 5, scope: !35)62!35 = distinct !DILexicalBlock(scope: !31, file: !1, line: 111, column: 27)63