diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2017-11-21 15:04:08 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2017-11-21 15:04:08 +0000 |
commit | 1b7f8d5b043a2c97d4db17fdbd092cf097d8445d (patch) | |
tree | a1f1d4bb763acfaf20b30c1b4d359d03d7979bdb | |
parent | a054ea9848b94c5e51a07cc062c271f3162d6b88 (diff) | |
download | bcm5719-llvm-1b7f8d5b043a2c97d4db17fdbd092cf097d8445d.tar.gz bcm5719-llvm-1b7f8d5b043a2c97d4db17fdbd092cf097d8445d.zip |
[demangler] Document some features that the demangler doesn't yet support, NFC
llvm-svn: 318765
-rw-r--r-- | libcxxabi/src/cxa_demangle.cpp | 6 | ||||
-rw-r--r-- | libcxxabi/test/test_demangle.pass.cpp | 35 |
2 files changed, 39 insertions, 2 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp index 7d173189835..96e41f0d52f 100644 --- a/libcxxabi/src/cxa_demangle.cpp +++ b/libcxxabi/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/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp index 18bbbba8862..8be716892f6 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/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 |