summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-16 21:19:20 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-16 21:19:20 +0000
commit2ee7b881a04573b82d9d34fffd44b71b9ccc2186 (patch)
tree6dd69fdd2775b3661876b971c0bca8777706adb7 /lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs
parent5fa75a048822b2c11856b1890f00d6d685bc6855 (diff)
downloadbcm5719-llvm-2ee7b881a04573b82d9d34fffd44b71b9ccc2186.tar.gz
bcm5719-llvm-2ee7b881a04573b82d9d34fffd44b71b9ccc2186.zip
Change TypeSystem::GetBitSize() to return an optional result.
This patch changes the behavior when printing C++ function references: where we previously would get a <could not determine size>, there is now a <no summary available>. It's not clear to me whether this is a bug or an omission, but it's one step further than LLDB previously got. Differential Revision: https://reviews.llvm.org/D56798 llvm-svn: 351376
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/Makefile3
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/TestFunctionRefs.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/main.cpp32
3 files changed, 39 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/Makefile b/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/Makefile
new file mode 100644
index 00000000000..99bfa7e03b4
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/TestFunctionRefs.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/TestFunctionRefs.py
new file mode 100644
index 00000000000..c8308c16011
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/TestFunctionRefs.py
@@ -0,0 +1,4 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals())
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/main.cpp
new file mode 100644
index 00000000000..a57b0867fb8
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/main.cpp
@@ -0,0 +1,32 @@
+// This is plagiarized from lit/SymbolFile/NativePDB/function-types-builtin.cpp.
+void nullary() {}
+
+template<typename Arg>
+void unary(Arg) { }
+
+template<typename A1, typename A2>
+void binary(A1, A2) { }
+
+int varargs(int, int, ...) { return 0; }
+
+auto &ref = unary<bool>;
+auto &ref2 = unary<volatile int*>;
+auto &ref3 = varargs;
+auto binp = &binary<int*, const int*>;
+auto &binr = binary<int*, const int*>;
+auto null = &nullary;
+int main(int argc, char **argv) {
+//% self.expect("target var ref", substrs=["(void (&)(bool))", "ref = 0x",
+//% "&::ref = <no summary available>"])
+//% self.expect("target var ref2",
+//% substrs=["(void (&)(volatile int *))", "ref2 = 0x"])
+//% self.expect("target var ref3",
+//% substrs=["(int (&)(int, int, ...))", "ref3 = 0x"])
+//% self.expect("target var binp",
+//% substrs=["(void (*)(int *, const int *))", "binp = 0x"])
+//% self.expect("target var binr",
+//% substrs=["(void (&)(int *, const int *))", "binr = 0x"])
+//% self.expect("target var null",
+//% substrs=["(void (*)())", "null = 0x"])
+ return 0;
+}
OpenPOWER on IntegriCloud