summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2017-11-21 15:04:08 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2017-11-21 15:04:08 +0000
commit1c300b9e6592df8e2259cf79f5abb121fb95de30 (patch)
treee2d8d6087f6b509617d40c24f1c272f95e81305b
parent43600b48fcd9201db390d94ffcce2625c5925f07 (diff)
[demangler] Document some features that the demangler doesn't yet support, NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@318765 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/cxa_demangle.cpp6
-rw-r--r--test/test_demangle.pass.cpp35
2 files changed, 39 insertions, 2 deletions
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index 7d17318..96e41f0 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -7,6 +7,12 @@
//
//===----------------------------------------------------------------------===//
+// FIXME: (possibly) incomplete list of features that clang mangles that this
+// file does not yet support:
+// - enable_if attribute
+// - decomposition declarations
+// - C++ modules TS
+
#define _LIBCPP_NO_EXCEPTIONS
#include "__cxxabi_config.h"
diff --git a/test/test_demangle.pass.cpp b/test/test_demangle.pass.cpp
index 18bbbba..8be7168 100644
--- a/test/test_demangle.pass.cpp
+++ b/test/test_demangle.pass.cpp
@@ -29712,7 +29712,7 @@ void test()
free(buf);
}
-void test2()
+void test_invalid_cases()
{
std::size_t len = 0;
char* buf = nullptr;
@@ -29733,6 +29733,36 @@ void test2()
free(buf);
}
+const char *xfail_cases[] = {
+ "_Z1fUa9enable_ifIXLi1EEEv", // enable_if attribute
+ "_ZDC2a12a2E", // decomposition decl
+ "_ZW6FooBarE2f3v", // C++ modules TS
+};
+
+const size_t num_xfails = sizeof(xfail_cases) / sizeof(xfail_cases[0]);
+
+void test_xfail_cases()
+{
+ std::size_t len = 0;
+ char* buf = nullptr;
+ for (std::size_t i = 0; i < num_xfails; ++i)
+ {
+ int status;
+ char* demang = __cxxabiv1::__cxa_demangle(xfail_cases[i], buf, &len, &status);
+ if (status != -2)
+ {
+ std::cout << xfail_cases[i] << " was documented as xfail but passed\n"
+ << "got status = " << status << '\n';
+ assert(status == -2);
+ }
+ else
+ {
+ buf = demang;
+ }
+ }
+ free(buf);
+}
+
void testFPLiterals()
{
std::size_t len = 0;
@@ -29769,7 +29799,8 @@ int main()
{
timer t;
test();
- test2();
+ test_invalid_cases();
+ test_xfail_cases();
testFPLiterals();
}
#if 0