gcc/libstdc++-v3/testsuite/30_threads/async/sync.cc

71 lines
2.2 KiB
C++
Raw Normal View History

libstdc++: Run tests on RTEMS libstdc++-v3/ChangeLog * testsuite/18_support/pthread_guard.cc: Add *-*-rtems* target selector to all lines which contain a *-*-cygwin target selector. * testsuite/20_util/shared_ptr/atomic/3.cc: Likewise. * testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Likewise. * testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise. * testsuite/21_strings/basic_string/pthread18185.cc: Likewise. * testsuite/21_strings/basic_string/pthread33394.cc: Likewise. * testsuite/21_strings/basic_string/pthread4.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/pthread5.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/30_threads/async/42819.cc: Likewise. * testsuite/30_threads/async/49668.cc: Likewise. * testsuite/30_threads/async/54297.cc: Likewise. * testsuite/30_threads/async/any.cc: Likewise. * testsuite/30_threads/async/async.cc: Likewise. * testsuite/30_threads/async/launch.cc: Likewise. * testsuite/30_threads/async/lwg2021.cc: Likewise. * testsuite/30_threads/async/sync.cc: Likewise. * testsuite/30_threads/call_once/39909.cc: Likewise. * testsuite/30_threads/call_once/49668.cc: Likewise. * testsuite/30_threads/call_once/60497.cc: Likewise. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/54185.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/members/1.cc: Likewise. * testsuite/30_threads/condition_variable/members/2.cc: Likewise. * testsuite/30_threads/condition_variable/members/3.cc: Likewise. * testsuite/30_threads/condition_variable/members/53841.cc: Likewise. * testsuite/30_threads/condition_variable/native_handle/typesizes.cc: Likewise. * testsuite/30_threads/condition_variable_any/50862.cc: Likewise. * testsuite/30_threads/condition_variable_any/53830.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/members/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/members/2.cc: Likewise. * testsuite/30_threads/future/cons/move.cc: Likewise. * testsuite/30_threads/future/members/45133.cc: Likewise. * testsuite/30_threads/future/members/get.cc: Likewise. * testsuite/30_threads/future/members/get2.cc: Likewise. * testsuite/30_threads/future/members/share.cc: Likewise. * testsuite/30_threads/future/members/valid.cc: Likewise. * testsuite/30_threads/future/members/wait.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/lock/1.cc: Likewise. * testsuite/30_threads/lock/2.cc: Likewise. * testsuite/30_threads/lock/3.cc: Likewise. * testsuite/30_threads/lock/4.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/native_handle/typesizes.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/2.cc: Likewise. * testsuite/30_threads/packaged_task/49668.cc: Likewise. * testsuite/30_threads/packaged_task/60564.cc: Likewise. * testsuite/30_threads/packaged_task/cons/1.cc: Likewise. * testsuite/30_threads/packaged_task/cons/2.cc: Likewise. * testsuite/30_threads/packaged_task/cons/3.cc: Likewise. * testsuite/30_threads/packaged_task/cons/56492.cc: Likewise. * testsuite/30_threads/packaged_task/cons/alloc.cc: Likewise. * testsuite/30_threads/packaged_task/cons/move.cc: Likewise. * testsuite/30_threads/packaged_task/cons/move_assign.cc: Likewise. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: Likewise. * testsuite/30_threads/packaged_task/members/get_future.cc: Likewise. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke3.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke4.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke5.cc: Likewise. * testsuite/30_threads/packaged_task/members/reset.cc: Likewise. * testsuite/30_threads/packaged_task/members/reset2.cc: Likewise. * testsuite/30_threads/packaged_task/members/swap.cc: Likewise. * testsuite/30_threads/packaged_task/members/valid.cc: Likewise. * testsuite/30_threads/promise/60966.cc: Likewise. * testsuite/30_threads/promise/cons/1.cc: Likewise. * testsuite/30_threads/promise/cons/alloc.cc: Likewise. * testsuite/30_threads/promise/cons/move.cc: Likewise. * testsuite/30_threads/promise/cons/move_assign.cc: Likewise. * testsuite/30_threads/promise/members/at_thread_exit.cc: Likewise. * testsuite/30_threads/promise/members/get_future.cc: Likewise. * testsuite/30_threads/promise/members/get_future2.cc: Likewise. * testsuite/30_threads/promise/members/set_exception.cc: Likewise. * testsuite/30_threads/promise/members/set_exception2.cc: Likewise. * testsuite/30_threads/promise/members/set_value.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/2.cc: Likewise. * testsuite/30_threads/shared_future/cons/move.cc: Likewise. * testsuite/30_threads/shared_future/members/45133.cc: Likewise. * testsuite/30_threads/shared_future/members/get.cc: Likewise. * testsuite/30_threads/shared_future/members/get2.cc: Likewise. * testsuite/30_threads/shared_future/members/valid.cc: Likewise. * testsuite/30_threads/shared_future/members/wait.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_lock/cons/1.cc: Likewise. * testsuite/30_threads/shared_lock/cons/2.cc: Likewise. * testsuite/30_threads/shared_lock/cons/3.cc: Likewise. * testsuite/30_threads/shared_lock/cons/4.cc: Likewise. * testsuite/30_threads/shared_lock/cons/5.cc: Likewise. * testsuite/30_threads/shared_lock/cons/6.cc: Likewise. * testsuite/30_threads/shared_lock/locking/1.cc: Likewise. * testsuite/30_threads/shared_lock/locking/2.cc: Likewise. * testsuite/30_threads/shared_lock/locking/3.cc: Likewise. * testsuite/30_threads/shared_lock/locking/4.cc: Likewise. * testsuite/30_threads/shared_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/shared_mutex/cons/1.cc: Likewise. * testsuite/30_threads/shared_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/shared_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/shared_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/shared_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/shared_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/shared_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/shared_timed_mutex/try_lock/3.cc: Likewise. * testsuite/30_threads/shared_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/this_thread/1.cc: Likewise. * testsuite/30_threads/this_thread/2.cc: Likewise. * testsuite/30_threads/this_thread/3.cc: Likewise. * testsuite/30_threads/this_thread/4.cc: Likewise. * testsuite/30_threads/thread/cons/1.cc: Likewise. * testsuite/30_threads/thread/cons/2.cc: Likewise. * testsuite/30_threads/thread/cons/3.cc: Likewise. * testsuite/30_threads/thread/cons/4.cc: Likewise. * testsuite/30_threads/thread/cons/49668.cc: Likewise. * testsuite/30_threads/thread/cons/5.cc: Likewise. * testsuite/30_threads/thread/cons/6.cc: Likewise. * testsuite/30_threads/thread/cons/7.cc: Likewise. * testsuite/30_threads/thread/cons/8.cc: Likewise. * testsuite/30_threads/thread/cons/9.cc: Likewise. * testsuite/30_threads/thread/cons/moveable.cc: Likewise. * testsuite/30_threads/thread/members/1.cc: Likewise. * testsuite/30_threads/thread/members/2.cc: Likewise. * testsuite/30_threads/thread/members/3.cc: Likewise. * testsuite/30_threads/thread/members/4.cc: Likewise. * testsuite/30_threads/thread/members/5.cc: Likewise. * testsuite/30_threads/thread/members/hardware_concurrency.cc: Likewise. * testsuite/30_threads/thread/native_handle/cancel.cc: Likewise. * testsuite/30_threads/thread/swap/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/typesizes.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/2.cc: Likewise. * testsuite/30_threads/try_lock/1.cc: Likewise. * testsuite/30_threads/try_lock/2.cc: Likewise. * testsuite/30_threads/try_lock/3.cc: Likewise. * testsuite/30_threads/try_lock/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc: Likewise. From-SVN: r227429
2015-09-03 07:45:33 +02:00
// { dg-do run { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* *-*-cygwin *-*-rtems* *-*-darwin* powerpc-ibm-aix* } }
Simplify dg-options for tests using pthreads * testsuite/21_strings/basic_string/pthread18185.cc: Use -pthread for *-*-solaris* instead of -pthreads. * testsuite/21_strings/basic_string/pthread4.cc : Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/pthread5.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/30_threads/shared_mutex/*: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/thread/ default_weaktoshared.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/thread/ mutex_weaktoshared.cc: Likewise. * testsuite/20_util/shared_ptr/atomic/3.cc: Likewise. Use dg-require-effective-target instead of using -std option. * testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Likewise. * testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise. * testsuite/23_containers/vector/debug/multithreaded_swap.cc: Likewise. * testsuite/30_threads/async/*: Likewise. * testsuite/30_threads/call_once/*: Likewise. * testsuite/30_threads/condition_variable/*: Likewise. * testsuite/30_threads/condition_variable_any/*: Likewise. * testsuite/30_threads/future/*: Likewise. * testsuite/30_threads/lock/*: Likewise. * testsuite/30_threads/mutex/*: Likewise. * testsuite/30_threads/packaged_task/*: Likewise. * testsuite/30_threads/promise/*: Likewise. * testsuite/30_threads/recursive_mutex/*: Likewise. * testsuite/30_threads/recursive_timed_mutex/*: Likewise. * testsuite/30_threads/shared_future/*: Likewise. * testsuite/30_threads/shared_lock/*: Likewise. * testsuite/30_threads/shared_timed_mutex/*: Likewise. * testsuite/30_threads/this_thread/*: Likewise. * testsuite/30_threads/thread/*: Likewise. * testsuite/30_threads/timed_mutex/*: Likewise. * testsuite/30_threads/try_lock/*: Likewise. * testsuite/30_threads/unique_lock/*: Likewise. From-SVN: r239624
2016-08-19 18:36:07 +02:00
// { dg-options "-pthread" { target *-*-freebsd* *-*-dragonfly* *-*-netbsd* *-*-linux* *-*-gnu* *-*-solaris* powerpc-ibm-aix* } }
// { dg-require-effective-target c++11 }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2010-2017 Free Software Foundation, Inc.
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
//
// 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 <future>
#include <testsuite_hooks.h>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
struct sum {
typedef int result_type;
int operator()(int i, int& j, const int& k) { return i + j + k; }
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void test01()
{
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
using namespace std;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
int a = 1;
int b = 1;
int c = 1;
future<int> f1 = async(launch::deferred, sum(), a, ref(b), cref(c));
a = 0;
b = 10;
c = 100;
const std::chrono::seconds delay(10);
const auto then = std::chrono::system_clock::now() + delay;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
VERIFY( f1.valid() );
// timed waiting functions should return 'deferred' immediately
VERIFY( f1.wait_until(then) == std::future_status::deferred );
VERIFY( f1.wait_for(delay) == std::future_status::deferred );
VERIFY( std::chrono::system_clock::now() < then );
f1.wait();
VERIFY( f1.valid() );
// timed waiting functions should return 'ready' immediately
VERIFY( f1.wait_until(then) == std::future_status::ready );
VERIFY( f1.wait_for(delay) == std::future_status::ready );
VERIFY( std::chrono::system_clock::now() < then );
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
VERIFY( f1.get() == 111 );
VERIFY( !f1.valid() );
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
int main()
{
test01();
return 0;
}