summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Core/RichManglingContextTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/unittests/Core/RichManglingContextTest.cpp')
-rw-r--r--lldb/unittests/Core/RichManglingContextTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/unittests/Core/RichManglingContextTest.cpp b/lldb/unittests/Core/RichManglingContextTest.cpp
index 19329ac8208..3bb0aaecbed 100644
--- a/lldb/unittests/Core/RichManglingContextTest.cpp
+++ b/lldb/unittests/Core/RichManglingContextTest.cpp
@@ -57,6 +57,29 @@ TEST(RichManglingContextTest, FromCxxMethodName) {
ItaniumRMC.ParseFullName();
CxxMethodRMC.ParseFullName();
EXPECT_TRUE(ItaniumRMC.GetBufferRef() == CxxMethodRMC.GetBufferRef());
+
+ // Construct with a random name.
+ {
+ RichManglingContext CxxMethodRMC;
+ EXPECT_TRUE(CxxMethodRMC.FromCxxMethodName(ConstString("X")));
+
+ // We expect it is not a function.
+ EXPECT_FALSE(CxxMethodRMC.IsFunction());
+ }
+
+ // Construct with a function without a context.
+ {
+ RichManglingContext CxxMethodRMC;
+ EXPECT_TRUE(CxxMethodRMC.FromCxxMethodName(
+ ConstString("void * operator new(unsigned __int64)")));
+
+ // We expect it is a function.
+ EXPECT_TRUE(CxxMethodRMC.IsFunction());
+
+ // We expect its context is empty.
+ CxxMethodRMC.ParseFunctionDeclContextName();
+ EXPECT_TRUE(CxxMethodRMC.GetBufferRef().empty());
+ }
}
TEST(RichManglingContextTest, SwitchProvider) {
OpenPOWER on IntegriCloud