aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-06-01 13:54:44 +0000
committerJan Hubicka <jh@suse.cz>2009-06-01 13:54:44 +0000
commit6a996753ba06a185c0d0b6e47c0efa1a8f922915 (patch)
tree2681e2611902ace1284c49eed9c68cbfa6774002 /libstdc++-v3
parenteec1fa01083d53610d3afdddb8aa1cc0384372fd (diff)
Merge from mainline.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/pretty-ipa@148042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog74
-rw-r--r--libstdc++-v3/Makefile.am3
-rw-r--r--libstdc++-v3/Makefile.in4
-rw-r--r--libstdc++-v3/acinclude.m42
-rwxr-xr-xlibstdc++-v3/configure5
-rw-r--r--libstdc++-v3/include/tr1_impl/functional10
-rw-r--r--libstdc++-v3/libsupc++/initializer_list51
-rw-r--r--libstdc++-v3/python/Makefile.am43
-rw-r--r--libstdc++-v3/python/Makefile.in504
-rw-r--r--libstdc++-v3/python/hook.in27
-rw-r--r--libstdc++-v3/python/libstdcxx/__init__.py1
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/__init__.py1
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py642
-rw-r--r--libstdc++-v3/testsuite/18_support/initializer_list/requirements/explicit_instantiation.cc24
-rw-r--r--libstdc++-v3/testsuite/18_support/initializer_list/requirements/typedefs.cc34
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/function/null_pointer_comparisons.cc44
-rw-r--r--libstdc++-v3/testsuite/20_util/function/requirements/explicit_instantiation.cc26
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/cons/1.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/cons/2.cc4
-rw-r--r--libstdc++-v3/testsuite/ext/array_allocator/check_delete.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/array_allocator/check_new.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/bitmap_allocator/check_delete.cc32
-rw-r--r--libstdc++-v3/testsuite/ext/bitmap_allocator/check_new.cc32
-rw-r--r--libstdc++-v3/testsuite/ext/debug_allocator/check_delete.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/debug_allocator/check_new.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/malloc_allocator/check_delete.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/malloc_allocator/check_new.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc45
-rw-r--r--libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc40
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/check_delete.cc31
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc31
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc40
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc40
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc41
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc40
-rw-r--r--libstdc++-v3/testsuite/ext/new_allocator/check_delete.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/new_allocator/check_new.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc39
-rw-r--r--libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc51
-rw-r--r--libstdc++-v3/testsuite/ext/pool_allocator/check_delete.cc32
-rw-r--r--libstdc++-v3/testsuite/ext/pool_allocator/check_new.cc32
-rw-r--r--libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc33
-rw-r--r--libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc42
-rw-r--r--libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc35
-rw-r--r--libstdc++-v3/testsuite/util/replacement_memory_operators.h110
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_allocator.h27
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_hooks.cc2
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_hooks.h20
59 files changed, 1722 insertions, 1203 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5f54296bb05..1a237c2531a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,77 @@
+2009-05-28 Tom Tromey <tromey@redhat.com>
+ Phil Muldoon <pmuldoon@redhat.com>
+ Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * python/Makefile.in, , python/libstdcxx/__init__.py,
+ python/libstdcxx/v6/__init__.py, python/libstdcxx/v6/printers.py,
+ python/hook.in, python/Makefile.am: New files.
+ * configure, Makefile.in: Rebuild.
+ * acinclude.m4 (glibcxx_SUBDIRS): Add python.
+ * Makefile.am (SUBDIRS): Add python.
+
+2009-05-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/util/testsuite_allocator.h (check_new, check_delete): Move
+ to ...
+ * testsuite/util/replacement_memory_operators.h: ...here. New.
+ * testsuite/util/testsuite_hooks.h (counter): To object_counter.
+ * testsuite/util/testsuite_hooks.cc: Same.
+
+ * testsuite/ext/mt_allocator/deallocate_local_thread-1.cc: Use
+ replacement_memory_operators.h.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-3.cc: Same.
+ * testsuite/ext/mt_allocator/check_delete.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-5.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-7.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_global_thread-1.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_global_thread-3.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_local-2.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_local-4.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_local-6.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_local-8.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_global-2.cc: Same.
+ * testsuite/ext/mt_allocator/deallocate_global-4.cc: Same.
+ * testsuite/ext/mt_allocator/check_new.cc: Same.
+ * testsuite/ext/debug_allocator/check_delete.cc: Same.
+ * testsuite/ext/debug_allocator/check_new.cc: Same.
+ * testsuite/ext/new_allocator/deallocate_global.cc: Same.
+ * testsuite/ext/new_allocator/check_delete.cc: Same.
+ * testsuite/ext/new_allocator/check_new.cc: Same.
+ * testsuite/ext/new_allocator/deallocate_local.cc: Same.
+ * testsuite/ext/throw_allocator/deallocate_global.cc: Same.
+ * testsuite/ext/throw_allocator/check_delete.cc: Same.
+ * testsuite/ext/throw_allocator/check_new.cc: Same.
+ * testsuite/ext/throw_allocator/deallocate_local.cc: Same.
+ * testsuite/ext/malloc_allocator/deallocate_global.cc: Same.
+ * testsuite/ext/malloc_allocator/check_delete.cc: Same.
+ * testsuite/ext/malloc_allocator/check_new.cc: Same.
+ * testsuite/ext/malloc_allocator/deallocate_local.cc: Same.
+ * testsuite/ext/pool_allocator/check_delete.cc: Same.
+ * testsuite/ext/pool_allocator/check_new.cc: Same.
+ * testsuite/ext/bitmap_allocator/check_delete.cc: Same.
+ * testsuite/ext/bitmap_allocator/check_new.cc: Same.
+ * testsuite/ext/array_allocator/check_delete.cc: Same.
+ * testsuite/ext/array_allocator/check_new.cc: Same.
+ * testsuite/23_containers/deque/cons/1.cc: Same.
+ * testsuite/23_containers/deque/cons/2.cc: Same.
+
+2009-05-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * libsupc++/initializer_list: Format.
+ * testsuite/18_support/initializer_list/requirements/typedefs.cc: New.
+ * testsuite/18_support/initializer_list/requirements/
+ explicit_instantiation.cc: New.
+
+2009-05-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/40273
+ * include/tr1_impl/functional: Add explicit casts.
+ * testsuite/20_util/function/requirements/
+ explicit_instantiation.cc: New.
+ * testsuite/20_util/function/null_pointer_comparisons.cc: New.
+
2009-05-24 Eelis van der Weegen <eelis@eelis.net>
-
+
* libsupc++/initializer_list (initializer_list): Add missing typedefs.
2009-05-21 Benjamin Kosnik <bkoz@redhat.com>
diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am
index 7c8f9c2df1d..1f8d3159bc7 100644
--- a/libstdc++-v3/Makefile.am
+++ b/libstdc++-v3/Makefile.am
@@ -27,7 +27,8 @@ if GLIBCXX_HOSTED
hosted_source = doc src po testsuite
endif
## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
-SUBDIRS = include libsupc++ $(hosted_source)
+## Note that python must come after src.
+SUBDIRS = include libsupc++ $(hosted_source) python
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 7d5afd96f05..c51a637bc1d 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -87,7 +87,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = include libsupc++ doc src po testsuite
+DIST_SUBDIRS = include libsupc++ doc src po testsuite python
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -321,7 +321,7 @@ WARN_CXXFLAGS = \
# -I/-D flags to pass when compiling.
AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
@GLIBCXX_HOSTED_TRUE@hosted_source = doc src po testsuite
-SUBDIRS = include libsupc++ $(hosted_source)
+SUBDIRS = include libsupc++ $(hosted_source) python
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
# Multilib support.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 186916c2e47..d7895f5ec7f 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -49,7 +49,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
# Keep these sync'd with the list in Makefile.am. The first provides an
# expandable list at autoconf time; the second provides an expandable list
# (i.e., shell variable) at configure time.
- m4_define([glibcxx_SUBDIRS],[include libsupc++ src doc po testsuite])
+ m4_define([glibcxx_SUBDIRS],[include libsupc++ python src doc po testsuite])
SUBDIRS='glibcxx_SUBDIRS'
# These need to be absolute paths, yet at the same time need to
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 50d8670219d..542e38a9078 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -2453,7 +2453,7 @@ echo "${ECHO_T}$ac_cv_prog_egrep" >&6
# expandable list at autoconf time; the second provides an expandable list
# (i.e., shell variable) at configure time.
- SUBDIRS='include libsupc++ src doc po testsuite'
+ SUBDIRS='include libsupc++ python src doc po testsuite'
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
@@ -118371,7 +118371,7 @@ else
fi
- ac_config_files="$ac_config_files Makefile include/Makefile libsupc++/Makefile src/Makefile doc/Makefile po/Makefile testsuite/Makefile"
+ ac_config_files="$ac_config_files Makefile include/Makefile libsupc++/Makefile python/Makefile src/Makefile doc/Makefile po/Makefile testsuite/Makefile"
ac_config_files="$ac_config_files scripts/testsuite_flags"
@@ -119416,6 +119416,7 @@ do
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"libsupc++/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsupc++/Makefile" ;;
+ "python/Makefile" ) CONFIG_FILES="$CONFIG_FILES python/Makefile" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"po/Makefile" ) CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
diff --git a/libstdc++-v3/include/tr1_impl/functional b/libstdc++-v3/include/tr1_impl/functional
index 980061d6902..584a403de48 100644
--- a/libstdc++-v3/include/tr1_impl/functional
+++ b/libstdc++-v3/include/tr1_impl/functional
@@ -1557,7 +1557,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
template<typename _Signature>
static bool
_M_not_empty_function(const function<_Signature>& __f)
- { return __f; }
+ { return static_cast<bool>(__f); }
template<typename _Tp>
static bool
@@ -2095,13 +2095,13 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
template<typename _Signature>
inline bool
operator==(const function<_Signature>& __f, _M_clear_type*)
- { return !__f; }
+ { return !static_cast<bool>(__f); }
/// @overload
template<typename _Signature>
inline bool
operator==(_M_clear_type*, const function<_Signature>& __f)
- { return !__f; }
+ { return !static_cast<bool>(__f); }
/**
* @brief Compares a polymorphic function object wrapper against 0
@@ -2113,13 +2113,13 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
template<typename _Signature>
inline bool
operator!=(const function<_Signature>& __f, _M_clear_type*)
- { return __f; }
+ { return static_cast<bool>(__f); }
/// @overload
template<typename _Signature>
inline bool
operator!=(_M_clear_type*, const function<_Signature>& __f)
- { return __f; }
+ { return static_cast<bool>(__f); }
// [3.7.2.8] specialized algorithms
diff --git a/libstdc++-v3/libsupc++/initializer_list b/libstdc++-v3/libsupc++/initializer_list
index 4a48cc567a3..20e29000d56 100644
--- a/libstdc++-v3/libsupc++/initializer_list
+++ b/libstdc++-v3/libsupc++/initializer_list
@@ -8,12 +8,12 @@
// 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.
-//
+//
// GCC 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.
-//
+//
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
@@ -27,8 +27,8 @@
* This is a Standard C++ Library header.
*/
-#ifndef __CXX_INITIALIZER_LIST
-#define __CXX_INITIALIZER_LIST
+#ifndef _INITIALIZER_LIST
+#define _INITIALIZER_LIST
#ifdef __GXX_EXPERIMENTAL_CXX0X__
@@ -42,40 +42,39 @@ namespace std
template<class _E>
class initializer_list
{
- const _E* __array;
- size_t __len;
-
- // The compiler can call a private constructor.
- initializer_list(const _E* __a, size_t __l)
- : __array(__a), __len(__l) { }
-
public:
+ typedef _E value_type;
+ typedef const _E& reference;
+ typedef const _E& const_reference;
+ typedef size_t size_type;
+ typedef const _E* iterator;
+ typedef const _E* const_iterator;
- typedef _E value_type;
- typedef const _E& reference;
- typedef const _E& const_reference;
- typedef size_t size_type;
+ private:
+ iterator _M_array;
+ size_type _M_len;
- typedef const _E* iterator;
- typedef const _E* const_iterator;
+ // The compiler can call a private constructor.
+ initializer_list(const_iterator __a, size_type __l)
+ : _M_array(__a), _M_len(__l) { }
- initializer_list()
- : __array(NULL), __len(0) { }
+ public:
+ initializer_list() : _M_array(NULL), _M_len(0) { }
// Number of elements.
- size_t size() const
- { return __len; }
+ size_type
+ size() const { return _M_len; }
// First element.
- const _E* begin() const
- { return __array; }
+ const_iterator
+ begin() const { return _M_array; }
// One past the last element.
- const _E* end() const
- { return begin() + size(); }
+ const_iterator
+ end() const { return begin() + size(); }
};
}
#pragma GCC visibility pop
#endif // C++0x
-#endif // __CXX_INITIALIZER_LIST
+#endif // _INITIALIZER_LIST
diff --git a/libstdc++-v3/python/Makefile.am b/libstdc++-v3/python/Makefile.am
new file mode 100644
index 00000000000..bcc8afea1eb
--- /dev/null
+++ b/libstdc++-v3/python/Makefile.am
@@ -0,0 +1,43 @@
+## Makefile for the python subdirectory of the GNU C++ Standard library.
+##
+## Copyright (C) 2009 Free Software Foundation, Inc.
+##
+## This file is part of the libstdc++ version 3 distribution.
+## Process this file with automake to produce Makefile.in.
+
+## 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.
+
+include $(top_srcdir)/fragment.am
+
+## Where to install the module code.
+pythondir = $(pkgdatadir)/python
+
+all-local: gdb.py
+
+nobase_python_DATA = \
+ libstdcxx/v6/printers.py \
+ libstdcxx/v6/__init__.py \
+ libstdcxx/__init__.py
+
+gdb.py: hook.in Makefile
+ sed -e 's,@dir@,$(pythondir),' < $(srcdir)/hook.in > $@
+
+install-data-local: gdb.py
+ @$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
+ @libname=`cd $(toolexeclibdir) && ls -r libstdc++* | fgrep -v gdb.py | sed 1q`; \
+ echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
+ $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
new file mode 100644
index 00000000000..879f040d606
--- /dev/null
+++ b/libstdc++-v3/python/Makefile.in
@@ -0,0 +1,504 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/fragment.am
+subdir = python
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
+ $(top_srcdir)/../config/futex.m4 \
+ $(top_srcdir)/../config/iconv.m4 \
+ $(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/lib-ld.m4 \
+ $(top_srcdir)/../config/lib-link.m4 \
+ $(top_srcdir)/../config/lib-prefix.m4 \
+ $(top_srcdir)/../config/multi.m4 \
+ $(top_srcdir)/../config/no-executables.m4 \
+ $(top_srcdir)/../config/override.m4 \
+ $(top_srcdir)/../config/proginstall.m4 \
+ $(top_srcdir)/../config/stdint.m4 \
+ $(top_srcdir)/../config/unwind_ipinfo.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
+ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
+ $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
+ $(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pythondir)"
+nobase_pythonDATA_INSTALL = $(install_sh_DATA)
+DATA = $(nobase_python_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABI_TWEAKS_SRCDIR = @ABI_TWEAKS_SRCDIR@
+ACLOCAL = @ACLOCAL@
+ALLOCATOR_H = @ALLOCATOR_H@
+ALLOCATOR_NAME = @ALLOCATOR_NAME@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+ATOMICITY_SRCDIR = @ATOMICITY_SRCDIR@
+ATOMIC_FLAGS = @ATOMIC_FLAGS@
+ATOMIC_WORD_SRCDIR = @ATOMIC_WORD_SRCDIR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASIC_FILE_CC = @BASIC_FILE_CC@
+BASIC_FILE_H = @BASIC_FILE_H@
+CC = @CC@
+CCODECVT_CC = @CCODECVT_CC@
+CCOLLATE_CC = @CCOLLATE_CC@
+CCTYPE_CC = @CCTYPE_CC@
+CFLAGS = @CFLAGS@
+CLOCALE_CC = @CLOCALE_CC@
+CLOCALE_H = @CLOCALE_H@
+CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
+CMESSAGES_CC = @CMESSAGES_CC@
+CMESSAGES_H = @CMESSAGES_H@
+CMONEY_CC = @CMONEY_CC@
+CNUMERIC_CC = @CNUMERIC_CC@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPU_DEFINES_SRCDIR = @CPU_DEFINES_SRCDIR@
+CSTDIO_H = @CSTDIO_H@
+CTIME_CC = @CTIME_CC@
+CTIME_H = @CTIME_H@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
+DEBUG_FLAGS = @DEBUG_FLAGS@
+DEFS = @DEFS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PARALLEL_FALSE = @ENABLE_PARALLEL_FALSE@
+ENABLE_PARALLEL_TRUE = @ENABLE_PARALLEL_TRUE@
+ENABLE_SYMVERS_DARWIN_FALSE = @ENABLE_SYMVERS_DARWIN_FALSE@
+ENABLE_SYMVERS_DARWIN_TRUE = @ENABLE_SYMVERS_DARWIN_TRUE@
+ENABLE_SYMVERS_FALSE = @ENABLE_SYMVERS_FALSE@
+ENABLE_SYMVERS_GNU_FALSE = @ENABLE_SYMVERS_GNU_FALSE@
+ENABLE_SYMVERS_GNU_NAMESPACE_FALSE = @ENABLE_SYMVERS_GNU_NAMESPACE_FALSE@
+ENABLE_SYMVERS_GNU_NAMESPACE_TRUE = @ENABLE_SYMVERS_GNU_NAMESPACE_TRUE@
+ENABLE_SYMVERS_GNU_TRUE = @ENABLE_SYMVERS_GNU_TRUE@
+ENABLE_SYMVERS_TRUE = @ENABLE_SYMVERS_TRUE@
+ENABLE_VISIBILITY_FALSE = @ENABLE_VISIBILITY_FALSE@
+ENABLE_VISIBILITY_TRUE = @ENABLE_VISIBILITY_TRUE@
+ERROR_CONSTANTS_SRCDIR = @ERROR_CONSTANTS_SRCDIR@
+EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
+FGREP = @FGREP@
+GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
+GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
+GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
+GLIBCXX_BUILD_PCH_TRUE = @GLIBCXX_BUILD_PCH_TRUE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@
+GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE = @GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@
+GLIBCXX_C_HEADERS_C_FALSE = @GLIBCXX_C_HEADERS_C_FALSE@
+GLIBCXX_C_HEADERS_C_GLOBAL_FALSE = @GLIBCXX_C_HEADERS_C_GLOBAL_FALSE@
+GLIBCXX_C_HEADERS_C_GLOBAL_TRUE = @GLIBCXX_C_HEADERS_C_GLOBAL_TRUE@
+GLIBCXX_C_HEADERS_C_STD_FALSE = @GLIBCXX_C_HEADERS_C_STD_FALSE@
+GLIBCXX_C_HEADERS_C_STD_TRUE = @GLIBCXX_C_HEADERS_C_STD_TRUE@
+GLIBCXX_C_HEADERS_C_TRUE = @GLIBCXX_C_HEADERS_C_TRUE@
+GLIBCXX_C_HEADERS_EXTRA_FALSE = @GLIBCXX_C_HEADERS_EXTRA_FALSE@
+GLIBCXX_C_HEADERS_EXTRA_TRUE = @GLIBCXX_C_HEADERS_EXTRA_TRUE@
+GLIBCXX_HOSTED_FALSE = @GLIBCXX_HOSTED_FALSE@
+GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
+GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
+GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
+GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
+OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SECTION_FLAGS = @SECTION_FLAGS@
+SECTION_LDFLAGS = @SECTION_LDFLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYMVER_FILE = @SYMVER_FILE@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARN_FLAGS = @WARN_FLAGS@
+WERROR = @WERROR@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_AS = @ac_ct_AS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_LIPO = @ac_ct_LIPO@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
+ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
+ac_ct_OTOOL = @ac_ct_OTOOL@
+ac_ct_OTOOL64 = @ac_ct_OTOOL64@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+baseline_dir = @baseline_dir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+check_msgfmt = @check_msgfmt@
+datadir = @datadir@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+exec_prefix = @exec_prefix@
+glibcxx_MOFILES = @glibcxx_MOFILES@
+glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@
+glibcxx_POFILES = @glibcxx_POFILES@
+glibcxx_builddir = @glibcxx_builddir@
+glibcxx_localedir = @glibcxx_localedir@
+glibcxx_prefixdir = @glibcxx_prefixdir@
+glibcxx_srcdir = @glibcxx_srcdir@
+glibcxx_thread_h = @glibcxx_thread_h@
+glibcxx_toolexecdir = @glibcxx_toolexecdir@
+glibcxx_toolexeclibdir = @glibcxx_toolexeclibdir@
+gxx_include_dir = @gxx_include_dir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libtool_VERSION = @libtool_VERSION@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+port_specific_symbol_files = @port_specific_symbol_files@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+toplevel_srcdir = @toplevel_srcdir@
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+MAINT_CHARSET = latin1
+mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
+toolexecdir = $(glibcxx_toolexecdir)
+toolexeclibdir = $(glibcxx_toolexeclibdir)
+
+# These bits are all figured out from configure. Look in acinclude.m4
+# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
+CONFIG_CXXFLAGS = \
+ $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS)
+
+WARN_CXXFLAGS = \
+ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once
+
+
+# -I/-D flags to pass when compiling.
+AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
+pythondir = $(pkgdatadir)/python
+nobase_python_DATA = \
+ libstdcxx/v6/printers.py \
+ libstdcxx/v6/__init__.py \
+ libstdcxx/__init__.py
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/fragment.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps python/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign --ignore-deps python/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-nobase_pythonDATA: $(nobase_python_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pythondir)" || $(mkdir_p) "$(DESTDIR)$(pythondir)"
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_python_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ $(am__vpath_adj) \
+ echo " $(nobase_pythonDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pythondir)/$$f'"; \
+ $(nobase_pythonDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pythondir)/$$f"; \
+ done
+
+uninstall-nobase_pythonDATA:
+ @$(NORMAL_UNINSTALL)
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_python_DATA)'; for p in $$list; do \
+ $(am__vpath_adj) \
+ echo " rm -f '$(DESTDIR)$(pythondir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pythondir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/..
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(pythondir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-nobase_pythonDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-nobase_pythonDATA
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+ clean-libtool distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-data-local \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-nobase_pythonDATA install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am uninstall-nobase_pythonDATA
+
+
+all-local: gdb.py
+
+gdb.py: hook.in Makefile
+ sed -e 's,@dir@,$(pythondir),' < $(srcdir)/hook.in > $@
+
+install-data-local: gdb.py
+ @$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
+ @libname=`cd $(toolexeclibdir) && ls -r libstdc++* | fgrep -v gdb.py | sed 1q`; \
+ echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
+ $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libstdc++-v3/python/hook.in b/libstdc++-v3/python/hook.in
new file mode 100644
index 00000000000..fe7c0722484
--- /dev/null
+++ b/libstdc++-v3/python/hook.in
@@ -0,0 +1,27 @@
+# -*- python -*-
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import gdb
+
+# Update module path.
+dir = '@dir@'
+if not dir in sys.path:
+ sys.path.insert(0, dir)
+
+# Load the pretty-printers.
+from libstdcxx.v6.printers import register_libstdcxx_printers
+register_libstdcxx_printers (gdb.current_objfile ())
diff --git a/libstdc++-v3/python/libstdcxx/__init__.py b/libstdc++-v3/python/libstdcxx/__init__.py
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/libstdc++-v3/python/libstdcxx/__init__.py
@@ -0,0 +1 @@
+
diff --git a/libstdc++-v3/python/libstdcxx/v6/__init__.py b/libstdc++-v3/python/libstdcxx/v6/__init__.py
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/libstdc++-v3/python/libstdcxx/v6/__init__.py
@@ -0,0 +1 @@
+
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
new file mode 100644
index 00000000000..7b22e8a0bdc
--- /dev/null
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -0,0 +1,642 @@
+# Pretty-printers for libstc++.
+
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program. If not, see <http://www.gnu.org/licenses/>.
+
+import gdb
+import itertools
+import re
+
+class StdPointerPrinter:
+ "Print a smart pointer of some kind"
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val
+
+ def to_string (self):
+ if self.val['_M_refcount']['_M_pi'] == 0:
+ return '%s (empty) %s' % (self.typename, self.val['_M_ptr'])
+ return '%s (count %d) %s' % (self.typename,
+ self.val['_M_refcount']['_M_pi']['_M_use_count'],
+ self.val['_M_ptr'])
+
+class UniquePointerPrinter:
+ "Print a unique_ptr"
+
+ def __init__ (self, val):
+ self.val = val
+
+ def to_string (self):
+ return self.val['_M_t']
+
+class StdListPrinter:
+ "Print a std::list"
+
+ class _iterator:
+ def __init__(self, nodetype, head):
+ self.nodetype = nodetype
+ self.base = head['_M_next']
+ self.head = head.address
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.base == self.head:
+ raise StopIteration
+ elt = self.base.cast(self.nodetype).dereference()
+ self.base = elt['_M_next']
+ count = self.count
+ self.count = self.count + 1
+ return ('[%d]' % count, elt['_M_data'])
+
+ def __init__(self, val):
+ self.val = val
+
+ def children(self):
+ itype = self.val.type.template_argument(0)
+ nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
+ return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
+
+ def to_string(self):
+ if self.val['_M_impl']['_M_node'].address == self.val['_M_impl']['_M_node']['_M_next']:
+ return 'empty std::list'
+ return 'std::list'
+
+class StdListIteratorPrinter:
+ "Print std::list::iterator"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ itype = self.val.type.template_argument(0)
+ nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
+ return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
+
+class StdSlistPrinter:
+ "Print a __gnu_cxx::slist"
+
+ class _iterator:
+ def __init__(self, nodetype, head):
+ self.nodetype = nodetype
+ self.base = head['_M_head']['_M_next']
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.base == 0:
+ raise StopIteration
+ elt = self.base.cast(self.nodetype).dereference()
+ self.base = elt['_M_next']
+ count = self.count
+ self.count = self.count + 1
+ return ('[%d]' % count, elt['_M_data'])
+
+ def __init__(self, val):
+ self.val = val
+
+ def children(self):
+ itype = self.val.type.template_argument(0)
+ nodetype = gdb.lookup_type('__gnu_cxx::_Slist_node<%s>' % itype).pointer()
+ return self._iterator(nodetype, self.val)
+
+ def to_string(self):
+ if self.val['_M_head']['_M_next'] == 0:
+ return 'empty __gnu_cxx::slist'
+ return '__gnu_cxx::slist'
+
+class StdSlistIteratorPrinter:
+ "Print __gnu_cxx::slist::iterator"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ itype = self.val.type.template_argument(0)
+ nodetype = gdb.lookup_type('__gnu_cxx::_Slist_node<%s>' % itype).pointer()
+ return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
+
+class StdVectorPrinter:
+ "Print a std::vector"
+
+ class _iterator:
+ def __init__ (self, start, finish):
+ self.item = start
+ self.finish = finish
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.item == self.finish:
+ raise StopIteration
+ count = self.count
+ self.count = self.count + 1
+ elt = self.item.dereference()
+ self.item = self.item + 1
+ return ('[%d]' % count, elt)
+
+ def __init__(self, val):
+ self.val = val
+
+ def children(self):
+ return self._iterator(self.val['_M_impl']['_M_start'],
+ self.val['_M_impl']['_M_finish'])
+
+ def to_string(self):
+ start = self.val['_M_impl']['_M_start']
+ finish = self.val['_M_impl']['_M_finish']
+ end = self.val['_M_impl']['_M_end_of_storage']
+ return ('std::vector of length %d, capacity %d'
+ % (int (finish - start), int (end - start)))
+
+ def display_hint(self):
+ return 'array'
+
+class StdVectorIteratorPrinter:
+ "Print std::vector::iterator"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return self.val['_M_current'].dereference()
+
+class StdStackOrQueuePrinter:
+ "Print a std::stack or std::queue"
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.visualizer = gdb.default_visualizer(val['c'])
+
+ def children (self):
+ return self.visualizer.children()
+
+ def to_string (self):
+ return '%s wrapping: %s' % (self.typename,
+ self.visualizer.to_string())
+
+ def display_hint (self):
+ if hasattr (self.visualizer, 'display_hint'):
+ return self.visualizer.display_hint ()
+ return None
+
+class RbtreeIterator:
+ def __init__(self, rbtree):
+ self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
+ self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def __len__(self):
+ return int (self.size)
+
+ def next(self):
+ if self.count == self.size:
+ raise StopIteration
+ result = self.node
+ self.count = self.count + 1
+ if self.count < self.size:
+ # Compute the next node.
+ node = self.node
+ if node.dereference()['_M_right']:
+ node = node.dereference()['_M_right']
+ while node.dereference()['_M_left']:
+ node = node.dereference()['_M_left']
+ else:
+ parent = node.dereference()['_M_parent']
+ while node == parent.dereference()['_M_right']:
+ node = parent
+ parent = parent.dereference()['_M_parent']
+ if node.dereference()['_M_right'] != parent:
+ node = parent
+ self.node = node
+ return result
+
+# This is a pretty printer for std::_Rb_tree_iterator (which is
+# std::map::iterator), and has nothing to do with the RbtreeIterator
+# class above.
+class StdRbtreeIteratorPrinter:
+ "Print std::map::iterator"
+
+ def __init__ (self, val):
+ self.val = val
+
+ def to_string (self):
+ valuetype = self.val.type.template_argument(0)
+ nodetype = gdb.lookup_type('std::_Rb_tree_node < %s >' % valuetype)
+ nodetype = nodetype.pointer()
+ return self.val.cast(nodetype).dereference()['_M_value_field']
+
+
+class StdMapPrinter:
+ "Print a std::map or std::multimap"
+
+ # Turn an RbtreeIterator into a pretty-print iterator.
+ class _iter:
+ def __init__(self, rbiter, type):
+ self.rbiter = rbiter
+ self.count = 0
+ self.type = type
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.count % 2 == 0:
+ n = self.rbiter.next()
+ n = n.cast(self.type).dereference()['_M_value_field']
+ self.pair = n
+ item = n['first']
+ else:
+ item = self.pair['second']
+ result = ('[%d]' % self.count, item)
+ self.count = self.count + 1
+ return result
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val
+ self.iter = RbtreeIterator (val)
+
+ def to_string (self):
+ return '%s with %d elements' % (self.typename, len (self.iter))
+
+ def children (self):
+ keytype = self.val.type.template_argument(0).const()
+ valuetype = self.val.type.template_argument(1)
+ nodetype = gdb.lookup_type('std::_Rb_tree_node< std::pair< %s, %s > >' % (keytype, valuetype))
+ nodetype = nodetype.pointer()
+ return self._iter (self.iter, nodetype)
+
+ def display_hint (self):
+ return 'map'
+
+class StdSetPrinter:
+ "Print a std::set or std::multiset"
+
+ # Turn an RbtreeIterator into a pretty-print iterator.
+ class _iter:
+ def __init__(self, rbiter, type):
+ self.rbiter = rbiter
+ self.count = 0
+ self.type = type
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ item = self.rbiter.next()
+ item = item.cast(self.type).dereference()['_M_value_field']
+ # FIXME: this is weird ... what to do?
+ # Maybe a 'set' display hint?
+ result = ('[%d]' % self.count, item)
+ self.count = self.count + 1
+ return result
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val
+ self.iter = RbtreeIterator (val)
+
+ def to_string (self):
+ return '%s with %d elements' % (self.typename, len (self.iter))
+
+ def children (self):
+ keytype = self.val.type.template_argument(0)
+ nodetype = gdb.lookup_type('std::_Rb_tree_node< %s >' % keytype).pointer()
+ return self._iter (self.iter, nodetype)
+
+class StdBitsetPrinter:
+ "Print a std::bitset"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string (self):
+ # If template_argument handled values, we could print the
+ # size. Or we could use a regexp on the type.
+ return 'std::bitset'
+
+ def children (self):
+ words = self.val['_M_w']
+ wtype = words.type
+
+ # The _M_w member can be either an unsigned long, or an
+ # array. This depends on the template specialization used.
+ # If it is a single long, convert to a single element list.
+ if wtype.code == gdb.TYPE_CODE_ARRAY:
+ tsize = wtype.target ().sizeof
+ else:
+ words = [words]
+ tsize = wtype.sizeof
+
+ nwords = wtype.sizeof / tsize
+ result = []
+ byte = 0
+ while byte < nwords:
+ w = words[byte]
+ bit = 0
+ while w != 0:
+ if (w & 1) != 0:
+ # Another spot where we could use 'set'?
+ result.append(('[%d]' % (byte * tsize * 8 + bit), 1))
+ bit = bit + 1
+ w = w >> 1
+ byte = byte + 1
+ return result
+
+class StdDequePrinter:
+ "Print a std::deque"
+
+ class _iter:
+ def __init__(self, node, start, end, last, buffer_size):
+ self.node = node
+ self.p = start
+ self.end = end
+ self.last = last
+ self.buffer_size = buffer_size
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.p == self.last:
+ raise StopIteration
+
+ result = ('[%d]' % self.count, self.p.dereference())
+ self.count = self.count + 1
+
+ # Advance the 'cur' pointer.
+ self.p = self.p + 1
+ if self.p == self.end:
+ # If we got to the end of this bucket, move to the
+ # next bucket.
+ self.node = self.node + 1
+ self.p = self.node[0]
+ self.end = self.p + self.buffer_size
+
+ return result
+
+ def __init__(self, val):
+ self.val = val
+ self.elttype = val.type.template_argument(0)
+ size = self.elttype.sizeof
+ if size < 512:
+ self.buffer_size = int (512 / size)
+ else:
+ self.buffer_size = 1
+
+ def to_string(self):
+ start = self.val['_M_impl']['_M_start']
+ end = self.val['_M_impl']['_M_finish']
+
+ delta_n = end['_M_node'] - start['_M_node'] - 1
+ delta_s = start['_M_last'] - start['_M_cur']
+ delta_e = end['_M_cur'] - end['_M_first']
+
+ size = self.buffer_size * delta_n + delta_s + delta_e
+
+ return 'std::deque with %d elements' % long (size)
+
+ def children(self):
+ start = self.val['_M_impl']['_M_start']
+ end = self.val['_M_impl']['_M_finish']
+ return self._iter(start['_M_node'], start['_M_cur'], start['_M_last'],
+ end['_M_cur'], self.buffer_size)
+
+ def display_hint (self):
+ return 'array'
+
+class StdDequeIteratorPrinter:
+ "Print std::deque::iterator"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return self.val['_M_cur'].dereference()
+
+class StdStringPrinter:
+ "Print a std::basic_string of some kind"
+
+ def __init__(self, encoding, val):
+ self.encoding = encoding
+ self.val = val
+
+ def to_string(self):
+ # Look up the target encoding as late as possible.
+ encoding = self.encoding
+ if encoding == 0:
+ encoding = gdb.parameter('target-charset')
+ elif encoding == 1:
+ encoding = gdb.parameter('target-wide-charset')
+ elif isinstance(encoding, WideEncoding):
+ encoding = encoding.value
+ return self.val['_M_dataplus']['_M_p'].string(encoding)
+
+ def display_hint (self):
+ return 'string'
+
+class Tr1HashtableIterator:
+ def __init__ (self, hash):
+ self.count = 0
+ self.n_buckets = hash['_M_element_count']
+ if self.n_buckets == 0:
+ self.node = False
+ else:
+ self.bucket = hash['_M_buckets']
+ self.node = self.bucket[0]
+ self.update ()
+
+ def __iter__ (self):
+ return self
+
+ def update (self):
+ # If we advanced off the end of the chain, move to the next
+ # bucket.
+ while self.node == 0:
+ self.bucket = self.bucket + 1
+ self.node = self.bucket[0]
+
+ # If we advanced off the end of the bucket array, then
+ # we're done.
+ if self.count == self.n_buckets:
+ self.node = False
+ else:
+ self.count = self.count + 1
+
+ def next (self):
+ if not self.node:
+ raise StopIteration
+ result = self.node.dereference()['_M_v']
+ self.node = self.node.dereference()['_M_next']
+ self.update ()
+ return result
+
+class Tr1UnorderedSetPrinter:
+ "Print a tr1::unordered_set"
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val
+
+ def to_string (self):
+ return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
+
+ @staticmethod
+ def format_count (i):
+ return '[%d]' % i
+
+ def children (self):
+ counter = itertools.imap (self.format_count, itertools.count())
+ return itertools.izip (counter, Tr1HashtableIterator (self.val))
+
+class Tr1UnorderedMapPrinter:
+ "Print a tr1::unordered_map"
+
+ def __init__ (self, typename, val):
+ self.typename = typename
+ self.val = val
+
+ def to_string (self):
+ return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
+
+ @staticmethod
+ def flatten (list):
+ for elt in list:
+ for i in elt:
+ yield i
+
+ @staticmethod
+ def format_one (elt):
+ return (elt['first'], elt['second'])
+
+ @staticmethod
+ def format_count (i):
+ return '[%d]' % i
+
+ def children (self):
+ counter = itertools.imap (self.format_count, itertools.count())
+ # Map over the hash table and flatten the result.
+ data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.val)))
+ # Zip the two iterators together.
+ return itertools.izip (counter, data)
+
+ def display_hint (self):
+ return 'map'
+
+def register_libstdcxx_printers (obj):
+ "Register libstdc++ pretty-printers with objfile Obj."
+
+ if obj == None:
+ obj = gdb
+
+ obj.pretty_printers.append (lookup_function)
+
+def lookup_function (val):
+ "Look-up and return a pretty-printer that can print val."
+
+ # Get the type.
+ type = val.type;
+
+ # If it points to a reference, get the reference.
+ if type.code == gdb.TYPE_CODE_REF:
+ type = type.target ()
+
+ # Get the unqualified type, stripped of typedefs.
+ type = type.unqualified ().strip_typedefs ()
+
+ # Get the type name.
+ typename = type.tag
+ if typename == None:
+ return None
+
+ # Iterate over local dictionary of types to determine
+ # if a printer is registered for that type. Return an
+ # instantiation of the printer if found.
+ for function in pretty_printers_dict:
+ if function.search (typename):
+ return pretty_printers_dict[function] (val)
+
+ # Cannot find a pretty printer. Return None.
+ return None
+
+def build_libstdcxx_dictionary ():
+ # libstdc++ objects requiring pretty-printing.
+ # In order from:
+ # http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01847.html
+ pretty_printers_dict[re.compile('^std::basic_string<char,.*>$')] = lambda val: StdStringPrinter(0, val)
+ pretty_printers_dict[re.compile('^std::basic_string<wchar_t,.*>$')] = lambda val: StdStringPrinter(1, val)
+ pretty_printers_dict[re.compile('^std::basic_string<char16_t,.*>$')] = lambda val: StdStringPrinter('UTF-16', val)
+ pretty_printers_dict[re.compile('^std::basic_string<char32_t,.*>$')] = lambda val: StdStringPrinter('UTF-32', val)
+ pretty_printers_dict[re.compile('^std::bitset<.*>$')] = StdBitsetPrinter
+ pretty_printers_dict[re.compile('^std::deque<.*>$')] = StdDequePrinter
+ pretty_printers_dict[re.compile('^std::list<.*>$')] = StdListPrinter
+ pretty_printers_dict[re.compile('^std::map<.*>$')] = lambda val: StdMapPrinter("std::map", val)
+ pretty_printers_dict[re.compile('^std::multimap<.*>$')] = lambda val: StdMapPrinter("std::multimap", val)
+ pretty_printers_dict[re.compile('^std::multiset<.*>$')] = lambda val: StdSetPrinter("std::multiset", val)
+ pretty_printers_dict[re.compile('^std::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::priority_queue", val)
+ pretty_printers_dict[re.compile('^std::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::queue", val)
+ pretty_printers_dict[re.compile('^std::set<.*>$')] = lambda val: StdSetPrinter("std::set", val)
+ pretty_printers_dict[re.compile('^std::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::stack", val)
+ pretty_printers_dict[re.compile('^std::unique_ptr<.*>$')] = UniquePointerPrinter
+ pretty_printers_dict[re.compile('^std::vector<.*>$')] = StdVectorPrinter
+ # vector<bool>
+
+ # These are the TR1 and C++0x printers.
+ # For array - the default GDB pretty-printer seems reasonable.
+ pretty_printers_dict[re.compile('^std::shared_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::shared_ptr', val)
+ pretty_printers_dict[re.compile('^std::weak_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::weak_ptr', val)
+ pretty_printers_dict[re.compile('^std::unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::unordered_map', val)
+ pretty_printers_dict[re.compile('^std::unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::unordered_set', val)
+ pretty_printers_dict[re.compile('^std::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::unordered_multimap', val)
+ pretty_printers_dict[re.compile('^std::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::unordered_multiset', val)
+
+ pretty_printers_dict[re.compile('^std::tr1::shared_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::tr1::shared_ptr', val)
+ pretty_printers_dict[re.compile('^std::tr1::weak_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::tr1::weak_ptr', val)
+ pretty_printers_dict[re.compile('^std::tr1::unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_map', val)
+ pretty_printers_dict[re.compile('^std::tr1::unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_set', val)
+ pretty_printers_dict[re.compile('^std::tr1::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_multimap', val)
+ pretty_printers_dict[re.compile('^std::tr1::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_multiset', val)
+
+
+ # Extensions.
+ pretty_printers_dict[re.compile('^__gnu_cxx::slist<.*>$')] = StdSlistPrinter
+
+ if True:
+ # These shouldn't be necessary, if GDB "print *i" worked.
+ # But it often doesn't, so here they are.
+ pretty_printers_dict[re.compile('^std::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::_Rb_tree_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::_Rb_tree_const_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::_Deque_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^std::_Deque_const_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^__gnu_cxx::__normal_iterator<.*>$')] = lambda val: StdVectorIteratorPrinter(val)
+ pretty_printers_dict[re.compile('^__gnu_cxx::_Slist_iterator<.*>$')] = lambda val: StdSlistIteratorPrinter(val)
+
+pretty_printers_dict = {}
+
+build_libstdcxx_dictionary ()
diff --git a/libstdc++-v3/testsuite/18_support/initializer_list/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/18_support/initializer_list/requirements/explicit_instantiation.cc
new file mode 100644
index 00000000000..651ec0ef11b
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/initializer_list/requirements/explicit_instantiation.cc
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// 2009-05-27 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 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/>.
+
+#include <initializer_list>
+
+template class std::initializer_list<int>;
diff --git a/libstdc++-v3/testsuite/18_support/initializer_list/requirements/typedefs.cc b/libstdc++-v3/testsuite/18_support/initializer_list/requirements/typedefs.cc
new file mode 100644
index 00000000000..1f9939260c5
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/initializer_list/requirements/typedefs.cc
@@ -0,0 +1,34 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// 2009-05-27 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 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/>.
+
+#include <initializer_list>
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::initializer_list<int> test_type;
+ typedef test_type::value_type type1;
+ typedef test_type::size_type type2;
+ typedef test_type::reference type3;
+ typedef test_type::const_reference type4;
+ typedef test_type::iterator type5;
+ typedef test_type::const_iterator type5;
+}
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool_neg.cc
index 554b59f3e7a..539dd891cd5 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool_neg.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/operators/bool_neg.cc
@@ -30,4 +30,4 @@ int main()
return i;
}
-// { dg-error "could not convert" "" { target *-*-* } 28 }
+// { dg-error "cannot convert" "" { target *-*-* } 28 }
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc
index 776179f3efa..6b8d129d2ff 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_condition/operators/bool_neg.cc
@@ -29,4 +29,4 @@ int test01()
return i;
}
-// { dg-error "could not convert" "" { target *-*-* } 27 }
+// { dg-error "cannot convert" "" { target *-*-* } 27 }
diff --git a/libstdc++-v3/testsuite/20_util/function/null_pointer_comparisons.cc b/libstdc++-v3/testsuite/20_util/function/null_pointer_comparisons.cc
new file mode 100644
index 00000000000..7f446d7d60a
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/function/null_pointer_comparisons.cc
@@ -0,0 +1,44 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 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/>.
+
+#include <functional>
+
+// libstdc++/40273
+int main()
+{
+ std::function<void* ()> f = 0;
+ if (f != 0)
+ {
+ }
+
+ if (0 != f)
+ {
+ }
+
+ if (f == 0)
+ {
+ }
+
+ if (0 == f)
+ {
+ }
+ return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/20_util/function/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/function/requirements/explicit_instantiation.cc
new file mode 100644
index 00000000000..dbd8be6303a
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/function/requirements/explicit_instantiation.cc
@@ -0,0 +1,26 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 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/>.
+
+#include <functional>
+
+namespace std
+{
+ template class function<void* ()>;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/cons/1.cc b/libstdc++-v3/testsuite/23_containers/deque/cons/1.cc
index 3d86fd806d3..579521582c7 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/cons/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/cons/1.cc
@@ -26,7 +26,7 @@
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
-typedef std::deque<__gnu_test::counter> gdeque;
+typedef std::deque<__gnu_test::object_counter> gdeque;
bool test __attribute__((unused)) = true;
diff --git a/libstdc++-v3/testsuite/23_containers/deque/cons/2.cc b/libstdc++-v3/testsuite/23_containers/deque/cons/2.cc
index 4d6e1308db8..23600284e72 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/cons/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/cons/2.cc
@@ -31,10 +31,10 @@ using __gnu_test::tracker_allocator_counter;
using __gnu_test::tracker_allocator;
using __gnu_test::copy_constructor;
using __gnu_test::assignment_operator;
-using __gnu_test::counter;
+using __gnu_test::object_counter;
using __gnu_test::destructor;
-typedef std::deque<counter> gdeque;
+typedef std::deque<object_counter> gdeque;
bool test __attribute__((unused)) = true;
diff --git a/libstdc++-v3/testsuite/ext/array_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/array_allocator/check_delete.cc
index 6a1214e63fe..9e6f32d13fa 100644
--- a/libstdc++-v3/testsuite/ext/array_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/array_allocator/check_delete.cc
@@ -21,40 +21,15 @@
#include <cstdlib>
#include <ext/array_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
+#include <replacement_memory_operators.h>
-using __gnu_cxx::array_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
+int main()
{
- bool test __attribute__((unused)) = true;
typedef unsigned int value_type;
typedef std::tr1::array<value_type, 15> array_type;
- typedef array_allocator<value_type, array_type> allocator_type;
+ typedef __gnu_cxx::array_allocator<value_type, array_type> allocator_type;
array_type store;
allocator_type a(&store);
- VERIFY( bool(__gnu_test::check_delete<allocator_type, false>(a)) );
-}
-
-int main()
-{
- test01();
+ __gnu_test::check_delete<allocator_type, false>(a);
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/array_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/array_allocator/check_new.cc
index ea75ee75f71..2d51a025064 100644
--- a/libstdc++-v3/testsuite/ext/array_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/array_allocator/check_new.cc
@@ -21,40 +21,15 @@
#include <cstdlib>
#include <ext/array_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
+#include <replacement_memory_operators.h>
-using __gnu_cxx::array_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
+int main()
{
- bool test __attribute__((unused)) = true;
typedef unsigned int value_type;
typedef std::tr1::array<value_type, 15> array_type;
- typedef array_allocator<value_type, array_type> allocator_type;
+ typedef __gnu_cxx::array_allocator<value_type, array_type> allocator_type;
array_type store;
allocator_type a(&store);
- VERIFY( bool(__gnu_test::check_new<allocator_type, false>(a)) );
-}
-
-int main()
-{
- test01();
+ __gnu_test::check_new<allocator_type, false>(a);
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/bitmap_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/bitmap_allocator/check_delete.cc
index 9cff3851307..a82bcc7f948 100644
--- a/libstdc++-v3/testsuite/ext/bitmap_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/bitmap_allocator/check_delete.cc
@@ -19,35 +19,11 @@
#include <cstdlib>
#include <ext/bitmap_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::bitmap_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef bitmap_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::bitmap_allocator<unsigned int> allocator_type;
+ __gnu_test::check_delete<allocator_type, true>();
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/bitmap_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/bitmap_allocator/check_new.cc
index 24ee3f08b0c..205fa3a1786 100644
--- a/libstdc++-v3/testsuite/ext/bitmap_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/bitmap_allocator/check_new.cc
@@ -19,35 +19,11 @@
#include <cstdlib>
#include <ext/bitmap_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::bitmap_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef bitmap_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::bitmap_allocator<unsigned int> allocator_type;
+ __gnu_test::check_new<allocator_type, true>();
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/debug_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/debug_allocator/check_delete.cc
index 04f0997cc34..5b9d06142b6 100644
--- a/libstdc++-v3/testsuite/ext/debug_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/debug_allocator/check_delete.cc
@@ -22,37 +22,12 @@
#include <cstdlib>
#include <ext/debug_allocator.h>
#include <ext/malloc_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
+#include <replacement_memory_operators.h>
-using __gnu_cxx::malloc_allocator;
-using __gnu_cxx::debug_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
+int main()
{
- bool test __attribute__((unused)) = true;
+ using namespace __gnu_cxx;
typedef debug_allocator<malloc_allocator<unsigned int> > allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, false>()) );
-}
-
-int main()
-{
- test01();
+ __gnu_test::check_delete<allocator_type, false>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/debug_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/debug_allocator/check_new.cc
index 9169637902a..105bf288912 100644
--- a/libstdc++-v3/testsuite/ext/debug_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/debug_allocator/check_new.cc
@@ -22,37 +22,12 @@
#include <cstdlib>
#include <ext/debug_allocator.h>
#include <ext/malloc_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
+#include <replacement_memory_operators.h>
-using __gnu_cxx::malloc_allocator;
-using __gnu_cxx::debug_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
+int main()
{
- bool test __attribute__((unused)) = true;
+ using namespace __gnu_cxx;
typedef debug_allocator<malloc_allocator<unsigned int> > allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, false>()) );
-}
-
-int main()
-{
- test01();
+ __gnu_test::check_new<allocator_type, false>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/check_delete.cc
index 2b9f8bcf861..2ed8d0454c0 100644
--- a/libstdc++-v3/testsuite/ext/malloc_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/malloc_allocator/check_delete.cc
@@ -21,36 +21,11 @@
#include <cstdlib>
#include <ext/malloc_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::malloc_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef malloc_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, false>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::malloc_allocator<unsigned int> allocator_type;
+ __gnu_test::check_delete<allocator_type, false>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/check_new.cc
index 51acf697ecb..fac139f2b0c 100644
--- a/libstdc++-v3/testsuite/ext/malloc_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/malloc_allocator/check_new.cc
@@ -21,36 +21,11 @@
#include <cstdlib>
#include <ext/malloc_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::malloc_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef malloc_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, false>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::malloc_allocator<unsigned int> allocator_type;
+ __gnu_test::check_new<allocator_type, false>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc
index 2d1ded83d3b..67041f5483f 100644
--- a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc
+++ b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc
@@ -17,56 +17,15 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 20.4.1.1 allocator members
-
#include <string>
#include <stdexcept>
-#include <cstdio>
#include <ext/malloc_allocator.h>
-#include <testsuite_hooks.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() {}
- ~count_check()
- {
- if (count != 0)
- throw std::runtime_error("count isn't zero");
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
- if (count == 0)
- printf("All memory released \n");
- else
- printf("%lu allocations to be released \n",
- static_cast<unsigned long>(count));
- free(p);
-}
+#include <replacement_memory_operators.h>
typedef char char_t;
typedef std::char_traits<char_t> traits_t;
typedef __gnu_cxx::malloc_allocator<char_t> allocator_t;
-typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
+typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
string_t s("bayou bend");
diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc
index f9cd80d2375..76ae1995f55 100644
--- a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc
+++ b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -17,51 +17,23 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 20.4.1.1 allocator members
-
#include <string>
-#include <cstdio>
#include <ext/malloc_allocator.h>
-#include <testsuite_hooks.h>
-
-static size_t alloc_cnt;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- alloc_cnt++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- alloc_cnt--;
- if (alloc_cnt == 0)
- printf("All memory released \n");
- else
- printf("%lu allocations to be released \n",
- static_cast<unsigned long>(alloc_cnt));
- free(p);
-}
+#include <replacement_memory_operators.h>
typedef char char_t;
typedef std::char_traits<char_t> traits_t;
typedef __gnu_cxx::malloc_allocator<char_t> allocator_t;
-typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
+typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
int main()
{
- bool test __attribute__((unused)) = true;
{
string_t s;
s += "bayou bend";
}
- VERIFY( alloc_cnt == 0 );
+
+ if (__gnu_test::counter::count() != 0)
+ throw std::runtime_error("count not zero");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/mt_allocator/check_delete.cc
index 470b66f5cf6..374c567060a 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/check_delete.cc
@@ -21,34 +21,11 @@
#include <cstdlib>
#include <ext/mt_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::__mt_alloc;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void* v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef __mt_alloc<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, false>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::__mt_alloc<unsigned int> allocator_type;
+ __gnu_test::check_delete<allocator_type, false>();
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc
index 171a2073f3c..52793264063 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc
@@ -21,35 +21,12 @@
#include <cstdlib>
#include <ext/mt_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
+#include <replacement_memory_operators.h>
-using __gnu_cxx::__mt_alloc;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void* v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-void test01()
+int main()
{
// Uses new but delete only optionally.
- bool test __attribute__((unused)) = true;
- typedef __mt_alloc<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, true>()) );
-}
-
-int main()
-{
- test01();
+ typedef __gnu_cxx::__mt_alloc<unsigned int> allocator_type;
+ __gnu_test::check_new<allocator_type, true>();
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc
index a75f38a0724..fcc5006bd3c 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc
@@ -24,43 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef std::string value_type;
using __gnu_cxx::__pool;
@@ -74,6 +38,9 @@ list_type l;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
l.push_back("bayou bend");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc
index bc9c2c7d477..cafbffb3494 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc
@@ -24,43 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef std::string value_t;
using __gnu_cxx::__pool;
@@ -74,6 +38,9 @@ list_type l;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
l.push_back("bayou bend");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc
index 6881c9f3d1a..f61cd38b790 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc
@@ -24,43 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef std::string value_type;
using __gnu_cxx::__pool;
@@ -74,6 +38,9 @@ list_type l;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
l.push_back("bayou bend");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc
index 2724d36392f..62074f0a426 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc
@@ -24,43 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef std::string value_type;
using __gnu_cxx::__pool;
@@ -74,6 +38,9 @@ list_type l;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
l.push_back("bayou bend");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc
index eec6dea8c1b..9ccebd57ed0 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc
@@ -23,43 +23,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef char value_type;
typedef std::char_traits<value_type> traits_type;
@@ -70,6 +34,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
index 793f6406164..9265a15a98b 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
@@ -23,43 +23,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- printf("allocation/deallocation count is %zu \n", count);
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef char value_type;
typedef std::char_traits<value_type> traits_type;
@@ -71,6 +35,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc
index fd1da97a53b..01755713885 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc
@@ -24,42 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: Using a pool that attempts to clean up resource use.
- if (count != 0)
- {
- printf("allocation/deallocation count is %zu \n", count);
- throw std::runtime_error("allocation/deallocation count isn't zero");
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
template<bool _Thread>
struct cleanup_pool : public __gnu_cxx::__pool<false>
@@ -81,6 +46,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc
index 1574e8cb473..34005e4b091 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc
@@ -24,42 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: Using a pool that attempts to clean up resource use.
- if (count != 0)
- {
- printf("allocation/deallocation count is %zu \n", count);
- throw std::runtime_error("allocation/deallocation count isn't zero");
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
template<bool _Thread>
struct cleanup_pool : public __gnu_cxx::__pool<false>
@@ -82,6 +47,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc
index 399d57686f1..012a7585acf 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc
@@ -23,43 +23,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef char value_type;
typedef std::char_traits<value_type> traits_type;
@@ -70,6 +34,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc
index 38977c569dd..0a9fde02b12 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc
@@ -23,43 +23,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: __mt_allocator doesn't clean itself up. Thus, this will not
- // be zero.
- if (count != 0)
- {
- //throw std::runtime_error("allocation/deallocation count isn't zero");
- printf("allocation/deallocation count is %zu \n", count);
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef char value_type;
typedef std::char_traits<value_type> traits_type;
@@ -71,6 +35,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc
index 49701c09bbc..a812aecf26c 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc
@@ -24,42 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: Using a pool that attempts to clean up resource use.
- if (count != 0)
- {
- printf("allocation/deallocation count is %zu \n", count);
- throw std::runtime_error("allocation/deallocation count isn't zero");
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
template<bool _Thread>
struct cleanup_pool : public __gnu_cxx::__pool<true>
@@ -72,7 +37,6 @@ template<bool _Thread>
~cleanup_pool() throw() { this->_M_destroy(); }
};
-
typedef char value_type;
typedef std::char_traits<value_type> traits_type;
typedef __gnu_cxx::__common_pool_policy<cleanup_pool, true> policy_type;
@@ -81,6 +45,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc
index 5bdfd0db8bb..ac8426ee9fc 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc
@@ -24,42 +24,7 @@
#include <stdexcept>
#include <cstdio>
#include <ext/mt_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- // NB: Using a pool that attempts to clean up resource use.
- if (count != 0)
- {
- printf("allocation/deallocation count is %zu \n", count);
- throw std::runtime_error("allocation/deallocation count isn't zero");
- }
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
template<bool _Thread>
struct cleanup_pool : public __gnu_cxx::__pool<true>
@@ -82,6 +47,9 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, the count will
+ // not be zero.
+ __gnu_test::counter::exceptions(false);
string_type s;
s += "bayou bend";
return 0;
diff --git a/libstdc++-v3/testsuite/ext/new_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/new_allocator/check_delete.cc
index f97903719ed..cff31c8926d 100644
--- a/libstdc++-v3/testsuite/ext/new_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/new_allocator/check_delete.cc
@@ -21,36 +21,11 @@
#include <cstdlib>
#include <ext/new_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::new_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef new_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::new_allocator<unsigned int> allocator_type;
+ __gnu_test::check_delete<allocator_type, true>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/new_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/new_allocator/check_new.cc
index 9fa0c04d7f2..098b624d146 100644
--- a/libstdc++-v3/testsuite/ext/new_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/new_allocator/check_new.cc
@@ -21,36 +21,11 @@
#include <cstdlib>
#include <ext/new_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::new_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef new_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::new_allocator<unsigned int> allocator_type;
+ __gnu_test::check_new<allocator_type, true>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc
index 014141bf639..783be483da8 100644
--- a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc
+++ b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc
@@ -17,50 +17,15 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 20.4.1.1 allocator members
-
#include <string>
#include <stdexcept>
-#include <cstdlib>
-#include <cstdio>
#include <ext/new_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- if (count != 0)
- throw std::runtime_error("allocation/deallocation count isn't zero");
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- std::printf("operator new is called \n");
- void* p = std::malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- std::printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef char char_t;
typedef std::char_traits<char_t> traits_t;
typedef __gnu_cxx::new_allocator<char_t> allocator_t;
-typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
+typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
string_t s("bayou bend");
diff --git a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc
index 7f224a5cb8a..dd7c634e06c 100644
--- a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc
+++ b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -17,54 +17,23 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 20.4.1.1 allocator members
-
#include <string>
-#include <stdexcept>
-#include <cstdlib>
-#include <cstdio>
#include <ext/new_allocator.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() { }
- ~count_check()
- {
- if (count != 0)
- throw std::runtime_error("allocation/deallocation count isn't zero");
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- std::printf("operator new is called \n");
- void* p = std::malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- std::printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
-}
+#include <replacement_memory_operators.h>
typedef char char_t;
typedef std::char_traits<char_t> traits_t;
typedef __gnu_cxx::new_allocator<char_t> allocator_t;
-typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
+typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
int main()
{
- string_t s;
- s += "bayou bend";
+ {
+ string_t s;
+ s += "bayou bend";
+ }
+
+ if (__gnu_test::counter::count() != 0)
+ throw std::runtime_error("count not zero");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/pool_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/pool_allocator/check_delete.cc
index b24550ee3de..ecc399df638 100644
--- a/libstdc++-v3/testsuite/ext/pool_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/pool_allocator/check_delete.cc
@@ -21,36 +21,12 @@
#include <cstdlib>
#include <ext/pool_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::__pool_alloc;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-void test01()
-{
- // Uses new, but delete only sometimes.
- bool test __attribute__((unused)) = true;
- typedef __pool_alloc<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, false>()) );
-}
+#include <replacement_memory_operators.h>
int main()
{
- test01();
+ // Uses new, but delete only sometimes.
+ typedef __gnu_cxx::__pool_alloc<unsigned int> allocator_type;
+ __gnu_test::check_delete<allocator_type, false>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/pool_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/pool_allocator/check_new.cc
index a4fad95d5ad..f1bdb77bb86 100644
--- a/libstdc++-v3/testsuite/ext/pool_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/pool_allocator/check_new.cc
@@ -21,35 +21,11 @@
#include <cstdlib>
#include <ext/pool_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::__pool_alloc;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef __pool_alloc<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::__pool_alloc<unsigned int> allocator_type;
+ __gnu_test::check_new<allocator_type, true>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc b/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc
index a33493181bb..cfc38ee02f6 100644
--- a/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc
+++ b/libstdc++-v3/testsuite/ext/throw_allocator/check_delete.cc
@@ -20,36 +20,11 @@
#include <cstdlib>
#include <ext/throw_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::throw_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef throw_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_delete<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::throw_allocator<unsigned int> allocator_type;
+ __gnu_test::check_delete<allocator_type, true>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc b/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc
index f0579fbf642..2d42891766b 100644
--- a/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc
+++ b/libstdc++-v3/testsuite/ext/throw_allocator/check_new.cc
@@ -20,36 +20,11 @@
#include <cstdlib>
#include <ext/throw_allocator.h>
-#include <testsuite_hooks.h>
-#include <testsuite_allocator.h>
-
-using __gnu_cxx::throw_allocator;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- new_called = true;
- return std::malloc(n);
-}
-
-void
-operator delete(void *v) throw()
-{
- delete_called = true;
- return std::free(v);
-}
-
-// These just help tracking down error messages.
-void test01()
-{
- bool test __attribute__((unused)) = true;
- typedef throw_allocator<unsigned int> allocator_type;
- VERIFY( bool(__gnu_test::check_new<allocator_type, true>()) );
-}
+#include <replacement_memory_operators.h>
int main()
-{
- test01();
+{
+ typedef __gnu_cxx::throw_allocator<unsigned int> allocator_type;
+ __gnu_test::check_new<allocator_type, true>();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc
index d298fe42b55..c53517ebc13 100644
--- a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc
+++ b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_global.cc
@@ -21,50 +21,12 @@
#include <string>
#include <stdexcept>
#include <ext/throw_allocator.h>
-#include <testsuite_hooks.h>
-
-static size_t count;
-
-struct count_check
-{
- count_check() {}
- ~count_check()
- {
- if (count != 0)
- throw std::runtime_error("count isn't zero");
- }
-};
-
-static count_check check;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- count++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- count--;
- if (count == 0)
- printf("All memory released \n");
- else
- printf("%lu allocations to be released \n",
- static_cast<unsigned long>(count));
- free(p);
-}
+#include <replacement_memory_operators.h>
typedef char char_t;
typedef std::char_traits<char_t> traits_t;
typedef __gnu_cxx::throw_allocator<char_t> allocator_t;
-typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
+typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
string_t s("bayou bend");
diff --git a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc
index 45fd6dcdde0..c2e918ccc25 100644
--- a/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc
+++ b/libstdc++-v3/testsuite/ext/throw_allocator/deallocate_local.cc
@@ -20,46 +20,21 @@
#include <string>
#include <ext/throw_allocator.h>
-#include <testsuite_hooks.h>
-
-static size_t alloc_cnt;
-
-void* operator new(size_t size) throw(std::bad_alloc)
-{
- printf("operator new is called \n");
- void* p = malloc(size);
- if (p == NULL)
- throw std::bad_alloc();
- alloc_cnt++;
- return p;
-}
-
-void operator delete(void* p) throw()
-{
- printf("operator delete is called \n");
- if (p == NULL)
- return;
- alloc_cnt--;
- if (alloc_cnt == 0)
- printf("All memory released \n");
- else
- printf("%lu allocations to be released \n",
- static_cast<unsigned long>(alloc_cnt));
- free(p);
-}
+#include <replacement_memory_operators.h>
typedef char char_t;
typedef std::char_traits<char_t> traits_t;
typedef __gnu_cxx::throw_allocator<char_t> allocator_t;
-typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
+typedef std::basic_string<char_t, traits_t, allocator_t> string_t;
int main()
{
- bool test __attribute__((unused)) = true;
{
string_t s;
s += "bayou bend";
}
- VERIFY( alloc_cnt == 0 );
+
+ if (__gnu_test::counter::count() != 0)
+ throw std::runtime_error("count not zero");
return 0;
}
diff --git a/libstdc++-v3/testsuite/util/replacement_memory_operators.h b/libstdc++-v3/testsuite/util/replacement_memory_operators.h
new file mode 100644
index 00000000000..91c8fa3d38a
--- /dev/null
+++ b/libstdc++-v3/testsuite/util/replacement_memory_operators.h
@@ -0,0 +1,110 @@
+//
+// Copyright (C) 2007, 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/>.
+
+#include <exception>
+
+namespace __gnu_test
+{
+ struct counter_error : public std::exception { };
+
+ struct counter
+ {
+ size_t _M_count;
+ bool _M_throw;
+
+ counter() : _M_count(0), _M_throw(true) { }
+
+ ~counter()
+ {
+ if (_M_throw && _M_count != 0)
+ throw counter_error();
+ }
+
+ static void
+ increment() { get()._M_count++; }
+
+ static void
+ decrement() { get()._M_count--; }
+
+ static counter&
+ get()
+ {
+ static counter g;
+ return g;
+ }
+
+ static size_t
+ count() { return get()._M_count; }
+
+ static void
+ exceptions(bool __b) { get()._M_throw = __b; }
+ };
+
+ template<typename Alloc, bool uses_global_new>
+ bool
+ check_new(Alloc a = Alloc())
+ {
+ __gnu_test::counter::exceptions(false);
+ a.allocate(10);
+ const bool __b((__gnu_test::counter::count() > 0) == uses_global_new);
+ if (!__b)
+ throw std::logic_error("counter not incremented");
+ return __b;
+ }
+
+ template<typename Alloc, bool uses_global_delete>
+ bool
+ check_delete(Alloc a = Alloc())
+ {
+ __gnu_test::counter::exceptions(false);
+ typename Alloc::pointer p = a.allocate(10);
+ const std::size_t count1 = __gnu_test::counter::count();
+ a.deallocate(p, 10);
+ const std::size_t count2 = __gnu_test::counter::count();
+ const bool __b((count2 < count1) == uses_global_delete);
+ if (!__b)
+ throw std::logic_error("counter not decremented");
+ return __b;
+ }
+} // namespace __gnu_test
+
+void* operator new(std::size_t size) throw(std::bad_alloc)
+{
+ printf("operator new is called \n");
+ void* p = std::malloc(size);
+ if (p == NULL)
+ throw std::bad_alloc();
+ __gnu_test::counter::increment();
+ return p;
+}
+
+void operator delete(void* p) throw()
+{
+ printf("operator delete is called \n");
+ if (p != NULL)
+ {
+ std::free(p);
+ __gnu_test::counter::decrement();
+
+ std::size_t count = __gnu_test::counter::count();
+ if (count == 0)
+ printf("All memory released \n");
+ else
+ printf("%lu allocations to be released \n", count);
+ }
+}
diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h
index d2759f4653f..96fe546b482 100644
--- a/libstdc++-v3/testsuite/util/testsuite_allocator.h
+++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h
@@ -32,12 +32,6 @@
#include <cassert>
#include <bits/move.h>
-namespace
-{
- bool new_called = false;
- bool delete_called = false;
-}
-
namespace __gnu_test
{
class tracker_allocator_counter
@@ -186,27 +180,6 @@ namespace __gnu_test
bool
check_construct_destroy(const char* tag, int expected_c, int expected_d);
- template<typename Alloc, bool uses_global_new>
- bool
- check_new(Alloc a = Alloc())
- {
- bool test __attribute__((unused)) = true;
- a.allocate(10);
- test &= ( new_called == uses_global_new );
- return test;
- }
-
- template<typename Alloc, bool uses_global_delete>
- bool
- check_delete(Alloc a = Alloc())
- {
- bool test __attribute__((unused)) = true;
- typename Alloc::pointer p = a.allocate(10);
- a.deallocate(p, 10);
- test &= ( delete_called == uses_global_delete );
- return test;
- }
-
template<typename Alloc>
bool
check_deallocate_null()
diff --git a/libstdc++-v3/testsuite/util/testsuite_hooks.cc b/libstdc++-v3/testsuite/util/testsuite_hooks.cc
index 8fb7e15b5e8..6d77d57672f 100644
--- a/libstdc++-v3/testsuite/util/testsuite_hooks.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_hooks.cc
@@ -217,7 +217,7 @@ namespace __gnu_test
#endif
}
- counter::size_type counter::count = 0;
+ object_counter::size_type object_counter::count = 0;
unsigned int copy_constructor::count_ = 0;
unsigned int copy_constructor::throw_on_ = 0;
unsigned int assignment_operator::count_ = 0;
diff --git a/libstdc++-v3/testsuite/util/testsuite_hooks.h b/libstdc++-v3/testsuite/util/testsuite_hooks.h
index add47b60309..88155fa70a9 100644
--- a/libstdc++-v3/testsuite/util/testsuite_hooks.h
+++ b/libstdc++-v3/testsuite/util/testsuite_hooks.h
@@ -34,8 +34,8 @@
// limit in megabytes (a floating-point number). If _GLIBCXX_RES_LIMITS is
// not #defined before including this header, then no limiting is attempted.
//
-// 3) counter
-// This is a POD with a static data member, gnu_counting_struct::count,
+// 3) object_counter
+// This is a POD with a static data member, object_counter::count,
// which starts at zero, increments on instance construction, and decrements
// on instance destruction. "assert_count(n)" can be called to VERIFY()
// that the count equals N.
@@ -135,19 +135,19 @@ namespace __gnu_test
run_tests_wrapped_env(const char*, const char*, const func_callback&);
// Counting.
- struct counter
+ struct object_counter
{
- // Specifically and glaringly-obviously marked 'signed' so that when
- // COUNT mistakenly goes negative, we can track the patterns of
- // deletions more easily.
+ // Specifically and glaringly-obviously marked 'signed' so that
+ // when COUNT mistakenly goes negative, we can track the patterns
+ // of deletions more easily.
typedef signed int size_type;
static size_type count;
- counter() { ++count; }
- counter (const counter&) { ++count; }
- ~counter() { --count; }
+ object_counter() { ++count; }
+ object_counter (const object_counter&) { ++count; }
+ ~object_counter() { --count; }
};
-#define assert_count(n) VERIFY(__gnu_test::counter::count == n)
+#define assert_count(n) VERIFY(__gnu_test::object_counter::count == n)
// A (static) class for counting copy constructors and possibly throwing an
// exception on a desired count.