63 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;; 1. int f(int a) {10;; 2. int x = a + 1;11;; 3. return x;12;; 4. }13;; 5. int g(int b) {14;; 6. return f(b);15;; 7. }16;;17;; Both functions contain 2 instructions in unique atom groups. In f we see18;; groups 1 and 3, and in g we see {!18, 1} and 1. All of these instructions19;; should get is_stmt.20 21; OBJ: 0000000000000000 <_Z1fi>:22; OBJ-NEXT: 0: leal 0x1(%rdi), %eax23; OBJ-NEXT: 3: retq24; OBJ: 0000000000000010 <_Z1gi>:25; OBJ-NEXT: 10: leal 0x1(%rdi), %eax26; OBJ-NEXT: 13: retq27 28; DBG: Address Line Column File ISA Discriminator OpIndex Flags29; DBG-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------30; DBG-NEXT: 0x0000000000000000 2 0 0 0 0 0 is_stmt prologue_end31; DBG-NEXT: 0x0000000000000003 3 0 0 0 0 0 is_stmt32; DBG-NEXT: 0x0000000000000010 2 0 0 0 0 0 is_stmt prologue_end33; DBG-NEXT: 0x0000000000000013 6 0 0 0 0 0 is_stmt34 35target triple = "x86_64-unknown-linux-gnu"36 37define hidden noundef i32 @_Z1fi(i32 noundef %a) local_unnamed_addr !dbg !11 {38entry:39 %add = add nsw i32 %a, 1, !dbg !DILocation(line: 2, scope: !11, atomGroup: 1, atomRank: 2)40 ret i32 %add, !dbg !DILocation(line: 3, scope: !11, atomGroup: 3, atomRank: 1)41}42 43define hidden noundef i32 @_Z1gi(i32 noundef %b) local_unnamed_addr !dbg !16 {44entry:45 %add.i = add nsw i32 %b, 1, !dbg !DILocation(line: 2, scope: !11, inlinedAt: !18, atomGroup: 1, atomRank: 2)46 ret i32 %add.i, !dbg !DILocation(line: 6, scope: !16, atomGroup: 1, atomRank: 1)47}48 49!llvm.dbg.cu = !{!0}50!llvm.module.flags = !{!2, !3}51!llvm.ident = !{!10}52 53!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)54!1 = !DIFile(filename: "test.cpp", directory: "/")55!2 = !{i32 7, !"Dwarf Version", i32 5}56!3 = !{i32 2, !"Debug Info Version", i32 3}57!10 = !{!"clang version 19.0.0"}58!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)59!12 = !DISubroutineType(types: !13)60!13 = !{}61!16 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 5, type: !12, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)62!18 = distinct !DILocation(line: 6, scope: !16)63