Changeset View
Changeset View
Standalone View
Standalone View
libcxxabi/test/test_demangle.pass.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 29,861 Lines • ▼ Show 20 Lines | // {"_Z1fM1XRFivEMS_OFivEMS_KOFivE", "f(int (X::*)() &, int (X::*)() &&, int (X::*)() const &&)"}, | ||||
{"_ZN2FnIXgsnw_iEEXna_ipiLi4EEEEEvv", "void Fn<::new int, new[] int(4)>()"}, | {"_ZN2FnIXgsnw_iEEXna_ipiLi4EEEEEvv", "void Fn<::new int, new[] int(4)>()"}, | ||||
{"_ZN2FnIXnwLj4E_iEEXgsnaLj4E_ipiLi4EEEEEvv", "void Fn<new(4u) int, ::new[](4u) int(4)>()"}, | {"_ZN2FnIXnwLj4E_iEEXgsnaLj4E_ipiLi4EEEEEvv", "void Fn<new(4u) int, ::new[](4u) int(4)>()"}, | ||||
{"_ZN2FnIXgsdlLi4EEXdaLi4EEEEvv", "void Fn<::delete 4, delete[] 4>()"}, | {"_ZN2FnIXgsdlLi4EEXdaLi4EEEEvv", "void Fn<::delete 4, delete[] 4>()"}, | ||||
{"_ZN2FnIXdlLj4EEXgsdaLj4EEEEvv", "void Fn<delete 4u, ::delete[] 4u>()"}, | {"_ZN2FnIXdlLj4EEXgsdaLj4EEEEvv", "void Fn<delete 4u, ::delete[] 4u>()"}, | ||||
{"_Z3TPLIiET_S0_", "int TPL<int>(int)"}, | {"_Z3TPLIiET_S0_", "int TPL<int>(int)"}, | ||||
{"_ZN1XawEv", "X::operator co_await()"}, | {"_ZN1XawEv", "X::operator co_await()"}, | ||||
// C++20 modules | |||||
{"_ZN5Outer5InnerW3FOO2FnERNS0_1XE", "Outer::Inner::Fn@FOO(Outer::Inner::X&)"}, | |||||
{"_ZN5OuterW3FOO5Inner2FnERNS1_1XE", "Outer::Inner@FOO::Fn(Outer::Inner@FOO::X&)"}, | |||||
{"_ZN4Quux4TotoW3FooW3Bar3BazEPNS0_S2_5PlughE", "Quux::Toto::Baz@Foo.Bar(Quux::Toto::Plugh@Foo.Bar*)"}, | |||||
{"_ZW6Module1fNS_1a1bENS0_1cE", "f@Module(a@Module::b, a@Module::c)"}, | |||||
{"_ZN3BobW3FOOW3BAR3BarEPS1_1APNS_S1_1BE", "Bob::Bar@FOO.BAR(A@FOO.BAR*, Bob::B@FOO.BAR*)"}, | |||||
{"_ZW3FOOW3BAR3FooPS0_1APN3BobS0_1BE", "Foo@FOO.BAR(A@FOO.BAR*, Bob::B@FOO.BAR*)"}, | |||||
{"_ZN3BobW3FOOW3BAZ3FooEPS0_W3BAR1APNS_S2_1BE", "Bob::Foo@FOO.BAZ(A@FOO.BAR*, Bob::B@FOO.BAR*)"}, | |||||
{"_ZW3FOOW3BAZ3BarPS_W3BAR1APN3BobS1_1BE", "Bar@FOO.BAZ(A@FOO.BAR*, Bob::B@FOO.BAR*)"}, | |||||
{"_ZNW3FOO3TPLIS_3OneE1MEPS1_", "TPL@FOO<One@FOO>::M(One@FOO*)"}, | |||||
{"_ZNW3FOO3TPLIS_3OneE1NIS_3TwoEEvPS1_PT_", "void TPL@FOO<One@FOO>::N<Two@FOO>(One@FOO*, Two@FOO*)"}, | |||||
{"_ZN3NMSW3FOO3TPLINS_S0_3OneEE1MEPS2_", "NMS::TPL@FOO<NMS::One@FOO>::M(NMS::One@FOO*)"}, | |||||
{"_ZN3NMSW3FOO3TPLINS_S0_3OneEE1NINS_S0_3TwoEEEvPS2_PT_", | |||||
"void NMS::TPL@FOO<NMS::One@FOO>::N<NMS::Two@FOO>(NMS::One@FOO*, NMS::Two@FOO*)"}, | |||||
{"_ZNStW3STD9allocatorIiE1MEPi", "std::allocator@STD<int>::M(int*)"}, | |||||
{"_ZNStW3STD9allocatorIiE1NIfEEPT_Pi", "float* std::allocator@STD<int>::N<float>(int*)"}, | |||||
{"_ZNStW3STD9allocatorI4PoohE1MEPS1_", "std::allocator@STD<Pooh>::M(Pooh*)"}, | |||||
{"_ZNStW3STD9allocatorI4PoohE1NI6PigletEEPT_PS1_", "Piglet* std::allocator@STD<Pooh>::N<Piglet>(Pooh*)"}, | |||||
{"_ZW3FooDC1a1bE", "[a, b]@Foo"}, | |||||
{"_ZN1NW3FooDC1a1bEE", "N::[a, b]@Foo"}, | |||||
{"_ZN3NMSW3MOD3FooB3ABIEv", "NMS::Foo@MOD[abi:ABI]()"}, | |||||
{"_ZGIW3Foo", "initializer for module Foo"}, | |||||
{"_ZGIW3FooW3Bar", "initializer for module Foo.Bar"}, | |||||
{"_ZGIW3FooWP3BarW3Baz", "initializer for module Foo:Bar.Baz"}, | |||||
}; | }; | ||||
const unsigned N = sizeof(cases) / sizeof(cases[0]); | const unsigned N = sizeof(cases) / sizeof(cases[0]); | ||||
struct FPLiteralCase { | struct FPLiteralCase { | ||||
const char *mangled; | const char *mangled; | ||||
// There are four possible demanglings of a given float. | // There are four possible demanglings of a given float. | ||||
std::string expecting[4]; | std::string expecting[4]; | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | // The following test cases were found by libFuzzer+ASAN | ||||
"_ZN3CLSIiEIiEE", | "_ZN3CLSIiEIiEE", | ||||
"_ZN3CLSDtLi0EEE", | "_ZN3CLSDtLi0EEE", | ||||
"_ZN3CLSIiEEvNS_T_Ev", | "_ZN3CLSIiEEvNS_T_Ev", | ||||
"_ZN1fIiEEvNTUt_E", | "_ZN1fIiEEvNTUt_E", | ||||
"_ZNDTUt_Ev", | "_ZNDTUt_Ev", | ||||
"_ZN1fIXawLi0EEEEvv", | "_ZN1fIXawLi0EEEEvv", | ||||
"_ZNWUt_3FOOEv", | |||||
"_ZWDC3FOOEv", | |||||
"_ZGI3Foo", | |||||
"_ZGIW3Foov", | |||||
}; | }; | ||||
const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]); | const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]); | ||||
void test() | void test() | ||||
{ | { | ||||
std::size_t len = 0; | std::size_t len = 0; | ||||
char* buf = nullptr; | char* buf = nullptr; | ||||
Show All 36 Lines | for (unsigned i = 0; i < NI; ++i) | ||||
if (demang) | if (demang) | ||||
buf = demang; | buf = demang; | ||||
} | } | ||||
free(buf); | free(buf); | ||||
assert(!passed && "demangle did not fail"); | assert(!passed && "demangle did not fail"); | ||||
} | } | ||||
const char *xfail_cases[] = { | const char *xfail_cases[] = { | ||||
"_ZW6FooBarE2f3v", // C++ modules TS | |||||
// FIXME: Why does clang generate the "cp" expr? | // FIXME: Why does clang generate the "cp" expr? | ||||
"_ZN5test11bIsEEDTcp3foocvT__EEES1_", | "_ZN5test11bIsEEDTcp3foocvT__EEES1_", | ||||
}; | }; | ||||
const size_t num_xfails = sizeof(xfail_cases) / sizeof(xfail_cases[0]); | const size_t num_xfails = sizeof(xfail_cases) / sizeof(xfail_cases[0]); | ||||
void test_xfail_cases() | void test_xfail_cases() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |