From 2ee7b881a04573b82d9d34fffd44b71b9ccc2186 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 16 Jan 2019 21:19:20 +0000 Subject: Change TypeSystem::GetBitSize() to return an optional result. This patch changes the behavior when printing C++ function references: where we previously would get a , there is now a . 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 --- .../lldbsuite/test/lang/cpp/function_refs/Makefile | 3 ++ .../lang/cpp/function_refs/TestFunctionRefs.py | 4 +++ .../lldbsuite/test/lang/cpp/function_refs/main.cpp | 32 ++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/Makefile create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/TestFunctionRefs.py create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/function_refs/main.cpp (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp') 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 +void unary(Arg) { } + +template +void binary(A1, A2) { } + +int varargs(int, int, ...) { return 0; } + +auto &ref = unary; +auto &ref2 = unary; +auto &ref3 = varargs; +auto binp = &binary; +auto &binr = binary; +auto null = &nullary; +int main(int argc, char **argv) { +//% self.expect("target var ref", substrs=["(void (&)(bool))", "ref = 0x", +//% "&::ref = "]) +//% 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; +} -- cgit v1.2.3