summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-30 18:15:47 +0000
committerZachary Turner <zturner@google.com>2017-06-30 18:15:47 +0000
commit02a267758e0f2fb0b1475e8c68cdfae8411f2483 (patch)
treecfdeee091483b19acc22cd28420249c0ef5c4296 /llvm/test/tools
parent9dd7e808b31f2a5370802ce94305ca822679418f (diff)
downloadbcm5719-llvm-02a267758e0f2fb0b1475e8c68cdfae8411f2483.tar.gz
bcm5719-llvm-02a267758e0f2fb0b1475e8c68cdfae8411f2483.zip
[llvm-pdbutil] Add the ability to dump the dependency tree for a type
Previously we had the -type-index option which would dump the record of a single, but we had no way to follow the dependency graph backwards and also dump all dependent types. Having this option makes test-writing better, because we can limit the test to only those records that are of importance for the thing we're trying to test, which allows us to use things like CHECK-NEXT to reduce fragility. Differential Revision: https://reviews.llvm.org/D34899 llvm-svn: 306852
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/llvm-pdbdump/partial-type-stream.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-pdbdump/partial-type-stream.test b/llvm/test/tools/llvm-pdbdump/partial-type-stream.test
new file mode 100644
index 00000000000..3a853c39145
--- /dev/null
+++ b/llvm/test/tools/llvm-pdbdump/partial-type-stream.test
@@ -0,0 +1,30 @@
+; RUN: llvm-pdbutil dump -type-index=0x1019 %p/Inputs/ClassLayoutTest.pdb \
+; RUN: | FileCheck --check-prefix=NODEPS %s
+; RUN: llvm-pdbutil dump -type-index=0x1019 -dependents %p/Inputs/ClassLayoutTest.pdb \
+; RUN: | FileCheck --check-prefix=DEPS %s
+
+
+NODEPS: Types (TPI Stream)
+NODEPS-NEXT: ============================================================
+NODEPS-NEXT: Showing 1 records.
+NODEPS-NEXT: 0x1019 | LF_MFUNCTION [size = 28]
+NODEPS-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100E
+NODEPS-NEXT: class type = 0x1017, this type = 0x1018, this adjust = 0
+NODEPS-NEXT: calling conv = thiscall, options = None
+
+
+DEPS: Types (TPI Stream)
+DEPS-NEXT: ============================================================
+DEPS-NEXT: Showing 1 records and their dependents (4 records total)
+DEPS-NEXT: 0x100E | LF_ARGLIST [size = 8]
+DEPS-NEXT: 0x1017 | LF_CLASS [size = 60]
+DEPS-NEXT: class name: `MembersTest::A`
+DEPS-NEXT: unique name: `.?AVA@MembersTest@@`
+DEPS-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>
+DEPS-NEXT: options: forward ref | has unique name
+DEPS-NEXT: 0x1018 | LF_POINTER [size = 12]
+DEPS-NEXT: referent = 0x1017, mode = pointer, opts = const, kind = ptr32
+DEPS-NEXT: 0x1019 | LF_MFUNCTION [size = 28]
+DEPS-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100E
+DEPS-NEXT: class type = 0x1017, this type = 0x1018, this adjust = 0
+DEPS-NEXT: calling conv = thiscall, options = None
OpenPOWER on IntegriCloud