summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/abi/demangle/abi_examples
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libstdc++-v3/testsuite/abi/demangle/abi_examples
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libstdc++-v3/testsuite/abi/demangle/abi_examples')
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/01.cc38
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/02.cc38
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/03.cc40
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/04.cc36
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/05.cc35
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/06.cc35
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/07.cc35
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/08.cc34
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/09.cc34
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/10.cc39
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/11.cc37
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/12.cc38
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/13.cc38
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/14.cc39
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/15.cc39
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/16.cc45
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/17.cc39
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/18.cc41
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/19.cc33
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc34
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/21.cc34
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/22.cc34
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/23.cc33
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/24.cc33
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/25.cc38
-rw-r--r--libstdc++-v3/testsuite/abi/demangle/abi_examples/26.cc33
26 files changed, 952 insertions, 0 deletions
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 000000000..45c012d0f
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/01.cc
@@ -0,0 +1,38 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2005, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..c20f44a2a
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/02.cc
@@ -0,0 +1,38 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2005, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..1006d2b8d
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/03.cc
@@ -0,0 +1,40 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..553f6b86d
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/04.cc
@@ -0,0 +1,36 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..0db11ea61
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/05.cc
@@ -0,0 +1,35 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..445b985b5
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/06.cc
@@ -0,0 +1,35 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..e2765e42a
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/07.cc
@@ -0,0 +1,35 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..15b5c9b7e
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/08.cc
@@ -0,0 +1,34 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..db1705155
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/09.cc
@@ -0,0 +1,34 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..6d0e06fef
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/10.cc
@@ -0,0 +1,39 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// Examples given in the IA64 C++ ABI
+// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
+int main()
+{
+ using namespace __gnu_test;
+
+ /*
+ template<typename T>
+ class Foo
+ { static int bar; };
+ int Foo<int[4]>::bar;
+ */
+ verify_demangle("_ZN3FooIA4_iE3barE", "Foo<int [4]>::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 000000000..03bb29ec7
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/11.cc
@@ -0,0 +1,37 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// Examples given in the IA64 C++ ABI
+// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
+int main()
+{
+ using namespace __gnu_test;
+
+ // template<typename T> void f(int) { }
+ // template void f<int>(int);
+ // NB: the return type is always explicitly encoded for template
+ // functions taking parameters.
+ verify_demangle("_Z1fIiEvi", "void f<int>(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 000000000..c01255be8
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/12.cc
@@ -0,0 +1,38 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<typename T> void first(Duo) { }
+ template void first<Duo>(Duo);
+ */
+ verify_demangle("_Z5firstI3DuoEvS0_", "void first<Duo>(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 000000000..6da15c32f
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/13.cc
@@ -0,0 +1,38 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<typename T> void first(T obj) { }
+ template void first(Duo);
+ */
+ verify_demangle("_Z5firstI3DuoEvT_", "void first<Duo>(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 000000000..98b998786
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/14.cc
@@ -0,0 +1,39 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<typename I, typename T, typename J> void foo() { }
+ template void foo<int, fun, int>();
+ */
+ //demangle("_Z3fooIiPFidEiEvv", "void foo<int, int (*)(double), int>(void)");
+ verify_demangle("_Z3fooIiFvdEiEvv", "void foo<int, void (double), int>()");
+
+ 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 000000000..d1909bbab
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/15.cc
@@ -0,0 +1,39 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..2433f51bd
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/16.cc
@@ -0,0 +1,45 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..7431dbd08
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/17.cc
@@ -0,0 +1,39 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..3098e306b
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/18.cc
@@ -0,0 +1,41 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// Examples given in the IA64 C++ ABI
+// http://www.codesourcery.com/cxx-abi/abi-examples.html#mangling
+int main()
+{
+ using namespace __gnu_test;
+
+ /*
+ template<typename T1, typename T2> struct Stack
+ {
+ static int level;
+ int return_level() { return level; }
+ };
+ template struct Stack<int, int>;
+ */
+ verify_demangle("_ZN5StackIiiE5levelE", "Stack<int, int>::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 000000000..bafb9069d
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/19.cc
@@ -0,0 +1,33 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<X>(A<X>::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 000000000..cb9f58c44
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/20.cc
@@ -0,0 +1,34 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..a3689d450
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/21.cc
@@ -0,0 +1,34 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<int> make<Factory, int>()");
+
+ 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 000000000..a3689d450
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/22.cc
@@ -0,0 +1,34 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<int> make<Factory, int>()");
+
+ 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 000000000..0b404cc84
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/23.cc
@@ -0,0 +1,33 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..1a70c763d
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/24.cc
@@ -0,0 +1,33 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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 000000000..ba4c3aa4e
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/25.cc
@@ -0,0 +1,38 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > 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 000000000..b55852795
--- /dev/null
+++ b/libstdc++-v3/testsuite/abi/demangle/abi_examples/26.cc
@@ -0,0 +1,33 @@
+// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2003, 2009 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// 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;
+}