diff options
Diffstat (limited to 'gcc-4.9/libstdc++-v3/testsuite')
8 files changed, 180 insertions, 8 deletions
diff --git a/gcc-4.9/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc b/gcc-4.9/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc new file mode 100644 index 000000000..19f8fd23f --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc @@ -0,0 +1,46 @@ +// { dg-options "-std=gnu++11" } +// { dg-require-atomic-builtins "" } + +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// PR libstdc++/60612 + +#include <exception> +#include <stdlib.h> + +#ifdef _GLIBCXX_USE_C99 +void terminate() { _Exit(0); } + +void f() noexcept +{ + try { + throw 1; + } catch (...) { + std::set_terminate(terminate); + std::rethrow_exception(std::current_exception()); + } +} +#endif + +int main() +{ +#ifdef _GLIBCXX_USE_C99 + f(); +#endif + return 0; +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc b/gcc-4.9/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc new file mode 100644 index 000000000..708f7486b --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc @@ -0,0 +1,45 @@ +// { dg-options "-std=gnu++11" } +// { dg-require-atomic-builtins "" } + +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// PR libstdc++/60612 + +#include <exception> +#include <stdlib.h> + +#ifdef _GLIBCXX_USE_C99 +void unexpected() { _Exit(0); } + +void f() throw() +{ + try { + throw 1; + } catch (...) { + std::set_unexpected(unexpected); + std::rethrow_exception(std::current_exception()); + } +} +#endif + +int main() +{ +#ifdef _GLIBCXX_USE_C99 + f(); +#endif +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/exchange/1.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/exchange/1.cc index 923920edd..2f8825d1e 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/exchange/1.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/exchange/1.cc @@ -78,8 +78,8 @@ void test04() To() = default; To(const To&) = default; To(const From&) = delete; - To& operator=(const From&) { value = 1; } - To& operator=(From&&) { value = 2; } + To& operator=(const From&) { value = 1; return *this; } + To& operator=(From&&) { value = 2; return *this; } }; To t; diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/pair/40925.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/pair/40925.cc index 599fd3875..5b34a626e 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/pair/40925.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/pair/40925.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } // { dg-do compile } // Copyright (C) 2009-2014 Free Software Foundation, Inc. @@ -63,5 +63,5 @@ void test01() std::pair<move_only, int*> p15(move_only(), ip); std::pair<move_only, int X::*> p16(move_only(), mp); - std::pair<move_only, move_only> p17(move_only(), move_only()); + std::pair<move_only, move_only> p17{move_only(), move_only()}; } diff --git a/gcc-4.9/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc b/gcc-4.9/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc index e40717ba1..d42caa54e 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/22_locale/codecvt_byname/50714.cc @@ -52,12 +52,12 @@ namespace std template<> int - codecvt<mychar, char, mbstate_t>::do_encoding() const + codecvt<mychar, char, mbstate_t>::do_encoding() const throw() { return 0; } template<> bool - codecvt<mychar, char, mbstate_t>::do_always_noconv() const + codecvt<mychar, char, mbstate_t>::do_always_noconv() const throw() { return false; } template<> @@ -69,7 +69,7 @@ namespace std template<> int - codecvt<mychar, char, mbstate_t>::do_max_length() const + codecvt<mychar, char, mbstate_t>::do_max_length() const throw() { return 4; } } diff --git a/gcc-4.9/libstdc++-v3/testsuite/27_io/manipulators/standard/char/60270.cc b/gcc-4.9/libstdc++-v3/testsuite/27_io/manipulators/standard/char/60270.cc new file mode 100644 index 000000000..b2b213b52 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/27_io/manipulators/standard/char/60270.cc @@ -0,0 +1,38 @@ +// { dg-do run } +// { dg-options "-std=gnu++14" } + +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// 27.7.6 - Quoted manipulators [quoted.manip] + +// libstdc++/60270 + +#include <string> +#include <sstream> +#include <iomanip> +#include <testsuite_hooks.h> + +int main() +{ + std::istringstream in; + std::string s = "xxx"; + in >> s; + VERIFY( !s.empty() ); + in >> std::quoted(s); + VERIFY( !s.empty() ); +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/29_atomics/atomic/60658.cc b/gcc-4.9/libstdc++-v3/testsuite/29_atomics/atomic/60658.cc new file mode 100644 index 000000000..5634085ad --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/29_atomics/atomic/60658.cc @@ -0,0 +1,43 @@ +// { dg-require-atomic-builtins "" } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <atomic> +#include <testsuite_hooks.h> + +// libstdc++/60658 + +struct Foo { + char buf[1]; +}; + +struct Bar { + char buf[100]; +}; + +int +main () +{ + bool test __attribute__((unused)) = true; + + std::atomic<Foo*> a; + std::atomic<Bar*> b; + + VERIFY (a.is_lock_free() == b.is_lock_free()); +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc b/gcc-4.9/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc index 3e30d4183..924271826 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/30_threads/condition_variable/54185.cc @@ -1,4 +1,4 @@ -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } } +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-darwin1[1-9]* powerpc-ibm-aix* } } // { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-gnu* powerpc-ibm-aix* } } // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } |