1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

DebugInfo: constrain gnu pubnames test further

Ensures that the pubnames entries actually refer to the intended
entities. This test could be more flexible if there was a way to do
multiline FileCheck matches with captures (in that way the test wouldn't
need to have hardcoded offset values and would thus be resilient to
changes in the layout of the DIEs in this CU).

llvm-svn: 191055
This commit is contained in:
David Blaikie 2013-09-19 23:43:46 +00:00
parent f43e48210e
commit 954130581b
2 changed files with 34 additions and 12 deletions

View File

@ -136,8 +136,8 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
PubIndexEntryDescriptor desc(pubNames.getU8(&offset));
OS << format("0x%8.8x ", dieRef)
<< format("%-8s", dwarf::GDBIndexEntryLinkageString(desc.Linkage))
<< ' ' << dwarf::GDBIndexEntryKindString(desc.Kind) << ' '
<< pubNames.getCStr(&offset) << "\n";
<< ' ' << dwarf::GDBIndexEntryKindString(desc.Kind) << " \""
<< pubNames.getCStr(&offset) << "\"\n";
}
}

View File

@ -36,18 +36,40 @@
; ASM: .byte 32 # Kind: VARIABLE, EXTERNAL
; CHECK: .debug_gnu_pubnames contents:
; CHECK-NEXT: Length: 167
; CHECK-NEXT: Version: 2
; CHECK: .debug_info contents:
; CHECK: 0x00000046: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_name {{.*}} "member_function"
; CHECK: 0x00000058: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function"
; CHECK: 0x0000007c: DW_TAG_variable
; CHECK-NEXT: DW_AT_name {{.*}} "global_variable"
; CHECK: 0x00000094: DW_TAG_variable
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_variable"
; CHECK: 0x000000a3: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_function"
; CHECK: 0x000000be: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_specification {{.*}}0x00000046}
; CHECK: 0x000000e8: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_specification {{.*}}0x00000058}
; CHECK: 0x000000ff: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_name {{.*}} "global_function"
; CHECK-LABEL: .debug_gnu_pubnames contents:
; CHECK-NEXT: Length: 167
; CHECK-NEXT: Version: 2
; CHECK-NEXT: Offset in .debug_info: 0
; CHECK-NEXT: Size: 317
; CHECK-NEXT: Size: 317
; CHECK-NEXT: Offset Linkage Kind Name
; CHECK-DAG: 0x00000094 EXTERNAL VARIABLE global_namespace_variable
; CHECK-DAG: 0x000000a3 EXTERNAL FUNCTION global_namespace_function
; CHECK-DAG: 0x000000e8 STATIC FUNCTION static_member_function
; CHECK-DAG: 0x0000007c EXTERNAL VARIABLE global_variable
; CHECK-DAG: 0x000000ff EXTERNAL FUNCTION global_function
; CHECK-DAG: 0x000000be STATIC FUNCTION member_function
; CHECK-DAG: 0x00000094 EXTERNAL VARIABLE "global_namespace_variable"
; CHECK-DAG: 0x000000a3 EXTERNAL FUNCTION "global_namespace_function"
; CHECK-DAG: 0x000000e8 STATIC FUNCTION "static_member_function"
; CHECK-DAG: 0x0000007c EXTERNAL VARIABLE "global_variable"
; CHECK-DAG: 0x000000ff EXTERNAL FUNCTION "global_function"
; CHECK-DAG: 0x000000be STATIC FUNCTION "member_function"
%struct.C = type { i8 }