diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-09-07 13:56:15 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-09-15 21:57:40 +0100 |
commit | 8cd5e57b251ba4af2ff301e92564dbf8d746632c (patch) | |
tree | b589ac6c4787a3f8b2fb67b06f79cad6324947b2 | |
parent | ed8fcd0df531eeebad64418a22fa578f045e34bb (diff) | |
download | gcc-8cd5e57b251ba4af2ff301e92564dbf8d746632c.zip gcc-8cd5e57b251ba4af2ff301e92564dbf8d746632c.tar.gz gcc-8cd5e57b251ba4af2ff301e92564dbf8d746632c.tar.bz2 |
libstdc++: Simplify dejagnu directives for some tests using threads
Replace dg-require-effective-target directives with a target selector on
the dg-do directive.
We can also remove { dg-require-effective-target pthread } and the
associated { dg-options "-pthread" } by allowing it to run on
non-pthread targets and conditionally adding -pthread only for pthread
targets.
libstdc++-v3/ChangeLog:
* testsuite/20_util/shared_ptr/atomic/3.cc: Simplify dg
directives.
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
Likewise.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/allocate.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/allocate_single.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/cons.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/cons_single.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/is_equal.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/multithreaded.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/options.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/release.cc:
Likewise.
* testsuite/20_util/synchronized_pool_resource/release_single.cc:
Likewise.
* testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc:
Likewise.
* testsuite/30_threads/stop_token/stop_callback/destroy.cc:
Likewise.
15 files changed, 24 insertions, 46 deletions
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc index 8346191..19efcad 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/atomic/3.cc @@ -1,6 +1,5 @@ -// { dg-do run } +// { dg-do run { target c++11 } } // { dg-additional-options "-pthread" { target pthread } } -// { dg-require-effective-target c++11 } // { dg-require-gthreads "" } // Copyright (C) 2014-2023 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc index 20c910c..af0e65e 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc @@ -17,10 +17,9 @@ // 20.6.6.2 Template class shared_ptr [util.smartptr.shared] -// { dg-do run } +// { dg-do run { target c++11 } } // { dg-additional-options "-pthread" { target pthread } } // { dg-add-options libatomic } -// { dg-require-effective-target c++11 } // { dg-require-gthreads "" } // { dg-require-cstdint "" } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc index d6c8611..07f7c49 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc @@ -17,10 +17,9 @@ // 20.6.6.2 Template class shared_ptr [util.smartptr.shared] -// { dg-do run } +// { dg-do run { target c++11 } } // { dg-additional-options "-pthread" { target pthread } } // { dg-add-options libatomic } -// { dg-require-effective-target c++11 } // { dg-require-gthreads "" } // { dg-require-cstdint "" } diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc index f9a4a2f..822a410 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <memory_resource> diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc index a29575f..4acfde6 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/allocate_single.cc @@ -15,8 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-require-effective-target c++17 } +// { dg-do run { target c++17 } } // { dg-require-gthreads "" } // This runs the same tests as allocate.cc but without -pthread diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc index f8b74d9..a3f9858 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <memory_resource> diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc index ab215ba..9668a51 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/cons_single.cc @@ -15,8 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-require-effective-target c++17 } +// { dg-do run { target c++17 } } // { dg-require-gthreads "" } // This runs the same tests as cons.cc but without -pthread diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc index 5be6bd6..aacf00b 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/is_equal.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <memory_resource> diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc index a7283bf..7992367 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/multithreaded.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <memory_resource> diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc index a869b99..9d98b50 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/options.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <memory_resource> diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc index d1c6043..6752d6e 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release.cc @@ -15,10 +15,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-options "-pthread" } -// { dg-require-effective-target c++17 } -// { dg-require-effective-target pthread } +// { dg-do run { target c++17 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <memory_resource> diff --git a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc index f69e960..9645bc6 100644 --- a/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc +++ b/libstdc++-v3/testsuite/20_util/synchronized_pool_resource/release_single.cc @@ -15,8 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do run } -// { dg-require-effective-target c++17 } +// { dg-do run { target c++17 } } // { dg-require-gthreads "" } // This runs the same tests as release.cc but without -pthread diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc b/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc index edebaa6..bac1f35 100644 --- a/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc +++ b/libstdc++-v3/testsuite/30_threads/condition_variable_any/stop_token/wait_on.cc @@ -15,11 +15,9 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-options "-std=gnu++2a -pthread" } // { dg-add-options libatomic } -// { dg-do run } -// { dg-require-effective-target c++2a } -// { dg-require-effective-target pthread } +// { dg-do run { target c++20 } } +// { dg-additional-options "-pthread" { target pthread } } #include <condition_variable> #include <thread> diff --git a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc index f616287..e780955 100644 --- a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc +++ b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/deadlock-mt.cc @@ -15,10 +15,9 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-options "-std=gnu++2a -pthread" } // { dg-add-options libatomic } -// { dg-require-effective-target c++2a } -// { dg-require-effective-target pthread } +// { dg-do run { target c++20 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <stop_token> diff --git a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc index 6bdd4d13..f13761c 100644 --- a/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc +++ b/libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc @@ -15,10 +15,9 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-options "-std=gnu++2a -pthread" } // { dg-add-options libatomic } -// { dg-require-effective-target c++2a } -// { dg-require-effective-target pthread } +// { dg-do run { target c++20 } } +// { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } #include <stop_token> |