67 lines · plain
1# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions --filetype=obj -o - \2# RUN: | llvm-objdump -d - --no-show-raw-insn \3# RUN: | FileCheck %s --check-prefix=OBJ4 5# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions --filetype=obj -o - \6# RUN: | llvm-dwarfdump - --debug-line \7# RUN: | FileCheck %s --check-prefix=DBG8 9# OBJ: 0000000000000000 <_Z1fPiii>:10# OBJ-NEXT: 0: movl $0x1, %ebx11# OBJ-NEXT: 5: movl $0x2, %eax12# OBJ-NEXT: a: movl $0x0, %eax13# OBJ-NEXT: f: movl $0x0, %eax14# OBJ-NEXT: 14: retq15 16# DBG: Address Line Column File ISA Discriminator OpIndex Flags17# DBG-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------18# DBG-NEXT: 0x0000000000000000 1 0 0 0 0 0 is_stmt prologue_end19# DBG-NEXT: 0x0000000000000005 2 0 0 0 0 0 is_stmt20# DBG-NEXT: 0x000000000000000a 0 0 0 0 0 021# DBG-NEXT: 0x0000000000000014 2 0 0 0 0 022# DBG-NEXT: 0x0000000000000015 2 0 0 0 0 0 end_sequence23 24## The `RET64` is the only key instruction. The `MOV32ri 2` has the same line25## number so the is_stmt should "float up" from the ret to the mov. Check this26## happens; check that the DBG_VALUE wedged between them with a different line27## number, the line zero, and missing DebugLoc, don't disrupt that; and check28## the is_stmt doesn't float too far up onto the `MOV32ri 1`.29 30--- |31 target triple = "x86_64-unknown-linux-gnu"32 33 define hidden noundef i32 @_Z1fPiii(ptr %a, i32 %b, i32 %c, i1 %cond) local_unnamed_addr !dbg !5 {34 entry:35 ret i32 236 }37 38 !llvm.dbg.cu = !{!0}39 !llvm.module.flags = !{!2, !3}40 !llvm.ident = !{!4}41 42 !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)43 !1 = !DIFile(filename: "test.cpp", directory: "/")44 !2 = !{i32 7, !"Dwarf Version", i32 5}45 !3 = !{i32 2, !"Debug Info Version", i32 3}46 !4 = !{!"clang version 19.0.0"}47 !5 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)48 !6 = !DISubroutineType(types: !7)49 !7 = !{}50 !8 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 1, type: !7)51 52...53---54name: _Z1fPiii55alignment: 1656body: |57 bb.0.entry:58 59 $ebx = MOV32ri 1, debug-location !DILocation(line: 1, scope: !5)60 $eax = MOV32ri 2, debug-location !DILocation(line: 2, scope: !5)61 $eax = MOV32ri 0, debug-location !DILocation(line: 0, scope: !5)62 $eax = MOV32ri 063 DBG_VALUE $noreg, $noreg, !8, !DIExpression(), debug-location !DILocation(line: 1, scope: !5)64 RET64 $eax, debug-location !DILocation(line: 2, scope: !5, atomGroup: 1, atomRank: 2)65 66...67