summaryrefslogtreecommitdiffstats
path: root/lldb/lit/SymbolFile
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-06-12 12:57:36 +0000
committerPavel Labath <labath@google.com>2018-06-12 12:57:36 +0000
commite6954cb2a1819abe0dd3b7cd46b41bc28302f155 (patch)
tree781fe55ee89ef8d8fec0253c03800653f18017be /lldb/lit/SymbolFile
parent3d671248abc0949fad063a390fba8c17aa545a40 (diff)
downloadbcm5719-llvm-e6954cb2a1819abe0dd3b7cd46b41bc28302f155.tar.gz
bcm5719-llvm-e6954cb2a1819abe0dd3b7cd46b41bc28302f155.zip
lldb-test symbols: Add -file argument and the ability to dump global variables in a file
The motivation for this is to be able to Dwarf index ability to look up variables within a given compilation unit. It also fits in with the patch in progress at D47939, which will add the ability to look up funtions using file+line pairs. The verification of which lldb-test options can be used together was getting a bit unwieldy, so I moved the logic out into a separate function. llvm-svn: 334498
Diffstat (limited to 'lldb/lit/SymbolFile')
-rw-r--r--lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp3
-rw-r--r--lldb/lit/SymbolFile/DWARF/find-variable-file.cpp20
2 files changed, 23 insertions, 0 deletions
diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp b/lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp
new file mode 100644
index 00000000000..cd02cb07c62
--- /dev/null
+++ b/lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp
@@ -0,0 +1,3 @@
+namespace two {
+int foo;
+}
diff --git a/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp b/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp
new file mode 100644
index 00000000000..4f0cb573aea
--- /dev/null
+++ b/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp
@@ -0,0 +1,20 @@
+// REQUIRES: lld
+
+// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux %s
+// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux %S/Inputs/find-variable-file-2.cpp
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=ONE %s
+// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=TWO %s
+
+// ONE: Found 1 variables:
+namespace one {
+int foo;
+// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-file.cpp:[[@LINE-1]]
+} // namespace one
+
+extern "C" void _start() {}
+
+// TWO: Found 1 variables:
+// TWO-DAG: name = "foo", {{.*}} decl = find-variable-file-2.cpp:2
OpenPOWER on IntegriCloud