Directory layout flattening.
authorBenjamin Kosnik <bkoz@redhat.com>
Tue, 20 Feb 2007 19:47:35 +0000 (19:47 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 20 Feb 2007 19:47:35 +0000 (19:47 +0000)
2007-02-20  Benjamin Kosnik  <bkoz@redhat.com>

Directory layout flattening.

Added in testsuite:
* 20_util/allocator
* 20_util/auto_ptr
* 20_util/function_objects
* 20_util/function_objects/binders
* 20_util/function_objects/binders/1.cc
* 20_util/function_objects/binders/3113.cc
* 20_util/function_objects/comparisons.cc
* 20_util/pair
* 20_util/raw_storage_iterator
* 20_util/rel_ops.cc
* 20_util/specialized_algorithms
* 20_util/specialized_algorithms/16505.cc
* 20_util/temporary_buffer.cc
* 26_numerics/numeric_arrays/slice_array
* 26_numerics/numeric_arrays/slice_array/array_assignment.cc
* 26_numerics/numeric_arrays/slice_array/requirements
* 26_numerics/numeric_arrays/slice_array/requirements/
explicit_instantiation.cc
* 26_numerics/numeric_arrays/slice_array/requirements/typedefs.cc
* 26_numerics/numeric_arrays/valarray
* 26_numerics/numeric_arrays/valarray/27867.cc
* 26_numerics/numeric_arrays/valarray/28277.cc
* 26_numerics/numeric_arrays/valarray/30416.cc
* 26_numerics/numeric_arrays/valarray/algo.cc
* 26_numerics/numeric_arrays/valarray/binary_closure.cc
* 26_numerics/numeric_arrays/valarray/const_bracket.cc
* 26_numerics/numeric_arrays/valarray/dr543.cc
* 26_numerics/numeric_arrays/valarray/name_lookup.cc
* 26_numerics/numeric_arrays/valarray/operators.cc
* 26_numerics/numeric_arrays/valarray/requirements
* 26_numerics/numeric_arrays/valarray/requirements/
explicit_instantiation.cc
* 26_numerics/numeric_arrays/valarray/requirements/typedefs.cc
* 26_numerics/numeric_arrays/valarray/subset_assignment.cc
* tr1/2_general_utilities/enable_shared_from_this
* tr1/2_general_utilities/shared_ptr
* tr1/2_general_utilities/weak_ptr

Deleted in testsuite:
* 20_util/functional
* 20_util/functional/binders
* 20_util/functional/binders/1.cc
* 20_util/functional/binders/3113.cc
* 20_util/functional/comparisons.cc
* 20_util/memory
* 20_util/memory/16505.cc
* 20_util/memory/allocator
* 20_util/memory/allocator/10378.cc
* 20_util/memory/allocator/14176.cc
* 20_util/memory/allocator/1.cc
* 20_util/memory/allocator/8230.cc
* 20_util/memory/allocator/requirements
* 20_util/memory/allocator/requirements/explicit_instantiation
* 20_util/memory/allocator/requirements/explicit_instantiation/1.cc
* 20_util/memory/auto_ptr
* 20_util/memory/auto_ptr/1.cc
* 20_util/memory/auto_ptr/2.cc
* 20_util/memory/auto_ptr/3946.cc
* 20_util/memory/auto_ptr/3.cc
* 20_util/memory/auto_ptr/4.cc
* 20_util/memory/auto_ptr/5.cc
* 20_util/memory/auto_ptr/6.cc
* 20_util/memory/auto_ptr/7.cc
* 20_util/memory/auto_ptr/assign_neg.cc
* 20_util/memory/auto_ptr/requirements
* 20_util/memory/auto_ptr/requirements/explicit_instantiation
* 20_util/memory/auto_ptr/requirements/explicit_instantiation/1.cc
* 20_util/memory/raw_storage_iterator
* 20_util/memory/raw_storage_iterator/requirements
* 20_util/memory/raw_storage_iterator/requirements/base_classes.cc
* 20_util/memory/raw_storage_iterator/requirements/
explicit_instantiation
* 20_util/memory/raw_storage_iterator/requirements/
explicit_instantiation/1.cc
* 20_util/memory/raw_storage_iterator/requirements/typedefs.cc
* 20_util/memory/temporary_buffer.cc
* 20_util/utility
* 20_util/utility/pair
* 20_util/utility/pair/1.cc
* 20_util/utility/pair/2.cc
* 20_util/utility/pair/3.cc
* 20_util/utility/pair/4.cc
* 20_util/utility/pair/requirements
* 20_util/utility/pair/requirements/explicit_instantiation
* 20_util/utility/pair/requirements/explicit_instantiation/1.cc
* 20_util/utility/rel_ops.cc
* 26_numerics/numeric_arrays/27867.cc
* 26_numerics/numeric_arrays/28277.cc
* 26_numerics/numeric_arrays/30416.cc
* 26_numerics/numeric_arrays/binary_closure.cc
* 26_numerics/numeric_arrays/dr543.cc
* 26_numerics/numeric_arrays/slice_array_assignment.cc
* 26_numerics/numeric_arrays/valarray.cc
* 26_numerics/numeric_arrays/valarray_const_bracket.cc
* 26_numerics/numeric_arrays/valarray_name_lookup.cc
* 26_numerics/numeric_arrays/valarray_operators.cc
* 26_numerics/numeric_arrays/valarray_subset_assignment.cc
* tr1/2_general_utilities/memory
* tr1/2_general_utilities/memory/enable_shared_from_this
* tr1/2_general_utilities/memory/enable_shared_from_this/1.cc
* tr1/2_general_utilities/memory/enable_shared_from_this/not_shared2.cc
* tr1/2_general_utilities/memory/enable_shared_from_this/not_shared3.cc
* tr1/2_general_utilities/memory/enable_shared_from_this/not_shared.cc
* tr1/2_general_utilities/memory/enable_shared_from_this/requirements
* tr1/2_general_utilities/memory/enable_shared_from_this/
requirements/explicit_instantiation
* tr1/2_general_utilities/memory/enable_shared_from_this/
requirements/explicit_instantiation/1.cc
* tr1/2_general_utilities/memory/enable_shared_from_this/shared.cc
* tr1/2_general_utilities/memory/enable_shared_from_this/
still_shared.cc
* tr1/2_general_utilities/memory/shared_ptr
* tr1/2_general_utilities/memory/shared_ptr/assign
* tr1/2_general_utilities/memory/shared_ptr/assign/assign.cc
* tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr.cc
* tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_neg.cc
* tr1/2_general_utilities/memory/shared_ptr/assign/
auto_ptr_rvalue_neg.cc
* tr1/2_general_utilities/memory/shared_ptr/assign/dr541.cc
* tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr.cc
* tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr_neg.cc
* tr1/2_general_utilities/memory/shared_ptr/casts
* tr1/2_general_utilities/memory/shared_ptr/casts/1.cc
* tr1/2_general_utilities/memory/shared_ptr/comparison
* tr1/2_general_utilities/memory/shared_ptr/comparison/cmp.cc
* tr1/2_general_utilities/memory/shared_ptr/cons
* tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr.cc
* tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr_neg.cc
* tr1/2_general_utilities/memory/shared_ptr/cons/copy.cc
* tr1/2_general_utilities/memory/shared_ptr/cons/default.cc
* tr1/2_general_utilities/memory/shared_ptr/cons/pointer.cc
* tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr.cc
* tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr_expired.cc
* tr1/2_general_utilities/memory/shared_ptr/dest
* tr1/2_general_utilities/memory/shared_ptr/dest/dest.cc
* tr1/2_general_utilities/memory/shared_ptr/misc
* tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc
* tr1/2_general_utilities/memory/shared_ptr/misc/io.cc
* tr1/2_general_utilities/memory/shared_ptr/misc/swap.cc
* tr1/2_general_utilities/memory/shared_ptr/modifiers
* tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc
* tr1/2_general_utilities/memory/shared_ptr/modifiers/reset.cc
* tr1/2_general_utilities/memory/shared_ptr/modifiers/reset_neg.cc
* tr1/2_general_utilities/memory/shared_ptr/modifiers/swap.cc
* tr1/2_general_utilities/memory/shared_ptr/modifiers/swap_neg.cc
* tr1/2_general_utilities/memory/shared_ptr/observers
* tr1/2_general_utilities/memory/shared_ptr/observers/bool_conv.cc
* tr1/2_general_utilities/memory/shared_ptr/observers/get.cc
* tr1/2_general_utilities/memory/shared_ptr/observers/unique.cc
* tr1/2_general_utilities/memory/shared_ptr/observers/use_count.cc
* tr1/2_general_utilities/memory/shared_ptr/requirements
* tr1/2_general_utilities/memory/shared_ptr/requirements/
explicit_instantiation
* tr1/2_general_utilities/memory/shared_ptr/requirements/
explicit_instantiation/1.cc
* tr1/2_general_utilities/memory/shared_ptr/thread
* tr1/2_general_utilities/memory/shared_ptr/thread/
default_weaktoshared.cc
* tr1/2_general_utilities/memory/shared_ptr/thread/
mutex_weaktoshared.cc
* tr1/2_general_utilities/memory/weak_ptr
* tr1/2_general_utilities/memory/weak_ptr/lock
* tr1/2_general_utilities/memory/weak_ptr/lock/1.cc
* tr1/2_general_utilities/memory/weak_ptr/requirements
* tr1/2_general_utilities/memory/weak_ptr/requirements/
explicit_instantiation
* tr1/2_general_utilities/memory/weak_ptr/requirements/
explicit_instantiation/1.cc

From-SVN: r122171

167 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/allocator/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/allocator/10378.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/allocator/14176.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/allocator/8230.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/allocator/requirements/explicit_instantiation/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/5.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/6.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/7.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/function_objects/comparisons.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/functional/binders/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/functional/binders/3113.cc [deleted file]
libstdc++-v3/testsuite/20_util/functional/comparisons.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/16505.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/allocator/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/allocator/10378.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/allocator/14176.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/allocator/8230.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/allocator/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/2.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/3.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/3946.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/4.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/5.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/6.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/7.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/auto_ptr/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/base_classes.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/20_util/memory/temporary_buffer.cc [deleted file]
libstdc++-v3/testsuite/20_util/pair/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/pair/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/pair/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/pair/4.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/pair/requirements/explicit_instantiation/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/rel_ops.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/specialized_algorithms/16505.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/temporary_buffer.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/utility/pair/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/utility/pair/2.cc [deleted file]
libstdc++-v3/testsuite/20_util/utility/pair/3.cc [deleted file]
libstdc++-v3/testsuite/20_util/utility/pair/4.cc [deleted file]
libstdc++-v3/testsuite/20_util/utility/pair/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/20_util/utility/rel_ops.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/27867.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/28277.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/30416.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/binary_closure.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/dr543.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/array_assignment.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array_assignment.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/27867.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/28277.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/30416.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/algo.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/binary_closure.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/const_bracket.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/dr543.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/name_lookup.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/operators.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/subset_assignment.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_const_bracket.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_name_lookup.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_operators.cc [deleted file]
libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_subset_assignment.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/shared.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/still_shared.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/1.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared2.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared3.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/shared.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/still_shared.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/assign.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_neg.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_rvalue_neg.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/dr541.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr_neg.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/casts/1.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/comparison/cmp.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr_neg.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/copy.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/default.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/pointer.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr_expired.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/dest/dest.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/io.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/swap.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset_neg.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap_neg.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/bool_conv.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/get.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/unique.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/use_count.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/thread/default_weaktoshared.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/thread/mutex_weaktoshared.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/lock/1.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/requirements/explicit_instantiation/1.cc [deleted file]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/assign.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/dr541.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/casts/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/comparison/cmp.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/default.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/pointer.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/dest/dest.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/24595.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/io.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/swap.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/24805.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/get.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/unique.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/use_count.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/lock/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc [new file with mode: 0644]

index 937d3150cb5bc7cea538c0b971cef8b5777f0dc1..712ad78f04b5eccd409b811df3ba9966ad31d233 100644 (file)
@@ -1,7 +1,182 @@
+2007-02-20  Benjamin Kosnik  <bkoz@redhat.com>
+
+       Directory layout flattening.
+
+       Added in testsuite:
+       * 20_util/allocator
+       * 20_util/auto_ptr
+       * 20_util/function_objects
+       * 20_util/function_objects/binders
+       * 20_util/function_objects/binders/1.cc
+       * 20_util/function_objects/binders/3113.cc
+       * 20_util/function_objects/comparisons.cc
+       * 20_util/pair
+       * 20_util/raw_storage_iterator
+       * 20_util/rel_ops.cc
+       * 20_util/specialized_algorithms
+       * 20_util/specialized_algorithms/16505.cc
+       * 20_util/temporary_buffer.cc
+       * 26_numerics/numeric_arrays/slice_array
+       * 26_numerics/numeric_arrays/slice_array/array_assignment.cc
+       * 26_numerics/numeric_arrays/slice_array/requirements
+       * 26_numerics/numeric_arrays/slice_array/requirements/
+       explicit_instantiation.cc
+       * 26_numerics/numeric_arrays/slice_array/requirements/typedefs.cc
+       * 26_numerics/numeric_arrays/valarray
+       * 26_numerics/numeric_arrays/valarray/27867.cc
+       * 26_numerics/numeric_arrays/valarray/28277.cc
+       * 26_numerics/numeric_arrays/valarray/30416.cc
+       * 26_numerics/numeric_arrays/valarray/algo.cc
+       * 26_numerics/numeric_arrays/valarray/binary_closure.cc
+       * 26_numerics/numeric_arrays/valarray/const_bracket.cc
+       * 26_numerics/numeric_arrays/valarray/dr543.cc
+       * 26_numerics/numeric_arrays/valarray/name_lookup.cc
+       * 26_numerics/numeric_arrays/valarray/operators.cc
+       * 26_numerics/numeric_arrays/valarray/requirements
+       * 26_numerics/numeric_arrays/valarray/requirements/
+       explicit_instantiation.cc
+       * 26_numerics/numeric_arrays/valarray/requirements/typedefs.cc
+       * 26_numerics/numeric_arrays/valarray/subset_assignment.cc
+       * tr1/2_general_utilities/enable_shared_from_this
+       * tr1/2_general_utilities/shared_ptr
+       * tr1/2_general_utilities/weak_ptr
+       
+       Deleted in testsuite:
+       * 20_util/functional
+       * 20_util/functional/binders
+       * 20_util/functional/binders/1.cc
+       * 20_util/functional/binders/3113.cc
+       * 20_util/functional/comparisons.cc
+       * 20_util/memory
+       * 20_util/memory/16505.cc
+       * 20_util/memory/allocator
+       * 20_util/memory/allocator/10378.cc
+       * 20_util/memory/allocator/14176.cc
+       * 20_util/memory/allocator/1.cc
+       * 20_util/memory/allocator/8230.cc
+       * 20_util/memory/allocator/requirements
+       * 20_util/memory/allocator/requirements/explicit_instantiation
+       * 20_util/memory/allocator/requirements/explicit_instantiation/1.cc
+       * 20_util/memory/auto_ptr
+       * 20_util/memory/auto_ptr/1.cc
+       * 20_util/memory/auto_ptr/2.cc
+       * 20_util/memory/auto_ptr/3946.cc
+       * 20_util/memory/auto_ptr/3.cc
+       * 20_util/memory/auto_ptr/4.cc
+       * 20_util/memory/auto_ptr/5.cc
+       * 20_util/memory/auto_ptr/6.cc
+       * 20_util/memory/auto_ptr/7.cc
+       * 20_util/memory/auto_ptr/assign_neg.cc
+       * 20_util/memory/auto_ptr/requirements
+       * 20_util/memory/auto_ptr/requirements/explicit_instantiation
+       * 20_util/memory/auto_ptr/requirements/explicit_instantiation/1.cc
+       * 20_util/memory/raw_storage_iterator
+       * 20_util/memory/raw_storage_iterator/requirements
+       * 20_util/memory/raw_storage_iterator/requirements/base_classes.cc
+       * 20_util/memory/raw_storage_iterator/requirements/
+       explicit_instantiation
+       * 20_util/memory/raw_storage_iterator/requirements/
+       explicit_instantiation/1.cc
+       * 20_util/memory/raw_storage_iterator/requirements/typedefs.cc
+       * 20_util/memory/temporary_buffer.cc
+       * 20_util/utility
+       * 20_util/utility/pair
+       * 20_util/utility/pair/1.cc
+       * 20_util/utility/pair/2.cc
+       * 20_util/utility/pair/3.cc
+       * 20_util/utility/pair/4.cc
+       * 20_util/utility/pair/requirements
+       * 20_util/utility/pair/requirements/explicit_instantiation
+       * 20_util/utility/pair/requirements/explicit_instantiation/1.cc
+       * 20_util/utility/rel_ops.cc
+       * 26_numerics/numeric_arrays/27867.cc
+       * 26_numerics/numeric_arrays/28277.cc
+       * 26_numerics/numeric_arrays/30416.cc
+       * 26_numerics/numeric_arrays/binary_closure.cc
+       * 26_numerics/numeric_arrays/dr543.cc
+       * 26_numerics/numeric_arrays/slice_array_assignment.cc
+       * 26_numerics/numeric_arrays/valarray.cc
+       * 26_numerics/numeric_arrays/valarray_const_bracket.cc
+       * 26_numerics/numeric_arrays/valarray_name_lookup.cc
+       * 26_numerics/numeric_arrays/valarray_operators.cc
+       * 26_numerics/numeric_arrays/valarray_subset_assignment.cc
+       * tr1/2_general_utilities/memory
+       * tr1/2_general_utilities/memory/enable_shared_from_this
+       * tr1/2_general_utilities/memory/enable_shared_from_this/1.cc
+       * tr1/2_general_utilities/memory/enable_shared_from_this/not_shared2.cc
+       * tr1/2_general_utilities/memory/enable_shared_from_this/not_shared3.cc
+       * tr1/2_general_utilities/memory/enable_shared_from_this/not_shared.cc
+       * tr1/2_general_utilities/memory/enable_shared_from_this/requirements
+       * tr1/2_general_utilities/memory/enable_shared_from_this/
+       requirements/explicit_instantiation
+       * tr1/2_general_utilities/memory/enable_shared_from_this/
+       requirements/explicit_instantiation/1.cc
+       * tr1/2_general_utilities/memory/enable_shared_from_this/shared.cc
+       * tr1/2_general_utilities/memory/enable_shared_from_this/
+       still_shared.cc
+       * tr1/2_general_utilities/memory/shared_ptr
+       * tr1/2_general_utilities/memory/shared_ptr/assign
+       * tr1/2_general_utilities/memory/shared_ptr/assign/assign.cc
+       * tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr.cc
+       * tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_neg.cc
+       * tr1/2_general_utilities/memory/shared_ptr/assign/
+       auto_ptr_rvalue_neg.cc
+       * tr1/2_general_utilities/memory/shared_ptr/assign/dr541.cc
+       * tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr.cc
+       * tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr_neg.cc
+       * tr1/2_general_utilities/memory/shared_ptr/casts
+       * tr1/2_general_utilities/memory/shared_ptr/casts/1.cc
+       * tr1/2_general_utilities/memory/shared_ptr/comparison
+       * tr1/2_general_utilities/memory/shared_ptr/comparison/cmp.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons
+       * tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr_neg.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons/copy.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons/default.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons/pointer.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr.cc
+       * tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr_expired.cc
+       * tr1/2_general_utilities/memory/shared_ptr/dest
+       * tr1/2_general_utilities/memory/shared_ptr/dest/dest.cc
+       * tr1/2_general_utilities/memory/shared_ptr/misc
+       * tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc
+       * tr1/2_general_utilities/memory/shared_ptr/misc/io.cc
+       * tr1/2_general_utilities/memory/shared_ptr/misc/swap.cc
+       * tr1/2_general_utilities/memory/shared_ptr/modifiers
+       * tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc
+       * tr1/2_general_utilities/memory/shared_ptr/modifiers/reset.cc
+       * tr1/2_general_utilities/memory/shared_ptr/modifiers/reset_neg.cc
+       * tr1/2_general_utilities/memory/shared_ptr/modifiers/swap.cc
+       * tr1/2_general_utilities/memory/shared_ptr/modifiers/swap_neg.cc
+       * tr1/2_general_utilities/memory/shared_ptr/observers
+       * tr1/2_general_utilities/memory/shared_ptr/observers/bool_conv.cc
+       * tr1/2_general_utilities/memory/shared_ptr/observers/get.cc
+       * tr1/2_general_utilities/memory/shared_ptr/observers/unique.cc
+       * tr1/2_general_utilities/memory/shared_ptr/observers/use_count.cc
+       * tr1/2_general_utilities/memory/shared_ptr/requirements
+       * tr1/2_general_utilities/memory/shared_ptr/requirements/
+       explicit_instantiation
+       * tr1/2_general_utilities/memory/shared_ptr/requirements/
+       explicit_instantiation/1.cc
+       * tr1/2_general_utilities/memory/shared_ptr/thread
+       * tr1/2_general_utilities/memory/shared_ptr/thread/
+       default_weaktoshared.cc
+       * tr1/2_general_utilities/memory/shared_ptr/thread/
+       mutex_weaktoshared.cc
+       * tr1/2_general_utilities/memory/weak_ptr
+       * tr1/2_general_utilities/memory/weak_ptr/lock
+       * tr1/2_general_utilities/memory/weak_ptr/lock/1.cc
+       * tr1/2_general_utilities/memory/weak_ptr/requirements
+       * tr1/2_general_utilities/memory/weak_ptr/requirements/
+       explicit_instantiation
+       * tr1/2_general_utilities/memory/weak_ptr/requirements/
+       explicit_instantiation/1.cc
+
 2007-02-20  Benjamin Kosnik  <bkoz@redhat.com>
 
        Revamp library API testing.
-       Added:
+       
+       Added in testsuite:
        * 17_intro/headers
        * 17_intro/headers/all_assert_neg.cc
        * 17_intro/headers/all_c++200x_compatibility.cc
        * tr1/6_containers/unordered_set/swap/2.cc
        * tr1/using_namespace_std_tr1.cc
 
-       Deleted:
+       Deleted in testsuite:
        * 17_intro/header_cassert.cc
        * 17_intro/header_cerrno.cc
        * 17_intro/header_csetjmp.cc
        * tr1/6_containers/unordered/types/multiset_iterator.cc
        * tr1/6_containers/unordered/types/set_iterator.cc
 
-       * 24_iterators/reverse_iterator/2.cc: To just one
+       * testsuite/24_iterators/reverse_iterator/2.cc: To just one
        non-requirements test.
-       * ext/headers.cc: Add new includes.
+       * testsuite/ext/headers.cc: Add new includes.
        
 2007-02-18  Paolo Carlini  <pcarlini@suse.de>
 
diff --git a/libstdc++-v3/testsuite/20_util/allocator/1.cc b/libstdc++-v3/testsuite/20_util/allocator/1.cc
new file mode 100644 (file)
index 0000000..3d62199
--- /dev/null
@@ -0,0 +1,66 @@
+// 2001-06-14  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.1.1 allocator members
+
+#include <memory>
+#include <stdexcept>
+#include <cstdlib>
+#include <testsuite_hooks.h>
+
+struct gnu { };
+
+bool check_new = false;
+bool check_delete = false;
+
+void* 
+operator new(std::size_t n) throw(std::bad_alloc)
+{
+  check_new = true;
+  return std::malloc(n);
+}
+
+void operator delete(void *v) throw()
+{
+  check_delete = true;
+  return std::free(v);
+}
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  std::allocator<gnu> obj;
+
+  // NB: These should work for various size allocation and
+  // deallocations.  Currently, they only work as expected for sizes >
+  // _MAX_BYTES as defined in stl_alloc.h, which happes to be 128. 
+  gnu* pobj = obj.allocate(256);
+  VERIFY( check_new );
+
+  obj.deallocate(pobj, 256);
+  VERIFY( check_delete );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/20_util/allocator/10378.cc b/libstdc++-v3/testsuite/20_util/allocator/10378.cc
new file mode 100644 (file)
index 0000000..268ccb2
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.1.5 allocator requirements / 20.4.1.1 allocator members
+
+#include <list>
+#include <cstdlib>
+#include <testsuite_hooks.h>
+
+class Bob
+{
+public:
+  static void* operator new(size_t sz)
+  { return std::malloc(sz); }
+};
+
+// libstdc++/10378
+void test01()
+{
+  using namespace std;
+  bool test __attribute__((unused)) = true;
+
+  list<Bob> uniset;
+  uniset.push_back(Bob());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/allocator/14176.cc b/libstdc++-v3/testsuite/20_util/allocator/14176.cc
new file mode 100644 (file)
index 0000000..340b7b2
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.1.1 allocator members
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+// libstdc++/14176
+void test02()
+{
+  unsigned int len = 0;  
+  std::allocator<int> a;
+  int* p = a.allocate(len);
+  a.deallocate(p, len);
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/allocator/8230.cc b/libstdc++-v3/testsuite/20_util/allocator/8230.cc
new file mode 100644 (file)
index 0000000..444443f
--- /dev/null
@@ -0,0 +1,54 @@
+// 2001-06-14  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.1.1 allocator members
+
+#include <memory>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+// libstdc++/8230
+void test02()
+{
+  bool test __attribute__((unused)) = true;
+  try 
+    {
+      std::allocator<int> alloc;
+      const std::allocator<int>::size_type n = alloc.max_size();
+      int* p = alloc.allocate(n + 1);
+      p[n] = 2002;
+    } 
+  catch(const std::bad_alloc& e) 
+    {
+      // Allowed.
+      test = true;
+    }
+  catch(...) 
+    {
+      test = false;
+    }
+  VERIFY( test );
+}
+
+int main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/allocator/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/allocator/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..ed88aef
--- /dev/null
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers.
+
+#include <memory>
+
+template class std::allocator<int>;
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc
new file mode 100644 (file)
index 0000000..f126008
--- /dev/null
@@ -0,0 +1,95 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+
+// 20.4.5.1 auto_ptr constructors [lib.auto.ptr.cons]
+
+// Construction from pointer
+int
+test01()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::auto_ptr<A> A_default;
+  VERIFY( A_default.get() == 0 );
+  VERIFY( A::ctor_count == 0 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+
+  std::auto_ptr<A> A_from_A(new A);
+  VERIFY( A_from_A.get() != 0 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+
+  std::auto_ptr<A> A_from_B(new B);
+  VERIFY( A_from_B.get() != 0 );
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc
new file mode 100644 (file)
index 0000000..7c51d80
--- /dev/null
@@ -0,0 +1,85 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+// Construction from std::auto_ptr
+int
+test02()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::auto_ptr<A> A_from_A(new A);
+  std::auto_ptr<B> B_from_B(new B);
+
+  std::auto_ptr<A> A_from_ptr_A(A_from_A);
+  std::auto_ptr<A> A_from_ptr_B(B_from_B);
+  VERIFY( A_from_A.get() == 0 );
+  VERIFY( B_from_B.get() == 0 );
+  VERIFY( A_from_ptr_A.get() != 0 );
+  VERIFY( A_from_ptr_B.get() != 0 );
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc
new file mode 100644 (file)
index 0000000..89e23b7
--- /dev/null
@@ -0,0 +1,87 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+// Assignment from std::auto_ptr
+int
+test03()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::auto_ptr<A> A_from_ptr_A;
+  std::auto_ptr<A> A_from_ptr_B;
+  std::auto_ptr<A> A_from_A(new A);
+  std::auto_ptr<B> B_from_B(new B);
+
+  A_from_ptr_A = A_from_A;
+  A_from_ptr_B = B_from_B;
+  VERIFY( A_from_A.get() == 0 );
+  VERIFY( B_from_B.get() == 0 );
+  VERIFY( A_from_ptr_A.get() != 0 );
+  VERIFY( A_from_ptr_B.get() != 0 );
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc
new file mode 100644 (file)
index 0000000..fcb9b45
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+// libstdc++/3946
+// http://gcc.gnu.org/ml/libstdc++/2002-07/msg00024.html
+struct Base { };
+struct Derived : public Base { };
+
+std::auto_ptr<Derived> 
+conversiontest08() { return std::auto_ptr<Derived>(new Derived); }
+
+void
+test08()
+{
+  std::auto_ptr<Base> ptr;
+  ptr = conversiontest08();
+}
+
+
+int 
+main()
+{
+  test08();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc
new file mode 100644 (file)
index 0000000..3f8bcd9
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+
+// Destruction
+int
+test04()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  {/*lifetine scope*/
+    std::auto_ptr<A> A_from_A(new A);
+    std::auto_ptr<A> A_from_B(new B);
+    std::auto_ptr<B> B_from_B(new B);
+  }/*destructors called here*/
+
+  VERIFY( A::ctor_count == 3 );
+  VERIFY( A::dtor_count == 3 );
+  VERIFY( B::ctor_count == 2 );
+  VERIFY( B::dtor_count == 2 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc
new file mode 100644 (file)
index 0000000..bb27a21
--- /dev/null
@@ -0,0 +1,87 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+
+// Class member construction/destruction
+template <typename T>
+class pimpl
+{
+public:
+  pimpl() : p_impl(new T) {}
+private:
+  std::auto_ptr<T> p_impl;
+};
+
+int 
+test05()
+{
+  bool test __attribute__((unused)) = true;
+  reset_count_struct __attribute__((unused)) reset;
+
+  pimpl<A>();
+  pimpl<B>();
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 2 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 1 );
+  return 0;
+}
+
+int 
+main()
+{
+  test05();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc
new file mode 100644 (file)
index 0000000..c4c995e
--- /dev/null
@@ -0,0 +1,91 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+// 20.4.5.2 auto_ptr members [lib.auto.ptr.members]
+
+// Member access
+int
+test06()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::auto_ptr<A> A_from_A(new A);
+  std::auto_ptr<A> A_from_A_ptr(A_from_A.release());
+  VERIFY( A_from_A.get() == 0 );
+  VERIFY( A_from_A_ptr.get() != 0 );
+  VERIFY( A_from_A_ptr->ctor_count == 1 );
+  VERIFY( (*A_from_A_ptr).dtor_count == 0 );
+
+  A* A_ptr = A_from_A_ptr.get();
+
+  A_from_A_ptr.reset(A_ptr);
+  VERIFY( A_from_A_ptr.get() == A_ptr );
+  VERIFY( A_from_A_ptr->ctor_count == 1 );
+  VERIFY( (*A_from_A_ptr).dtor_count == 0 );
+
+  A_from_A_ptr.reset(new A);
+  VERIFY( A_from_A_ptr.get() != A_ptr );
+  VERIFY( A_from_A_ptr->ctor_count == 2 );
+  VERIFY( (*A_from_A_ptr).dtor_count == 1 );
+  return 0;
+}
+
+int 
+main()
+{
+  test06();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc
new file mode 100644 (file)
index 0000000..8e22804
--- /dev/null
@@ -0,0 +1,91 @@
+// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+// 20.4.5.3 auto_ptr conversions [lib.auto.ptr.conv]
+
+// Parameters and return values
+template <typename T>
+static std::auto_ptr<T> source()
+{
+  return std::auto_ptr<T>(new T);
+}
+
+template <typename T>
+static void drain(std::auto_ptr<T>)
+{}
+
+int
+test07()
+{
+  bool test __attribute__((unused)) = true;
+  reset_count_struct __attribute__((unused)) reset;
+
+  drain(source<A>());
+  // The resolution of core issue 84, now a DR, breaks this call.
+  // drain<A>(source<B>());
+  drain(source<B>());
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 2 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 1 );
+  return 0;
+}
+
+int 
+main()
+{
+  test07();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
new file mode 100644 (file)
index 0000000..4ae7acf
--- /dev/null
@@ -0,0 +1,50 @@
+// { dg-do compile }
+
+// Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+//
+// 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.
+
+// 20.4.5 Template class auto_ptr negative tests [lib.auto.ptr]
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+// via Jack Reeves <jack_reeves@hispeed.ch>
+// libstdc++/3946
+// http://gcc.gnu.org/ml/libstdc++/2002-07/msg00024.html
+struct Base { };
+struct Derived : public Base { };
+
+std::auto_ptr<Derived> 
+foo() { return std::auto_ptr<Derived>(new Derived); }
+
+int
+test01()
+{
+  std::auto_ptr<Base> ptr2;
+  ptr2 = new Base; // { dg-error "no match" }
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
+// { dg-error "candidates" "" { target *-*-* } 224 } 
+// { dg-error "::auto_ptr" "" { target *-*-* } 354 } 
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..e6abacd
--- /dev/null
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers.
+
+#include <memory>
+
+template class std::auto_ptr<int>;
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc b/libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc
new file mode 100644 (file)
index 0000000..2d374e6
--- /dev/null
@@ -0,0 +1,104 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.3.6 Binders
+
+// { dg-do compile }
+
+#include <functional>
+using namespace std;
+
+struct s
+{
+  void f_void_int_const(int) const {}
+  void f_void_int(int) {}
+  int f_int_int_const(int) const { return 1; }
+  int f_int_int(int) {return 1; }
+  void f_void_void_const() const {}
+  void f_void_void() {}
+  int f_int_void_const() const { return 1; }
+  int f_int_void() { return 1; }
+};
+
+void test01(s& a)
+{ 
+  mem_fun_t<void, s> p1(&s::f_void_void);
+  mem_fun_t<int, s> p2(&s::f_int_void);
+  p1(&a);
+  p2(&a);
+  mem_fun1_t<void, s, int> q1(&s::f_void_int);
+  mem_fun1_t<int, s, int> q2(&s::f_int_int);
+  q1(&a,0);
+  q2(&a,0);
+
+  (mem_fun(&s::f_void_void))(&a);
+  (mem_fun(&s::f_void_int))(&a,0);
+  (mem_fun(&s::f_int_void))(&a);
+  (mem_fun(&s::f_int_int))(&a,0);
+
+  mem_fun_ref_t<void, s> ref1(&s::f_void_void);
+  mem_fun_ref_t<int, s> ref2(&s::f_int_void);
+
+  ref1(a);
+  ref2(a);
+
+  mem_fun1_ref_t<void, s, int> ref3(&s::f_void_int);
+  mem_fun1_ref_t<int, s, int> ref4(&s::f_int_int); 
+
+  ref3(a,0);
+  ref4(a,0);
+
+  (mem_fun_ref(&s::f_void_void))(a);
+  (mem_fun_ref(&s::f_void_int))(a, 0);
+  (mem_fun_ref(&s::f_int_void))(a);
+  (mem_fun_ref(&s::f_int_int))(a, 0);
+}
+
+void test02(const s& a)
+{
+  const_mem_fun_t<void, s> p1(&s::f_void_void_const);
+  const_mem_fun_t<int, s> p2(&s::f_int_void_const);
+  p1(&a);
+  p2(&a);
+  const_mem_fun1_t<void, s, int> q1(&s::f_void_int_const);
+  const_mem_fun1_t<int, s, int> q2(&s::f_int_int_const);
+  q1(&a,0);
+  q2(&a,0);
+
+  (mem_fun(&s::f_void_void_const))(&a);
+  (mem_fun(&s::f_void_int_const))(&a, 0);
+  (mem_fun(&s::f_int_void_const))(&a);
+  (mem_fun(&s::f_int_int_const))(&a, 0);
+
+  const_mem_fun_ref_t<void, s> ref1(&s::f_void_void_const);
+  const_mem_fun_ref_t<int, s> ref2(&s::f_int_void_const);
+
+  ref1(a);
+  ref2(a);
+
+  const_mem_fun1_ref_t<void, s, int> ref3(&s::f_void_int_const);
+  const_mem_fun1_ref_t<int, s, int> ref4(&s::f_int_int_const); 
+
+  ref3(a,0);
+  ref4(a,0);
+
+  (mem_fun_ref(&s::f_void_void_const))(a);
+  (mem_fun_ref(&s::f_void_int_const))(a, 0);
+  (mem_fun_ref(&s::f_int_void_const))(a);
+  (mem_fun_ref(&s::f_int_int_const))(a, 0);
+}
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc b/libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc
new file mode 100644 (file)
index 0000000..2106316
--- /dev/null
@@ -0,0 +1,50 @@
+// 2001-06-11  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.3.6 Binders
+
+#include <vector>
+#include <algorithm> // for_each
+#include <functional>
+
+class Elem 
+{ 
+public: 
+  void print(int) const { } 
+  void modify(int) { } 
+}; 
+
+// libstdc++/3113
+void test01()
+{ 
+  std::vector<Elem> coll(2); 
+  // OK 
+  std::for_each(coll.begin(), coll.end(), 
+          std::bind2nd(std::mem_fun_ref(&Elem::print), 42));
+  // OK
+  std::for_each(coll.begin(), coll.end(), 
+          std::bind2nd(std::mem_fun_ref(&Elem::modify), 42));
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/comparisons.cc b/libstdc++-v3/testsuite/20_util/function_objects/comparisons.cc
new file mode 100644 (file)
index 0000000..9ed12fe
--- /dev/null
@@ -0,0 +1,53 @@
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.3.3 Comparisons
+
+#include <functional>
+
+class gnu_obj
+{
+  int i;
+public:
+  gnu_obj(int arg = 0): i(arg) { }
+  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
+  bool operator!=(const gnu_obj& rhs) const { return i != rhs.i; }
+  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
+};
+
+template<typename T>
+  struct gnu_t
+  {
+    bool b;
+  public:
+    gnu_t(bool arg = 0): b(arg) { }
+    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
+    bool operator!=(const gnu_t& rhs) const { return b != rhs.b; }
+    bool operator<(const gnu_t& rhs) const { return b == rhs.b; }
+  };
+
+template struct std::not_equal_to<void*>;
+template struct std::not_equal_to<gnu_obj>;
+template struct std::not_equal_to<gnu_t<long> >;
+
+int main() 
+{ 
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/functional/binders/1.cc b/libstdc++-v3/testsuite/20_util/functional/binders/1.cc
deleted file mode 100644 (file)
index 2d374e6..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.3.6 Binders
-
-// { dg-do compile }
-
-#include <functional>
-using namespace std;
-
-struct s
-{
-  void f_void_int_const(int) const {}
-  void f_void_int(int) {}
-  int f_int_int_const(int) const { return 1; }
-  int f_int_int(int) {return 1; }
-  void f_void_void_const() const {}
-  void f_void_void() {}
-  int f_int_void_const() const { return 1; }
-  int f_int_void() { return 1; }
-};
-
-void test01(s& a)
-{ 
-  mem_fun_t<void, s> p1(&s::f_void_void);
-  mem_fun_t<int, s> p2(&s::f_int_void);
-  p1(&a);
-  p2(&a);
-  mem_fun1_t<void, s, int> q1(&s::f_void_int);
-  mem_fun1_t<int, s, int> q2(&s::f_int_int);
-  q1(&a,0);
-  q2(&a,0);
-
-  (mem_fun(&s::f_void_void))(&a);
-  (mem_fun(&s::f_void_int))(&a,0);
-  (mem_fun(&s::f_int_void))(&a);
-  (mem_fun(&s::f_int_int))(&a,0);
-
-  mem_fun_ref_t<void, s> ref1(&s::f_void_void);
-  mem_fun_ref_t<int, s> ref2(&s::f_int_void);
-
-  ref1(a);
-  ref2(a);
-
-  mem_fun1_ref_t<void, s, int> ref3(&s::f_void_int);
-  mem_fun1_ref_t<int, s, int> ref4(&s::f_int_int); 
-
-  ref3(a,0);
-  ref4(a,0);
-
-  (mem_fun_ref(&s::f_void_void))(a);
-  (mem_fun_ref(&s::f_void_int))(a, 0);
-  (mem_fun_ref(&s::f_int_void))(a);
-  (mem_fun_ref(&s::f_int_int))(a, 0);
-}
-
-void test02(const s& a)
-{
-  const_mem_fun_t<void, s> p1(&s::f_void_void_const);
-  const_mem_fun_t<int, s> p2(&s::f_int_void_const);
-  p1(&a);
-  p2(&a);
-  const_mem_fun1_t<void, s, int> q1(&s::f_void_int_const);
-  const_mem_fun1_t<int, s, int> q2(&s::f_int_int_const);
-  q1(&a,0);
-  q2(&a,0);
-
-  (mem_fun(&s::f_void_void_const))(&a);
-  (mem_fun(&s::f_void_int_const))(&a, 0);
-  (mem_fun(&s::f_int_void_const))(&a);
-  (mem_fun(&s::f_int_int_const))(&a, 0);
-
-  const_mem_fun_ref_t<void, s> ref1(&s::f_void_void_const);
-  const_mem_fun_ref_t<int, s> ref2(&s::f_int_void_const);
-
-  ref1(a);
-  ref2(a);
-
-  const_mem_fun1_ref_t<void, s, int> ref3(&s::f_void_int_const);
-  const_mem_fun1_ref_t<int, s, int> ref4(&s::f_int_int_const); 
-
-  ref3(a,0);
-  ref4(a,0);
-
-  (mem_fun_ref(&s::f_void_void_const))(a);
-  (mem_fun_ref(&s::f_void_int_const))(a, 0);
-  (mem_fun_ref(&s::f_int_void_const))(a);
-  (mem_fun_ref(&s::f_int_int_const))(a, 0);
-}
diff --git a/libstdc++-v3/testsuite/20_util/functional/binders/3113.cc b/libstdc++-v3/testsuite/20_util/functional/binders/3113.cc
deleted file mode 100644 (file)
index 2106316..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// 2001-06-11  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.3.6 Binders
-
-#include <vector>
-#include <algorithm> // for_each
-#include <functional>
-
-class Elem 
-{ 
-public: 
-  void print(int) const { } 
-  void modify(int) { } 
-}; 
-
-// libstdc++/3113
-void test01()
-{ 
-  std::vector<Elem> coll(2); 
-  // OK 
-  std::for_each(coll.begin(), coll.end(), 
-          std::bind2nd(std::mem_fun_ref(&Elem::print), 42));
-  // OK
-  std::for_each(coll.begin(), coll.end(), 
-          std::bind2nd(std::mem_fun_ref(&Elem::modify), 42));
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/functional/comparisons.cc b/libstdc++-v3/testsuite/20_util/functional/comparisons.cc
deleted file mode 100644 (file)
index 9ed12fe..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.3.3 Comparisons
-
-#include <functional>
-
-class gnu_obj
-{
-  int i;
-public:
-  gnu_obj(int arg = 0): i(arg) { }
-  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
-  bool operator!=(const gnu_obj& rhs) const { return i != rhs.i; }
-  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
-};
-
-template<typename T>
-  struct gnu_t
-  {
-    bool b;
-  public:
-    gnu_t(bool arg = 0): b(arg) { }
-    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
-    bool operator!=(const gnu_t& rhs) const { return b != rhs.b; }
-    bool operator<(const gnu_t& rhs) const { return b == rhs.b; }
-  };
-
-template struct std::not_equal_to<void*>;
-template struct std::not_equal_to<gnu_obj>;
-template struct std::not_equal_to<gnu_t<long> >;
-
-int main() 
-{ 
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/16505.cc b/libstdc++-v3/testsuite/20_util/memory/16505.cc
deleted file mode 100644 (file)
index b20c049..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.4 specialized algorithms
-
-// { dg-do compile }
-
-#include <memory>
-
-// libstdc++/16505
-
-struct S { };
-
-template
-  void
-  std::uninitialized_fill_n<S*, int, S>(S*, int, const S&);
diff --git a/libstdc++-v3/testsuite/20_util/memory/allocator/1.cc b/libstdc++-v3/testsuite/20_util/memory/allocator/1.cc
deleted file mode 100644 (file)
index 3d62199..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// 2001-06-14  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.1.1 allocator members
-
-#include <memory>
-#include <stdexcept>
-#include <cstdlib>
-#include <testsuite_hooks.h>
-
-struct gnu { };
-
-bool check_new = false;
-bool check_delete = false;
-
-void* 
-operator new(std::size_t n) throw(std::bad_alloc)
-{
-  check_new = true;
-  return std::malloc(n);
-}
-
-void operator delete(void *v) throw()
-{
-  check_delete = true;
-  return std::free(v);
-}
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  std::allocator<gnu> obj;
-
-  // NB: These should work for various size allocation and
-  // deallocations.  Currently, they only work as expected for sizes >
-  // _MAX_BYTES as defined in stl_alloc.h, which happes to be 128. 
-  gnu* pobj = obj.allocate(256);
-  VERIFY( check_new );
-
-  obj.deallocate(pobj, 256);
-  VERIFY( check_delete );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/20_util/memory/allocator/10378.cc b/libstdc++-v3/testsuite/20_util/memory/allocator/10378.cc
deleted file mode 100644 (file)
index 268ccb2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.1.5 allocator requirements / 20.4.1.1 allocator members
-
-#include <list>
-#include <cstdlib>
-#include <testsuite_hooks.h>
-
-class Bob
-{
-public:
-  static void* operator new(size_t sz)
-  { return std::malloc(sz); }
-};
-
-// libstdc++/10378
-void test01()
-{
-  using namespace std;
-  bool test __attribute__((unused)) = true;
-
-  list<Bob> uniset;
-  uniset.push_back(Bob());
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/allocator/14176.cc b/libstdc++-v3/testsuite/20_util/memory/allocator/14176.cc
deleted file mode 100644 (file)
index 340b7b2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.1.1 allocator members
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-// libstdc++/14176
-void test02()
-{
-  unsigned int len = 0;  
-  std::allocator<int> a;
-  int* p = a.allocate(len);
-  a.deallocate(p, len);
-}
-
-int main()
-{
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/allocator/8230.cc b/libstdc++-v3/testsuite/20_util/memory/allocator/8230.cc
deleted file mode 100644 (file)
index 444443f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// 2001-06-14  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.1.1 allocator members
-
-#include <memory>
-#include <stdexcept>
-#include <testsuite_hooks.h>
-
-// libstdc++/8230
-void test02()
-{
-  bool test __attribute__((unused)) = true;
-  try 
-    {
-      std::allocator<int> alloc;
-      const std::allocator<int>::size_type n = alloc.max_size();
-      int* p = alloc.allocate(n + 1);
-      p[n] = 2002;
-    } 
-  catch(const std::bad_alloc& e) 
-    {
-      // Allowed.
-      test = true;
-    }
-  catch(...) 
-    {
-      test = false;
-    }
-  VERIFY( test );
-}
-
-int main()
-{
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/allocator/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/memory/allocator/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index ed88aef..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING.  If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02110-1301, USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This file tests explicit instantiation of library containers.
-
-#include <memory>
-
-template class std::allocator<int>;
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/1.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/1.cc
deleted file mode 100644 (file)
index f126008..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-
-// 20.4.5.1 auto_ptr constructors [lib.auto.ptr.cons]
-
-// Construction from pointer
-int
-test01()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::auto_ptr<A> A_default;
-  VERIFY( A_default.get() == 0 );
-  VERIFY( A::ctor_count == 0 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-
-  std::auto_ptr<A> A_from_A(new A);
-  VERIFY( A_from_A.get() != 0 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-
-  std::auto_ptr<A> A_from_B(new B);
-  VERIFY( A_from_B.get() != 0 );
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/2.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/2.cc
deleted file mode 100644 (file)
index 7c51d80..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-// Construction from std::auto_ptr
-int
-test02()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::auto_ptr<A> A_from_A(new A);
-  std::auto_ptr<B> B_from_B(new B);
-
-  std::auto_ptr<A> A_from_ptr_A(A_from_A);
-  std::auto_ptr<A> A_from_ptr_B(B_from_B);
-  VERIFY( A_from_A.get() == 0 );
-  VERIFY( B_from_B.get() == 0 );
-  VERIFY( A_from_ptr_A.get() != 0 );
-  VERIFY( A_from_ptr_B.get() != 0 );
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/3.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/3.cc
deleted file mode 100644 (file)
index 89e23b7..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-// Assignment from std::auto_ptr
-int
-test03()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::auto_ptr<A> A_from_ptr_A;
-  std::auto_ptr<A> A_from_ptr_B;
-  std::auto_ptr<A> A_from_A(new A);
-  std::auto_ptr<B> B_from_B(new B);
-
-  A_from_ptr_A = A_from_A;
-  A_from_ptr_B = B_from_B;
-  VERIFY( A_from_A.get() == 0 );
-  VERIFY( B_from_B.get() == 0 );
-  VERIFY( A_from_ptr_A.get() != 0 );
-  VERIFY( A_from_ptr_B.get() != 0 );
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/3946.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/3946.cc
deleted file mode 100644 (file)
index fcb9b45..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-// libstdc++/3946
-// http://gcc.gnu.org/ml/libstdc++/2002-07/msg00024.html
-struct Base { };
-struct Derived : public Base { };
-
-std::auto_ptr<Derived> 
-conversiontest08() { return std::auto_ptr<Derived>(new Derived); }
-
-void
-test08()
-{
-  std::auto_ptr<Base> ptr;
-  ptr = conversiontest08();
-}
-
-
-int 
-main()
-{
-  test08();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/4.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/4.cc
deleted file mode 100644 (file)
index 3f8bcd9..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-
-// Destruction
-int
-test04()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  {/*lifetine scope*/
-    std::auto_ptr<A> A_from_A(new A);
-    std::auto_ptr<A> A_from_B(new B);
-    std::auto_ptr<B> B_from_B(new B);
-  }/*destructors called here*/
-
-  VERIFY( A::ctor_count == 3 );
-  VERIFY( A::dtor_count == 3 );
-  VERIFY( B::ctor_count == 2 );
-  VERIFY( B::dtor_count == 2 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test04();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/5.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/5.cc
deleted file mode 100644 (file)
index bb27a21..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-
-// Class member construction/destruction
-template <typename T>
-class pimpl
-{
-public:
-  pimpl() : p_impl(new T) {}
-private:
-  std::auto_ptr<T> p_impl;
-};
-
-int 
-test05()
-{
-  bool test __attribute__((unused)) = true;
-  reset_count_struct __attribute__((unused)) reset;
-
-  pimpl<A>();
-  pimpl<B>();
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 2 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 1 );
-  return 0;
-}
-
-int 
-main()
-{
-  test05();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/6.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/6.cc
deleted file mode 100644 (file)
index c4c995e..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-// 20.4.5.2 auto_ptr members [lib.auto.ptr.members]
-
-// Member access
-int
-test06()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::auto_ptr<A> A_from_A(new A);
-  std::auto_ptr<A> A_from_A_ptr(A_from_A.release());
-  VERIFY( A_from_A.get() == 0 );
-  VERIFY( A_from_A_ptr.get() != 0 );
-  VERIFY( A_from_A_ptr->ctor_count == 1 );
-  VERIFY( (*A_from_A_ptr).dtor_count == 0 );
-
-  A* A_ptr = A_from_A_ptr.get();
-
-  A_from_A_ptr.reset(A_ptr);
-  VERIFY( A_from_A_ptr.get() == A_ptr );
-  VERIFY( A_from_A_ptr->ctor_count == 1 );
-  VERIFY( (*A_from_A_ptr).dtor_count == 0 );
-
-  A_from_A_ptr.reset(new A);
-  VERIFY( A_from_A_ptr.get() != A_ptr );
-  VERIFY( A_from_A_ptr->ctor_count == 2 );
-  VERIFY( (*A_from_A_ptr).dtor_count == 1 );
-  return 0;
-}
-
-int 
-main()
-{
-  test06();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/7.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/7.cc
deleted file mode 100644 (file)
index 8e22804..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-// 20.4.5.3 auto_ptr conversions [lib.auto.ptr.conv]
-
-// Parameters and return values
-template <typename T>
-static std::auto_ptr<T> source()
-{
-  return std::auto_ptr<T>(new T);
-}
-
-template <typename T>
-static void drain(std::auto_ptr<T>)
-{}
-
-int
-test07()
-{
-  bool test __attribute__((unused)) = true;
-  reset_count_struct __attribute__((unused)) reset;
-
-  drain(source<A>());
-  // The resolution of core issue 84, now a DR, breaks this call.
-  // drain<A>(source<B>());
-  drain(source<B>());
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 2 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 1 );
-  return 0;
-}
-
-int 
-main()
-{
-  test07();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc
deleted file mode 100644 (file)
index 4ae7acf..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
-//
-// 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.
-
-// 20.4.5 Template class auto_ptr negative tests [lib.auto.ptr]
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-// via Jack Reeves <jack_reeves@hispeed.ch>
-// libstdc++/3946
-// http://gcc.gnu.org/ml/libstdc++/2002-07/msg00024.html
-struct Base { };
-struct Derived : public Base { };
-
-std::auto_ptr<Derived> 
-foo() { return std::auto_ptr<Derived>(new Derived); }
-
-int
-test01()
-{
-  std::auto_ptr<Base> ptr2;
-  ptr2 = new Base; // { dg-error "no match" }
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
-// { dg-error "candidates" "" { target *-*-* } 224 } 
-// { dg-error "::auto_ptr" "" { target *-*-* } 354 } 
diff --git a/libstdc++-v3/testsuite/20_util/memory/auto_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/memory/auto_ptr/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index e6abacd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING.  If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02110-1301, USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This file tests explicit instantiation of library containers.
-
-#include <memory>
-
-template class std::auto_ptr<int>;
diff --git a/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/base_classes.cc
deleted file mode 100644 (file)
index bc2793f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// { dg-do compile }
-
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.2 raw storage iterator
-
-#include <memory>
-
-void test01()
-{
-  using namespace std;
-
-  // Check for required base class.
-  long l;
-  typedef raw_storage_iterator<long*, long> test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
-  test_iterator rs_it(&l);
-  base_iterator* base __attribute__((unused)) = &rs_it;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index 41023b6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING.  If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02110-1301, USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This file tests explicit instantiation of library containers.
-
-#include <memory>
-
-template class std::raw_storage_iterator<int*, int>;
diff --git a/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator/requirements/typedefs.cc
deleted file mode 100644 (file)
index 4a51c4c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// { dg-do compile }
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.2 raw storage iterator
-
-#include <memory>
-
-void test01()
-{
-  using namespace std;
-
-  // Check for required typedefs
-  long l;
-  typedef raw_storage_iterator<long*, long> test_iterator;
-  typedef test_iterator::value_type value_type;
-  typedef test_iterator::difference_type difference_type;
-  typedef test_iterator::pointer pointer;
-  typedef test_iterator::reference reference;
-  typedef test_iterator::iterator_category iteratory_category;
-}
diff --git a/libstdc++-v3/testsuite/20_util/memory/temporary_buffer.cc b/libstdc++-v3/testsuite/20_util/memory/temporary_buffer.cc
deleted file mode 100644 (file)
index aee343a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// 2002-01-24  Phil Edwards  <pme@gcc.gnu.org>
-
-// Copyright (C) 2002 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.4.3 temporary buffers
-
-#include <memory>
-#include <testsuite_hooks.h>
-
-struct junk { char j[12]; };
-
-int main(void)
-{
-  bool test __attribute__((unused)) = true;
-
-  std::pair<junk*,ptrdiff_t>  results = std::get_temporary_buffer<junk>(5);
-
-  if (results.second != 0)
-  {
-      // make sure it works:  test the returned capacity, and then construct
-      // some junk in the buffer.
-      // XXX
-      VERIFY( results.first != 0 );
-  }
-  else
-  {
-      // if it says it didn't work, make sure it didn't work
-      VERIFY( results.first == 0 );
-  }
-
-  std::return_temporary_buffer(results.first);
-
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/pair/1.cc b/libstdc++-v3/testsuite/20_util/pair/1.cc
new file mode 100644 (file)
index 0000000..9b7f555
--- /dev/null
@@ -0,0 +1,79 @@
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.2.2 Pairs
+
+#include <utility>
+#include <testsuite_hooks.h>
+
+class gnu_obj
+{
+  int i;
+public:
+  gnu_obj(int arg = 0): i(arg) { }
+  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
+  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
+};
+
+template<typename T>
+  struct gnu_t
+  {
+    bool b;
+  public:
+    gnu_t(bool arg = 0): b(arg) { }
+    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
+    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
+  };
+
+
+// heterogeneous
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::pair<bool, long> p_bl_1(true, 433);
+  std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
+  VERIFY( p_bl_1 == p_bl_2 );
+  VERIFY( !(p_bl_1 < p_bl_2) );
+
+  std::pair<const char*, float> p_sf_1("total enlightenment", 433.00);
+  std::pair<const char*, float> p_sf_2 = std::make_pair("total enlightenment", 
+                                                       433.00);
+  VERIFY( p_sf_1 == p_sf_2 );
+  VERIFY( !(p_sf_1 < p_sf_2) );
+
+  std::pair<const char*, gnu_obj> p_sg_1("enlightenment", gnu_obj(5));
+  std::pair<const char*, gnu_obj> p_sg_2 = std::make_pair("enlightenment", 
+                                                         gnu_obj(5));
+  VERIFY( p_sg_1 == p_sg_2 );
+  VERIFY( !(p_sg_1 < p_sg_2) );
+
+  std::pair<gnu_t<long>, gnu_obj> p_st_1(gnu_t<long>(false), gnu_obj(5));
+  std::pair<gnu_t<long>, gnu_obj> p_st_2 = std::make_pair(gnu_t<long>(false),
+                                                         gnu_obj(5));
+  VERIFY( p_st_1 == p_st_2 );
+  VERIFY( !(p_st_1 < p_st_2) );
+}
+
+int main() 
+{ 
+  test01(); 
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/pair/2.cc b/libstdc++-v3/testsuite/20_util/pair/2.cc
new file mode 100644 (file)
index 0000000..fd5f8ad
--- /dev/null
@@ -0,0 +1,60 @@
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.2.2 Pairs
+
+#include <utility>
+#include <testsuite_hooks.h>
+
+class gnu_obj
+{
+  int i;
+public:
+  gnu_obj(int arg = 0): i(arg) { }
+  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
+  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
+};
+
+template<typename T>
+  struct gnu_t
+  {
+    bool b;
+  public:
+    gnu_t(bool arg = 0): b(arg) { }
+    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
+    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
+  };
+
+// homogeneous
+void test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::pair<bool, bool> p_bb_1(true, false);
+  std::pair<bool, bool> p_bb_2 = std::make_pair(true, false);
+  VERIFY( p_bb_1 == p_bb_2 );
+  VERIFY( !(p_bb_1 < p_bb_2) );
+}
+
+int main() 
+{ 
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/pair/3.cc b/libstdc++-v3/testsuite/20_util/pair/3.cc
new file mode 100644 (file)
index 0000000..f861134
--- /dev/null
@@ -0,0 +1,79 @@
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.2.2 Pairs
+
+#include <utility>
+#include <testsuite_hooks.h>
+
+class gnu_obj
+{
+  int i;
+public:
+  gnu_obj(int arg = 0): i(arg) { }
+  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
+  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
+};
+
+template<typename T>
+  struct gnu_t
+  {
+    bool b;
+  public:
+    gnu_t(bool arg = 0): b(arg) { }
+    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
+    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
+  };
+
+
+// const
+void test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::pair<bool, long> p_bl_1(true, 433);
+  const std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
+  VERIFY( p_bl_1 == p_bl_2 );
+  VERIFY( !(p_bl_1 < p_bl_2) );
+
+  const std::pair<const char*, float> p_sf_1("total enlightenment", 433.00);
+  const std::pair<const char*, float> p_sf_2 = 
+    std::make_pair("total enlightenment", 433.00);
+  VERIFY( p_sf_1 == p_sf_2 );
+  VERIFY( !(p_sf_1 < p_sf_2) );
+
+  const std::pair<const char*, gnu_obj> p_sg_1("enlightenment", gnu_obj(5));
+  const std::pair<const char*, gnu_obj> p_sg_2 = 
+    std::make_pair("enlightenment", gnu_obj(5));
+  VERIFY( p_sg_1 == p_sg_2 );
+  VERIFY( !(p_sg_1 < p_sg_2) );
+
+  const std::pair<gnu_t<long>, gnu_obj> p_st_1(gnu_t<long>(false), gnu_obj(5));
+  const std::pair<gnu_t<long>, gnu_obj> p_st_2 = 
+    std::make_pair(gnu_t<long>(false), gnu_obj(5));
+  VERIFY( p_st_1 == p_st_2 );
+  VERIFY( !(p_st_1 < p_st_2) );
+}
+
+int main() 
+{ 
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/pair/4.cc b/libstdc++-v3/testsuite/20_util/pair/4.cc
new file mode 100644 (file)
index 0000000..086cc9e
--- /dev/null
@@ -0,0 +1,67 @@
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.2.2 Pairs
+
+#include <utility>
+#include <testsuite_hooks.h>
+
+class gnu_obj
+{
+  int i;
+public:
+  gnu_obj(int arg = 0): i(arg) { }
+  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
+  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
+};
+
+template<typename T>
+  struct gnu_t
+  {
+    bool b;
+  public:
+    gnu_t(bool arg = 0): b(arg) { }
+    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
+    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
+  };
+
+// const&
+void test04()
+{
+  bool test __attribute__((unused)) = true;
+  const gnu_obj& obj1 = gnu_obj(5);
+  const std::pair<const char*, gnu_obj> p_sg_1("enlightenment", obj1);
+  const std::pair<const char*, gnu_obj> p_sg_2 = 
+    std::make_pair("enlightenment", obj1);
+  VERIFY( p_sg_1 == p_sg_2 );
+  VERIFY( !(p_sg_1 < p_sg_2) );
+
+  const gnu_t<long>& tmpl1 = gnu_t<long>(false);
+  const std::pair<gnu_t<long>, gnu_obj> p_st_1(tmpl1, obj1);
+  const std::pair<gnu_t<long>, gnu_obj> p_st_2 = std::make_pair(tmpl1, obj1);
+  VERIFY( p_st_1 == p_st_2 );
+  VERIFY( !(p_st_1 < p_st_2) );
+}
+
+int main() 
+{ 
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/pair/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/pair/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..3d55f62
--- /dev/null
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers.
+
+#include <utility>
+
+template class std::pair<int, long>;
diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc
new file mode 100644 (file)
index 0000000..bc2793f
--- /dev/null
@@ -0,0 +1,37 @@
+// { dg-do compile }
+
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.2 raw storage iterator
+
+#include <memory>
+
+void test01()
+{
+  using namespace std;
+
+  // Check for required base class.
+  long l;
+  typedef raw_storage_iterator<long*, long> test_iterator;
+  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  test_iterator rs_it(&l);
+  base_iterator* base __attribute__((unused)) = &rs_it;
+}
diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..41023b6
--- /dev/null
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers.
+
+#include <memory>
+
+template class std::raw_storage_iterator<int*, int>;
diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..4a51c4c
--- /dev/null
@@ -0,0 +1,38 @@
+// { dg-do compile }
+// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.2 raw storage iterator
+
+#include <memory>
+
+void test01()
+{
+  using namespace std;
+
+  // Check for required typedefs
+  long l;
+  typedef raw_storage_iterator<long*, long> test_iterator;
+  typedef test_iterator::value_type value_type;
+  typedef test_iterator::difference_type difference_type;
+  typedef test_iterator::pointer pointer;
+  typedef test_iterator::reference reference;
+  typedef test_iterator::iterator_category iteratory_category;
+}
diff --git a/libstdc++-v3/testsuite/20_util/rel_ops.cc b/libstdc++-v3/testsuite/20_util/rel_ops.cc
new file mode 100644 (file)
index 0000000..e2ac57d
--- /dev/null
@@ -0,0 +1,46 @@
+// 2002-04-13  Paolo Carlini  <pcarlini@unitus.it>
+
+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.2.1 Operators
+
+#include <utility>
+#include <vector>
+
+using namespace std::rel_ops;
+
+// libstdc++/3628
+void test01()
+{
+  std::vector<int> v;
+  std::vector<int>::iterator vi;
+  v.push_back(1);
+  vi = v.end();
+  vi != v.begin();
+  vi > v.begin();
+  vi <= v.begin();
+  vi >= v.begin();
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/16505.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/16505.cc
new file mode 100644 (file)
index 0000000..b20c049
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.4 specialized algorithms
+
+// { dg-do compile }
+
+#include <memory>
+
+// libstdc++/16505
+
+struct S { };
+
+template
+  void
+  std::uninitialized_fill_n<S*, int, S>(S*, int, const S&);
diff --git a/libstdc++-v3/testsuite/20_util/temporary_buffer.cc b/libstdc++-v3/testsuite/20_util/temporary_buffer.cc
new file mode 100644 (file)
index 0000000..aee343a
--- /dev/null
@@ -0,0 +1,50 @@
+// 2002-01-24  Phil Edwards  <pme@gcc.gnu.org>
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 20.4.3 temporary buffers
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct junk { char j[12]; };
+
+int main(void)
+{
+  bool test __attribute__((unused)) = true;
+
+  std::pair<junk*,ptrdiff_t>  results = std::get_temporary_buffer<junk>(5);
+
+  if (results.second != 0)
+  {
+      // make sure it works:  test the returned capacity, and then construct
+      // some junk in the buffer.
+      // XXX
+      VERIFY( results.first != 0 );
+  }
+  else
+  {
+      // if it says it didn't work, make sure it didn't work
+      VERIFY( results.first == 0 );
+  }
+
+  std::return_temporary_buffer(results.first);
+
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/utility/pair/1.cc b/libstdc++-v3/testsuite/20_util/utility/pair/1.cc
deleted file mode 100644 (file)
index 9b7f555..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.2.2 Pairs
-
-#include <utility>
-#include <testsuite_hooks.h>
-
-class gnu_obj
-{
-  int i;
-public:
-  gnu_obj(int arg = 0): i(arg) { }
-  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
-  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
-};
-
-template<typename T>
-  struct gnu_t
-  {
-    bool b;
-  public:
-    gnu_t(bool arg = 0): b(arg) { }
-    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
-    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
-  };
-
-
-// heterogeneous
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::pair<bool, long> p_bl_1(true, 433);
-  std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
-  VERIFY( p_bl_1 == p_bl_2 );
-  VERIFY( !(p_bl_1 < p_bl_2) );
-
-  std::pair<const char*, float> p_sf_1("total enlightenment", 433.00);
-  std::pair<const char*, float> p_sf_2 = std::make_pair("total enlightenment", 
-                                                       433.00);
-  VERIFY( p_sf_1 == p_sf_2 );
-  VERIFY( !(p_sf_1 < p_sf_2) );
-
-  std::pair<const char*, gnu_obj> p_sg_1("enlightenment", gnu_obj(5));
-  std::pair<const char*, gnu_obj> p_sg_2 = std::make_pair("enlightenment", 
-                                                         gnu_obj(5));
-  VERIFY( p_sg_1 == p_sg_2 );
-  VERIFY( !(p_sg_1 < p_sg_2) );
-
-  std::pair<gnu_t<long>, gnu_obj> p_st_1(gnu_t<long>(false), gnu_obj(5));
-  std::pair<gnu_t<long>, gnu_obj> p_st_2 = std::make_pair(gnu_t<long>(false),
-                                                         gnu_obj(5));
-  VERIFY( p_st_1 == p_st_2 );
-  VERIFY( !(p_st_1 < p_st_2) );
-}
-
-int main() 
-{ 
-  test01(); 
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/utility/pair/2.cc b/libstdc++-v3/testsuite/20_util/utility/pair/2.cc
deleted file mode 100644 (file)
index fd5f8ad..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.2.2 Pairs
-
-#include <utility>
-#include <testsuite_hooks.h>
-
-class gnu_obj
-{
-  int i;
-public:
-  gnu_obj(int arg = 0): i(arg) { }
-  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
-  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
-};
-
-template<typename T>
-  struct gnu_t
-  {
-    bool b;
-  public:
-    gnu_t(bool arg = 0): b(arg) { }
-    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
-    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
-  };
-
-// homogeneous
-void test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::pair<bool, bool> p_bb_1(true, false);
-  std::pair<bool, bool> p_bb_2 = std::make_pair(true, false);
-  VERIFY( p_bb_1 == p_bb_2 );
-  VERIFY( !(p_bb_1 < p_bb_2) );
-}
-
-int main() 
-{ 
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/utility/pair/3.cc b/libstdc++-v3/testsuite/20_util/utility/pair/3.cc
deleted file mode 100644 (file)
index f861134..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.2.2 Pairs
-
-#include <utility>
-#include <testsuite_hooks.h>
-
-class gnu_obj
-{
-  int i;
-public:
-  gnu_obj(int arg = 0): i(arg) { }
-  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
-  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
-};
-
-template<typename T>
-  struct gnu_t
-  {
-    bool b;
-  public:
-    gnu_t(bool arg = 0): b(arg) { }
-    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
-    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
-  };
-
-
-// const
-void test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::pair<bool, long> p_bl_1(true, 433);
-  const std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
-  VERIFY( p_bl_1 == p_bl_2 );
-  VERIFY( !(p_bl_1 < p_bl_2) );
-
-  const std::pair<const char*, float> p_sf_1("total enlightenment", 433.00);
-  const std::pair<const char*, float> p_sf_2 = 
-    std::make_pair("total enlightenment", 433.00);
-  VERIFY( p_sf_1 == p_sf_2 );
-  VERIFY( !(p_sf_1 < p_sf_2) );
-
-  const std::pair<const char*, gnu_obj> p_sg_1("enlightenment", gnu_obj(5));
-  const std::pair<const char*, gnu_obj> p_sg_2 = 
-    std::make_pair("enlightenment", gnu_obj(5));
-  VERIFY( p_sg_1 == p_sg_2 );
-  VERIFY( !(p_sg_1 < p_sg_2) );
-
-  const std::pair<gnu_t<long>, gnu_obj> p_st_1(gnu_t<long>(false), gnu_obj(5));
-  const std::pair<gnu_t<long>, gnu_obj> p_st_2 = 
-    std::make_pair(gnu_t<long>(false), gnu_obj(5));
-  VERIFY( p_st_1 == p_st_2 );
-  VERIFY( !(p_st_1 < p_st_2) );
-}
-
-int main() 
-{ 
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/utility/pair/4.cc b/libstdc++-v3/testsuite/20_util/utility/pair/4.cc
deleted file mode 100644 (file)
index 086cc9e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// 2001-06-18  Benjamin Kosnik  <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.2.2 Pairs
-
-#include <utility>
-#include <testsuite_hooks.h>
-
-class gnu_obj
-{
-  int i;
-public:
-  gnu_obj(int arg = 0): i(arg) { }
-  bool operator==(const gnu_obj& rhs) const { return i == rhs.i; }
-  bool operator<(const gnu_obj& rhs) const { return i < rhs.i; }
-};
-
-template<typename T>
-  struct gnu_t
-  {
-    bool b;
-  public:
-    gnu_t(bool arg = 0): b(arg) { }
-    bool operator==(const gnu_t& rhs) const { return b == rhs.b; }
-    bool operator<(const gnu_t& rhs) const { return int(b) < int(rhs.b); }
-  };
-
-// const&
-void test04()
-{
-  bool test __attribute__((unused)) = true;
-  const gnu_obj& obj1 = gnu_obj(5);
-  const std::pair<const char*, gnu_obj> p_sg_1("enlightenment", obj1);
-  const std::pair<const char*, gnu_obj> p_sg_2 = 
-    std::make_pair("enlightenment", obj1);
-  VERIFY( p_sg_1 == p_sg_2 );
-  VERIFY( !(p_sg_1 < p_sg_2) );
-
-  const gnu_t<long>& tmpl1 = gnu_t<long>(false);
-  const std::pair<gnu_t<long>, gnu_obj> p_st_1(tmpl1, obj1);
-  const std::pair<gnu_t<long>, gnu_obj> p_st_2 = std::make_pair(tmpl1, obj1);
-  VERIFY( p_st_1 == p_st_2 );
-  VERIFY( !(p_st_1 < p_st_2) );
-}
-
-int main() 
-{ 
-  test04();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/utility/pair/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/utility/pair/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index 3d55f62..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING.  If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02110-1301, USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This file tests explicit instantiation of library containers.
-
-#include <utility>
-
-template class std::pair<int, long>;
diff --git a/libstdc++-v3/testsuite/20_util/utility/rel_ops.cc b/libstdc++-v3/testsuite/20_util/utility/rel_ops.cc
deleted file mode 100644 (file)
index e2ac57d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// 2002-04-13  Paolo Carlini  <pcarlini@unitus.it>
-
-// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 20.2.1 Operators
-
-#include <utility>
-#include <vector>
-
-using namespace std::rel_ops;
-
-// libstdc++/3628
-void test01()
-{
-  std::vector<int> v;
-  std::vector<int>::iterator vi;
-  v.push_back(1);
-  vi = v.end();
-  vi != v.begin();
-  vi > v.begin();
-  vi <= v.begin();
-  vi >= v.begin();
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/27867.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/27867.cc
deleted file mode 100644 (file)
index 7c208f4..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// 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.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <valarray>
-#include <testsuite_hooks.h>
-
-// libstdc++/27867
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::valarray<int> v1(100, 1);
-  std::valarray<int> v2(100, 1);
-  std::valarray<bool> v3(true, 1);
-
-  std::valarray<bool> resl(1);
-  resl = ((v1 == v2) == v3);
-  VERIFY( resl[0] == true );
-
-  std::valarray<bool> resr(1);
-  resr = (v3 == (v1 == v2));
-  VERIFY( resr[0] == true );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/28277.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/28277.cc
deleted file mode 100644 (file)
index 52f4c71..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// 2006-07-15  Paolo Carlini  <pcarlini@suse.de>
-
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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 <valarray>
-#include <testsuite_hooks.h>
-
-// libstdc++/28277
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::valarray<int> v1(1, 5000000);
-
-  const std::valarray<int> v2 = v1.shift(1);
-  VERIFY( v2.size() == v1.size() );
-  VERIFY( v2[v1.size() - 1] == 0 );
-
-  const std::valarray<int> v3 = v2.cshift(-1);
-  VERIFY( v3.size() == v2.size() );
-  VERIFY( v3[0] == 0 );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/30416.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/30416.cc
deleted file mode 100644 (file)
index c513292..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-// 2007-01-11  Paolo Carlini  <pcarlini@suse.de>
-
-// Copyright (C) 2007 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <valarray>
-#include <testsuite_hooks.h>
-
-bool
-comp_vala(const std::valarray<int>& v1, const std::valarray<int>& v2)
-{
-  if (v1.size() == v2.size())
-    {
-      for (size_t i = 0; i < v1.size(); ++i)
-       if (v1[i] != v2[i])
-         return false;
-      return true;
-    }
-  return false;
-}
-
-void
-init_vala(std::valarray<int>& v, size_t first, size_t last, int val)
-{
-  for (size_t i = first; i <= last; ++i)
-    v[i] = val++;
-}
-
-// libstdc++/30416
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using namespace std;
-
-  // shift
-  valarray<int> v1;
-  valarray<int> v1_ris(v1.shift(0));
-  VERIFY( comp_vala(v1, v1_ris) );
-  
-  valarray<int> v2;
-  valarray<int> v2_ris(v2.shift(10));
-  VERIFY( comp_vala(v2, v2_ris) );
-  
-  valarray<int> v3;
-  valarray<int> v3_ris(v3.shift(-10));
-  VERIFY( comp_vala(v3, v3_ris) );
-  
-  valarray<int> v4(10);
-  valarray<int> v4_ris(v4.shift(0));
-  VERIFY( comp_vala(v4, v4_ris) );
-  
-  valarray<int> v5(10);
-  init_vala(v5, 0, 9, 1);
-  valarray<int> v5_ref(10);  
-  
-  valarray<int> v5_ris(v5.shift(16));
-  VERIFY( comp_vala(v5_ris, v5_ref) );
-  
-  valarray<int> v6(10);
-  init_vala(v6, 0, 9, 1);
-  valarray<int> v6_ref(10);
-  
-  valarray<int> v6_ris(v6.shift(-16));
-  VERIFY( comp_vala(v6_ris, v6_ref) );
-
-  valarray<int> v7(10);
-  init_vala(v7, 0, 9, 1);
-  valarray<int> v7_ref(10);  
-  
-  valarray<int> v7_ris(v7.shift(10));
-  VERIFY( comp_vala(v7_ris, v7_ref) );
-  
-  valarray<int> v8(10);
-  init_vala(v8, 0, 9, 1);
-  valarray<int> v8_ref(10);
-  
-  valarray<int> v8_ris(v8.shift(-10));
-  VERIFY( comp_vala(v8_ris, v8_ref) );
-
-  valarray<int> v9(10);
-  init_vala(v9, 0, 9, 1);
-  valarray<int> v9_ref(10);  
-  init_vala(v9_ref, 0, 3, 7);
-  
-  valarray<int> v9_ris(v9.shift(6));
-  VERIFY( comp_vala(v9_ris, v9_ref) );
-  
-  valarray<int> v10(10);
-  init_vala(v10, 0, 9, 1);
-  valarray<int> v10_ref(10);
-  init_vala(v10_ref, 6, 9, 1);
-
-  valarray<int> v10_ris(v10.shift(-6));
-  VERIFY( comp_vala(v10_ris, v10_ref) );
-
-  // cshift
-  valarray<int> v11;
-  valarray<int> v11_ris(v11.cshift(0));
-  VERIFY( comp_vala(v11, v11_ris) );
-  
-  valarray<int> v12;
-  valarray<int> v12_ris(v12.cshift(10));
-  VERIFY( comp_vala(v12, v12_ris) );
-  
-  valarray<int> v13;
-  valarray<int> v13_ris(v13.cshift(-10));
-  VERIFY( comp_vala(v13, v13_ris) );
-  
-  valarray<int> v14(10);
-  valarray<int> v14_ris(v14.cshift(0));
-  VERIFY( comp_vala(v14, v14_ris) );
-  
-  valarray<int> v15(10);
-  init_vala(v15, 0, 9, 1);
-  valarray<int> v15_ref(10);
-  init_vala(v15_ref, 0, 3, 7);
-  init_vala(v15_ref, 4, 9, 1);
-  
-  valarray<int> v15_ris(v15.cshift(16));
-  VERIFY( comp_vala(v15_ris, v15_ref) );
-
-  valarray<int> v16(10);
-  init_vala(v16, 0, 9, 1);
-  valarray<int> v16_ref(10);
-  init_vala(v16_ref, 0, 5, 5);
-  init_vala(v16_ref, 6, 9, 1);
-  
-  valarray<int> v16_ris(v16.cshift(-16));
-  VERIFY( comp_vala(v16_ris, v16_ref) );
-
-  valarray<int> v17(10);
-  init_vala(v17, 0, 9, 1);
-  
-  valarray<int> v17_ris(v15.cshift(10));
-  VERIFY( comp_vala(v17, v17_ris) );
-  
-  valarray<int> v18(10);
-  init_vala(v18, 0, 9, 1);
-  
-  valarray<int> v18_ris(v18.cshift(-10));
-  VERIFY( comp_vala(v18, v18_ris) );
-
-  valarray<int> v19(10);
-  init_vala(v19, 0, 9, 1);
-  valarray<int> v19_ref(10);
-  init_vala(v19_ref, 0, 3, 7);
-  init_vala(v19_ref, 4, 9, 1);
-  
-  valarray<int> v19_ris(v15.cshift(6));
-  VERIFY( comp_vala(v19_ris, v19_ref) );
-  
-  valarray<int> v20(10);
-  init_vala(v20, 0, 9, 1);
-  valarray<int> v20_ref(10);
-  init_vala(v20_ref, 0, 5, 5);
-  init_vala(v20_ref, 6, 9, 1);
-  
-  valarray<int> v20_ris(v20.cshift(-6));
-  VERIFY( comp_vala(v20_ris, v20_ref) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-} 
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/binary_closure.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/binary_closure.cc
deleted file mode 100644 (file)
index 7dbcfbd..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// 19990805 gdr
-//
-// XXX: to impove later.
-// Origin: Andreas Amann <amann@physik.tu-berlin.de>
-// CXXFLAGS: -g
-
-#include <iostream>
-#include <valarray>
-
-
-int main()
-{
-    std::valarray<double> a(10), b(10), c(10), d(10);
-
-    a = 1.2;
-    b = 3.1;
-
-    c = 4.0;
-
-    d = ( 2.0 * b + a );  // works
-    std::cout << "d[4] = " << d[4] << std::endl;
-
-    d = (a * 2.0 + b ); // works
-    std::cout << "d[4] = " << d[4] << std::endl;
-
-    d = (a + b * 2.0 ); // segfaults!
-    std::cout << "d[4] = " << d[4] << std::endl;
-    d = (a + 2.0* b );
-
-    std::cout << "d[4] = " << d[4] << std::endl;
-    d = (a + 2.0* b );
-    std::cout << "d[4] = " << d[4] << std::endl;
-    d = (a + 2.0* b );
-
-    std::cout << "d[4] = " << d[4] << std::endl;
-    return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/dr543.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/dr543.cc
deleted file mode 100644 (file)
index 9afa93a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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 <valarray>
-#include <testsuite_hooks.h>
-
-// DR 543. valarray slice default constructor
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::valarray<int> v1(10);
-  std::valarray<int> v2 = v1[std::slice()];
-  VERIFY( v2.size() == 0 );
-
-  std::valarray<int> v3(10);
-  std::valarray<int> v4 = v3[std::gslice()];
-  VERIFY( v4.size() == 0 );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/array_assignment.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/array_assignment.cc
new file mode 100644 (file)
index 0000000..34888be
--- /dev/null
@@ -0,0 +1,51 @@
+// 20010613 gdr
+
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+
+// This is DR-253.  Test for accessible assignment-operators.
+#include <valarray>
+#include <testsuite_hooks.h>
+
+int main()
+{
+  bool test __attribute__((unused)) = true;
+  using std::valarray;
+  using std::slice;
+  valarray<int> v(1, 10), w(2, 10);
+
+  w[slice(0, 3, 3)] = v[slice(2, 3, 3)];
+
+  VERIFY(v[0] == 1 && w[0] == 1);
+  VERIFY(v[3] == 1 && w[3] == 1);
+  VERIFY(v[6] == 1 && w[6] == 1);
+
+  std::slice_array<int> t = v[slice(0, 10, 1)];
+  
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..09dfed6
--- /dev/null
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers.
+
+#include <valarray>
+
+template class std::slice_array<short>;
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..1529551
--- /dev/null
@@ -0,0 +1,39 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 6.2.2 Class template array
+
+#include <valarray>
+
+void test01()
+{
+  // Check for required typedefs
+  typedef std::slice_array<int> test_type;
+  typedef test_type::value_type value_type;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array_assignment.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/slice_array_assignment.cc
deleted file mode 100644 (file)
index 34888be..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// 20010613 gdr
-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-
-// This is DR-253.  Test for accessible assignment-operators.
-#include <valarray>
-#include <testsuite_hooks.h>
-
-int main()
-{
-  bool test __attribute__((unused)) = true;
-  using std::valarray;
-  using std::slice;
-  valarray<int> v(1, 10), w(2, 10);
-
-  w[slice(0, 3, 3)] = v[slice(2, 3, 3)];
-
-  VERIFY(v[0] == 1 && w[0] == 1);
-  VERIFY(v[3] == 1 && w[3] == 1);
-  VERIFY(v[6] == 1 && w[6] == 1);
-
-  std::slice_array<int> t = v[slice(0, 10, 1)];
-  
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray.cc
deleted file mode 100644 (file)
index 3c206e3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// 19990404 gdr
-
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <valarray>
-
-int main()
-{
-  // 01: instantiation
-  std::valarray<double> a(20);
-
-  // 02: algo
-  using std::valarray;
-  valarray<double> b, c;
-  double m __attribute__((unused)) = std::abs(b - c).max();
-
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/27867.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/27867.cc
new file mode 100644 (file)
index 0000000..7c208f4
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// 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.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <valarray>
+#include <testsuite_hooks.h>
+
+// libstdc++/27867
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::valarray<int> v1(100, 1);
+  std::valarray<int> v2(100, 1);
+  std::valarray<bool> v3(true, 1);
+
+  std::valarray<bool> resl(1);
+  resl = ((v1 == v2) == v3);
+  VERIFY( resl[0] == true );
+
+  std::valarray<bool> resr(1);
+  resr = (v3 == (v1 == v2));
+  VERIFY( resr[0] == true );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/28277.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/28277.cc
new file mode 100644 (file)
index 0000000..52f4c71
--- /dev/null
@@ -0,0 +1,44 @@
+// 2006-07-15  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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 <valarray>
+#include <testsuite_hooks.h>
+
+// libstdc++/28277
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::valarray<int> v1(1, 5000000);
+
+  const std::valarray<int> v2 = v1.shift(1);
+  VERIFY( v2.size() == v1.size() );
+  VERIFY( v2[v1.size() - 1] == 0 );
+
+  const std::valarray<int> v3 = v2.cshift(-1);
+  VERIFY( v3.size() == v2.size() );
+  VERIFY( v3[0] == 0 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/30416.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/30416.cc
new file mode 100644 (file)
index 0000000..c513292
--- /dev/null
@@ -0,0 +1,190 @@
+// 2007-01-11  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <valarray>
+#include <testsuite_hooks.h>
+
+bool
+comp_vala(const std::valarray<int>& v1, const std::valarray<int>& v2)
+{
+  if (v1.size() == v2.size())
+    {
+      for (size_t i = 0; i < v1.size(); ++i)
+       if (v1[i] != v2[i])
+         return false;
+      return true;
+    }
+  return false;
+}
+
+void
+init_vala(std::valarray<int>& v, size_t first, size_t last, int val)
+{
+  for (size_t i = first; i <= last; ++i)
+    v[i] = val++;
+}
+
+// libstdc++/30416
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using namespace std;
+
+  // shift
+  valarray<int> v1;
+  valarray<int> v1_ris(v1.shift(0));
+  VERIFY( comp_vala(v1, v1_ris) );
+  
+  valarray<int> v2;
+  valarray<int> v2_ris(v2.shift(10));
+  VERIFY( comp_vala(v2, v2_ris) );
+  
+  valarray<int> v3;
+  valarray<int> v3_ris(v3.shift(-10));
+  VERIFY( comp_vala(v3, v3_ris) );
+  
+  valarray<int> v4(10);
+  valarray<int> v4_ris(v4.shift(0));
+  VERIFY( comp_vala(v4, v4_ris) );
+  
+  valarray<int> v5(10);
+  init_vala(v5, 0, 9, 1);
+  valarray<int> v5_ref(10);  
+  
+  valarray<int> v5_ris(v5.shift(16));
+  VERIFY( comp_vala(v5_ris, v5_ref) );
+  
+  valarray<int> v6(10);
+  init_vala(v6, 0, 9, 1);
+  valarray<int> v6_ref(10);
+  
+  valarray<int> v6_ris(v6.shift(-16));
+  VERIFY( comp_vala(v6_ris, v6_ref) );
+
+  valarray<int> v7(10);
+  init_vala(v7, 0, 9, 1);
+  valarray<int> v7_ref(10);  
+  
+  valarray<int> v7_ris(v7.shift(10));
+  VERIFY( comp_vala(v7_ris, v7_ref) );
+  
+  valarray<int> v8(10);
+  init_vala(v8, 0, 9, 1);
+  valarray<int> v8_ref(10);
+  
+  valarray<int> v8_ris(v8.shift(-10));
+  VERIFY( comp_vala(v8_ris, v8_ref) );
+
+  valarray<int> v9(10);
+  init_vala(v9, 0, 9, 1);
+  valarray<int> v9_ref(10);  
+  init_vala(v9_ref, 0, 3, 7);
+  
+  valarray<int> v9_ris(v9.shift(6));
+  VERIFY( comp_vala(v9_ris, v9_ref) );
+  
+  valarray<int> v10(10);
+  init_vala(v10, 0, 9, 1);
+  valarray<int> v10_ref(10);
+  init_vala(v10_ref, 6, 9, 1);
+
+  valarray<int> v10_ris(v10.shift(-6));
+  VERIFY( comp_vala(v10_ris, v10_ref) );
+
+  // cshift
+  valarray<int> v11;
+  valarray<int> v11_ris(v11.cshift(0));
+  VERIFY( comp_vala(v11, v11_ris) );
+  
+  valarray<int> v12;
+  valarray<int> v12_ris(v12.cshift(10));
+  VERIFY( comp_vala(v12, v12_ris) );
+  
+  valarray<int> v13;
+  valarray<int> v13_ris(v13.cshift(-10));
+  VERIFY( comp_vala(v13, v13_ris) );
+  
+  valarray<int> v14(10);
+  valarray<int> v14_ris(v14.cshift(0));
+  VERIFY( comp_vala(v14, v14_ris) );
+  
+  valarray<int> v15(10);
+  init_vala(v15, 0, 9, 1);
+  valarray<int> v15_ref(10);
+  init_vala(v15_ref, 0, 3, 7);
+  init_vala(v15_ref, 4, 9, 1);
+  
+  valarray<int> v15_ris(v15.cshift(16));
+  VERIFY( comp_vala(v15_ris, v15_ref) );
+
+  valarray<int> v16(10);
+  init_vala(v16, 0, 9, 1);
+  valarray<int> v16_ref(10);
+  init_vala(v16_ref, 0, 5, 5);
+  init_vala(v16_ref, 6, 9, 1);
+  
+  valarray<int> v16_ris(v16.cshift(-16));
+  VERIFY( comp_vala(v16_ris, v16_ref) );
+
+  valarray<int> v17(10);
+  init_vala(v17, 0, 9, 1);
+  
+  valarray<int> v17_ris(v15.cshift(10));
+  VERIFY( comp_vala(v17, v17_ris) );
+  
+  valarray<int> v18(10);
+  init_vala(v18, 0, 9, 1);
+  
+  valarray<int> v18_ris(v18.cshift(-10));
+  VERIFY( comp_vala(v18, v18_ris) );
+
+  valarray<int> v19(10);
+  init_vala(v19, 0, 9, 1);
+  valarray<int> v19_ref(10);
+  init_vala(v19_ref, 0, 3, 7);
+  init_vala(v19_ref, 4, 9, 1);
+  
+  valarray<int> v19_ris(v15.cshift(6));
+  VERIFY( comp_vala(v19_ris, v19_ref) );
+  
+  valarray<int> v20(10);
+  init_vala(v20, 0, 9, 1);
+  valarray<int> v20_ref(10);
+  init_vala(v20_ref, 0, 5, 5);
+  init_vala(v20_ref, 6, 9, 1);
+  
+  valarray<int> v20_ris(v20.cshift(-6));
+  VERIFY( comp_vala(v20_ris, v20_ref) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+} 
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/algo.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/algo.cc
new file mode 100644 (file)
index 0000000..a69ce65
--- /dev/null
@@ -0,0 +1,40 @@
+// 19990404 gdr
+
+// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <valarray>
+
+int main()
+{
+  // 02: algo
+  using std::valarray;
+  valarray<double> b, c;
+  double m __attribute__((unused)) = std::abs(b - c).max();
+
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/binary_closure.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/binary_closure.cc
new file mode 100644 (file)
index 0000000..7dbcfbd
--- /dev/null
@@ -0,0 +1,37 @@
+// 19990805 gdr
+//
+// XXX: to impove later.
+// Origin: Andreas Amann <amann@physik.tu-berlin.de>
+// CXXFLAGS: -g
+
+#include <iostream>
+#include <valarray>
+
+
+int main()
+{
+    std::valarray<double> a(10), b(10), c(10), d(10);
+
+    a = 1.2;
+    b = 3.1;
+
+    c = 4.0;
+
+    d = ( 2.0 * b + a );  // works
+    std::cout << "d[4] = " << d[4] << std::endl;
+
+    d = (a * 2.0 + b ); // works
+    std::cout << "d[4] = " << d[4] << std::endl;
+
+    d = (a + b * 2.0 ); // segfaults!
+    std::cout << "d[4] = " << d[4] << std::endl;
+    d = (a + 2.0* b );
+
+    std::cout << "d[4] = " << d[4] << std::endl;
+    d = (a + 2.0* b );
+    std::cout << "d[4] = " << d[4] << std::endl;
+    d = (a + 2.0* b );
+
+    std::cout << "d[4] = " << d[4] << std::endl;
+    return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/const_bracket.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/const_bracket.cc
new file mode 100644 (file)
index 0000000..512cbaf
--- /dev/null
@@ -0,0 +1,48 @@
+// 20010518 gdr
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <valarray>
+
+// dg-do compile
+
+template<typename P>
+  void copy(P, std::size_t) { }
+
+template<typename T>
+  void test(const std::valarray<T>& v)
+  {
+     copy(&v[0], v.size());
+  }
+
+int main()
+{
+  std::valarray<double> v(190);
+  test(v);
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/dr543.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/dr543.cc
new file mode 100644 (file)
index 0000000..9afa93a
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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 <valarray>
+#include <testsuite_hooks.h>
+
+// DR 543. valarray slice default constructor
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::valarray<int> v1(10);
+  std::valarray<int> v2 = v1[std::slice()];
+  VERIFY( v2.size() == 0 );
+
+  std::valarray<int> v3(10);
+  std::valarray<int> v4 = v3[std::gslice()];
+  VERIFY( v4.size() == 0 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/name_lookup.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/name_lookup.cc
new file mode 100644 (file)
index 0000000..735f65f
--- /dev/null
@@ -0,0 +1,142 @@
+// 2002-08-02 gdr
+
+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// Test name lookup resolutions for standard functions applied to an
+// array expression.
+// { dg-do compile }
+
+#include <valarray>
+
+namespace My
+{
+  struct Number 
+  { 
+    operator bool() const;
+  };
+  
+  Number operator+(Number);
+  Number operator-(Number);
+  Number operator~(Number);
+
+  bool operator!(Number);
+  
+  Number operator+(Number, Number);
+  Number operator-(Number, Number);
+  Number operator*(Number, Number);
+  Number operator/(Number, Number);
+  Number operator%(Number, Number);
+
+  Number operator^(Number, Number);
+  Number operator&(Number, Number);
+  Number operator|(Number, Number);
+
+  Number operator<<(Number, Number);
+  Number operator>>(Number, Number);
+
+  bool operator==(Number, Number);
+  bool operator!=(Number, Number);
+  bool operator<(Number, Number);
+  bool operator<=(Number, Number);
+  bool operator>(Number, Number);
+  bool operator>=(Number, Number);
+
+  Number abs(Number);
+
+  Number cos(Number);
+  Number cosh(Number);
+  Number acos(Number);
+
+  Number sin(Number);
+  Number sinh(Number);
+  Number asin(Number);
+  
+  Number tan(Number);
+  Number tanh(Number);
+  Number atan(Number);
+
+  Number exp(Number);
+  Number log(Number);
+  Number log10(Number);
+  Number sqrt(Number);
+
+  Number atan2(Number, Number);
+  Number pow(Number, Number);
+}
+
+int main()
+{
+  typedef std::valarray<My::Number> Array;
+  Array u(10), v(10);
+  v = +u;
+  v = -u;
+  v = ~u;
+  std::valarray<bool> z = !u;
+
+  v = abs(u);
+  
+  v = cos(u);
+  v = cosh(u);
+  v = acos(u);
+
+  v = sin(u);
+  v = sinh(u);
+  v = asin(u);
+
+  v = tan(u);
+  v = tanh(u);
+  v = atan(u);
+
+  v = exp(u);
+  v = log(u);
+  v = log10(u);
+  v = sqrt(u);  
+
+  Array w = u + v;
+  w = u - v;
+  w = u * v;
+  w = u / v;
+  w = u % v;
+
+  w = u ^ v;
+  w = u & v;
+  w = u | v;
+
+  w = u << v;
+  w = u >> v;
+
+  z = u == v;
+  z = u != v;
+  z = u < v;
+  z = u <= v;
+  z = u > v;
+  z = u >= v;
+
+  w = atan2(u, v);
+  w = pow(u, v);
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/operators.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/operators.cc
new file mode 100644 (file)
index 0000000..70ad0b0
--- /dev/null
@@ -0,0 +1,69 @@
+// { dg-do run }
+// 2003-02-03  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+// Copyright (C) 2003 Free Software Foundation
+//
+// 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 <valarray>
+#include <testsuite_hooks.h>
+
+void test01() // check unary operators
+{
+  bool test __attribute__((unused)) = true;
+  std::valarray<int> u(1);
+  u[0]=1;
+
+  VERIFY( (+u)[0] == +1 );
+  VERIFY( (-u)[0] == -1 );
+  VERIFY( (!u)[0] == !1 );
+  VERIFY( (~u)[0] == ~1 );
+}
+
+void test02() // check binary operators
+{
+  bool test __attribute__((unused)) = true;
+  std::valarray<int> u(1), v(1);
+  u[0]=1;
+  v[0]=3;
+
+  VERIFY( (u+ v)[0] == (1+ 3) );
+  VERIFY( (u- v)[0] == (1- 3) );
+  VERIFY( (u* v)[0] == (1* 3) );
+  VERIFY( (u/ v)[0] == (1/ 3) );
+  VERIFY( (u% v)[0] == (1% 3) );
+  VERIFY( (u^ v)[0] == (1^ 3) );
+  VERIFY( (u& v)[0] == (1& 3) );
+  VERIFY( (u| v)[0] == (1| 3) );
+  VERIFY( (u<<v)[0] == (1<<3) );
+  VERIFY( (u>>v)[0] == (1>>3) );
+  VERIFY( (u&&v)[0] == (1&&3) );
+  VERIFY( (u||v)[0] == (1||3) );
+  VERIFY( (u==v)[0] == (1==3) );
+  VERIFY( (u!=v)[0] == (1!=3) );
+  VERIFY( (u< v)[0] == (1< 3) );
+  VERIFY( (u> v)[0] == (1> 3) );
+  VERIFY( (u<=v)[0] == (1<=3) );
+  VERIFY( (u>=v)[0] == (1>=3) );
+}
+
+int main()
+{
+  test01();
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..d4d5e28
--- /dev/null
@@ -0,0 +1,34 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of library containers.
+
+#include <valarray>
+
+template class std::valarray<short>;
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..a6f28dc
--- /dev/null
@@ -0,0 +1,39 @@
+// { dg-do compile }
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// 6.2.2 Class template array
+
+#include <valarray>
+
+void test01()
+{
+  // Check for required typedefs
+  typedef std::valarray<int> test_type;
+  typedef test_type::value_type value_type;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/subset_assignment.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/subset_assignment.cc
new file mode 100644 (file)
index 0000000..4ce22af
--- /dev/null
@@ -0,0 +1,87 @@
+// 2004-01-03  Jerry Quinn  <jlquinn@optonline.net>
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// PR 3247
+
+// This is DR-253.  Test for accessible assignment-operators.
+#include <valarray>
+#include <testsuite_hooks.h>
+
+bool check_array(std::valarray<double>& a, double b[])
+{
+  for (unsigned int i=0; i < a.size(); i++)
+    if (a[i] != b[i]) return false;
+  return true;
+}
+
+int main()
+{
+  std::valarray<double> val_d(10);  //  0 1 2 3 4 5 6 7 8 9 
+  std::valarray<double> val_d1(10); // 10 9 8 7 6 5 4 3 2 1
+
+  for (int i=0; i< 10; i++) { val_d[i] = 10;  val_d1[i] = i; }
+  std::valarray<double> val_c(val_d);
+  std::valarray<double> val_f(val_d);
+  std::valarray<double> val_g(val_d);
+
+  std::slice slc(1, 3, 3);     // 1 4 7
+  val_d[slc] = val_d1[slc];
+
+  double ans1[10] = {10, 1, 10, 10, 4, 10, 10, 7, 10, 10};
+  VERIFY(check_array(val_d, ans1));
+
+  std::valarray<std::size_t> val_size(2);
+  std::valarray<std::size_t> val_stride(2);
+  val_size[0] = 2;   val_size[1] = 3;
+  val_stride[0] = 4; val_stride[1] = 1;
+
+  std::gslice gslc(1, val_size, val_stride);
+  val_c[gslc] = val_d1[gslc];
+
+  double ans2[10] = {10, 1, 2, 3, 10, 5, 6, 7, 10, 10};
+  VERIFY(check_array(val_c, ans2));
+
+  std::valarray<bool> val_b(false, 10);
+  val_b[2] = val_b[6] = val_b[9] = true;
+  val_f[val_b] = val_d1[val_b];
+
+  double ans3[10] = {10, 10, 2, 10, 10, 10, 6, 10, 10, 9};
+  VERIFY(check_array(val_f, ans3));
+
+  size_t addr[] = {1, 2, 3, 4, 5};
+  size_t addr1[] = {2, 7, 1, 9, 4};
+  std::valarray<std::size_t> val_indirect(addr, 5);
+  std::valarray<std::size_t> val_indirect1(addr1, 5);
+  val_g[val_indirect] = val_d1[val_indirect1];
+
+  double ans4[10] = {10, 2, 7, 1, 9, 4, 10, 10, 10, 10};
+  VERIFY(check_array(val_g, ans4));
+
+  return 0;
+};
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_const_bracket.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_const_bracket.cc
deleted file mode 100644 (file)
index 512cbaf..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// 20010518 gdr
-
-// Copyright (C) 2001 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-#include <valarray>
-
-// dg-do compile
-
-template<typename P>
-  void copy(P, std::size_t) { }
-
-template<typename T>
-  void test(const std::valarray<T>& v)
-  {
-     copy(&v[0], v.size());
-  }
-
-int main()
-{
-  std::valarray<double> v(190);
-  test(v);
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_name_lookup.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_name_lookup.cc
deleted file mode 100644 (file)
index 735f65f..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-// 2002-08-02 gdr
-
-// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Test name lookup resolutions for standard functions applied to an
-// array expression.
-// { dg-do compile }
-
-#include <valarray>
-
-namespace My
-{
-  struct Number 
-  { 
-    operator bool() const;
-  };
-  
-  Number operator+(Number);
-  Number operator-(Number);
-  Number operator~(Number);
-
-  bool operator!(Number);
-  
-  Number operator+(Number, Number);
-  Number operator-(Number, Number);
-  Number operator*(Number, Number);
-  Number operator/(Number, Number);
-  Number operator%(Number, Number);
-
-  Number operator^(Number, Number);
-  Number operator&(Number, Number);
-  Number operator|(Number, Number);
-
-  Number operator<<(Number, Number);
-  Number operator>>(Number, Number);
-
-  bool operator==(Number, Number);
-  bool operator!=(Number, Number);
-  bool operator<(Number, Number);
-  bool operator<=(Number, Number);
-  bool operator>(Number, Number);
-  bool operator>=(Number, Number);
-
-  Number abs(Number);
-
-  Number cos(Number);
-  Number cosh(Number);
-  Number acos(Number);
-
-  Number sin(Number);
-  Number sinh(Number);
-  Number asin(Number);
-  
-  Number tan(Number);
-  Number tanh(Number);
-  Number atan(Number);
-
-  Number exp(Number);
-  Number log(Number);
-  Number log10(Number);
-  Number sqrt(Number);
-
-  Number atan2(Number, Number);
-  Number pow(Number, Number);
-}
-
-int main()
-{
-  typedef std::valarray<My::Number> Array;
-  Array u(10), v(10);
-  v = +u;
-  v = -u;
-  v = ~u;
-  std::valarray<bool> z = !u;
-
-  v = abs(u);
-  
-  v = cos(u);
-  v = cosh(u);
-  v = acos(u);
-
-  v = sin(u);
-  v = sinh(u);
-  v = asin(u);
-
-  v = tan(u);
-  v = tanh(u);
-  v = atan(u);
-
-  v = exp(u);
-  v = log(u);
-  v = log10(u);
-  v = sqrt(u);  
-
-  Array w = u + v;
-  w = u - v;
-  w = u * v;
-  w = u / v;
-  w = u % v;
-
-  w = u ^ v;
-  w = u & v;
-  w = u | v;
-
-  w = u << v;
-  w = u >> v;
-
-  z = u == v;
-  z = u != v;
-  z = u < v;
-  z = u <= v;
-  z = u > v;
-  z = u >= v;
-
-  w = atan2(u, v);
-  w = pow(u, v);
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_operators.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_operators.cc
deleted file mode 100644 (file)
index 70ad0b0..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// { dg-do run }
-// 2003-02-03  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
-
-// Copyright (C) 2003 Free Software Foundation
-//
-// 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 <valarray>
-#include <testsuite_hooks.h>
-
-void test01() // check unary operators
-{
-  bool test __attribute__((unused)) = true;
-  std::valarray<int> u(1);
-  u[0]=1;
-
-  VERIFY( (+u)[0] == +1 );
-  VERIFY( (-u)[0] == -1 );
-  VERIFY( (!u)[0] == !1 );
-  VERIFY( (~u)[0] == ~1 );
-}
-
-void test02() // check binary operators
-{
-  bool test __attribute__((unused)) = true;
-  std::valarray<int> u(1), v(1);
-  u[0]=1;
-  v[0]=3;
-
-  VERIFY( (u+ v)[0] == (1+ 3) );
-  VERIFY( (u- v)[0] == (1- 3) );
-  VERIFY( (u* v)[0] == (1* 3) );
-  VERIFY( (u/ v)[0] == (1/ 3) );
-  VERIFY( (u% v)[0] == (1% 3) );
-  VERIFY( (u^ v)[0] == (1^ 3) );
-  VERIFY( (u& v)[0] == (1& 3) );
-  VERIFY( (u| v)[0] == (1| 3) );
-  VERIFY( (u<<v)[0] == (1<<3) );
-  VERIFY( (u>>v)[0] == (1>>3) );
-  VERIFY( (u&&v)[0] == (1&&3) );
-  VERIFY( (u||v)[0] == (1||3) );
-  VERIFY( (u==v)[0] == (1==3) );
-  VERIFY( (u!=v)[0] == (1!=3) );
-  VERIFY( (u< v)[0] == (1< 3) );
-  VERIFY( (u> v)[0] == (1> 3) );
-  VERIFY( (u<=v)[0] == (1<=3) );
-  VERIFY( (u>=v)[0] == (1>=3) );
-}
-
-int main()
-{
-  test01();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_subset_assignment.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray_subset_assignment.cc
deleted file mode 100644 (file)
index 4ce22af..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// 2004-01-03  Jerry Quinn  <jlquinn@optonline.net>
-
-// Copyright (C) 2004 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING.  If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// PR 3247
-
-// This is DR-253.  Test for accessible assignment-operators.
-#include <valarray>
-#include <testsuite_hooks.h>
-
-bool check_array(std::valarray<double>& a, double b[])
-{
-  for (unsigned int i=0; i < a.size(); i++)
-    if (a[i] != b[i]) return false;
-  return true;
-}
-
-int main()
-{
-  std::valarray<double> val_d(10);  //  0 1 2 3 4 5 6 7 8 9 
-  std::valarray<double> val_d1(10); // 10 9 8 7 6 5 4 3 2 1
-
-  for (int i=0; i< 10; i++) { val_d[i] = 10;  val_d1[i] = i; }
-  std::valarray<double> val_c(val_d);
-  std::valarray<double> val_f(val_d);
-  std::valarray<double> val_g(val_d);
-
-  std::slice slc(1, 3, 3);     // 1 4 7
-  val_d[slc] = val_d1[slc];
-
-  double ans1[10] = {10, 1, 10, 10, 4, 10, 10, 7, 10, 10};
-  VERIFY(check_array(val_d, ans1));
-
-  std::valarray<std::size_t> val_size(2);
-  std::valarray<std::size_t> val_stride(2);
-  val_size[0] = 2;   val_size[1] = 3;
-  val_stride[0] = 4; val_stride[1] = 1;
-
-  std::gslice gslc(1, val_size, val_stride);
-  val_c[gslc] = val_d1[gslc];
-
-  double ans2[10] = {10, 1, 2, 3, 10, 5, 6, 7, 10, 10};
-  VERIFY(check_array(val_c, ans2));
-
-  std::valarray<bool> val_b(false, 10);
-  val_b[2] = val_b[6] = val_b[9] = true;
-  val_f[val_b] = val_d1[val_b];
-
-  double ans3[10] = {10, 10, 2, 10, 10, 10, 6, 10, 10, 9};
-  VERIFY(check_array(val_f, ans3));
-
-  size_t addr[] = {1, 2, 3, 4, 5};
-  size_t addr1[] = {2, 7, 1, 9, 4};
-  std::valarray<std::size_t> val_indirect(addr, 5);
-  std::valarray<std::size_t> val_indirect1(addr1, 5);
-  val_g[val_indirect] = val_d1[val_indirect1];
-
-  double ans4[10] = {10, 2, 7, 1, 9, 4, 10, 10, 10, 10};
-  VERIFY(check_array(val_g, ans4));
-
-  return 0;
-};
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/1.cc
new file mode 100644 (file)
index 0000000..2d1ebad
--- /dev/null
@@ -0,0 +1,39 @@
+// 2006-09-24  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { dg-do compile }
+
+struct X : public std::tr1::enable_shared_from_this<X>
+{
+};
+
+int main()
+{
+  using __gnu_test::check_ret_type;
+  using std::tr1::shared_ptr;
+
+  shared_ptr<X> spx(new X);
+  check_ret_type<shared_ptr<X> >(spx->shared_from_this());
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared.cc
new file mode 100644 (file)
index 0000000..c7a9dbf
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct X : public std::tr1::enable_shared_from_this<X>
+{
+};
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  X x;
+
+  try
+    {
+      std::tr1::shared_ptr<X> p = x.shared_from_this();
+      VERIFY( false );
+    }
+  catch (const std::tr1::bad_weak_ptr&)
+    {
+      // Expected.
+      VERIFY( true );
+    }
+  catch (...)
+    {
+      // Failed.
+      VERIFY( false );
+    }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared2.cc
new file mode 100644 (file)
index 0000000..9f5f88e
--- /dev/null
@@ -0,0 +1,61 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct X : public std::tr1::enable_shared_from_this<X>
+{
+};
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<X> p(new X);
+
+  X x(*p);  // copy of shared object should not be shared
+
+  try
+    {
+      std::tr1::shared_ptr<X> p = x.shared_from_this();
+      VERIFY( false );
+    }
+  catch (const std::tr1::bad_weak_ptr&)
+    {
+      // Expected.
+      VERIFY( true );
+    }
+  catch (...)
+    {
+      // Failed.
+      VERIFY( false );
+    }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared3.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/not_shared3.cc
new file mode 100644 (file)
index 0000000..14b203b
--- /dev/null
@@ -0,0 +1,63 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct X : public std::tr1::enable_shared_from_this<X>
+{
+};
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<X> p(new X);
+
+  X x;
+  x = *p;  // copy of shared object should not be shared
+
+  try
+    {
+      std::tr1::shared_ptr<X> p = x.shared_from_this();
+      VERIFY( false );
+    }
+  catch (const std::tr1::bad_weak_ptr&)
+    {
+      // Expected.
+      VERIFY( true );
+    }
+  catch (...)
+    {
+      // Failed.
+      VERIFY( false );
+    }
+
+  return 0;
+}
+
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..b497ebb
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { dg-do compile }
+
+using namespace __gnu_test;
+using std::tr1::enable_shared_from_this;
+template class enable_shared_from_this<int>;
+template class enable_shared_from_this<void>;
+template class enable_shared_from_this<ClassType>;
+template class enable_shared_from_this<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/shared.cc
new file mode 100644 (file)
index 0000000..f860fb7
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct X : public std::tr1::enable_shared_from_this<X>
+{
+};
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<X> p(new X);
+  std::tr1::shared_ptr<X>  q = p->shared_from_this();
+  VERIFY( p == q );
+  VERIFY( !(p < q) && !(q < p) );  // p and q share ownership
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/still_shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/enable_shared_from_this/still_shared.cc
new file mode 100644 (file)
index 0000000..b9568af
--- /dev/null
@@ -0,0 +1,55 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct X : public std::tr1::enable_shared_from_this<X>
+{
+};
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<X> p(new X);
+
+  *p = X();  // assigning to shared object doesn't stop it being shared
+
+  try
+  {
+    std::tr1::shared_ptr<X> p2 = p->shared_from_this();
+  }
+  catch (const std::tr1::bad_weak_ptr&)
+  {
+    test = false;
+  }
+  VERIFY( test );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/1.cc
deleted file mode 100644 (file)
index 2d1ebad..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// 2006-09-24  Paolo Carlini  <pcarlini@suse.de>
-
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_tr1.h>
-
-// { dg-do compile }
-
-struct X : public std::tr1::enable_shared_from_this<X>
-{
-};
-
-int main()
-{
-  using __gnu_test::check_ret_type;
-  using std::tr1::shared_ptr;
-
-  shared_ptr<X> spx(new X);
-  check_ret_type<shared_ptr<X> >(spx->shared_from_this());
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared.cc
deleted file mode 100644 (file)
index c7a9dbf..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct X : public std::tr1::enable_shared_from_this<X>
-{
-};
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  X x;
-
-  try
-    {
-      std::tr1::shared_ptr<X> p = x.shared_from_this();
-      VERIFY( false );
-    }
-  catch (const std::tr1::bad_weak_ptr&)
-    {
-      // Expected.
-      VERIFY( true );
-    }
-  catch (...)
-    {
-      // Failed.
-      VERIFY( false );
-    }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared2.cc
deleted file mode 100644 (file)
index 9f5f88e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct X : public std::tr1::enable_shared_from_this<X>
-{
-};
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<X> p(new X);
-
-  X x(*p);  // copy of shared object should not be shared
-
-  try
-    {
-      std::tr1::shared_ptr<X> p = x.shared_from_this();
-      VERIFY( false );
-    }
-  catch (const std::tr1::bad_weak_ptr&)
-    {
-      // Expected.
-      VERIFY( true );
-    }
-  catch (...)
-    {
-      // Failed.
-      VERIFY( false );
-    }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared3.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared3.cc
deleted file mode 100644 (file)
index 14b203b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct X : public std::tr1::enable_shared_from_this<X>
-{
-};
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<X> p(new X);
-
-  X x;
-  x = *p;  // copy of shared object should not be shared
-
-  try
-    {
-      std::tr1::shared_ptr<X> p = x.shared_from_this();
-      VERIFY( false );
-    }
-  catch (const std::tr1::bad_weak_ptr&)
-    {
-      // Expected.
-      VERIFY( true );
-    }
-  catch (...)
-    {
-      // Failed.
-      VERIFY( false );
-    }
-
-  return 0;
-}
-
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index b497ebb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_tr1.h>
-
-// { dg-do compile }
-
-using namespace __gnu_test;
-using std::tr1::enable_shared_from_this;
-template class enable_shared_from_this<int>;
-template class enable_shared_from_this<void>;
-template class enable_shared_from_this<ClassType>;
-template class enable_shared_from_this<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/shared.cc
deleted file mode 100644 (file)
index f860fb7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct X : public std::tr1::enable_shared_from_this<X>
-{
-};
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<X> p(new X);
-  std::tr1::shared_ptr<X>  q = p->shared_from_this();
-  VERIFY( p == q );
-  VERIFY( !(p < q) && !(q < p) );  // p and q share ownership
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/still_shared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/still_shared.cc
deleted file mode 100644 (file)
index b9568af..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// 2.2.5 Template class enable_shared_from_this [tr.util.smartptr.enab]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct X : public std::tr1::enable_shared_from_this<X>
-{
-};
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<X> p(new X);
-
-  *p = X();  // assigning to shared object doesn't stop it being shared
-
-  try
-  {
-    std::tr1::shared_ptr<X> p2 = p->shared_from_this();
-  }
-  catch (const std::tr1::bad_weak_ptr&)
-  {
-    test = false;
-  }
-  VERIFY( test );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/assign.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/assign.cc
deleted file mode 100644 (file)
index 93f90ce..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-  }
-};
-
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
-
-// Assignment from shared_ptr<Y>
-void
-test01()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-
-  a = std::tr1::shared_ptr<A>(new A);
-  VERIFY( a.get() != 0 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-
-  a = std::tr1::shared_ptr<A>();
-  VERIFY( a.get() == 0 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 1 );
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr.cc
deleted file mode 100644 (file)
index 9a36f95..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
-
-// Assignment from auto_ptr<Y>
-int
-test01()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a(new A);
-  std::auto_ptr<B> b(new B);
-  a = b;
-  VERIFY( a.get() != 0 );
-  VERIFY( b.get() == 0 );
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 1 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_neg.cc
deleted file mode 100644 (file)
index cca1049..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-struct B { };
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
-
-// Assignment from incompatible auto_ptr<Y>
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-  std::auto_ptr<B> b;
-  a = b;                      // { dg-error "here" }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
-// { dg-excess-errors "In constructor" }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_rvalue_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_rvalue_neg.cc
deleted file mode 100644 (file)
index da02329..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-std::auto_ptr<A> source() { return std::auto_ptr<A>(); }
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
-
-// Assignment from rvalue auto_ptr
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-  a = source(); // { dg-error "no match" }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
-// { dg-excess-errors "candidates are" }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/dr541.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/dr541.cc
deleted file mode 100644 (file)
index f9dc839..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-
-// DR 541. shared_ptr template assignment and void
-void test01()
-{
-  std::tr1::shared_ptr<void> p;
-  p.operator=<void>(p);
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr.cc
deleted file mode 100644 (file)
index 90ab7ee..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
-
-// Assignment from shared_ptr<Y>
-void
-test01()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-
-  a = std::tr1::shared_ptr<A>();
-  VERIFY( a.get() == 0 );
-  VERIFY( A::ctor_count == 0 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-
-  a = std::tr1::shared_ptr<A>(new A);
-  VERIFY( a.get() != 0 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-
-  a = std::tr1::shared_ptr<B>(new B);
-  VERIFY( a.get() != 0 );
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 1 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr_neg.cc
deleted file mode 100644 (file)
index 407cc5b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-struct B { };
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
-
-// Assignment from incompatible shared_ptr<Y>
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-  std::tr1::shared_ptr<B> b;
-  a = b;                      // { dg-error "here" }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
-// { dg-error "In member function" "" { target *-*-* } 0 }
-// { dg-error "cannot convert" "" { target *-*-* } 0 }
-// { dg-error "instantiated from" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/casts/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/casts/1.cc
deleted file mode 100644 (file)
index 8851f25..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// 2006-09-24  Paolo Carlini  <pcarlini@suse.de>
-
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.3.9 shared_ptr casts [tr.util.smartptr.shared.cast]
-
-#include <tr1/memory>
-#include <testsuite_tr1.h>
-
-// { dg-do compile }
-
-struct MyP { virtual ~MyP() { }; };
-struct MyDP : MyP { };
-
-int main()
-{
-  using __gnu_test::check_ret_type;
-  using std::tr1::shared_ptr;
-  using std::tr1::static_pointer_cast;
-  using std::tr1::const_pointer_cast;
-  using std::tr1::dynamic_pointer_cast;
-
-  shared_ptr<double> spd;
-  shared_ptr<const int> spci;
-  shared_ptr<MyP> spa;
-
-  check_ret_type<shared_ptr<void> >(static_pointer_cast<void>(spd));
-  check_ret_type<shared_ptr<int> >(const_pointer_cast<int>(spci));
-  check_ret_type<shared_ptr<MyDP> >(static_pointer_cast<MyDP>(spa));  
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/comparison/cmp.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/comparison/cmp.cc
deleted file mode 100644 (file)
index 15b7b1e..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  virtual ~A() { }
-};
-
-struct B : A
-{
-};
-
-// 2.2.3.6 shared_ptr comparison [tr.util.smartptr.shared.cmp]
-
-int
-test01()
-{
-    // test empty shared_ptrs compare equivalent
-    std::tr1::shared_ptr<A> p1;
-    std::tr1::shared_ptr<B> p2;
-    VERIFY( p1 == p2 );
-    VERIFY( !(p1 != p2) );
-    VERIFY( !(p1 < p2) && !(p2 < p1) );
-    return 0;
-}
-
-
-// Construction from pointer
-int
-test02()
-{
-  std::tr1::shared_ptr<A> A_default;
-
-  std::tr1::shared_ptr<A> A_from_A(new A);
-  VERIFY( A_default != A_from_A );
-  VERIFY( !(A_default == A_from_A) );
-  VERIFY( (A_default < A_from_A) || (A_from_A < A_default) );
-
-  std::tr1::shared_ptr<B> B_from_B(new B);
-  VERIFY( B_from_B != A_from_A );
-  VERIFY( !(B_from_B == A_from_A) );
-  VERIFY( (B_from_B < A_from_A) || (A_from_A < B_from_B) );
-
-  A_from_A.reset();
-  VERIFY( A_default == A_from_A );
-  VERIFY( !(A_default != A_from_A) );
-  VERIFY( !(A_default < A_from_A) && !(A_from_A < A_default) );
-
-  B_from_B.reset();
-  VERIFY( B_from_B == A_from_A );
-  VERIFY( !(B_from_B != A_from_A) );
-  VERIFY( !(B_from_B < A_from_A) && !(A_from_A < B_from_B) );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr.cc
deleted file mode 100644 (file)
index b91c5a2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
-
-// Construction from auto_ptr
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::auto_ptr<A> a(new A);
-  std::tr1::shared_ptr<A> a2(a);
-  VERIFY( a.get() == 0 );
-  VERIFY( a2.get() != 0 );
-  VERIFY( a2.use_count() == 1 );
-
-  return 0;
-}
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr_neg.cc
deleted file mode 100644 (file)
index c2a3202..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.const]
-
-// Construction from const auto_ptr
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::auto_ptr<A> a;
-  std::tr1::shared_ptr<A> p(a); // { dg-error "no match" }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
-// { dg-excess-errors "candidates are" }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/copy.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/copy.cc
deleted file mode 100644 (file)
index cc529e0..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  virtual ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  virtual ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-void deleter(A* p) { delete p; }
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-  }
-};
-
-// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
-
-// Copy construction
-int test01()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a1;
-  std::tr1::shared_ptr<A> a2(a1);
-  VERIFY( a2.use_count() == 0 );
-  VERIFY( A::ctor_count == 0 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int
-test02()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a1(new A);
-  std::tr1::shared_ptr<A> a2(a1);
-  VERIFY( a2.use_count() == 2 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int
-test03()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<B> b(new B);
-  std::tr1::shared_ptr<A> a(b);
-  VERIFY( a.use_count() == 2 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int
-test04()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<B> b(new B, &deleter);
-  std::tr1::shared_ptr<A> a(b);
-  VERIFY( a.use_count() == 2 );
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-
-  return 0;
-}
-
-int
-main()
-{
-  test01();
-  test02();
-  test03();
-  test04();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/default.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/default.cc
deleted file mode 100644 (file)
index 641834d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
-
-// Default construction
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-  VERIFY( a.get() == 0 );
-
-  return 0;
-}
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/pointer.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/pointer.cc
deleted file mode 100644 (file)
index dec0514..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-struct B : A { };
-
-
-// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
-
-// Construction from pointer
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = 0;
-  std::tr1::shared_ptr<A> p(a);
-  VERIFY( p.get() == 0 );
-  VERIFY( p.use_count() == 1 );
-
-  return 0;
-}
-
-int
-test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  std::tr1::shared_ptr<A> p(a);
-  VERIFY( p.get() == a );
-  VERIFY( p.use_count() == 1 );
-
-  return 0;
-}
-
-
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  B * const b = new B;
-  std::tr1::shared_ptr<A> p(b);
-  VERIFY( p.get() == b );
-  VERIFY( p.use_count() == 1 );
-
-  return 0;
-}
-
-int
-main()
-{
-  test01();
-  test02();
-  test02();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr.cc
deleted file mode 100644 (file)
index 048d93a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
-
-// Construction from weak_ptr
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  std::tr1::shared_ptr<A> a1(a);
-  std::tr1::weak_ptr<A> wa(a1);
-  std::tr1::shared_ptr<A> a2(wa);
-  VERIFY( a2.get() == a );
-  VERIFY( a2.use_count() == wa.use_count() );
-
-  return 0;
-}
-
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr_expired.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr_expired.cc
deleted file mode 100644 (file)
index d40227a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// { dg-do run { xfail *-*-* } }
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
-
-// Construction from expired weak_ptr
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a1(new A);
-  std::tr1::weak_ptr<A> wa(a1);
-  a1.reset();
-  VERIFY( wa.expired() );
-  try
-  {
-    std::tr1::shared_ptr<A> a2(wa);
-  }
-  catch (const std::tr1::bad_weak_ptr&)
-  {
-    // Expected.
-      __throw_exception_again;
-  }
-  catch (...)
-  {
-    // Failed.
-  }
-
-  return 0;
-}
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/dest/dest.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/dest/dest.cc
deleted file mode 100644 (file)
index a632264..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() { ++ctor_count; }
-  ~A() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long A::ctor_count = 0;
-long A::dtor_count = 0;
-
-struct B : A
-{
-  B() { ++ctor_count; }
-  ~B() { ++dtor_count; }
-  static long ctor_count;
-  static long dtor_count;
-};
-long B::ctor_count = 0;
-long B::dtor_count = 0;
-
-struct D
-{
-  void operator()(const B* p) { delete p; ++delete_count; }
-  static long delete_count;
-};
-long D::delete_count = 0;
-
-struct reset_count_struct
-{
-  ~reset_count_struct()
-  {
-    A::ctor_count = 0;
-    A::dtor_count = 0;
-    B::ctor_count = 0;
-    B::dtor_count = 0;
-    D::delete_count = 0;
-  }
-};
-
-
-// 2.2.3.2 shared_ptr destructor [tr.util.smartptr.shared.dest]
-
-// empty shared_ptr
-int
-test01()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  {
-    std::tr1::shared_ptr<A> a;
-  }
-  VERIFY( A::ctor_count == 0 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 0 );
-  VERIFY( B::dtor_count == 0 );
-  VERIFY( D::delete_count == 0 );
-
-  return 0;
-}
-
-// shared ownership
-int
-test02()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> a;
-  {
-    a = std::tr1::shared_ptr<A>(new B, D());
-  }
-  VERIFY( A::ctor_count == 1 );
-  VERIFY( A::dtor_count == 0 );
-  VERIFY( B::ctor_count == 1 );
-  VERIFY( B::dtor_count == 0 );
-  VERIFY( D::delete_count == 0 );
-
-  return 0;
-}
-
-// exclusive ownership
-int
-test03()
-{
-  reset_count_struct __attribute__((unused)) reset;
-  bool test __attribute__((unused)) = true;
-
-  {
-    std::tr1::shared_ptr<A> a1(new B);
-    std::tr1::shared_ptr<A> a2(new B, D());
-  }
-  VERIFY( A::ctor_count == 2 );
-  VERIFY( A::dtor_count == 2 );
-  VERIFY( B::ctor_count == 2 );
-  VERIFY( B::dtor_count == 2 );
-  VERIFY( D::delete_count == 1 );
-
-  return 0;
-}
-
-
-int
-main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc
deleted file mode 100644 (file)
index 71cbd0b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-using std::tr1::get_deleter;
-
-// libstdc++/24595
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<int> sp;
-  VERIFY( !get_deleter<void(*)(int*)>(sp) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/io.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/io.cc
deleted file mode 100644 (file)
index 51de755..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <sstream>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.7 shared_ptr I/O [tr.util.smartptr.shared.io]
-
-// operator<<
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p(new A);
-  std::ostringstream buf;
-  buf << p;
-  const std::string s = buf.str();
-  buf.str("");
-  buf << p.get();
-  VERIFY( s == buf.str() );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/swap.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/swap.cc
deleted file mode 100644 (file)
index c22b2f8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.8 shared_ptr specialized algorithms [tr.util.smartptr.shared.spec]
-
-// std::swap
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a1 = new A;
-  A * const a2 = new A;
-  std::tr1::shared_ptr<A> p1(a1);
-  std::tr1::shared_ptr<A> p2(a2);
-  std::swap(p1, p2);
-  VERIFY( p1.get() == a2 );
-  VERIFY( p2.get() == a1 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc
deleted file mode 100644 (file)
index 94824f6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-
-// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
-
-// swap
-
-// libstdc++/24805
-using std::tr1::swap;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset.cc
deleted file mode 100644 (file)
index 244a9f2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-struct B : A { };
-struct D
-{
-  void operator()(B* p) { delete p; ++delete_count; }
-  static long delete_count;
-};
-long D::delete_count = 0;
-
-// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
-
-// reset
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  std::tr1::shared_ptr<A> p1(a);
-  std::tr1::shared_ptr<A> p2(p1);
-  p1.reset();
-  VERIFY( p1.get() == 0 );
-  VERIFY( p2.get() == a );
-
-  return 0;
-}
-
-int
-test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  B * const b = new B;
-  std::tr1::shared_ptr<A> p1(a);
-  std::tr1::shared_ptr<A> p2(p1);
-  p1.reset(b);
-  VERIFY( p1.get() == b );
-  VERIFY( p2.get() == a );
-
-  return 0;
-}
-
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  {
-    std::tr1::shared_ptr<A> p1;
-    p1.reset(new B, D());
-  }
-  VERIFY( D::delete_count == 1 );
-
-  return 0;
-}   
-
-int
-main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset_neg.cc
deleted file mode 100644 (file)
index 136d2b7..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
-
-// reset
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::tr1::shared_ptr<A> p1(new A);
-  p1.reset();     // { dg-error "discards qualifiers" }
-
-  return 0;
-}
-
-int
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap.cc
deleted file mode 100644 (file)
index eb251b5..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
-
-// swap
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a1 = new A;
-  A * const a2 = new A;
-  std::tr1::shared_ptr<A> p1(a1);
-  std::tr1::shared_ptr<A> p2(a2);
-  p1.swap(p2);
-  VERIFY( p1.get() == a2 );
-  VERIFY( p2.get() == a1 );
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap_neg.cc
deleted file mode 100644 (file)
index 606d8e3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// { dg-do compile }
-
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
-
-// swap
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::tr1::shared_ptr<A> p1(new A);
-  std::tr1::shared_ptr<A> p2(new A);
-  p1.swap(p2);   // { dg-error "discards qualifiers" }
-
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/bool_conv.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/bool_conv.cc
deleted file mode 100644 (file)
index 9455884..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
-
-// conversion to bool
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::tr1::shared_ptr<A> p1;
-  VERIFY( p1 == false );
-  const std::tr1::shared_ptr<A> p2(p1);
-  VERIFY( p2 == false );
-
-  return 0;
-}
-
-int
-test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p1(new A);
-  VERIFY( p1 );
-  std::tr1::shared_ptr<A> p2(p1);
-  VERIFY( p2 );
-  p1.reset();
-  VERIFY( !p1 );
-  VERIFY( p2 );
-
-  return 0;
-}
-
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p1(new A);
-  std::tr1::shared_ptr<A> p2(p1);
-  p2.reset(new A);
-  VERIFY( p1 );
-  VERIFY( p2 );
-
-  return 0;
-}
-
-
-int 
-main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/get.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/get.cc
deleted file mode 100644 (file)
index d85ec66..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A
-{
-  A() : i() {}
-  int i;
-};
-
-// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
-
-// get
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  const std::tr1::shared_ptr<A> p(a);
-  VERIFY( p.get() == a );
-
-  return 0;
-}
-
-// operator*
-int
-test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  const std::tr1::shared_ptr<A> p(a);
-  VERIFY( &*p == a );
-
-  return 0;
-}
-
-
-// operator->
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  A * const a = new A;
-  const std::tr1::shared_ptr<A> p(a);
-  VERIFY( &p->i == &a->i );
-
-  return 0;
-}
-
-
-int 
-main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/unique.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/unique.cc
deleted file mode 100644 (file)
index 81253e4..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-
-// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
-
-// unique
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::tr1::shared_ptr<A> p1;
-  VERIFY( !p1.unique() );
-  const std::tr1::shared_ptr<A> p2(p1);
-  VERIFY( !p1.unique() );
-
-  return 0;
-}
-
-int
-test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p1(new A);
-  VERIFY( p1.unique() );
-  std::tr1::shared_ptr<A> p2(p1);
-  VERIFY( !p1.unique() );
-  p1.reset();
-  VERIFY( !p1.unique() );
-  VERIFY( p2.unique() );
-
-  return 0;
-}
-
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p1(new A);
-  std::tr1::shared_ptr<A> p2(p1);
-  p2.reset(new A);
-  VERIFY( p1.unique() );
-  VERIFY( p2.unique() );
-
-  return 0;
-}
-
-
-int 
-main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/use_count.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/use_count.cc
deleted file mode 100644 (file)
index 85f1850..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (C) 2005 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_hooks.h>
-
-struct A { };
-struct B : A { };
-
-// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
-
-// use_count
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const std::tr1::shared_ptr<A> p1;
-  VERIFY( p1.use_count() == 0 );
-  const std::tr1::shared_ptr<A> p2(p1);
-  VERIFY( p1.use_count() == 0 );
-
-  return 0;
-}
-
-int
-test02()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p1(new A);
-  std::tr1::shared_ptr<A> p2(p1);
-  p1.reset();
-  VERIFY( p1.use_count() == 0 );
-  VERIFY( p2.use_count() == 1 );
-
-  return 0;
-}
-
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::tr1::shared_ptr<A> p1(new A);
-  std::tr1::shared_ptr<A> p2(p1);
-  p2.reset(new B);
-  VERIFY( p1.use_count() == 1 );
-  VERIFY( p2.use_count() == 1 );
-
-  return 0;
-}
-
-
-int 
-main()
-{
-  test01();
-  test02();
-  test03();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index 015e22e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-#include <tr1/memory>
-#include <testsuite_tr1.h>
-
-// { dg-do compile }
-
-using namespace __gnu_test;
-using std::tr1::shared_ptr;
-template class shared_ptr<int>;
-template class shared_ptr<void>;
-template class shared_ptr<ClassType>;
-template class shared_ptr<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/thread/default_weaktoshared.cc
deleted file mode 100644 (file)
index 5b17500..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
-// { dg-options "-pthreads" { target *-*-solaris* } }
-
-#include <tr1/memory>
-#include <tr1/random>
-#include <vector>
-#include <testsuite_hooks.h>
-#include <iostream>
-
-#include <pthread.h>
-
-#ifdef _GLIBCXX_HAVE_UNISTD_H
-#include <unistd.h>    // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
-#endif
-
-/* This (brute-force) tests the atomicity and thus thread safety of the
- * shared_ptr <- weak_ptr
- * assignment operation by allocating a test object, retrieving a weak
- * reference to it, and letting a number of threads repeatedly create strong
- * references from the weak reference.
- * Specifically, this tests the function _Sp_counted_base<true>::add_ref_lock()
- */
-
-
-const unsigned int HAMMER_MAX_THREADS = 10;
-const unsigned int POOL_SIZE = 1000;
-const unsigned long HAMMER_REPEAT = 100000;
-const unsigned long KILL_ONE_IN = 1000;
-
-struct A
-  {
-    static _Atomic_word counter;
-    A()
-      {
-       __gnu_cxx::__atomic_add(&counter, 1);
-      }
-    ~A()
-      {
-       __gnu_cxx::__atomic_add(&counter, -1);
-      }
-  };
-
-_Atomic_word A::counter = 0;
-
-typedef std::tr1::shared_ptr<A> sp_A_t;
-typedef std::tr1::weak_ptr<A> wp_A_t;
-
-typedef std::vector<sp_A_t> sp_vector_t;
-typedef std::vector<wp_A_t> wp_vector_t;
-
-struct shared_and_weak_pools
-{
-  sp_vector_t& shared_pool;
-  wp_vector_t& weak_pool;
-  
-  shared_and_weak_pools(sp_vector_t& _shared_pool, wp_vector_t& _weak_pool)
-    : shared_pool(_shared_pool), weak_pool(_weak_pool)
-    { }
-};
-
-void* thread_hammer_and_kill(void* opaque_pools)
-{
-  shared_and_weak_pools& pools = *reinterpret_cast<shared_and_weak_pools*>(opaque_pools);
-  // Using the same parameters as in the RNG test cases.
-  std::tr1::mersenne_twister<
-    unsigned long, 32, 624, 397, 31,
-    0x9908b0dful, 11, 7,
-    0x9d2c5680ul, 15,
-    0xefc60000ul, 18> rng;
-  
-  sp_vector_t::iterator cur_shared = pools.shared_pool.begin();
-  wp_vector_t::iterator cur_weak = pools.weak_pool.begin();
-  
-  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
-    {
-      try
-      {
-        sp_A_t strong(*cur_weak);
-      }
-      catch (std::tr1::bad_weak_ptr& exception)
-      {
-        ++cur_weak;
-        if (cur_weak == pools.weak_pool.end())
-          break;
-      }
-      
-      if (rng() % KILL_ONE_IN == 0)
-      {
-        cur_shared->reset();
-        ++cur_shared;
-      }
-    }
-  return 0;
-}
-
-void* thread_hammer(void* opaque_weak)
-{
-  wp_vector_t& weak_pool = *reinterpret_cast<wp_vector_t*>(opaque_weak);
-  // Using the same parameters as in the RNG test cases.
-  std::tr1::mersenne_twister<
-    unsigned long, 32, 624, 397, 31,
-    0x9908b0dful, 11, 7,
-    0x9d2c5680ul, 15,
-    0xefc60000ul, 18> rng;
-  wp_vector_t::iterator cur_weak = weak_pool.begin();
-
-  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
-    {
-      try
-      {
-        sp_A_t strong(*cur_weak);
-      }
-      catch (std::tr1::bad_weak_ptr& exception)
-      {
-        ++cur_weak;
-        if (cur_weak == weak_pool.end())
-          break;
-      }
-    }
-  return 0;
-}
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-  sp_vector_t obj_pool(POOL_SIZE);
-  
-  for(sp_vector_t::iterator cur = obj_pool.begin(); cur != obj_pool.end(); ++cur)
-  {
-    cur->reset(new A);
-  }
-  // Obtain weak references.
-  std::vector<wp_vector_t> weak_pool(HAMMER_MAX_THREADS, wp_vector_t(obj_pool.begin(), obj_pool.end()));
-  
-  // Launch threads with pointer to weak reference.
-  pthread_t threads[HAMMER_MAX_THREADS];
-#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
-  pthread_setconcurrency (HAMMER_MAX_THREADS);
-#endif
-  
-  pthread_attr_t tattr;
-  int ret = pthread_attr_init(&tattr);
-
-  shared_and_weak_pools pools(obj_pool, weak_pool[0]);
-  pthread_create(threads, &tattr, thread_hammer_and_kill, reinterpret_cast<void*>(&pools));
-  for (unsigned int worker = 1; worker < HAMMER_MAX_THREADS; worker++)
-    {
-      if (pthread_create(&threads[worker], &tattr,
-                        thread_hammer, reinterpret_cast<void*>(&weak_pool[worker])))
-       abort();
-    }
-  // Wait for threads to complete, then check integrity of reference.
-  void* status;
-  for (unsigned int worker = 0; worker < HAMMER_MAX_THREADS; worker++)
-    {
-      if (pthread_join(threads[worker], &status))
-       abort();
-    }
-  obj_pool.clear();
-  
-  VERIFY( A::counter == 0 );
-  
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/thread/mutex_weaktoshared.cc
deleted file mode 100644 (file)
index 370218a..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
-// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
-// { dg-options "-pthreads" { target *-*-solaris* } }
-
-#include <tr1/memory>
-#include <tr1/random>
-#include <vector>
-#include <testsuite_hooks.h>
-#include <iostream>
-
-#include <pthread.h>
-
-#ifdef _GLIBCXX_HAVE_UNISTD_H
-#include <unistd.h>    // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
-#endif
-
-/* This (brute-force) tests the atomicity and thus thread safety of the
- * shared_ptr <- weak_ptr
- * assignment operation by allocating a test object, retrieving a weak
- * reference to it, and letting a number of threads repeatedly create strong
- * references from the weak reference.
- * Specifically, this tests the function _Sp_counted_base<true>::add_ref_lock()
- */
-
-
-const unsigned int HAMMER_MAX_THREADS = 10;
-const unsigned int POOL_SIZE = 1000;
-const unsigned long HAMMER_REPEAT = 100000;
-const unsigned long KILL_ONE_IN = 1000;
-
-struct A
-  {
-    static _Atomic_word counter;
-    A()
-      {
-       __gnu_cxx::__atomic_add(&counter, 1);
-      }
-    ~A()
-      {
-       __gnu_cxx::__atomic_add(&counter, -1);
-      }
-  };
-
-_Atomic_word A::counter = 0;
-
-using std::tr1::_S_mutex;
-
-typedef std::tr1::__shared_ptr<A, _S_mutex> sp_A_t;
-typedef std::tr1::__weak_ptr<A, _S_mutex> wp_A_t;
-
-typedef std::vector<sp_A_t> sp_vector_t;
-typedef std::vector<wp_A_t> wp_vector_t;
-
-struct shared_and_weak_pools
-{
-  sp_vector_t& shared_pool;
-  wp_vector_t& weak_pool;
-  
-  shared_and_weak_pools(sp_vector_t& _shared_pool, wp_vector_t& _weak_pool)
-    : shared_pool(_shared_pool), weak_pool(_weak_pool)
-    { }
-};
-
-void* thread_hammer_and_kill(void* opaque_pools)
-{
-  shared_and_weak_pools& pools = *reinterpret_cast<shared_and_weak_pools*>(opaque_pools);
-  // Using the same parameters as in the RNG test cases.
-  std::tr1::mersenne_twister<
-    unsigned long, 32, 624, 397, 31,
-    0x9908b0dful, 11, 7,
-    0x9d2c5680ul, 15,
-    0xefc60000ul, 18> rng;
-  
-  sp_vector_t::iterator cur_shared = pools.shared_pool.begin();
-  wp_vector_t::iterator cur_weak = pools.weak_pool.begin();
-  
-  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
-    {
-      try
-      {
-        sp_A_t strong(*cur_weak);
-      }
-      catch (std::tr1::bad_weak_ptr& exception)
-      {
-        ++cur_weak;
-        if (cur_weak == pools.weak_pool.end())
-          break;
-      }
-      
-      if (rng() % KILL_ONE_IN == 0)
-      {
-        cur_shared->reset();
-        ++cur_shared;
-      }
-    }
-  return 0;
-}
-
-void* thread_hammer(void* opaque_weak)
-{
-  wp_vector_t& weak_pool = *reinterpret_cast<wp_vector_t*>(opaque_weak);
-  // Using the same parameters as in the RNG test cases.
-  std::tr1::mersenne_twister<
-    unsigned long, 32, 624, 397, 31,
-    0x9908b0dful, 11, 7,
-    0x9d2c5680ul, 15,
-    0xefc60000ul, 18> rng;
-  wp_vector_t::iterator cur_weak = weak_pool.begin();
-
-  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
-    {
-      try
-      {
-        sp_A_t strong(*cur_weak);
-      }
-      catch (std::tr1::bad_weak_ptr& exception)
-      {
-        ++cur_weak;
-        if (cur_weak == weak_pool.end())
-          break;
-      }
-    }
-  return 0;
-}
-
-int
-test01()
-{
-  bool test __attribute__((unused)) = true;
-  sp_vector_t obj_pool(POOL_SIZE);
-  
-  for(sp_vector_t::iterator cur = obj_pool.begin(); cur != obj_pool.end(); ++cur)
-  {
-    cur->reset(new A);
-  }
-  // Obtain weak references.
-  std::vector<wp_vector_t> weak_pool(HAMMER_MAX_THREADS, wp_vector_t(obj_pool.begin(), obj_pool.end()));
-  
-  // Launch threads with pointer to weak reference.
-  pthread_t threads[HAMMER_MAX_THREADS];
-#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
-  pthread_setconcurrency (HAMMER_MAX_THREADS);
-#endif
-  
-  pthread_attr_t tattr;
-  int ret = pthread_attr_init(&tattr);
-
-  shared_and_weak_pools pools(obj_pool, weak_pool[0]);
-  pthread_create(threads, &tattr, thread_hammer_and_kill, reinterpret_cast<void*>(&pools));
-  for (unsigned int worker = 1; worker < HAMMER_MAX_THREADS; worker++)
-    {
-      if (pthread_create(&threads[worker], &tattr,
-                        thread_hammer, reinterpret_cast<void*>(&weak_pool[worker])))
-       abort();
-    }
-  // Wait for threads to complete, then check integrity of reference.
-  void* status;
-  for (unsigned int worker = 0; worker < HAMMER_MAX_THREADS; worker++)
-    {
-      if (pthread_join(threads[worker], &status))
-       abort();
-    }
-  obj_pool.clear();
-  
-  VERIFY( A::counter == 0 );
-  
-  return 0;
-}
-
-int 
-main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/lock/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/lock/1.cc
deleted file mode 100644 (file)
index 0367b31..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// 2006-09-24  Paolo Carlini  <pcarlini@suse.de>
-
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak]
-
-#include <tr1/memory>
-#include <testsuite_tr1.h>
-
-// { dg-do compile }
-
-int main()
-{
-  using __gnu_test::check_ret_type;
-  using std::tr1::weak_ptr;
-  using std::tr1::shared_ptr;
-
-  weak_ptr<int> wp;
-  check_ret_type<shared_ptr<int> >(wp.lock());
-}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/requirements/explicit_instantiation/1.cc
deleted file mode 100644 (file)
index 6c22459..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2006 Free Software Foundation
-//
-// 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.
-
-// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak]
-
-#include <tr1/memory>
-#include <testsuite_tr1.h>
-
-// { dg-do compile }
-
-using namespace __gnu_test;
-using std::tr1::weak_ptr;
-template class weak_ptr<int>;
-template class weak_ptr<void>;
-template class weak_ptr<ClassType>;
-template class weak_ptr<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/assign.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/assign.cc
new file mode 100644 (file)
index 0000000..93f90ce
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+  }
+};
+
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
+
+// Assignment from shared_ptr<Y>
+void
+test01()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+
+  a = std::tr1::shared_ptr<A>(new A);
+  VERIFY( a.get() != 0 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+
+  a = std::tr1::shared_ptr<A>();
+  VERIFY( a.get() == 0 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 1 );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc
new file mode 100644 (file)
index 0000000..9a36f95
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
+
+// Assignment from auto_ptr<Y>
+int
+test01()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a(new A);
+  std::auto_ptr<B> b(new B);
+  a = b;
+  VERIFY( a.get() != 0 );
+  VERIFY( b.get() == 0 );
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 1 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc
new file mode 100644 (file)
index 0000000..cca1049
--- /dev/null
@@ -0,0 +1,50 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+struct B { };
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
+
+// Assignment from incompatible auto_ptr<Y>
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+  std::auto_ptr<B> b;
+  a = b;                      // { dg-error "here" }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
+// { dg-excess-errors "In constructor" }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc
new file mode 100644 (file)
index 0000000..da02329
--- /dev/null
@@ -0,0 +1,49 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+std::auto_ptr<A> source() { return std::auto_ptr<A>(); }
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
+
+// Assignment from rvalue auto_ptr
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+  a = source(); // { dg-error "no match" }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
+// { dg-excess-errors "candidates are" }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/dr541.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/dr541.cc
new file mode 100644 (file)
index 0000000..f9dc839
--- /dev/null
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+
+// DR 541. shared_ptr template assignment and void
+void test01()
+{
+  std::tr1::shared_ptr<void> p;
+  p.operator=<void>(p);
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr.cc
new file mode 100644 (file)
index 0000000..90ab7ee
--- /dev/null
@@ -0,0 +1,95 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
+
+// Assignment from shared_ptr<Y>
+void
+test01()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+
+  a = std::tr1::shared_ptr<A>();
+  VERIFY( a.get() == 0 );
+  VERIFY( A::ctor_count == 0 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+
+  a = std::tr1::shared_ptr<A>(new A);
+  VERIFY( a.get() != 0 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+
+  a = std::tr1::shared_ptr<B>(new B);
+  VERIFY( a.get() != 0 );
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 1 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc
new file mode 100644 (file)
index 0000000..407cc5b
--- /dev/null
@@ -0,0 +1,52 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+struct B { };
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.assign]
+
+// Assignment from incompatible shared_ptr<Y>
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+  std::tr1::shared_ptr<B> b;
+  a = b;                      // { dg-error "here" }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
+// { dg-error "In member function" "" { target *-*-* } 0 }
+// { dg-error "cannot convert" "" { target *-*-* } 0 }
+// { dg-error "instantiated from" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/casts/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/casts/1.cc
new file mode 100644 (file)
index 0000000..8851f25
--- /dev/null
@@ -0,0 +1,46 @@
+// 2006-09-24  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.3.9 shared_ptr casts [tr.util.smartptr.shared.cast]
+
+#include <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { dg-do compile }
+
+struct MyP { virtual ~MyP() { }; };
+struct MyDP : MyP { };
+
+int main()
+{
+  using __gnu_test::check_ret_type;
+  using std::tr1::shared_ptr;
+  using std::tr1::static_pointer_cast;
+  using std::tr1::const_pointer_cast;
+  using std::tr1::dynamic_pointer_cast;
+
+  shared_ptr<double> spd;
+  shared_ptr<const int> spci;
+  shared_ptr<MyP> spa;
+
+  check_ret_type<shared_ptr<void> >(static_pointer_cast<void>(spd));
+  check_ret_type<shared_ptr<int> >(const_pointer_cast<int>(spci));
+  check_ret_type<shared_ptr<MyDP> >(static_pointer_cast<MyDP>(spa));  
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/comparison/cmp.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/comparison/cmp.cc
new file mode 100644 (file)
index 0000000..15b7b1e
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  virtual ~A() { }
+};
+
+struct B : A
+{
+};
+
+// 2.2.3.6 shared_ptr comparison [tr.util.smartptr.shared.cmp]
+
+int
+test01()
+{
+    // test empty shared_ptrs compare equivalent
+    std::tr1::shared_ptr<A> p1;
+    std::tr1::shared_ptr<B> p2;
+    VERIFY( p1 == p2 );
+    VERIFY( !(p1 != p2) );
+    VERIFY( !(p1 < p2) && !(p2 < p1) );
+    return 0;
+}
+
+
+// Construction from pointer
+int
+test02()
+{
+  std::tr1::shared_ptr<A> A_default;
+
+  std::tr1::shared_ptr<A> A_from_A(new A);
+  VERIFY( A_default != A_from_A );
+  VERIFY( !(A_default == A_from_A) );
+  VERIFY( (A_default < A_from_A) || (A_from_A < A_default) );
+
+  std::tr1::shared_ptr<B> B_from_B(new B);
+  VERIFY( B_from_B != A_from_A );
+  VERIFY( !(B_from_B == A_from_A) );
+  VERIFY( (B_from_B < A_from_A) || (A_from_A < B_from_B) );
+
+  A_from_A.reset();
+  VERIFY( A_default == A_from_A );
+  VERIFY( !(A_default != A_from_A) );
+  VERIFY( !(A_default < A_from_A) && !(A_from_A < A_default) );
+
+  B_from_B.reset();
+  VERIFY( B_from_B == A_from_A );
+  VERIFY( !(B_from_B != A_from_A) );
+  VERIFY( !(B_from_B < A_from_A) && !(A_from_A < B_from_B) );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc
new file mode 100644 (file)
index 0000000..b91c5a2
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
+
+// Construction from auto_ptr
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::auto_ptr<A> a(new A);
+  std::tr1::shared_ptr<A> a2(a);
+  VERIFY( a.get() == 0 );
+  VERIFY( a2.get() != 0 );
+  VERIFY( a2.use_count() == 1 );
+
+  return 0;
+}
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc
new file mode 100644 (file)
index 0000000..c2a3202
--- /dev/null
@@ -0,0 +1,48 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.3 shared_ptr assignment [tr.util.smartptr.shared.const]
+
+// Construction from const auto_ptr
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::auto_ptr<A> a;
+  std::tr1::shared_ptr<A> p(a); // { dg-error "no match" }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
+// { dg-excess-errors "candidates are" }
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/copy.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/copy.cc
new file mode 100644 (file)
index 0000000..cc529e0
--- /dev/null
@@ -0,0 +1,135 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  virtual ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  virtual ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+void deleter(A* p) { delete p; }
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+  }
+};
+
+// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
+
+// Copy construction
+int test01()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a1;
+  std::tr1::shared_ptr<A> a2(a1);
+  VERIFY( a2.use_count() == 0 );
+  VERIFY( A::ctor_count == 0 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int
+test02()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a1(new A);
+  std::tr1::shared_ptr<A> a2(a1);
+  VERIFY( a2.use_count() == 2 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int
+test03()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<B> b(new B);
+  std::tr1::shared_ptr<A> a(b);
+  VERIFY( a.use_count() == 2 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int
+test04()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<B> b(new B, &deleter);
+  std::tr1::shared_ptr<A> a(b);
+  VERIFY( a.use_count() == 2 );
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+
+  return 0;
+}
+
+int
+main()
+{
+  test01();
+  test02();
+  test03();
+  test04();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/default.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/default.cc
new file mode 100644 (file)
index 0000000..641834d
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
+
+// Default construction
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+  VERIFY( a.get() == 0 );
+
+  return 0;
+}
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/pointer.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/pointer.cc
new file mode 100644 (file)
index 0000000..dec0514
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+struct B : A { };
+
+
+// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
+
+// Construction from pointer
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = 0;
+  std::tr1::shared_ptr<A> p(a);
+  VERIFY( p.get() == 0 );
+  VERIFY( p.use_count() == 1 );
+
+  return 0;
+}
+
+int
+test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  std::tr1::shared_ptr<A> p(a);
+  VERIFY( p.get() == a );
+  VERIFY( p.use_count() == 1 );
+
+  return 0;
+}
+
+
+int
+test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  B * const b = new B;
+  std::tr1::shared_ptr<A> p(b);
+  VERIFY( p.get() == b );
+  VERIFY( p.use_count() == 1 );
+
+  return 0;
+}
+
+int
+main()
+{
+  test01();
+  test02();
+  test02();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr.cc
new file mode 100644 (file)
index 0000000..048d93a
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
+
+// Construction from weak_ptr
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  std::tr1::shared_ptr<A> a1(a);
+  std::tr1::weak_ptr<A> wa(a1);
+  std::tr1::shared_ptr<A> a2(wa);
+  VERIFY( a2.get() == a );
+  VERIFY( a2.use_count() == wa.use_count() );
+
+  return 0;
+}
+
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/weak_ptr_expired.cc
new file mode 100644 (file)
index 0000000..d40227a
--- /dev/null
@@ -0,0 +1,61 @@
+// { dg-do run { xfail *-*-* } }
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.1 shared_ptr constructors [tr.util.smartptr.shared.const]
+
+// Construction from expired weak_ptr
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a1(new A);
+  std::tr1::weak_ptr<A> wa(a1);
+  a1.reset();
+  VERIFY( wa.expired() );
+  try
+  {
+    std::tr1::shared_ptr<A> a2(wa);
+  }
+  catch (const std::tr1::bad_weak_ptr&)
+  {
+    // Expected.
+      __throw_exception_again;
+  }
+  catch (...)
+  {
+    // Failed.
+  }
+
+  return 0;
+}
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/dest/dest.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/dest/dest.cc
new file mode 100644 (file)
index 0000000..a632264
--- /dev/null
@@ -0,0 +1,133 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() { ++ctor_count; }
+  ~A() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long A::ctor_count = 0;
+long A::dtor_count = 0;
+
+struct B : A
+{
+  B() { ++ctor_count; }
+  ~B() { ++dtor_count; }
+  static long ctor_count;
+  static long dtor_count;
+};
+long B::ctor_count = 0;
+long B::dtor_count = 0;
+
+struct D
+{
+  void operator()(const B* p) { delete p; ++delete_count; }
+  static long delete_count;
+};
+long D::delete_count = 0;
+
+struct reset_count_struct
+{
+  ~reset_count_struct()
+  {
+    A::ctor_count = 0;
+    A::dtor_count = 0;
+    B::ctor_count = 0;
+    B::dtor_count = 0;
+    D::delete_count = 0;
+  }
+};
+
+
+// 2.2.3.2 shared_ptr destructor [tr.util.smartptr.shared.dest]
+
+// empty shared_ptr
+int
+test01()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  {
+    std::tr1::shared_ptr<A> a;
+  }
+  VERIFY( A::ctor_count == 0 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 0 );
+  VERIFY( B::dtor_count == 0 );
+  VERIFY( D::delete_count == 0 );
+
+  return 0;
+}
+
+// shared ownership
+int
+test02()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> a;
+  {
+    a = std::tr1::shared_ptr<A>(new B, D());
+  }
+  VERIFY( A::ctor_count == 1 );
+  VERIFY( A::dtor_count == 0 );
+  VERIFY( B::ctor_count == 1 );
+  VERIFY( B::dtor_count == 0 );
+  VERIFY( D::delete_count == 0 );
+
+  return 0;
+}
+
+// exclusive ownership
+int
+test03()
+{
+  reset_count_struct __attribute__((unused)) reset;
+  bool test __attribute__((unused)) = true;
+
+  {
+    std::tr1::shared_ptr<A> a1(new B);
+    std::tr1::shared_ptr<A> a2(new B, D());
+  }
+  VERIFY( A::ctor_count == 2 );
+  VERIFY( A::dtor_count == 2 );
+  VERIFY( B::ctor_count == 2 );
+  VERIFY( B::dtor_count == 2 );
+  VERIFY( D::delete_count == 1 );
+
+  return 0;
+}
+
+
+int
+main()
+{
+  test01();
+  test02();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/24595.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/24595.cc
new file mode 100644 (file)
index 0000000..71cbd0b
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+using std::tr1::get_deleter;
+
+// libstdc++/24595
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<int> sp;
+  VERIFY( !get_deleter<void(*)(int*)>(sp) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/io.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/io.cc
new file mode 100644 (file)
index 0000000..51de755
--- /dev/null
@@ -0,0 +1,51 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.7 shared_ptr I/O [tr.util.smartptr.shared.io]
+
+// operator<<
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p(new A);
+  std::ostringstream buf;
+  buf << p;
+  const std::string s = buf.str();
+  buf.str("");
+  buf << p.get();
+  VERIFY( s == buf.str() );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/swap.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/misc/swap.cc
new file mode 100644 (file)
index 0000000..c22b2f8
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.8 shared_ptr specialized algorithms [tr.util.smartptr.shared.spec]
+
+// std::swap
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a1 = new A;
+  A * const a2 = new A;
+  std::tr1::shared_ptr<A> p1(a1);
+  std::tr1::shared_ptr<A> p2(a2);
+  std::swap(p1, p2);
+  VERIFY( p1.get() == a2 );
+  VERIFY( p2.get() == a1 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/24805.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/24805.cc
new file mode 100644 (file)
index 0000000..94824f6
--- /dev/null
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+
+// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
+
+// swap
+
+// libstdc++/24805
+using std::tr1::swap;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset.cc
new file mode 100644 (file)
index 0000000..244a9f2
--- /dev/null
@@ -0,0 +1,88 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+struct B : A { };
+struct D
+{
+  void operator()(B* p) { delete p; ++delete_count; }
+  static long delete_count;
+};
+long D::delete_count = 0;
+
+// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
+
+// reset
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  std::tr1::shared_ptr<A> p1(a);
+  std::tr1::shared_ptr<A> p2(p1);
+  p1.reset();
+  VERIFY( p1.get() == 0 );
+  VERIFY( p2.get() == a );
+
+  return 0;
+}
+
+int
+test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  B * const b = new B;
+  std::tr1::shared_ptr<A> p1(a);
+  std::tr1::shared_ptr<A> p2(p1);
+  p1.reset(b);
+  VERIFY( p1.get() == b );
+  VERIFY( p2.get() == a );
+
+  return 0;
+}
+
+int
+test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  {
+    std::tr1::shared_ptr<A> p1;
+    p1.reset(new B, D());
+  }
+  VERIFY( D::delete_count == 1 );
+
+  return 0;
+}   
+
+int
+main()
+{
+  test01();
+  test02();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/reset_neg.cc
new file mode 100644 (file)
index 0000000..136d2b7
--- /dev/null
@@ -0,0 +1,47 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
+
+// reset
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::tr1::shared_ptr<A> p1(new A);
+  p1.reset();     // { dg-error "discards qualifiers" }
+
+  return 0;
+}
+
+int
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap.cc
new file mode 100644 (file)
index 0000000..eb251b5
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
+
+// swap
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a1 = new A;
+  A * const a2 = new A;
+  std::tr1::shared_ptr<A> p1(a1);
+  std::tr1::shared_ptr<A> p2(a2);
+  p1.swap(p2);
+  VERIFY( p1.get() == a2 );
+  VERIFY( p2.get() == a1 );
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/modifiers/swap_neg.cc
new file mode 100644 (file)
index 0000000..606d8e3
--- /dev/null
@@ -0,0 +1,48 @@
+// { dg-do compile }
+
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.4 shared_ptr modifiers [tr.util.smartptr.shared.mod]
+
+// swap
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::tr1::shared_ptr<A> p1(new A);
+  std::tr1::shared_ptr<A> p2(new A);
+  p1.swap(p2);   // { dg-error "discards qualifiers" }
+
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc
new file mode 100644 (file)
index 0000000..9455884
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
+
+// conversion to bool
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::tr1::shared_ptr<A> p1;
+  VERIFY( p1 == false );
+  const std::tr1::shared_ptr<A> p2(p1);
+  VERIFY( p2 == false );
+
+  return 0;
+}
+
+int
+test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p1(new A);
+  VERIFY( p1 );
+  std::tr1::shared_ptr<A> p2(p1);
+  VERIFY( p2 );
+  p1.reset();
+  VERIFY( !p1 );
+  VERIFY( p2 );
+
+  return 0;
+}
+
+int
+test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p1(new A);
+  std::tr1::shared_ptr<A> p2(p1);
+  p2.reset(new A);
+  VERIFY( p1 );
+  VERIFY( p2 );
+
+  return 0;
+}
+
+
+int 
+main()
+{
+  test01();
+  test02();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/get.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/get.cc
new file mode 100644 (file)
index 0000000..d85ec66
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A
+{
+  A() : i() {}
+  int i;
+};
+
+// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
+
+// get
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  const std::tr1::shared_ptr<A> p(a);
+  VERIFY( p.get() == a );
+
+  return 0;
+}
+
+// operator*
+int
+test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  const std::tr1::shared_ptr<A> p(a);
+  VERIFY( &*p == a );
+
+  return 0;
+}
+
+
+// operator->
+int
+test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  A * const a = new A;
+  const std::tr1::shared_ptr<A> p(a);
+  VERIFY( &p->i == &a->i );
+
+  return 0;
+}
+
+
+int 
+main()
+{
+  test01();
+  test02();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/unique.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/unique.cc
new file mode 100644 (file)
index 0000000..81253e4
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+
+// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
+
+// unique
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::tr1::shared_ptr<A> p1;
+  VERIFY( !p1.unique() );
+  const std::tr1::shared_ptr<A> p2(p1);
+  VERIFY( !p1.unique() );
+
+  return 0;
+}
+
+int
+test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p1(new A);
+  VERIFY( p1.unique() );
+  std::tr1::shared_ptr<A> p2(p1);
+  VERIFY( !p1.unique() );
+  p1.reset();
+  VERIFY( !p1.unique() );
+  VERIFY( p2.unique() );
+
+  return 0;
+}
+
+int
+test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p1(new A);
+  std::tr1::shared_ptr<A> p2(p1);
+  p2.reset(new A);
+  VERIFY( p1.unique() );
+  VERIFY( p2.unique() );
+
+  return 0;
+}
+
+
+int 
+main()
+{
+  test01();
+  test02();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/use_count.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/use_count.cc
new file mode 100644 (file)
index 0000000..85f1850
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright (C) 2005 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_hooks.h>
+
+struct A { };
+struct B : A { };
+
+// 2.2.3.5 shared_ptr observers [tr.util.smartptr.shared.obs]
+
+// use_count
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const std::tr1::shared_ptr<A> p1;
+  VERIFY( p1.use_count() == 0 );
+  const std::tr1::shared_ptr<A> p2(p1);
+  VERIFY( p1.use_count() == 0 );
+
+  return 0;
+}
+
+int
+test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p1(new A);
+  std::tr1::shared_ptr<A> p2(p1);
+  p1.reset();
+  VERIFY( p1.use_count() == 0 );
+  VERIFY( p2.use_count() == 1 );
+
+  return 0;
+}
+
+int
+test03()
+{
+  bool test __attribute__((unused)) = true;
+
+  std::tr1::shared_ptr<A> p1(new A);
+  std::tr1::shared_ptr<A> p2(p1);
+  p2.reset(new B);
+  VERIFY( p1.use_count() == 1 );
+  VERIFY( p2.use_count() == 1 );
+
+  return 0;
+}
+
+
+int 
+main()
+{
+  test01();
+  test02();
+  test03();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..015e22e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+#include <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { dg-do compile }
+
+using namespace __gnu_test;
+using std::tr1::shared_ptr;
+template class shared_ptr<int>;
+template class shared_ptr<void>;
+template class shared_ptr<ClassType>;
+template class shared_ptr<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc
new file mode 100644 (file)
index 0000000..5b17500
--- /dev/null
@@ -0,0 +1,193 @@
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
+// { dg-options "-pthreads" { target *-*-solaris* } }
+
+#include <tr1/memory>
+#include <tr1/random>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <iostream>
+
+#include <pthread.h>
+
+#ifdef _GLIBCXX_HAVE_UNISTD_H
+#include <unistd.h>    // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
+#endif
+
+/* This (brute-force) tests the atomicity and thus thread safety of the
+ * shared_ptr <- weak_ptr
+ * assignment operation by allocating a test object, retrieving a weak
+ * reference to it, and letting a number of threads repeatedly create strong
+ * references from the weak reference.
+ * Specifically, this tests the function _Sp_counted_base<true>::add_ref_lock()
+ */
+
+
+const unsigned int HAMMER_MAX_THREADS = 10;
+const unsigned int POOL_SIZE = 1000;
+const unsigned long HAMMER_REPEAT = 100000;
+const unsigned long KILL_ONE_IN = 1000;
+
+struct A
+  {
+    static _Atomic_word counter;
+    A()
+      {
+       __gnu_cxx::__atomic_add(&counter, 1);
+      }
+    ~A()
+      {
+       __gnu_cxx::__atomic_add(&counter, -1);
+      }
+  };
+
+_Atomic_word A::counter = 0;
+
+typedef std::tr1::shared_ptr<A> sp_A_t;
+typedef std::tr1::weak_ptr<A> wp_A_t;
+
+typedef std::vector<sp_A_t> sp_vector_t;
+typedef std::vector<wp_A_t> wp_vector_t;
+
+struct shared_and_weak_pools
+{
+  sp_vector_t& shared_pool;
+  wp_vector_t& weak_pool;
+  
+  shared_and_weak_pools(sp_vector_t& _shared_pool, wp_vector_t& _weak_pool)
+    : shared_pool(_shared_pool), weak_pool(_weak_pool)
+    { }
+};
+
+void* thread_hammer_and_kill(void* opaque_pools)
+{
+  shared_and_weak_pools& pools = *reinterpret_cast<shared_and_weak_pools*>(opaque_pools);
+  // Using the same parameters as in the RNG test cases.
+  std::tr1::mersenne_twister<
+    unsigned long, 32, 624, 397, 31,
+    0x9908b0dful, 11, 7,
+    0x9d2c5680ul, 15,
+    0xefc60000ul, 18> rng;
+  
+  sp_vector_t::iterator cur_shared = pools.shared_pool.begin();
+  wp_vector_t::iterator cur_weak = pools.weak_pool.begin();
+  
+  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
+    {
+      try
+      {
+        sp_A_t strong(*cur_weak);
+      }
+      catch (std::tr1::bad_weak_ptr& exception)
+      {
+        ++cur_weak;
+        if (cur_weak == pools.weak_pool.end())
+          break;
+      }
+      
+      if (rng() % KILL_ONE_IN == 0)
+      {
+        cur_shared->reset();
+        ++cur_shared;
+      }
+    }
+  return 0;
+}
+
+void* thread_hammer(void* opaque_weak)
+{
+  wp_vector_t& weak_pool = *reinterpret_cast<wp_vector_t*>(opaque_weak);
+  // Using the same parameters as in the RNG test cases.
+  std::tr1::mersenne_twister<
+    unsigned long, 32, 624, 397, 31,
+    0x9908b0dful, 11, 7,
+    0x9d2c5680ul, 15,
+    0xefc60000ul, 18> rng;
+  wp_vector_t::iterator cur_weak = weak_pool.begin();
+
+  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
+    {
+      try
+      {
+        sp_A_t strong(*cur_weak);
+      }
+      catch (std::tr1::bad_weak_ptr& exception)
+      {
+        ++cur_weak;
+        if (cur_weak == weak_pool.end())
+          break;
+      }
+    }
+  return 0;
+}
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+  sp_vector_t obj_pool(POOL_SIZE);
+  
+  for(sp_vector_t::iterator cur = obj_pool.begin(); cur != obj_pool.end(); ++cur)
+  {
+    cur->reset(new A);
+  }
+  // Obtain weak references.
+  std::vector<wp_vector_t> weak_pool(HAMMER_MAX_THREADS, wp_vector_t(obj_pool.begin(), obj_pool.end()));
+  
+  // Launch threads with pointer to weak reference.
+  pthread_t threads[HAMMER_MAX_THREADS];
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
+  pthread_setconcurrency (HAMMER_MAX_THREADS);
+#endif
+  
+  pthread_attr_t tattr;
+  int ret = pthread_attr_init(&tattr);
+
+  shared_and_weak_pools pools(obj_pool, weak_pool[0]);
+  pthread_create(threads, &tattr, thread_hammer_and_kill, reinterpret_cast<void*>(&pools));
+  for (unsigned int worker = 1; worker < HAMMER_MAX_THREADS; worker++)
+    {
+      if (pthread_create(&threads[worker], &tattr,
+                        thread_hammer, reinterpret_cast<void*>(&weak_pool[worker])))
+       abort();
+    }
+  // Wait for threads to complete, then check integrity of reference.
+  void* status;
+  for (unsigned int worker = 0; worker < HAMMER_MAX_THREADS; worker++)
+    {
+      if (pthread_join(threads[worker], &status))
+       abort();
+    }
+  obj_pool.clear();
+  
+  VERIFY( A::counter == 0 );
+  
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc
new file mode 100644 (file)
index 0000000..370218a
--- /dev/null
@@ -0,0 +1,195 @@
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
+
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* } }
+// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* } }
+// { dg-options "-pthreads" { target *-*-solaris* } }
+
+#include <tr1/memory>
+#include <tr1/random>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <iostream>
+
+#include <pthread.h>
+
+#ifdef _GLIBCXX_HAVE_UNISTD_H
+#include <unistd.h>    // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
+#endif
+
+/* This (brute-force) tests the atomicity and thus thread safety of the
+ * shared_ptr <- weak_ptr
+ * assignment operation by allocating a test object, retrieving a weak
+ * reference to it, and letting a number of threads repeatedly create strong
+ * references from the weak reference.
+ * Specifically, this tests the function _Sp_counted_base<true>::add_ref_lock()
+ */
+
+
+const unsigned int HAMMER_MAX_THREADS = 10;
+const unsigned int POOL_SIZE = 1000;
+const unsigned long HAMMER_REPEAT = 100000;
+const unsigned long KILL_ONE_IN = 1000;
+
+struct A
+  {
+    static _Atomic_word counter;
+    A()
+      {
+       __gnu_cxx::__atomic_add(&counter, 1);
+      }
+    ~A()
+      {
+       __gnu_cxx::__atomic_add(&counter, -1);
+      }
+  };
+
+_Atomic_word A::counter = 0;
+
+using std::tr1::_S_mutex;
+
+typedef std::tr1::__shared_ptr<A, _S_mutex> sp_A_t;
+typedef std::tr1::__weak_ptr<A, _S_mutex> wp_A_t;
+
+typedef std::vector<sp_A_t> sp_vector_t;
+typedef std::vector<wp_A_t> wp_vector_t;
+
+struct shared_and_weak_pools
+{
+  sp_vector_t& shared_pool;
+  wp_vector_t& weak_pool;
+  
+  shared_and_weak_pools(sp_vector_t& _shared_pool, wp_vector_t& _weak_pool)
+    : shared_pool(_shared_pool), weak_pool(_weak_pool)
+    { }
+};
+
+void* thread_hammer_and_kill(void* opaque_pools)
+{
+  shared_and_weak_pools& pools = *reinterpret_cast<shared_and_weak_pools*>(opaque_pools);
+  // Using the same parameters as in the RNG test cases.
+  std::tr1::mersenne_twister<
+    unsigned long, 32, 624, 397, 31,
+    0x9908b0dful, 11, 7,
+    0x9d2c5680ul, 15,
+    0xefc60000ul, 18> rng;
+  
+  sp_vector_t::iterator cur_shared = pools.shared_pool.begin();
+  wp_vector_t::iterator cur_weak = pools.weak_pool.begin();
+  
+  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
+    {
+      try
+      {
+        sp_A_t strong(*cur_weak);
+      }
+      catch (std::tr1::bad_weak_ptr& exception)
+      {
+        ++cur_weak;
+        if (cur_weak == pools.weak_pool.end())
+          break;
+      }
+      
+      if (rng() % KILL_ONE_IN == 0)
+      {
+        cur_shared->reset();
+        ++cur_shared;
+      }
+    }
+  return 0;
+}
+
+void* thread_hammer(void* opaque_weak)
+{
+  wp_vector_t& weak_pool = *reinterpret_cast<wp_vector_t*>(opaque_weak);
+  // Using the same parameters as in the RNG test cases.
+  std::tr1::mersenne_twister<
+    unsigned long, 32, 624, 397, 31,
+    0x9908b0dful, 11, 7,
+    0x9d2c5680ul, 15,
+    0xefc60000ul, 18> rng;
+  wp_vector_t::iterator cur_weak = weak_pool.begin();
+
+  for (unsigned int i = 0; i < HAMMER_REPEAT; ++i)
+    {
+      try
+      {
+        sp_A_t strong(*cur_weak);
+      }
+      catch (std::tr1::bad_weak_ptr& exception)
+      {
+        ++cur_weak;
+        if (cur_weak == weak_pool.end())
+          break;
+      }
+    }
+  return 0;
+}
+
+int
+test01()
+{
+  bool test __attribute__((unused)) = true;
+  sp_vector_t obj_pool(POOL_SIZE);
+  
+  for(sp_vector_t::iterator cur = obj_pool.begin(); cur != obj_pool.end(); ++cur)
+  {
+    cur->reset(new A);
+  }
+  // Obtain weak references.
+  std::vector<wp_vector_t> weak_pool(HAMMER_MAX_THREADS, wp_vector_t(obj_pool.begin(), obj_pool.end()));
+  
+  // Launch threads with pointer to weak reference.
+  pthread_t threads[HAMMER_MAX_THREADS];
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
+  pthread_setconcurrency (HAMMER_MAX_THREADS);
+#endif
+  
+  pthread_attr_t tattr;
+  int ret = pthread_attr_init(&tattr);
+
+  shared_and_weak_pools pools(obj_pool, weak_pool[0]);
+  pthread_create(threads, &tattr, thread_hammer_and_kill, reinterpret_cast<void*>(&pools));
+  for (unsigned int worker = 1; worker < HAMMER_MAX_THREADS; worker++)
+    {
+      if (pthread_create(&threads[worker], &tattr,
+                        thread_hammer, reinterpret_cast<void*>(&weak_pool[worker])))
+       abort();
+    }
+  // Wait for threads to complete, then check integrity of reference.
+  void* status;
+  for (unsigned int worker = 0; worker < HAMMER_MAX_THREADS; worker++)
+    {
+      if (pthread_join(threads[worker], &status))
+       abort();
+    }
+  obj_pool.clear();
+  
+  VERIFY( A::counter == 0 );
+  
+  return 0;
+}
+
+int 
+main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/lock/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/lock/1.cc
new file mode 100644 (file)
index 0000000..0367b31
--- /dev/null
@@ -0,0 +1,36 @@
+// 2006-09-24  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak]
+
+#include <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { dg-do compile }
+
+int main()
+{
+  using __gnu_test::check_ret_type;
+  using std::tr1::weak_ptr;
+  using std::tr1::shared_ptr;
+
+  weak_ptr<int> wp;
+  check_ret_type<shared_ptr<int> >(wp.lock());
+}
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/1.cc
new file mode 100644 (file)
index 0000000..6c22459
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2006 Free Software Foundation
+//
+// 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.
+
+// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak]
+
+#include <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { dg-do compile }
+
+using namespace __gnu_test;
+using std::tr1::weak_ptr;
+template class weak_ptr<int>;
+template class weak_ptr<void>;
+template class weak_ptr<ClassType>;
+template class weak_ptr<IncompleteClass>;