diff options
Diffstat (limited to 'libstdc++-v3/testsuite')
25 files changed, 120 insertions, 32 deletions
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc index 24b73333744..b8643e08c3f 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc @@ -1,6 +1,6 @@ // 2003-05-04 Paolo Carlini <pcarlini@unitus.it> -// Copyright (C) 2003 Free Software Foundation, Inc. +// Copyright (C) 2003, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -63,7 +63,7 @@ bool test03(void) // size_type find_first_not_of(const char* s, size_type pos, size_type n) const; csz01 = str01.find_first_not_of(str_lit01, 0, 0); VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str_lit01, 0, 10); + csz01 = str01.find_first_not_of(str_lit01, 0, 8); VERIFY( csz01 == 8 ); csz01 = str01.find_first_not_of(str_lit01, 10, 0); VERIFY( csz01 == 10 ); diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc index 6964e013f30..dd27c438063 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc @@ -1,6 +1,6 @@ // 2003-05-04 Paolo Carlini <pcarlini@unitus.it> -// Copyright (C) 2003 Free Software Foundation, Inc. +// Copyright (C) 2003, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -63,7 +63,7 @@ bool test03(void) // size_type find_first_not_of(const char* s, size_type pos, size_type n) const; csz01 = str01.find_first_not_of(str_lit01, 0, 0); VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str_lit01, 0, 10); + csz01 = str01.find_first_not_of(str_lit01, 0, 8); VERIFY( csz01 == 8 ); csz01 = str01.find_first_not_of(str_lit01, 10, 0); VERIFY( csz01 == 10 ); diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc index 28c96055aef..c4a95b6cd81 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc @@ -19,6 +19,7 @@ // USA. // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc index 7c2cbca5e63..6819fa5411a 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc index 055abe4e2c0..f7c1cc06f1e 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc index 766ec03f89a..4fac2729585 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc index 7c2cbca5e63..6819fa5411a 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc index 055abe4e2c0..f7c1cc06f1e 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc index 0373c35b1c9..a52899b7625 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc index 8a0a5570c16..c3286289cc5 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc index bcfc10f0aff..b8bb537555a 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc @@ -21,6 +21,7 @@ // 22.2.4.1.1 collate members // { dg-do run } +// { dg-xfail-if "" { "*-*-hpux11.23" } { "*" } { "" } } */ // { dg-options "-finput-charset=ISO8859-1" } // { dg-require-iconv "ISO8859-1" } diff --git a/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc index 69487473f3d..79486191766 100644 --- a/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc +++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2004 Free Software Foundation, Inc. +// 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 @@ -33,7 +33,6 @@ #include <set> #include <sstream> -#include <testsuite_performance.h> using namespace std; diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc index dcb89a6dfa2..cbc4c7ac109 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -40,9 +40,10 @@ void test01() ifs1.open(name_01); VERIFY( ifs1.is_open() ); - // fail bit still true - VERIFY( !(ifs1) ); - VERIFY( ifs1.rdstate() == std::ios_base::failbit ); + + // As per the resolution of DR 409. + VERIFY( (ifs1) ); + VERIFY( ifs1.rdstate() == std::ios_base::goodbit ); ifs1.close(); } diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc index 5bb02d4eb3c..64b9e342c38 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -41,9 +41,10 @@ void test01() ofs1.open(name_02); VERIFY( ofs1.is_open() ); - // fail bit still true - VERIFY( !(ofs1) ); - VERIFY( ofs1.rdstate() == std::ios_base::failbit ); + + // As per the resolution of DR 409. + VERIFY( (ofs1) ); + VERIFY( ofs1.rdstate() == std::ios_base::goodbit ); ofs1.close(); } diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc index 626d45c9f35..978ae203cd8 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc @@ -33,8 +33,8 @@ test03(void) typedef wios::pos_type pos_type; - const char* TEST_IN = "wostream_inserter_other_in"; - const char* TEST_OUT = "wostream_inserter_other_out"; + const char* TEST_IN = "wostream_inserter_other_in.txt"; + const char* TEST_OUT = "wostream_inserter_other_out.txt"; pos_type i_read, i_wrote, rs, ws; double tf_size = BUFSIZ * 2.5; ofstream testfile(TEST_IN); diff --git a/libstdc++-v3/testsuite/testsuite_abi.cc b/libstdc++-v3/testsuite/testsuite_abi.cc index 1120c7d3399..4b9534fb339 100644 --- a/libstdc++-v3/testsuite/testsuite_abi.cc +++ b/libstdc++-v3/testsuite/testsuite_abi.cc @@ -169,6 +169,7 @@ check_version(const symbol& test, bool added) known_versions.push_back("CXXABI_1.2"); known_versions.push_back("CXXABI_1.2.1"); known_versions.push_back("CXXABI_1.3"); + known_versions.push_back("CXXABI_1.3.1"); } compat_list::iterator begin = known_versions.begin(); compat_list::iterator end = known_versions.end(); diff --git a/libstdc++-v3/testsuite/testsuite_tr1.h b/libstdc++-v3/testsuite/testsuite_tr1.h index 74a187666fd..ea6affb37c1 100644 --- a/libstdc++-v3/testsuite/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/testsuite_tr1.h @@ -32,10 +32,10 @@ #define _GLIBCXX_TESTSUITE_TR1_H namespace __gnu_test -{ +{ // For tr1/type_traits. template<template<typename> class Category, - typename Type> + typename Type> bool test_category(bool value) { @@ -52,7 +52,7 @@ namespace __gnu_test } template<template<typename> class Property, - typename Type> + typename Type> bool test_property(typename Property<Type>::value_type value) { @@ -63,7 +63,7 @@ namespace __gnu_test } template<template<typename> class Property, - typename Type> + typename Type> bool test_copy_property(bool value) { @@ -80,7 +80,7 @@ namespace __gnu_test } template<template<typename> class Property, - typename Type> + typename Type> bool test_assign_property(bool value) { @@ -97,7 +97,7 @@ namespace __gnu_test } template<template<typename, typename> class Relationship, - typename Type1, typename Type2> + typename Type1, typename Type2> bool test_relationship(bool value) { @@ -113,14 +113,90 @@ namespace __gnu_test typedef volatile ClassType vClassType; typedef const volatile ClassType cvClassType; + class DerivedType : public ClassType { }; + enum EnumType { }; struct ConvType { operator int() const; }; class AbstractClass - { virtual void rotate(int) = 0; }; - -}; // namespace __gnu_test + { + virtual void rotate(int) = 0; + virtual ~AbstractClass(); + }; + + class PolymorphicClass + { + virtual void rotate(int); + virtual ~PolymorphicClass(); + }; + + class DerivedPolymorphic : public PolymorphicClass { }; + + union UnionType { }; + + + int truncate_float(float x) { return (int)x; } + long truncate_double(double x) { return (long)x; } + + struct do_truncate_float_t + { + do_truncate_float_t() + { + ++live_objects; + } + + do_truncate_float_t(const do_truncate_float_t&) + { + ++live_objects; + } + + ~do_truncate_float_t() + { + --live_objects; + } + + int operator()(float x) { return (int)x; } + + static int live_objects; + }; + + int do_truncate_float_t::live_objects = 0; + + struct do_truncate_double_t + { + do_truncate_double_t() + { + ++live_objects; + } + + do_truncate_double_t(const do_truncate_double_t&) + { + ++live_objects; + } + + ~do_truncate_double_t() + { + --live_objects; + } + + long operator()(double x) { return (long)x; } + + static int live_objects; + }; + + int do_truncate_double_t::live_objects = 0; + + struct X + { + int bar; + + int foo() { return 1; } + int foo_c() const { return 2; } + int foo_v() volatile { return 3; } + int foo_cv() const volatile { return 4; } + }; +} // namespace __gnu_test #endif // _GLIBCXX_TESTSUITE_TR1_H diff --git a/libstdc++-v3/testsuite/thread/pthread1.cc b/libstdc++-v3/testsuite/thread/pthread1.cc index 26d198a755e..f83e20595af 100644 --- a/libstdc++-v3/testsuite/thread/pthread1.cc +++ b/libstdc++-v3/testsuite/thread/pthread1.cc @@ -111,7 +111,7 @@ main () task_queue* tq[thread_pairs]; -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (thread_pairs * 2); #endif diff --git a/libstdc++-v3/testsuite/thread/pthread2.cc b/libstdc++-v3/testsuite/thread/pthread2.cc index 7a0efd067a2..84485165cd2 100644 --- a/libstdc++-v3/testsuite/thread/pthread2.cc +++ b/libstdc++-v3/testsuite/thread/pthread2.cc @@ -48,7 +48,7 @@ main() { pthread_t tid[max_thread_count]; -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (max_thread_count); #endif diff --git a/libstdc++-v3/testsuite/thread/pthread3.cc b/libstdc++-v3/testsuite/thread/pthread3.cc index 4696fb76cdc..23f4e04e180 100644 --- a/libstdc++-v3/testsuite/thread/pthread3.cc +++ b/libstdc++-v3/testsuite/thread/pthread3.cc @@ -45,7 +45,7 @@ main() { pthread_t tid[max_thread_count]; -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (max_thread_count); #endif diff --git a/libstdc++-v3/testsuite/thread/pthread4.cc b/libstdc++-v3/testsuite/thread/pthread4.cc index a9ec9b84e38..b58445fb68e 100644 --- a/libstdc++-v3/testsuite/thread/pthread4.cc +++ b/libstdc++-v3/testsuite/thread/pthread4.cc @@ -98,7 +98,7 @@ template class __gnu_cxx::__mt_alloc<std::_List_node<std::string> >; int main (void) { -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (2); #endif diff --git a/libstdc++-v3/testsuite/thread/pthread5.cc b/libstdc++-v3/testsuite/thread/pthread5.cc index 93f03a22761..30086d4584d 100644 --- a/libstdc++-v3/testsuite/thread/pthread5.cc +++ b/libstdc++-v3/testsuite/thread/pthread5.cc @@ -100,7 +100,7 @@ main () int ids[NTHREADS]; void* status; -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (NTHREADS); #endif diff --git a/libstdc++-v3/testsuite/thread/pthread6.cc b/libstdc++-v3/testsuite/thread/pthread6.cc index ba8c341c3f8..44b2b897146 100644 --- a/libstdc++-v3/testsuite/thread/pthread6.cc +++ b/libstdc++-v3/testsuite/thread/pthread6.cc @@ -80,7 +80,7 @@ main (void) { pthread_t tid[max_thread_count]; -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (max_thread_count); #endif diff --git a/libstdc++-v3/testsuite/thread/pthread7-rope.cc b/libstdc++-v3/testsuite/thread/pthread7-rope.cc index 307973c202d..3f5a338d086 100644 --- a/libstdc++-v3/testsuite/thread/pthread7-rope.cc +++ b/libstdc++-v3/testsuite/thread/pthread7-rope.cc @@ -68,7 +68,7 @@ main() pthread_t tid[max_thread_count]; -#if defined(__sun) && defined(__svr4__) +#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 pthread_setconcurrency (max_thread_count); #endif diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc index 4bbda75280b..1c8d64dca4d 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc @@ -41,6 +41,7 @@ void test01() VERIFY( (test_category<is_function, const void>(false)) ); VERIFY( (test_category<is_function, AbstractClass>(false)) ); + VERIFY( (test_category<is_function, int(&)(int)>(false)) ); // Sanity check. VERIFY( (test_category<is_function, ClassType>(false)) ); |