31 lines · plain
1; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj2; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s3 4; Make sure that structures have a decl file and decl line attached.5; CHECK: DW_TAG_structure_type6; CHECK: DW_AT_decl_file7; CHECK: DW_AT_decl_line8; CHECK: DW_TAG_member9 10source_filename = "test/DebugInfo/X86/struct-loc.ll"11 12%struct.foo = type { i32 }13 14@f = common global %struct.foo zeroinitializer, align 4, !dbg !015 16!llvm.dbg.cu = !{!7}17!llvm.module.flags = !{!10}18 19!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())20!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true)21!2 = !DIFile(filename: "struct_bug.c", directory: "/Users/echristo/tmp")22!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !2, line: 1, size: 32, align: 32, elements: !4)23!4 = !{!5}24!5 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !3, file: !2, line: 2, baseType: !6, size: 32, align: 32)25!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)26!7 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !8, retainedTypes: !8, globals: !9, imports: !8)27!8 = !{}28!9 = !{!0}29!10 = !{i32 1, !"Debug Info Version", i32 3}30 31