xref: /aosp_15_r20/external/llvm/test/DebugInfo/X86/struct-loc.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; Make sure that structures have a decl file and decl line attached.
5*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_structure_type
6*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_decl_file
7*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_decl_line
8*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_member
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker%struct.foo = type { i32 }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker@f = common global %struct.foo zeroinitializer, align 4
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
15*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!12}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, emissionKind: FullDebug, file: !11, enums: !1, retainedTypes: !1, globals: !3, imports:  !1)
18*9880d681SAndroid Build Coastguard Worker!1 = !{}
19*9880d681SAndroid Build Coastguard Worker!3 = !{!5}
20*9880d681SAndroid Build Coastguard Worker!5 = !DIGlobalVariable(name: "f", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.foo* @f)
21*9880d681SAndroid Build Coastguard Worker!6 = !DIFile(filename: "struct_bug.c", directory: "/Users/echristo/tmp")
22*9880d681SAndroid Build Coastguard Worker!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 32, align: 32, file: !11, elements: !8)
23*9880d681SAndroid Build Coastguard Worker!8 = !{!9}
24*9880d681SAndroid Build Coastguard Worker!9 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !11, scope: !7, baseType: !10)
25*9880d681SAndroid Build Coastguard Worker!10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
26*9880d681SAndroid Build Coastguard Worker!11 = !DIFile(filename: "struct_bug.c", directory: "/Users/echristo/tmp")
27*9880d681SAndroid Build Coastguard Worker!12 = !{i32 1, !"Debug Info Version", i32 3}
28