66 lines · plain
1; RUN: llc %s --filetype=obj -o - --dwarf-use-key-instructions \2; RUN: | llvm-objdump -d - --no-show-raw-insn \3; RUN: | FileCheck %s --check-prefix=OBJ4 5; RUN: llc %s --filetype=obj -o - --dwarf-use-key-instructions \6; RUN: | llvm-dwarfdump - --debug-line \7; RUN: | FileCheck %s --check-prefix=DBG8 9;; Hand written. The stores and add are in the same atom group. Check that,10;; despite each instruction belonging to a separate block, the stores (line 3)11;; get is_stmt (both rank 1) and the add (line 2) does not (it's rank 2).12 13; OBJ: 16: addl %ebp, %ebx14; OBJ-NEXT: 18: testb $0x1, %r15b15; OBJ-NEXT: 1c: je 0x23 <_Z1fPiii+0x23>16; OBJ-NEXT: 1e: movl %ebx, (%r14)17; OBJ-NEXT: 21: jmp 0x26 <_Z1fPiii+0x26>18; OBJ-NEXT: 23: movl %ebp, (%r14)19 20; DBG: Address Line Column File ISA Discriminator OpIndex Flags21; DBG-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------22; DBG-NEXT: 0x0000000000000000 1 0 0 0 0 0 is_stmt23; DBG-NEXT: 0x0000000000000011 1 0 0 0 0 0 is_stmt prologue_end24;; The add: no is_stmt25; DBG-NEXT: 0x0000000000000016 2 0 0 0 0 026; DBG-NEXT: 0x0000000000000018 1 0 0 0 0 027;; Both stores: is_stmt28; DBG-NEXT: 0x000000000000001e 3 0 0 0 0 0 is_stmt29; DBG-NEXT: 0x0000000000000023 3 0 0 0 0 0 is_stmt30; DBG-NEXT: 0x0000000000000026 1 0 0 0 0 031; DBG-NEXT: 0x0000000000000028 1 0 0 0 0 0 epilogue_begin32; DBG-NEXT: 0x0000000000000033 1 0 0 0 0 0 end_sequence33 34target triple = "x86_64-unknown-linux-gnu"35 36define hidden noundef i32 @_Z1fPiii(ptr %a, i32 %b, i32 %c, i1 %cond) local_unnamed_addr !dbg !11 {37entry:38 tail call void @_Z12prologue_endv(), !dbg !DILocation(line: 1, scope: !11)39 %add = add nsw i32 %c, %b, !dbg !DILocation(line: 2, scope: !11, atomGroup: 1, atomRank: 2)40 br i1 %cond, label %bb1, label %bb2, !dbg !DILocation(line: 1, scope: !11)41 42bb1:43 store i32 %add, ptr %a, align 4, !dbg !DILocation(line: 3, scope: !11, atomGroup: 1, atomRank: 1)44 ret i32 %add, !dbg !DILocation(line: 1, scope: !11)45 46bb2:47 store i32 %b, ptr %a, align 4, !dbg !DILocation(line: 3, scope: !11, atomGroup: 1, atomRank: 1)48 store i32 %c, ptr %a, align 4, !dbg !DILocation(line: 3, scope: !11, atomGroup: 1, atomRank: 1)49 ret i32 %add, !dbg !DILocation(line: 1, scope: !11)50}51 52declare void @_Z12prologue_endv() local_unnamed_addr #153 54!llvm.dbg.cu = !{!0}55!llvm.module.flags = !{!2, !3}56!llvm.ident = !{!10}57 58!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_17, file: !1, producer: "clang version 19.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)59!1 = !DIFile(filename: "test.cpp", directory: "/")60!2 = !{i32 7, !"Dwarf Version", i32 5}61!3 = !{i32 2, !"Debug Info Version", i32 3}62!10 = !{!"clang version 19.0.0"}63!11 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !12, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)64!12 = !DISubroutineType(types: !13)65!13 = !{}66