From: Benjamin Kosnik Date: Mon, 9 Oct 2006 23:53:35 +0000 (+0000) Subject: re PR libstdc++/29095 (cxxabi.h __cxa_cdtor_type not declared when included from... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c6430a3146d2961f538cc733930118318493a0e;p=gcc.git re PR libstdc++/29095 (cxxabi.h __cxa_cdtor_type not declared when included from "C") 2006-10-09 Benjamin Kosnik PR libstdc++/29095 * libsupc++/cxxabi.h (__cxa_cdtor_type): Explicit "C" linkage. * config/cpu/arm/cxxabi_tweaks.h: Same. * config/cpu/generic/cxxabi_tweaks.h: Same. * testsuite/abi: Add. * testsuite/abi/header_cxxabi.cc: New. * testsuite/demangle: Move... * testsuite/abi/demangle: ...here. * testsuite/libstdc++-dg/conformance.exp: Adjust testsuite file calculation. * scripts/create_testsuite_files: Same. * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): New. (libstdc++-dg-test): Use it. From-SVN: r117589 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f9123f136f1..c88fb9984b1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2006-10-09 Benjamin Kosnik + + PR libstdc++/29095 + * libsupc++/cxxabi.h (__cxa_cdtor_type): Explicit "C" linkage. + * config/cpu/arm/cxxabi_tweaks.h: Same. + * config/cpu/generic/cxxabi_tweaks.h: Same. + * testsuite/abi: Add. + * testsuite/abi/header_cxxabi.cc: New. + * testsuite/demangle: Move... + * testsuite/abi/demangle: ...here. + * testsuite/libstdc++-dg/conformance.exp: Adjust testsuite file + calculation. + * scripts/create_testsuite_files: Same. + * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): New. + (libstdc++-dg-test): Use it. + 2006-10-09 Paolo Carlini PR libstdc++/28277 (partial: __add_grouping) diff --git a/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h b/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h index 76c8a36400e..f8a1820b734 100644 --- a/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h +++ b/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h @@ -1,6 +1,6 @@ // Control various target specific ABI tweaks. ARM version. -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2006 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -33,6 +33,8 @@ #ifdef __cplusplus namespace __cxxabiv1 { + extern "C" + { #endif #ifdef __ARM_EABI__ @@ -67,7 +69,8 @@ namespace __cxxabiv1 #endif //!__ARM_EABI__ #ifdef __cplusplus + } } // namespace __cxxabiv1 #endif -#endif // __cxxabiv1 +#endif diff --git a/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h b/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h index 4b74805d8b0..4b1e7320851 100644 --- a/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h +++ b/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h @@ -1,6 +1,6 @@ // Control various target specific ABI tweaks. Generic version. -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2006 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -33,6 +33,8 @@ #ifdef __cplusplus namespace __cxxabiv1 { + extern "C" + { #endif // The generic ABI uses the first byte of a 64-bit guard variable. @@ -47,7 +49,8 @@ namespace __cxxabiv1 typedef void __cxa_cdtor_return_type; #ifdef __cplusplus + } } // namespace __cxxabiv1 #endif -#endif // __cxxabiv1 +#endif diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h index e7b2857bb22..c0418d82588 100644 --- a/libstdc++-v3/libsupc++/cxxabi.h +++ b/libstdc++-v3/libsupc++/cxxabi.h @@ -1,6 +1,6 @@ // new abi support -*- C++ -*- -// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. +// Copyright (C) 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -54,12 +54,12 @@ #ifdef __cplusplus namespace __cxxabiv1 { - typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *); - extern "C" { #endif + typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *); + // Allocate array. void* __cxa_vec_new(size_t __element_count, size_t __element_size, diff --git a/libstdc++-v3/scripts/create_testsuite_files b/libstdc++-v3/scripts/create_testsuite_files index 74b2455d061..8d87e09d017 100755 --- a/libstdc++-v3/scripts/create_testsuite_files +++ b/libstdc++-v3/scripts/create_testsuite_files @@ -32,7 +32,7 @@ cd $srcdir # This is the ugly version of "everything but the current directory". It's # what has to happen when find(1) doesn't support -mindepth, or -xtype. dlist=`echo [0-9][0-9]*` -dlist="$dlist backward demangle ext performance thread tr1" +dlist="$dlist abi backward ext performance thread tr1" find $dlist "(" -type f -o -type l ")" -name "*.cc" -print > $tmp.01 find $dlist "(" -type f -o -type l ")" -name "*.c" -print > $tmp.02 cat $tmp.01 $tmp.02 | sort > $tmp.1 diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/01.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/01.cc new file mode 100644 index 00000000000..85cb59d428d --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/01.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // extern "C" function + // extern "C" float f(void) { }; + // T f + // f is ambiguous between "C" external name and internal built-in type + // name. The ambiguity is resolved to the built-in type name. + verify_demangle("f", "float"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/02.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/02.cc new file mode 100644 index 00000000000..408d6ae419a --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/02.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // or variable "f" + // int f; + // B f + // f is ambiguous between variable external name and internal built-in type + // name. The ambiguity is resolved to the built-in type name. + verify_demangle("f", "float"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/03.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/03.cc new file mode 100644 index 00000000000..70673a9a796 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/03.cc @@ -0,0 +1,41 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // or a global namespace variable "f" + /* + namespace f + { + int f; + } + */ + verify_demangle("_ZN1f1fE", "f::f"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/04.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/04.cc new file mode 100644 index 00000000000..9cf22cfa3ef --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/04.cc @@ -0,0 +1,37 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // void f() { }; + // int f() { }; + // verify_demangle("_Z1fv", "f(void)"); + verify_demangle("_Z1fv", "f()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/05.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/05.cc new file mode 100644 index 00000000000..293bbd4354d --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/05.cc @@ -0,0 +1,36 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // void f(int) { }; + // int f(int) { }; + verify_demangle("_Z1fi", "f(int)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/06.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/06.cc new file mode 100644 index 00000000000..3fb40043fcc --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/06.cc @@ -0,0 +1,36 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // class bar { }; + // void foo(bar) { }; + verify_demangle("_Z3foo3bar", "foo(bar)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/07.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/07.cc new file mode 100644 index 00000000000..40a6c5cef8e --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/07.cc @@ -0,0 +1,36 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // class X { }; + // int operator%(X, X) { }; + verify_demangle("_Zrm1XS_", "operator%(X, X)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/08.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/08.cc new file mode 100644 index 00000000000..087cfd58621 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/08.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // int operator+(X&, X&) { }; + verify_demangle("_ZplR1XS0_", "operator+(X&, X&)"); // XXX + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/09.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/09.cc new file mode 100644 index 00000000000..3242cb541b1 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/09.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // int operator<< (X const&, X const&) { }; + verify_demangle("_ZlsRK1XS1_", "operator<<(X const&, X const&)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/10.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/10.cc new file mode 100644 index 00000000000..a47c9235462 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/10.cc @@ -0,0 +1,40 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + template + class Foo + { static int bar; }; + int Foo::bar; + */ + verify_demangle("_ZN3FooIA4_iE3barE", "Foo::bar"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/11.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/11.cc new file mode 100644 index 00000000000..2b1f3b6a1b1 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/11.cc @@ -0,0 +1,38 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // template void f(int) { } + // template void f(int); + // NB: the return type is always explicitly encoded for template + // functions taking parameters. + verify_demangle("_Z1fIiEvi", "void f(int)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/12.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/12.cc new file mode 100644 index 00000000000..60b299f4aa6 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/12.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + class Duo { }; + template void first(Duo) { } + template void first(Duo); + */ + verify_demangle("_Z5firstI3DuoEvS0_", "void first(Duo)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/13.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/13.cc new file mode 100644 index 00000000000..9c17340d9b7 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/13.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + class Duo { }; + template void first(T obj) { } + template void first(Duo); + */ + verify_demangle("_Z5firstI3DuoEvT_", "void first(Duo)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/14.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/14.cc new file mode 100644 index 00000000000..fe6879c1034 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/14.cc @@ -0,0 +1,40 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + typedef void fun(double); + template void foo() { } + template void foo(); + */ + //demangle("_Z3fooIiPFidEiEvv", "void foo(void)"); + verify_demangle("_Z3fooIiFvdEiEvv", "void foo()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/15.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/15.cc new file mode 100644 index 00000000000..9fcb64aa1e7 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/15.cc @@ -0,0 +1,40 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + namespace N + { + int f; + } + */ + verify_demangle("_ZN1N1fE", "N::f"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/16.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/16.cc new file mode 100644 index 00000000000..d3732ead390 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/16.cc @@ -0,0 +1,46 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + namespace System + { + struct Sound + { + int beep(); + }; + + int Sound::beep() { }; + } + */ + // verify_demangle("_ZN6System5Sound4beepEv", "System::Sound::beep(void)"); + verify_demangle("_ZN6System5Sound4beepEv", "System::Sound::beep()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/17.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/17.cc new file mode 100644 index 00000000000..29274b2fee9 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/17.cc @@ -0,0 +1,40 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + namespace Arena + { + int level; + } + */ + verify_demangle("_ZN5Arena5levelE", "Arena::level"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/18.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/18.cc new file mode 100644 index 00000000000..526b1d8d1b8 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/18.cc @@ -0,0 +1,42 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + /* + template struct Stack + { + static int level; + int return_level() { return level; } + }; + template struct Stack; + */ + verify_demangle("_ZN5StackIiiE5levelE", "Stack::level"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/19.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/19.cc new file mode 100644 index 00000000000..2d6ae3d00fb --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/19.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_Z1fI1XEvPVN1AIT_E1TE", "void f(A::T volatile*)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc new file mode 100644 index 00000000000..eaa5db0430f --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_ZngILi42EEvN1AIXplT_Li2EEE1TE", + "void operator-<42>(A<(42) + (2)>::T)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/21.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/21.cc new file mode 100644 index 00000000000..d4c69a91005 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/21.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_Z4makeI7FactoryiET_IT0_Ev", + "Factory make()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/22.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/22.cc new file mode 100644 index 00000000000..d4c69a91005 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/22.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_Z4makeI7FactoryiET_IT0_Ev", + "Factory make()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/23.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/23.cc new file mode 100644 index 00000000000..57659fb0cd7 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/23.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_Z3foo5Hello5WorldS0_S_", + "foo(Hello, World, World, Hello)"); + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/24.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/24.cc new file mode 100644 index 00000000000..5be5266a132 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/24.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_Z3fooPM2ABi", "foo(int AB::**)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/25.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/25.cc new file mode 100644 index 00000000000..3a3c019b22b --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/25.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // Equivalent + // uncompressed, cp-dem + // verify_demangle("_ZlsRSoRKSs", "operator<<(std::basic_ostream >&, std::basic_string, std::allocator > const&)"); + // compressed (good!), new __cxa_demangle + verify_demangle("_ZlsRSoRKSs", + "operator<<(std::ostream&, std::string const&)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_examples/26.cc b/libstdc++-v3/testsuite/abi/demangle/abi_examples/26.cc new file mode 100644 index 00000000000..783eafa3787 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/26.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_ZTI7a_class", "typeinfo for a_class"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/01.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/01.cc new file mode 100644 index 00000000000..70da290442b --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/01.cc @@ -0,0 +1,42 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Examples given in the IA64 C++ ABI +// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling +int main() +{ + using namespace __gnu_test; + + // 5.1.5 Type encodings. + // int* volatile const restrict _far p; + // cplus-dem FAIL + // icc CORE + // Equivalent as considered order-insensitive. + // standard text + // verify_demangle("U4_farrVKPi", "int* volatile const restrict _far"); + // new __cxa_demangle + verify_demangle("U4_farrVKPi", "int* const volatile restrict _far"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc new file mode 100644 index 00000000000..28a617aef7d --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/02.cc @@ -0,0 +1,42 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // template void foo (int (&)[I + 1]) { }; + // template void foo<2> (int (&)[3]); + // Equivalent, but formatting difference in void argument and parentheses. + // icc, __cxa_demangle + verify_demangle("_Z3fooILi2EEvRAplT_Li1E_i", + "void foo<2>(int (&) [(2) + (1)])"); + // cplus-dem + // verify_demangle("_Z3fooILi2EEvRAplT_Li1E_i", + // "void foo<(int)2>(int (&) [((int)2)+((int)1)])"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/03.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/03.cc new file mode 100644 index 00000000000..deca8721dbf --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/03.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // struct A; + // void f (void (A::*)() const) {} + // cplus-dem FAIL + // Equivalent, but formatting difference in void argument. + verify_demangle("_Z1fM1AKFvvE", "f(void (A::*)() const)"); + // verify_demangle("_Z1fM1AKFvvE", "f(void (A::*)(void) const)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/04.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/04.cc new file mode 100644 index 00000000000..073240bd96b --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/04.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // void foo(char); + verify_demangle("_Z3fooc", "foo(char)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/05.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/05.cc new file mode 100644 index 00000000000..5b94fd80859 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/05.cc @@ -0,0 +1,39 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // void foo(char); + // template struct CB { }; + // CB obj; + // cplus-dem FAIL + // standard text FAIL "CB" + verify_demangle("2CBIL_Z3foocEE", "CB"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/06.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/06.cc new file mode 100644 index 00000000000..caf11256ded --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/06.cc @@ -0,0 +1,38 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // extern "C" bool IsEmpty(char *); + // template struct CB; + // CB is mangled as + // cplus-dem FAIL + verify_demangle("2CBIL_Z7IsEmptyEE", "CB"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/07.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/07.cc new file mode 100644 index 00000000000..6c3285a84f1 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/07.cc @@ -0,0 +1,53 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // 5.1.6 Scope Encoding + /* + namespace N + { + inline char* + f(int i) + { + static char *p = "Itanium C++ ABI"; // p = 1, "..." = 2 + { + struct X + { // X = 3 + void g() {} + }; + } + return p[i]; + } + } + */ + // encoding of N::f::p (first local mangled entity) + verify_demangle("_ZZN1N1fEiE1p", "N::f(int)::p"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/08.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/08.cc new file mode 100644 index 00000000000..ff7e8bb1f3a --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/08.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // encoding of N::f::"Itanium C++ ABI" (no discriminator) + verify_demangle("_ZZN1N1fEiEs", "N::f(int)::string literal"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/09.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/09.cc new file mode 100644 index 00000000000..67abf85a660 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/09.cc @@ -0,0 +1,37 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // encoding of N::f::X::g() + // (third local mangled entity used as a class-qualifier) + // cplus-dem FAIL + // icc CORE + verify_demangle("_ZNZN1N1fEiE1X1gE", "error code = -2: invalid mangled name"); + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/10.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/10.cc new file mode 100644 index 00000000000..f9c651f1f8d --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/10.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + verify_demangle("_ZNZN1N1fEiE1X1gEv", + "error code = -2: invalid mangled name"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/11.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/11.cc new file mode 100644 index 00000000000..8c458e91414 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/11.cc @@ -0,0 +1,42 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // 5.1.7 Compression. + // typedef void T(); + // struct S {}; + // void f(T*, T (S::*)) { } + // Equivalent, void variance. + // standard text, not possible + // verify_demangle("_Z1fPFvvEM1SFvvE", "void f(T*, T (S::*))"); + verify_demangle("_Z1fPFvvEM1SFvvE", "f(void (*)(), void (S::*)())"); + // demangle("_Z1fPFvvEM1SFvvE", "f(void (*)(void), void (S::*)(void))"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/12.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/12.cc new file mode 100644 index 00000000000..4db3df44f62 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/12.cc @@ -0,0 +1,36 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // N::T::mf(N::T) + verify_demangle("_ZN1N1TIiiE2mfES0_IddE", + "N::T::mf(N::T)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/13.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/13.cc new file mode 100644 index 00000000000..5b6f64afc71 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/13.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // std::state + verify_demangle("_ZSt5state", "std::state"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/abi_text/14.cc b/libstdc++-v3/testsuite/abi/demangle/abi_text/14.cc new file mode 100644 index 00000000000..cde1cbf28d2 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/abi_text/14.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// Specific examples mentioned in the IA64 C++ ABI text +// http://www.codesourcery.com/cxx-abi/abi.html#mangling +int main() +{ + using namespace __gnu_test; + + // std::_In::ward + verify_demangle("_ZNSt3_In4wardE", "std::_In::ward"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/3111-1.cc b/libstdc++-v3/testsuite/abi/demangle/regression/3111-1.cc new file mode 100644 index 00000000000..f21aed06fdc --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/3111-1.cc @@ -0,0 +1,33 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// c++/3111 +int main() +{ + using namespace __gnu_test; + + verify_demangle("_Z1fKPFiiE", "f(int (* const)(int))"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/3111-2.cc b/libstdc++-v3/testsuite/abi/demangle/regression/3111-2.cc new file mode 100644 index 00000000000..725cc55f16c --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/3111-2.cc @@ -0,0 +1,38 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// c++/3111 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + // icc FAIL + // verify_demangle("_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i", + // "f(int[sizeof(N::A::f() const::foo())])"); + verify_demangle("_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i", + "f(int [sizeof (N::A::f() const::foo)])"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-01.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-01.cc new file mode 100644 index 00000000000..67eeb67c64e --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-01.cc @@ -0,0 +1,33 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + // cplus-dem FAIL + verify_demangle("_Z1fA37_iPS_", "f(int [37], int (*) [37])"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-02.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-02.cc new file mode 100644 index 00000000000..4d9e3ad9ed6 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-02.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // Equivalent, but formatting difference in void argument. + // verify_demangle("_Z1fM1AFivEPS0_", "f(int (A::*)(void), int (*)(void))"); + verify_demangle("_Z1fM1AFivEPS0_", "f(int (A::*)(), int (*)())"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-03.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-03.cc new file mode 100644 index 00000000000..c4da14d780f --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-03.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z1fPFPA1_ivE", "f(int (*(*)()) [1])"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-04.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-04.cc new file mode 100644 index 00000000000..46507944df9 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-04.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z1fPKM1AFivE", "f(int (A::* const*)())"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-05.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-05.cc new file mode 100644 index 00000000000..4ca3eb4f9c0 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-05.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z1jM1AFivEPS1_", "j(int (A::*)(), int (A::**)())"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-06.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-06.cc new file mode 100644 index 00000000000..04881ebc9df --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-06.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z1sPA37_iPS0_", "s(int (*) [37], int (**) [37])"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-07.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-07.cc new file mode 100644 index 00000000000..45ebff7b61e --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-07.cc @@ -0,0 +1,35 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z3fooA30_A_i", "foo(int [30][])"); + + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-08.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-08.cc new file mode 100644 index 00000000000..148add2d21e --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-08.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z3kooPA28_A30_i", "koo(int (*) [28][30])"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-09.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-09.cc new file mode 100644 index 00000000000..7ac3ac0f3b7 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-09.cc @@ -0,0 +1,40 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + // Equivalent as considered order-insensitive? + // standard text, icc FAIL + // verify_demangle("_ZlsRKU3fooU4bart1XS0_", + // "operator<<(X const foo bart&, X const foo bart)"); + // new __cxa_demangle + verify_demangle("_ZlsRKU3fooU4bart1XS0_", + "operator<<(X bart foo const&, X bart)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-10.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-10.cc new file mode 100644 index 00000000000..592a9fda9cc --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-10.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + verify_demangle("_ZlsRKU3fooU4bart1XS2_", + "operator<<(X bart foo const&, X bart foo const)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-11.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-11.cc new file mode 100644 index 00000000000..34bc8835861 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-11.cc @@ -0,0 +1,34 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // cplus-dem FAIL + verify_demangle("_Z1fM1AKFivE", "f(int (A::*)() const)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986-12.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986-12.cc new file mode 100644 index 00000000000..819a915726c --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986-12.cc @@ -0,0 +1,47 @@ +// 2003-02-26 Benjamin Kosnik + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libstdc++/7986 +int main() +{ + using namespace __gnu_test; + + // ICE on figmative float template parameters? + /* + demangle("_Z3absILd1c1f1496f8a44219EEvv", "void abs<3.14159e-173>()"); + demangle("_Z3absILd40092acd9e83e426EEvv", "void abs<3.1459>()"); + demangl("_Z3absILe08042191a6cc56a2fe117becEEvv", "void abs<1.234e-2345l>()"); + demangle("_Z3absILf4016147bEEvv", "void abs<2.345f>()"); + demangle("_Z3absILfc1800000EEvv", " void abs<-16f>()"); + demangle("_Z3absILe804bfff8000000000000000EEvv", "void abs<-1l>()"); + */ + + // template void abs(void) { }; + // template void abs<11>(void); + // Equivalent, but formatting difference in void argument. + // verify_demangle("_Z3absILi11EEvv", "void abs<(int)11>()"); + verify_demangle("_Z3absILi11EEvv", "void abs<11>()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/7986.cc b/libstdc++-v3/testsuite/abi/demangle/regression/7986.cc new file mode 100644 index 00000000000..7cea89643ef --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/7986.cc @@ -0,0 +1,32 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/8897.cc b/libstdc++-v3/testsuite/abi/demangle/regression/8897.cc new file mode 100644 index 00000000000..1a7e54532cb --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/8897.cc @@ -0,0 +1,61 @@ +// 2003-02-26 Martin v. Loewis + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// c++/8897 +int main() +{ + using namespace __gnu_test; + + /* + template + struct A + { + template + operator T2(); + }; + + A a; + (int)a; <-- that function. + */ + /* + Using "operator int()" is ambigious because that + could be either: + + operator int(); + + or + + template + operator T(); + with T = int. + + - Carlo Wood + */ + // cplus-dem FAIL + // icc FAIL + // new __cxa_demangle FAIL + verify_demangle("_ZN1AIfEcvT_IiEEv", "A::operator int()"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-01.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-01.cc new file mode 100644 index 00000000000..920c14d878d --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-01.cc @@ -0,0 +1,54 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + + /* +class libcw_app_ct { +public: + void dummy(char const*) { } + template + static void add_option(void (T::*)(char const*), char const*, char, + char const*, char const*); +}; + +template + void libcw_app_ct::add_option(void (T::*)(char const*), char const*, char, + char const*, char const*) +{ } + +void fn(void) +{ + // Instantiation. + libcw_app_ct::add_option(&libcw_app_ct::dummy, "", '\0', "", ""); +} +*/ +verify_demangle("_ZN12libcw_app_ct10add_optionIS_EEvMT_FvPKcES3_cS3_S3_", + "void libcw_app_ct::add_option(void (libcw_app_ct::*)(char const*), char const*, char, char const*, char const*)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-02.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-02.cc new file mode 100644 index 00000000000..b38c323eca1 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-02.cc @@ -0,0 +1,59 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + +/* +namespace libcw { + namespace debug { + class memblk_types_manipulator_data_ct { }; + } + template + class omanip_id_tct { }; + namespace { + template + class compiler_bug_workaround { + public: + static std::vector ids; + }; + template + std::vector compiler_bug_workaround::ids; + typedef std::vector > vector_t; + compiler_bug_workaround dummy; + } +} + +void g(void) +{ + // Instantiation. + libcw::dummy.ids.size(); +} +*/ + verify_demangle("_ZGVN5libcw24_GLOBAL__N_cbll.cc0ZhUKa23compiler_bug_workaroundISt6vectorINS_13omanip_id_tctINS_5debug32memblk_types_manipulator_data_ctEEESaIS6_EEE3idsE", "guard variable for libcw::(anonymous namespace)::compiler_bug_workaround, std::allocator > > >::ids"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-03.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-03.cc new file mode 100644 index 00000000000..710dea6d7bf --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-03.cc @@ -0,0 +1,54 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + +/* +namespace libcw { + namespace _private_ { + class GlobalObject { public: void dummy(std::ostream&) const; }; + } + namespace debug { + template + class cwprint_using_tct { }; + template + cwprint_using_tct cwprint_using(T const&, void (T::*)(std::ostream&) const); + } +} + +void h(void) +{ + // Instantiation. + libcw::_private_::GlobalObject dummy; + (void)libcw::debug::cwprint_using(dummy, &libcw::_private_::GlobalObject::dummy); +} +*/ + // cplus-dem CORE + verify_demangle("_ZN5libcw5debug13cwprint_usingINS_9_private_12GlobalObjectEEENS0_17cwprint_using_tctIT_EERKS5_MS5_KFvRSt7ostreamE", "libcw::debug::cwprint_using_tct libcw::debug::cwprint_using(libcw::_private_::GlobalObject const&, void (libcw::_private_::GlobalObject::*)(std::ostream&) const)"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-04.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-04.cc new file mode 100644 index 00000000000..8a524f3480c --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-04.cc @@ -0,0 +1,45 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + + +/* +class timer_event_request_base_ct { }; +struct timer_greater { }; + +void i(void) +{ + // Instantiation. + std::priority_queue, timer_greater> dummy; + dummy.top(); +} +*/ + verify_demangle("_ZNKSt14priority_queueIP27timer_event_request_base_ctSt5dequeIS1_SaIS1_EE13timer_greaterE3topEv", "std::priority_queue >, timer_greater>::top() const"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-05.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-05.cc new file mode 100644 index 00000000000..2b776853346 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-05.cc @@ -0,0 +1,51 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + +/* +struct memory_block_st { }; +namespace std { + template + class _Deque_iterator { + public: + void operator==(_Deque_iterator const&) const { } + }; +} + +void j(void) +{ + // Instantiation. + std::_Deque_iterator dummy; + dummy.operator==(dummy); +} +*/ + verify_demangle("_ZNKSt15_Deque_iteratorIP15memory_block_stRKS1_PS2_EeqERKS5_", + "std::_Deque_iterator::operator==(std::_Deque_iterator const&) const"); + + return 0; +} diff --git a/libstdc++-v3/testsuite/abi/demangle/regression/cw-06.cc b/libstdc++-v3/testsuite/abi/demangle/regression/cw-06.cc new file mode 100644 index 00000000000..a131d4c5f5c --- /dev/null +++ b/libstdc++-v3/testsuite/abi/demangle/regression/cw-06.cc @@ -0,0 +1,51 @@ +// 2003-02-26 Carlo Wood + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling) + +#include + +// libcwd tests +int main() +{ + using namespace __gnu_test; + +/* +struct option { }; +namespace std { + template + class __normal_iterator { + public: + void operator-(__normal_iterator const&) const { } + }; +} + +void k(void) +{ + // Instantiation. + std::__normal_iterator