summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAdrian McCarthy <amccarth@google.com>2017-04-10 16:43:09 +0000
committerAdrian McCarthy <amccarth@google.com>2017-04-10 16:43:09 +0000
commit08eb343cce893e2594de62f1ab976ed03536cb56 (patch)
tree3b347ba58438fd8141fc070cb46d2389974ec645 /llvm/test
parent3eec73e20b8fce19bf2754b270968e876fb31e9d (diff)
downloadbcm5719-llvm-08eb343cce893e2594de62f1ab976ed03536cb56.tar.gz
bcm5719-llvm-08eb343cce893e2594de62f1ab976ed03536cb56.zip
Improves pretty printing of variable types in llvm-pdbdump
* Adds support for pointers to arrays, which was missing * Adds some tests * Improves consistency of const and volatile qualifiers * Eliminates non-composable special case code for arrays and function by using a more general recursive approach * Has a hack for getting the calling convention into the right spot for pointer-to-functions Given the rapid changes happenning in llvm-pdbdump, this may be difficult to merge. Differential Revision: https://reviews.llvm.org/D31832 llvm-svn: 299848
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/DebugInfo/PDB/DIA/pdbdump-linenumbers.test14
-rw-r--r--llvm/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test15
-rw-r--r--llvm/test/DebugInfo/PDB/Inputs/symbolformat.cpp8
-rw-r--r--llvm/test/DebugInfo/PDB/Inputs/symbolformat.pdbbin35840 -> 44032 bytes
4 files changed, 28 insertions, 9 deletions
diff --git a/llvm/test/DebugInfo/PDB/DIA/pdbdump-linenumbers.test b/llvm/test/DebugInfo/PDB/DIA/pdbdump-linenumbers.test
index 780e0db8466..2a596e4af14 100644
--- a/llvm/test/DebugInfo/PDB/DIA/pdbdump-linenumbers.test
+++ b/llvm/test/DebugInfo/PDB/DIA/pdbdump-linenumbers.test
@@ -1,12 +1,14 @@
+; RUN: llvm-pdbdump pretty -lines %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=LINE_NUMS_FPO %s
; RUN: llvm-pdbdump pretty -lines %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=LINE_NUMS %s
-; LINE_NUMS: llvm\test\debuginfo\pdb\inputs\symbolformat-fpo.cpp
-; LINE_NUMS: Line 5, Address: [0x000011a0 - 0x000011a5] (6 bytes)
-; LINE_NUMS: Line 6, Address: [0x000011a6 - 0x000011a6] (1 bytes)
+; LINE_NUMS_FPO: llvm\test\debuginfo\pdb\inputs\symbolformat-fpo.cpp
+; LINE_NUMS_FPO: Line 5, Address: [0x000011a0 - 0x000011a5] (6 bytes)
+; LINE_NUMS_FPO: Line 6, Address: [0x000011a6 - 0x000011a6] (1 bytes)
+
; LINE_NUMS: llvm\test\debuginfo\pdb\inputs\symbolformat.cpp
; LINE_NUMS: Line 6, Address: [0x00001060 - 0x00001066] (7 bytes)
-; LINE_NUMS: Line 72, Address: [0x000010d0 - 0x000010d1] (2 bytes)
-; LINE_NUMS: Line 73, Address: [0x000010d2 - 0x000010d5] (4 bytes)
+; LINE_NUMS: Line 80, Address: [0x000010d0 - 0x000010d1] (2 bytes)
+; LINE_NUMS: Line 81, Address: [0x000010d2 - 0x000010d5] (4 bytes)
; LINE_NUMS: Line 28, Address: [0x00001170 - 0x0000117a] (11 bytes)
; LINE_NUMS: Line 21, Address: [0x00001180 - 0x0000118a] (11 bytes)
-; LINE_NUMS: Line 20, Address: [0x00001190 - 0x0000119a] (11 bytes) \ No newline at end of file
+; LINE_NUMS: Line 20, Address: [0x00001190 - 0x0000119a] (11 bytes)
diff --git a/llvm/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test b/llvm/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test
index 4116deb9922..697a723c483 100644
--- a/llvm/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test
+++ b/llvm/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test
@@ -1,3 +1,4 @@
+; RUN: llvm-pdbdump pretty -symbols %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=SYM_FORMAT_FPO %s
; RUN: llvm-pdbdump pretty -symbols %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=SYM_FORMAT %s
; RUN: llvm-pdbdump pretty -types %p/../Inputs/symbolformat.pdb > %t.types
; RUN: FileCheck --check-prefix=TYPES_FORMAT %s < %t.types
@@ -7,9 +8,11 @@
; RUN: llvm-pdbdump pretty -globals %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=GLOBALS %s
; The format is func [0x<rva_start>+<prologue_length> - 0x<rva_end>-<epilogue_length>]
+; SYM_FORMAT_FPO: ---SYMBOLS---
+; SYM_FORMAT_FPO: symbolformat-fpo.obj
+; SYM_FORMAT-FPO: func [{{.*}}] (FPO) unsigned int __cdecl fpo_func(unsigned int n)
+
; SYM_FORMAT: ---SYMBOLS---
-; SYM_FORMAT: symbolformat-fpo.obj
-; SYM_FORMAT-DAG: func [{{.*}}] (FPO) unsigned int __cdecl fpo_func(unsigned int n)
; SYM_FORMAT: symbolformat.obj
; SYM_FORMAT-DAG: func [{{.*}}] (EBP) int __cdecl _purecall()
; SYM_FORMAT-DAG: func [{{.*}}] (EBP) int __cdecl main(int argc, char** argv)
@@ -50,10 +53,16 @@
; TYPES_2: data +0x28 unsigned __int64 m_unsigned_int64
; TYPES_2: data +0x30 float m_float
; TYPES_2: data +0x38 double m_double
-; TYPES_2: data +0x40 void (__cdecl *m_pfn_2_args)(int, double)
+; TYPES_2: data +0x40 void (__cdecl * m_pfn_2_args)(int, double)
+; TYPES_2: data +0x44 int m_multidimensional_array[2][3]
; TYPES_2: }
; GLOBALS: ---GLOBALS---
; GLOBALS-DAG: func [{{.*}}] (FPO) unsigned int __cdecl fpo_func(unsigned int n)
; GLOBALS-DAG: data [{{.*}}] static void* g_global_pointer
; GLOBALS-DAG: data [{{.*}}] static int g_global_int
+; GLOBALS-DAG: data [{{.*}}] static int g_array[3]
+; GLOBALS-DAG: data [{{.*}}] static int (* g_pointer_to_array)[3]
+; GLOBALS-DAG: data [{{.*}}] static const int* g_pointer_to_const_int
+; GLOBALS-DAG: data int* const g_const_pointer_to_int = 0
+; GLOBALS-DAG: data const int* const g_const_pointer_to_const_int = 0
diff --git a/llvm/test/DebugInfo/PDB/Inputs/symbolformat.cpp b/llvm/test/DebugInfo/PDB/Inputs/symbolformat.cpp
index 5479b717cd9..14b44ae3c31 100644
--- a/llvm/test/DebugInfo/PDB/Inputs/symbolformat.cpp
+++ b/llvm/test/DebugInfo/PDB/Inputs/symbolformat.cpp
@@ -50,6 +50,7 @@ struct MemberTest {
float m_float;
double m_double;
void (*m_pfn_2_args)(int, double);
+ int m_multidimensional_array[2][3];
};
typedef int IntType;
@@ -58,6 +59,13 @@ typedef A ClassAType;
int g_global_int;
void *g_global_pointer = nullptr;
+typedef int int_array[3];
+int_array g_array = { 1, 2, 3 };
+int_array *g_pointer_to_array = &g_array;
+const int *g_pointer_to_const_int = nullptr;
+int * const g_const_pointer_to_int = nullptr;
+const int * const g_const_pointer_to_const_int = nullptr;
+
int main(int argc, char **argv) {
// Force symbol references so the linker generates debug info
B b;
diff --git a/llvm/test/DebugInfo/PDB/Inputs/symbolformat.pdb b/llvm/test/DebugInfo/PDB/Inputs/symbolformat.pdb
index 53d8a1b31a3..0e509f3a93c 100644
--- a/llvm/test/DebugInfo/PDB/Inputs/symbolformat.pdb
+++ b/llvm/test/DebugInfo/PDB/Inputs/symbolformat.pdb
Binary files differ
OpenPOWER on IntegriCloud