[libcxxabi] r318765 - [demangler] Document some features that the demangler doesn't yet support, NFC

Erik Pilkington via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 07:04:08 PST 2017


Author: epilk
Date: Tue Nov 21 07:04:08 2017
New Revision: 318765

URL: http://llvm.org/viewvc/llvm-project?rev=318765&view=rev
Log:
[demangler] Document some features that the demangler doesn't yet support, NFC

Modified:
    libcxxabi/trunk/src/cxa_demangle.cpp
    libcxxabi/trunk/test/test_demangle.pass.cpp

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=318765&r1=318764&r2=318765&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Tue Nov 21 07:04:08 2017
@@ -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"

Modified: libcxxabi/trunk/test/test_demangle.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_demangle.pass.cpp?rev=318765&r1=318764&r2=318765&view=diff
==============================================================================
--- libcxxabi/trunk/test/test_demangle.pass.cpp (original)
+++ libcxxabi/trunk/test/test_demangle.pass.cpp Tue Nov 21 07:04:08 2017
@@ -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




More information about the cfe-commits mailing list