1 # RUN: llc -verify-machineinstrs -start-after=prologepilog -filetype=obj -o - %s | llvm-dwarfdump -v --debug-info - | FileCheck %s
2 # CHECK: .debug_info contents:
3 # CHECK: DW_TAG_variable
4 # CHECK-NEXT: DW_AT_location {{.*}} (DW_OP_reg1 RDX, DW_OP_bit_piece 0x8 0x8)
5 # CHECK-NEXT: DW_AT_name {{.*}}"dh"
7 ; Manually created after:
13 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
14 target triple = "x86_64-apple-macosx10.12.0"
16 define signext i8 @f(i32 %i) local_unnamed_addr #0 !dbg !7 {
18 tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !13, metadata !15), !dbg !16
19 %shr1 = lshr i32 %i, 8, !dbg !17
20 %conv = trunc i32 %shr1 to i8, !dbg !18
21 tail call void @llvm.dbg.value(metadata i8 %conv, i64 0, metadata !14, metadata !15), !dbg !19
22 ret i8 %conv, !dbg !20
25 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
27 attributes #0 = { nounwind readnone }
30 !llvm.module.flags = !{!3, !4, !5}
33 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 288677) (llvm/trunk 288679)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
34 !1 = !DIFile(filename: "t.c", directory: "/")
36 !3 = !{i32 2, !"Dwarf Version", i32 4}
37 !4 = !{i32 2, !"Debug Info Version", i32 3}
38 !5 = !{i32 1, !"PIC Level", i32 2}
39 !6 = !{!"clang version 4.0.0 (trunk 288677) (llvm/trunk 288679)"}
40 !7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !12)
41 !8 = !DISubroutineType(types: !9)
43 !10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
44 !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
46 !13 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 1, type: !11)
47 !14 = !DILocalVariable(name: "dh", scope: !7, file: !1, line: 2, type: !10)
49 !16 = !DILocation(line: 1, column: 12, scope: !7)
50 !17 = !DILocation(line: 2, column: 14, scope: !7)
51 !18 = !DILocation(line: 2, column: 13, scope: !7)
52 !19 = !DILocation(line: 2, column: 8, scope: !7)
53 !20 = !DILocation(line: 3, column: 3, scope: !7)
59 exposesReturnsTwice: false
61 regBankSelected: false
63 tracksRegLiveness: true
67 isFrameAddressTaken: false
68 isReturnAddressTaken: false
77 hasOpaqueSPAdjustment: false
79 hasMustTailInVarArgFunc: false
81 - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
86 frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
87 CFI_INSTRUCTION def_cfa_offset 16
88 CFI_INSTRUCTION offset $rbp, -16
89 $rbp = frame-setup MOV64rr $rsp
90 CFI_INSTRUCTION def_cfa_register $rbp
91 DBG_VALUE $dh, _, !14, !15, debug-location !16
92 $edi = SHR32ri killed $edi, 8, implicit-def dead $eflags, debug-location !17
93 $eax = MOVSX32rr8 $dil, implicit killed $edi, debug-location !20
94 $rbp = POP64r implicit-def $rsp, implicit $rsp, debug-location !20
95 RETQ $eax, debug-location !20