94 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# Test is_stmt emission for a key-instructions function inlined into a10# not-key-instructions function, and vice versa.11 12--- |13 target triple = "x86_64-unknown-linux-gnu"14 15 define hidden noundef i32 @key() local_unnamed_addr !dbg !5 {16 entry:17 ret i32 018 }19 20 define hidden noundef i32 @not_key() local_unnamed_addr !dbg !9 {21 entry:22 ret i32 023 }24 25 !llvm.dbg.cu = !{!0}26 !llvm.module.flags = !{!2, !3}27 !llvm.ident = !{!4}28 29 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_17, file: !1, producer: "clang version 21.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)30 !1 = !DIFile(filename: "test.cpp", directory: "/")31 !2 = !{i32 7, !"Dwarf Version", i32 5}32 !3 = !{i32 2, !"Debug Info Version", i32 3}33 !4 = !{!"clang version 21.0.0"}34 !5 = distinct !DISubprogram(name: "key", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)35 !6 = !DISubroutineType(types: !7)36 !7 = !{}37 !9 = distinct !DISubprogram(name: "not_key", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: false)38 !10 = distinct !DILocation(line: 5, scope: !5)39 !11 = distinct !DILocation(line: 9, scope: !9)40...41---42name: key43alignment: 1644body: |45 bb.0.entry:46 47 ; OBJ: 0000000000000000 <key>:48 ; OBJ-NEXT: 0: movl $0x1, %eax49 ; OBJ-NEXT: 5: movl $0x2, %eax50 ; OBJ-NEXT: a: movl $0x3, %eax51 ; OBJ-NEXT: f: movl $0x4, %eax52 ; OBJ-NEXT: 14: movl $0x5, %eax53 ; OBJ-NEXT: 19: retq54 ;55 ; DBG: Address Line Column File ISA Discriminator OpIndex Flags56 ; DBG-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------57 ; DBG-NEXT: 0x0000000000000000 1 0 0 0 0 0 is_stmt prologue_end58 ; DBG-NEXT: 0x0000000000000005 2 0 0 0 0 0 is_stmt59 ; DBG-NEXT: 0x000000000000000a 2 0 0 0 0 060 ; DBG-NEXT: 0x000000000000000f 3 0 0 0 0 0 is_stmt61 ; DBG-NEXT: 0x0000000000000014 3 0 0 0 0 062 ;63 $eax = MOV32ri 1, debug-location !DILocation(line: 1, scope: !5) ; is_stmt (prologue_end)64 $eax = MOV32ri 2, debug-location !DILocation(line: 2, scope: !5, atomGroup: 1, atomRank: 1) ; is_stmt (key)65 $eax = MOV32ri 3, debug-location !DILocation(line: 2, scope: !9, inlinedAt: !10)66 $eax = MOV32ri 4, debug-location !DILocation(line: 3, scope: !9, inlinedAt: !10) ; is_stmt (not_key)67 $eax = MOV32ri 5, debug-location !DILocation(line: 3, scope: !5, atomGroup: 1, atomRank: 2) ; is_stmt (key)68 RET64 $eax, debug-location !DILocation(line: 3, scope: !5, atomGroup: 1, atomRank: 1)69...70---71name: not_key72alignment: 1673body: |74 bb.0.entry:75 76 ; OBJ: 0000000000000020 <not_key>:77 ; OBJ-NEXT: 20: movl $0x1, %eax78 ; OBJ-NEXT: 25: movl $0x2, %eax79 ; OBJ-NEXT: 2a: movl $0x3, %eax80 ; OBJ-NEXT: 2f: retq81 ;82 ; Address Line Column File ISA Discriminator OpIndex Flags83 ; ------------------ ------ ------ ------ --- ------------- ------- -------------84 ; DBG-NEXT: 0x0000000000000020 1 0 0 0 0 0 is_stmt prologue_end85 ; DBG-NEXT: 0x0000000000000025 2 0 0 0 0 086 ; DBG-NEXT: 0x000000000000002a 3 0 0 0 0 0 is_stmt87 ; DBG-NEXT: 0x000000000000002f 3 0 0 0 0 088 ;89 $eax = MOV32ri 1, debug-location !DILocation(line: 1, scope: !9) ; is_stmt (prologue_end)90 $eax = MOV32ri 2, debug-location !DILocation(line: 2, scope: !5, inlinedAt: !11, atomGroup: 1, atomRank: 2)91 $eax = MOV32ri 3, debug-location !DILocation(line: 3, scope: !5, inlinedAt: !11, atomGroup: 1, atomRank: 1) ; is_stmt (key)92 RET64 $eax, debug-location !DILocation(line: 3, scope: !9)93...94