summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2023-03-07 12:08:07 +0000
committerMichael Buch <michaelbuch12@gmail.com>2023-03-07 14:17:35 +0000
commit554f79e050cb240d00e239ee4ca8d6aefdfa737d (patch)
treeb8177a3015ac925f3bb5f96c2ba50ce409edf0e9 /lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
parent2b62774b653affb7e5ef35e25745e80612b990a9 (diff)
[lldb][test] TestDataFormatterCpp.py: add test-case for member function pointer format
This patch adds a test for formatting of member function pointers. This was split from https://reviews.llvm.org/D145242, which caused this test case to fail on Windows buildbots. I split this out in order to make sure that this indeed works on Windows without the D145242 patch. Differential Revision: https://reviews.llvm.org/D145487
Diffstat (limited to 'lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp')
-rw-r--r--lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
index c81a68fd2094..1b54acf811e8 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-cpp/main.cpp
@@ -57,6 +57,9 @@ struct IUseCharStar
{
const char* pointer;
IUseCharStar() : pointer("Hello world") {}
+
+ char const *member_func(int) { return ""; }
+ virtual void virt_member_func() {}
};
int main (int argc, const char * argv[])
@@ -106,7 +109,15 @@ int main (int argc, const char * argv[])
char* strptr = "Hello world!";
i_am_cooler the_coolest_guy(1,2,3.14,6.28,'E','G');
-
+
+ const char *IUseCharStar::*member_ptr = &IUseCharStar::pointer;
+ const char *(IUseCharStar::*member_func_ptr)(int) =
+ &IUseCharStar::member_func;
+ auto &ref_to_member_func_ptr = member_func_ptr;
+
+ void (IUseCharStar::*virt_member_func_ptr)() =
+ &IUseCharStar::virt_member_func;
+
return 0; // Set break point at this line.
}