1; RUN: llc -mtriple=x86_64-linux -O0 -o - -filetype=obj < %s | llvm-dwarfdump -v -debug-info -| FileCheck %s 2; RUN: llc -mtriple=x86_64-linux -dwarf-version=2 -O0 -o - -filetype=obj < %s | llvm-dwarfdump -v -debug-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 {{.*}} (DW_OP_plus_uconst 0x0) 24 25; DWARF2: DW_AT_name {{.*}} "i" 26; DWARF2-NOT: DW_TAG 27; DWARF2: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x4) 28 29source_filename = "test/DebugInfo/X86/data_member_location.ll" 30 31%struct.foo = type { i8, i32 } 32 33@f = global %struct.foo zeroinitializer, align 4, !dbg !0 34 35!llvm.dbg.cu = !{!9} 36!llvm.module.flags = !{!13, !14} 37!llvm.ident = !{!15} 38 39!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 40!1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 6, type: !3, isLocal: false, isDefinition: true) 41!2 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo") 42!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !2, line: 1, size: 64, align: 32, elements: !4, identifier: "_ZTS3foo") 43!4 = !{!5, !7} 44!5 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !3, file: !2, line: 2, baseType: !6, size: 8, align: 8) 45!6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) 46!7 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !3, file: !2, line: 3, baseType: !8, size: 32, align: 32, offset: 32) 47!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 48!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, retainedTypes: !11, globals: !12, imports: !10) 49!10 = !{} 50!11 = !{!3} 51!12 = !{!0} 52!13 = !{i32 2, !"Dwarf Version", i32 4} 53!14 = !{i32 1, !"Debug Info Version", i32 3} 54!15 = !{!"clang version 3.4 "} 55 56