From: Benjamin Kosnik Date: Sat, 21 Feb 2009 03:56:21 +0000 (+0000) Subject: this_thread: Move... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e0bdc5e2265896a7dcc1630eed536cc47d7771c;p=gcc.git this_thread: Move... 2009-02-20 Benjamin Kosnik * testsuite/30_threads/thread/this_thread: Move... * testsuite/30_threads/this_thread: ...here. * testsuite/20_util/unique_ptr/assign/assign.cc: Move... * testsuite/20_util/unique_ptr/assign/assign_neg.cc: ...here. * testsuite/20_util/ratio/cons/cons_overflow.cc: Move... * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: ...here. * testsuite/20_util/ratio/operations/ops_overflow.cc: Move... * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: ...here. From-SVN: r144346 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dbd4a0aa494..fd8bf05c784 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,14 @@ +2009-02-20 Benjamin Kosnik + + * testsuite/30_threads/thread/this_thread: Move... + * testsuite/30_threads/this_thread: ...here. + * testsuite/20_util/unique_ptr/assign/assign.cc: Move... + * testsuite/20_util/unique_ptr/assign/assign_neg.cc: ...here. + * testsuite/20_util/ratio/cons/cons_overflow.cc: Move... + * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: ...here. + * testsuite/20_util/ratio/operations/ops_overflow.cc: Move... + * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: ...here. + 2009-02-20 Benjamin Kosnik * doc/doxygen/user.cfg.in: Tweaks. diff --git a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow.cc b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow.cc deleted file mode 100644 index 220eb8ff63a..00000000000 --- a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow.cc +++ /dev/null @@ -1,55 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } -// { dg-require-cstdint "" } - -// Copyright (C) 2008, 2009 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 - -void -test01() -{ - std::ratio r1; - std::ratio<-INTMAX_MAX, INTMAX_MAX> r2; -} - -void -test02() -{ - std::ratio r1; -} - -void -test03() -{ - std::ratio<1, INTMAX_MIN> r1; -} - -void -test04() -{ - std::ratio<1,0> r1; -} - -// { dg-error "instantiated from here" "" { target *-*-* } 35 } -// { dg-error "instantiated from here" "" { target *-*-* } 41 } -// { dg-error "instantiated from here" "" { target *-*-* } 47 } -// { dg-error "denominator cannot be zero" "" { target *-*-* } 158 } -// { dg-error "out of range" "" { target *-*-* } 159 } -// { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc new file mode 100644 index 00000000000..220eb8ff63a --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc @@ -0,0 +1,55 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// Copyright (C) 2008, 2009 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 + +void +test01() +{ + std::ratio r1; + std::ratio<-INTMAX_MAX, INTMAX_MAX> r2; +} + +void +test02() +{ + std::ratio r1; +} + +void +test03() +{ + std::ratio<1, INTMAX_MIN> r1; +} + +void +test04() +{ + std::ratio<1,0> r1; +} + +// { dg-error "instantiated from here" "" { target *-*-* } 35 } +// { dg-error "instantiated from here" "" { target *-*-* } 41 } +// { dg-error "instantiated from here" "" { target *-*-* } 47 } +// { dg-error "denominator cannot be zero" "" { target *-*-* } 158 } +// { dg-error "out of range" "" { target *-*-* } 159 } +// { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow.cc b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow.cc deleted file mode 100644 index 318a8df6b40..00000000000 --- a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow.cc +++ /dev/null @@ -1,48 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } -// { dg-require-cstdint "" } - -// 2008-07-03 Chris Fairles - -// Copyright (C) 2008, 2009 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 - -void -test01() -{ - std::ratio_add, std::ratio<1>>::type r1; -} - -void -test02() -{ - std::ratio_multiply, std::ratio<3, 2>>::type r1; - std::ratio_multiply, std::ratio>::type r2; -} - -// { dg-error "instantiated from here" "" { target *-*-* } 30 } -// { dg-error "instantiated from here" "" { target *-*-* } 36 } -// { dg-error "instantiated from here" "" { target *-*-* } 37 } -// { dg-error "overflow in addition" "" { target *-*-* } 135 } -// { dg-error "overflow in multiplication" "" { target *-*-* } 103 } -// { dg-error "overflow in multiplication" "" { target *-*-* } 105 } -// { dg-error "overflow in multiplication" "" { target *-*-* } 107 } -// { dg-excess-errors "In instantiation of" } -// { dg-excess-errors "out of range" } diff --git a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc new file mode 100644 index 00000000000..318a8df6b40 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc @@ -0,0 +1,48 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2008-07-03 Chris Fairles + +// Copyright (C) 2008, 2009 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 + +void +test01() +{ + std::ratio_add, std::ratio<1>>::type r1; +} + +void +test02() +{ + std::ratio_multiply, std::ratio<3, 2>>::type r1; + std::ratio_multiply, std::ratio>::type r2; +} + +// { dg-error "instantiated from here" "" { target *-*-* } 30 } +// { dg-error "instantiated from here" "" { target *-*-* } 36 } +// { dg-error "instantiated from here" "" { target *-*-* } 37 } +// { dg-error "overflow in addition" "" { target *-*-* } 135 } +// { dg-error "overflow in multiplication" "" { target *-*-* } 103 } +// { dg-error "overflow in multiplication" "" { target *-*-* } 105 } +// { dg-error "overflow in multiplication" "" { target *-*-* } 107 } +// { dg-excess-errors "In instantiation of" } +// { dg-excess-errors "out of range" } diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign.cc deleted file mode 100644 index 272ed3a97ff..00000000000 --- a/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign.cc +++ /dev/null @@ -1,59 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } - -// Copyright (C) 2008, 2009 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 - -struct base { virtual ~base() {} }; -struct derived : base {}; - -void -test01() -{ - std::unique_ptr p1(new derived); - std::unique_ptr p2(new derived); -// p2 = p1; // should not compile - p2 = std::move(p1); - std::unique_ptr p3(new base); -// p3 = p2; // should not compile - p3 = std::move(p2); -} - -void -test02() -{ - std::unique_ptr p1(new int(420)); - std::unique_ptr p2 = p1; -} - -void -test03() -{ - std::unique_ptr p1(new int[3]); - std::unique_ptr p2 = p1; -} - -// { dg-error "used here" "" { target *-*-* } 43 } -// { dg-error "no matching" "" { target *-*-* } 49 } -// { dg-error "used here" "" { target *-*-* } 50 } -// { dg-error "candidates are" "" { target *-*-* } 219 } -// { dg-error "deleted function" "" { target *-*-* } 219 } -// { dg-error "deleted function" "" { target *-*-* } 365 } -// { dg-excess-errors "note" } diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc new file mode 100644 index 00000000000..272ed3a97ff --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc @@ -0,0 +1,59 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008, 2009 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 + +struct base { virtual ~base() {} }; +struct derived : base {}; + +void +test01() +{ + std::unique_ptr p1(new derived); + std::unique_ptr p2(new derived); +// p2 = p1; // should not compile + p2 = std::move(p1); + std::unique_ptr p3(new base); +// p3 = p2; // should not compile + p3 = std::move(p2); +} + +void +test02() +{ + std::unique_ptr p1(new int(420)); + std::unique_ptr p2 = p1; +} + +void +test03() +{ + std::unique_ptr p1(new int[3]); + std::unique_ptr p2 = p1; +} + +// { dg-error "used here" "" { target *-*-* } 43 } +// { dg-error "no matching" "" { target *-*-* } 49 } +// { dg-error "used here" "" { target *-*-* } 50 } +// { dg-error "candidates are" "" { target *-*-* } 219 } +// { dg-error "deleted function" "" { target *-*-* } 219 } +// { dg-error "deleted function" "" { target *-*-* } 365 } +// { dg-excess-errors "note" } diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/1.cc b/libstdc++-v3/testsuite/30_threads/this_thread/1.cc new file mode 100644 index 00000000000..c012ea923ff --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/this_thread/1.cc @@ -0,0 +1,58 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } + +// Copyright (C) 2008 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 +#include +#include + +int main() +{ + bool test __attribute__((unused)) = true; + + try + { + std::thread::id id = std::this_thread::get_id(); + VERIFY( id != std::thread::id() ); + } + catch (const std::system_error&) + { + VERIFY( false ); + } + catch (...) + { + VERIFY( false ); + } + + return 0; +} diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/2.cc b/libstdc++-v3/testsuite/30_threads/this_thread/2.cc new file mode 100644 index 00000000000..a632a45942f --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/this_thread/2.cc @@ -0,0 +1,58 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } +// { dg-require-sched-yield "" } + +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 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 +#include +#include + +int main() +{ + bool test __attribute__((unused)) = true; + + try + { + std::this_thread::yield(); + } + catch (const std::system_error&) + { + VERIFY( false ); + } + catch (...) + { + VERIFY( false ); + } + + return 0; +} diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/3.cc b/libstdc++-v3/testsuite/30_threads/this_thread/3.cc new file mode 100644 index 00000000000..564bd1f704e --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/this_thread/3.cc @@ -0,0 +1,74 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } +// { dg-require-nanosleep "" } + +// Copyright (C) 2008 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 +#include +#include +#include + +namespace chr = std::chrono; + +void foo() +{ + bool test __attribute__((unused)) = true; + + chr::system_clock::time_point begin = chr::system_clock::now(); + chr::microseconds ms(500); + + std::this_thread::sleep_for(ms); + + VERIFY( (chr::system_clock::now() - begin) >= ms ); +} + +int main() +{ + bool test __attribute__((unused)) = true; + + try + { + std::thread t(foo); + t.join(); + } + catch (const std::system_error&) + { + VERIFY( false ); + } + catch (...) + { + VERIFY( false ); + } + + return 0; +} diff --git a/libstdc++-v3/testsuite/30_threads/this_thread/4.cc b/libstdc++-v3/testsuite/30_threads/this_thread/4.cc new file mode 100644 index 00000000000..54bef5bae31 --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/this_thread/4.cc @@ -0,0 +1,74 @@ +// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } +// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } +// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } +// { dg-require-cstdint "" } +// { dg-require-gthreads "" } +// { dg-require-nanosleep "" } + +// Copyright (C) 2008 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 +#include +#include +#include + +namespace chr = std::chrono; + +void foo() +{ + bool test __attribute__((unused)) = true; + + chr::system_clock::time_point begin = chr::system_clock::now(); + chr::microseconds ms(500); + + std::this_thread::sleep_until(chr::system_clock::now() + ms); + + VERIFY( (chr::system_clock::now() - begin) >= ms ); +} + +int main() +{ + bool test __attribute__((unused)) = true; + + try + { + std::thread t(foo); + t.join(); + } + catch (const std::system_error&) + { + VERIFY( false ); + } + catch (...) + { + VERIFY( false ); + } + + return 0; +} diff --git a/libstdc++-v3/testsuite/30_threads/thread/this_thread/1.cc b/libstdc++-v3/testsuite/30_threads/thread/this_thread/1.cc deleted file mode 100644 index c012ea923ff..00000000000 --- a/libstdc++-v3/testsuite/30_threads/thread/this_thread/1.cc +++ /dev/null @@ -1,58 +0,0 @@ -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } -// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } -// { dg-require-cstdint "" } -// { dg-require-gthreads "" } - -// Copyright (C) 2008 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 -#include -#include - -int main() -{ - bool test __attribute__((unused)) = true; - - try - { - std::thread::id id = std::this_thread::get_id(); - VERIFY( id != std::thread::id() ); - } - catch (const std::system_error&) - { - VERIFY( false ); - } - catch (...) - { - VERIFY( false ); - } - - return 0; -} diff --git a/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc b/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc deleted file mode 100644 index a632a45942f..00000000000 --- a/libstdc++-v3/testsuite/30_threads/thread/this_thread/2.cc +++ /dev/null @@ -1,58 +0,0 @@ -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } -// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } -// { dg-require-cstdint "" } -// { dg-require-gthreads "" } -// { dg-require-sched-yield "" } - -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 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 -#include -#include - -int main() -{ - bool test __attribute__((unused)) = true; - - try - { - std::this_thread::yield(); - } - catch (const std::system_error&) - { - VERIFY( false ); - } - catch (...) - { - VERIFY( false ); - } - - return 0; -} diff --git a/libstdc++-v3/testsuite/30_threads/thread/this_thread/3.cc b/libstdc++-v3/testsuite/30_threads/thread/this_thread/3.cc deleted file mode 100644 index 564bd1f704e..00000000000 --- a/libstdc++-v3/testsuite/30_threads/thread/this_thread/3.cc +++ /dev/null @@ -1,74 +0,0 @@ -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } -// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } -// { dg-require-cstdint "" } -// { dg-require-gthreads "" } -// { dg-require-nanosleep "" } - -// Copyright (C) 2008 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 -#include -#include -#include - -namespace chr = std::chrono; - -void foo() -{ - bool test __attribute__((unused)) = true; - - chr::system_clock::time_point begin = chr::system_clock::now(); - chr::microseconds ms(500); - - std::this_thread::sleep_for(ms); - - VERIFY( (chr::system_clock::now() - begin) >= ms ); -} - -int main() -{ - bool test __attribute__((unused)) = true; - - try - { - std::thread t(foo); - t.join(); - } - catch (const std::system_error&) - { - VERIFY( false ); - } - catch (...) - { - VERIFY( false ); - } - - return 0; -} diff --git a/libstdc++-v3/testsuite/30_threads/thread/this_thread/4.cc b/libstdc++-v3/testsuite/30_threads/thread/this_thread/4.cc deleted file mode 100644 index 54bef5bae31..00000000000 --- a/libstdc++-v3/testsuite/30_threads/thread/this_thread/4.cc +++ /dev/null @@ -1,74 +0,0 @@ -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } -// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } -// { dg-require-cstdint "" } -// { dg-require-gthreads "" } -// { dg-require-nanosleep "" } - -// Copyright (C) 2008 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 -#include -#include -#include - -namespace chr = std::chrono; - -void foo() -{ - bool test __attribute__((unused)) = true; - - chr::system_clock::time_point begin = chr::system_clock::now(); - chr::microseconds ms(500); - - std::this_thread::sleep_until(chr::system_clock::now() + ms); - - VERIFY( (chr::system_clock::now() - begin) >= ms ); -} - -int main() -{ - bool test __attribute__((unused)) = true; - - try - { - std::thread t(foo); - t.join(); - } - catch (const std::system_error&) - { - VERIFY( false ); - } - catch (...) - { - VERIFY( false ); - } - - return 0; -}