1 ; RUN: llc -mtriple=x86_64-apple-darwin10 < %s | FileCheck %s
3 %struct.a = type { i32 }
5 define i32 @bar(ptr nocapture %b) nounwind ssp !dbg !0 {
7 tail call void @llvm.dbg.value(metadata ptr %b, metadata !6, metadata !DIExpression()), !dbg !13
8 %tmp2 = load i32, ptr %b, align 4, !dbg !14
9 tail call void @llvm.dbg.value(metadata i32 %tmp2, metadata !11, metadata !DIExpression()), !dbg !14
10 %call = tail call i32 (...) @foo(i32 %tmp2) nounwind , !dbg !18
11 %add = add nsw i32 %tmp2, 1, !dbg !19
12 ret i32 %add, !dbg !19
17 declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
20 !llvm.module.flags = !{!24}
22 !0 = distinct !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !22, scope: !1, type: !3, retainedNodes: !21)
23 !1 = !DIFile(filename: "bar.c", directory: "/private/tmp")
24 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 122997)", isOptimized: true, emissionKind: FullDebug, file: !22, enums: !23, retainedTypes: !23, imports: null)
25 !3 = !DISubroutineType(types: !4)
27 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
28 !6 = !DILocalVariable(name: "b", line: 5, arg: 1, scope: !0, file: !1, type: !7)
29 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !8)
30 !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "a", line: 1, size: 32, align: 32, file: !22, scope: !2, elements: !9)
32 !10 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 2, size: 32, align: 32, file: !22, scope: !1, baseType: !5)
33 !11 = !DILocalVariable(name: "x", line: 6, scope: !12, file: !1, type: !5)
34 !12 = distinct !DILexicalBlock(line: 5, column: 22, file: !22, scope: !0)
35 !13 = !DILocation(line: 5, column: 19, scope: !0)
36 !14 = !DILocation(line: 6, column: 14, scope: !12)
37 !18 = !DILocation(line: 7, column: 2, scope: !12)
38 !19 = !DILocation(line: 8, column: 2, scope: !12)
40 !22 = !DIFile(filename: "bar.c", directory: "/private/tmp")
43 ; Check that variable bar:b value range is appropriately truncated in debug info.
44 ; The variable is in %rdi which is clobbered by 'movl %ebx, %edi'
45 ; Here Ltmp7 is the end of the location range.
49 ;CHECK-NEXT: [[CLOBBER:Ltmp[0-9]*]]
52 ;CHECK-NEXT: .set Lset{{.*}},
54 ;CHECK-NEXT: .set [[CLOBBER_OFF:Lset.*]], [[CLOBBER]]-{{.*}}
55 ;CHECK-NEXT: .quad [[CLOBBER_OFF]]
56 ;CHECK-NEXT: .short 1 ## Loc expr size
57 ;CHECK-NEXT: .byte 85 ## DW_OP_reg
60 !24 = !{i32 1, !"Debug Info Version", i32 3}