diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-01-16 21:19:20 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-01-16 21:19:20 +0000 |
commit | 2ee7b881a04573b82d9d34fffd44b71b9ccc2186 (patch) | |
tree | 6dd69fdd2775b3661876b971c0bca8777706adb7 /lldb/packages/Python/lldbsuite | |
parent | 5fa75a048822b2c11856b1890f00d6d685bc6855 (diff) | |
download | bcm5719-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')
4 files changed, 43 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/struct_types/main.c b/lldb/packages/Python/lldbsuite/test/lang/c/struct_types/main.c index 29ac10cb94a..02fefd36cee 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/struct_types/main.c +++ b/lldb/packages/Python/lldbsuite/test/lang/c/struct_types/main.c @@ -29,6 +29,10 @@ int main (int argc, char const *argv[]) //% self.expect("expression -- (pt.padding[0])", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["(char)", " = "]) //% self.expect("image lookup -t point_tag", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ['padding[]']) # Once rdar://problem/12566646 is fixed, this should display correctly + struct {} empty; + //% self.expect("frame variable empty", substrs = ["empty = {}"]) + //% self.expect("expression -- sizeof(empty)", substrs = ["= 0"]) + struct rect_tag { struct point_tag bottom_left; struct point_tag top_right; 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; +} |