• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=x86_64-linux -O0 -o - -filetype=obj < %s | llvm-dwarfdump -debug-dump=info -| FileCheck %s
2; RUN: llc -mtriple=x86_64-linux -dwarf-version=2 -O0 -o - -filetype=obj < %s | llvm-dwarfdump -debug-dump=info -| FileCheck -check-prefix=DWARF2 %s
3
4; Generated from Clang with the following source:
5;
6; struct foo {
7;   char c;
8;   int i;
9; };
10;
11; foo f;
12
13; CHECK: DW_AT_name {{.*}} "c"
14; CHECK-NOT: DW_TAG
15; CHECK: DW_AT_data_member_location {{.*}} (0x00)
16
17; CHECK: DW_AT_name {{.*}} "i"
18; CHECK-NOT: DW_TAG
19; CHECK: DW_AT_data_member_location {{.*}} (0x04)
20
21; DWARF2: DW_AT_name {{.*}} "c"
22; DWARF2-NOT: DW_TAG
23; DWARF2: DW_AT_data_member_location {{.*}} (<0x02> 23 00 )
24
25; DWARF2: DW_AT_name {{.*}} "i"
26; DWARF2-NOT: DW_TAG
27; DWARF2: DW_AT_data_member_location {{.*}} (<0x02> 23 04 )
28
29%struct.foo = type { i8, i32 }
30
31@f = global %struct.foo zeroinitializer, align 4
32
33!llvm.dbg.cu = !{!0}
34!llvm.module.flags = !{!13, !15}
35!llvm.ident = !{!14}
36
37!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !10, imports: !2)
38!1 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")
39!2 = !{}
40!3 = !{!4}
41!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 64, align: 32, file: !1, elements: !5, identifier: "_ZTS3foo")
42!5 = !{!6, !8}
43!6 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 2, size: 8, align: 8, file: !1, scope: !4, baseType: !7)
44!7 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
45!8 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 3, size: 32, align: 32, offset: 32, file: !1, scope: !4, baseType: !9)
46!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
47!10 = !{!11}
48!11 = !DIGlobalVariable(name: "f", line: 6, isLocal: false, isDefinition: true, scope: null, file: !12, type: !4, variable: %struct.foo* @f)
49!12 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")
50!13 = !{i32 2, !"Dwarf Version", i32 4}
51!14 = !{!"clang version 3.4 "}
52
53!15 = !{i32 1, !"Debug Info Version", i32 3}
54