69 lines · plain
1; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin | FileCheck %s2; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin -filetype=obj \3; RUN: | llvm-dwarfdump -v - --debug-info | FileCheck %s --check-prefix=DWARF4 5; <rdar://problem/11134152>6 7; CHECK-LABEL: _foo:8; CHECK-NOT: #DEBUG_VALUE9 10; "[DW_FORM_exprloc] <0x2> 91 XX" means fbreg uleb(XX)11; DWARF-LABEL: DW_TAG_formal_parameter12; DWARF-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg -16)13; DWARF-NEXT: DW_AT_name [DW_FORM_strp] ( {{.*}} = "x")14 15; FIXME: There is no debug info to describe "a".16 17define i32 @foo(ptr %x) nounwind uwtable ssp !dbg !5 {18entry:19 %x.addr = alloca ptr, align 820 %saved_stack = alloca ptr21 %cleanup.dest.slot = alloca i3222 store ptr %x, ptr %x.addr, align 823 call void @llvm.dbg.declare(metadata ptr %x.addr, metadata !14, metadata !DIExpression()), !dbg !1524 %0 = load ptr, ptr %x.addr, align 8, !dbg !1625 %1 = load i32, ptr %0, align 4, !dbg !1626 %2 = zext i32 %1 to i64, !dbg !1627 %3 = call ptr @llvm.stacksave(), !dbg !1628 store ptr %3, ptr %saved_stack, !dbg !1629 %vla = alloca i8, i64 %2, align 16, !dbg !1630 call void @llvm.dbg.declare(metadata ptr %vla, metadata !18, metadata !DIExpression()), !dbg !2331 store i32 1, ptr %cleanup.dest.slot32 %4 = load ptr, ptr %saved_stack, !dbg !2433 call void @llvm.stackrestore(ptr %4), !dbg !2434 ret i32 0, !dbg !2535}36 37declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone38 39declare ptr @llvm.stacksave() nounwind40 41declare void @llvm.stackrestore(ptr) nounwind42 43!llvm.dbg.cu = !{!0}44!llvm.module.flags = !{!27}45 46!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153698)", isOptimized: false, emissionKind: FullDebug, file: !26, enums: !1, retainedTypes: !1, globals: !1)47!1 = !{}48!5 = distinct !DISubprogram(name: "foo", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, file: !26, scope: !0, type: !7)49!6 = !DIFile(filename: "20020104-2.c", directory: "/Volumes/Sandbox/llvm")50!7 = !DISubroutineType(types: !8)51!8 = !{!9, !10}52!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)53!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11)54!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)55!14 = !DILocalVariable(name: "x", line: 5, arg: 1, scope: !5, file: !6, type: !10)56!15 = !DILocation(line: 5, column: 21, scope: !5)57!16 = !DILocation(line: 7, column: 13, scope: !17)58!17 = distinct !DILexicalBlock(line: 6, column: 1, file: !26, scope: !5)59!18 = !DILocalVariable(name: "a", line: 7, scope: !17, file: !6, type: !19)60!19 = !DICompositeType(tag: DW_TAG_array_type, align: 8, baseType: !20, elements: !21)61!20 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)62!21 = !{!22}63!22 = !DISubrange(count: -1)64!23 = !DILocation(line: 7, column: 8, scope: !17)65!24 = !DILocation(line: 9, column: 1, scope: !17)66!25 = !DILocation(line: 8, column: 3, scope: !17)67!26 = !DIFile(filename: "20020104-2.c", directory: "/Volumes/Sandbox/llvm")68!27 = !{i32 1, !"Debug Info Version", i32 3}69