From 71dc5ae574ffa61faca12e662d8985a90d7085b9 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Wed, 10 Mar 2021 16:01:12 +0000 Subject: [PATCH] Add options to link with libatomic in various tests. libstdc++-v3/ChangeLog: * testsuite/29_atomics/atomic/wait_notify/bool.cc: Add options to link with libatomic. * testsuite/29_atomics/atomic/wait_notify/generic.cc: Likewise. * testsuite/29_atomics/atomic/wait_notify/pointers.cc: Likewise. * testsuite/29_atomics/atomic_flag/wait_notify/1.cc: Likewise. * testsuite/30_threads/barrier/arrive.cc: Likewise. * testsuite/30_threads/barrier/arrive_and_drop.cc: Likewise. * testsuite/30_threads/barrier/arrive_and_wait.cc: Likewise. * testsuite/30_threads/barrier/completion.cc: Likewise. * testsuite/30_threads/latch/3.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_for.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise. --- libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/bool.cc | 1 + libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/generic.cc | 1 + libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/pointers.cc | 1 + libstdc++-v3/testsuite/29_atomics/atomic_flag/wait_notify/1.cc | 1 + libstdc++-v3/testsuite/30_threads/barrier/arrive.cc | 1 + libstdc++-v3/testsuite/30_threads/barrier/arrive_and_drop.cc | 1 + libstdc++-v3/testsuite/30_threads/barrier/arrive_and_wait.cc | 1 + libstdc++-v3/testsuite/30_threads/barrier/completion.cc | 1 + libstdc++-v3/testsuite/30_threads/latch/3.cc | 1 + libstdc++-v3/testsuite/30_threads/semaphore/try_acquire.cc | 1 + libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_for.cc | 1 + libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc | 1 + 12 files changed, 12 insertions(+) diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/bool.cc b/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/bool.cc index 0550f17c69d..b26ffb5749c 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/bool.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/bool.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/generic.cc b/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/generic.cc index 9ab1b071c96..e67ab776e71 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/generic.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/generic.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/pointers.cc b/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/pointers.cc index cc63694f596..023354366b3 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/pointers.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/pointers.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-additional-options "-pthread" { target pthread } } // { dg-require-gthreads "" } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/wait_notify/1.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/wait_notify/1.cc index 45b68c5bbb8..241251fc72f 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/wait_notify/1.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/wait_notify/1.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/30_threads/barrier/arrive.cc b/libstdc++-v3/testsuite/30_threads/barrier/arrive.cc index fb0f56292c0..1faad7e9281 100644 --- a/libstdc++-v3/testsuite/30_threads/barrier/arrive.cc +++ b/libstdc++-v3/testsuite/30_threads/barrier/arrive.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_drop.cc b/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_drop.cc index 22b40200c80..2e203ea8209 100644 --- a/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_drop.cc +++ b/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_drop.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_wait.cc b/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_wait.cc index f9b4fa29063..f5460fbe620 100644 --- a/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_wait.cc +++ b/libstdc++-v3/testsuite/30_threads/barrier/arrive_and_wait.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/30_threads/barrier/completion.cc b/libstdc++-v3/testsuite/30_threads/barrier/completion.cc index 27be0844a60..fd3cb922060 100644 --- a/libstdc++-v3/testsuite/30_threads/barrier/completion.cc +++ b/libstdc++-v3/testsuite/30_threads/barrier/completion.cc @@ -2,6 +2,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } // Copyright (C) 2020-2021 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/30_threads/latch/3.cc b/libstdc++-v3/testsuite/30_threads/latch/3.cc index 079963f131e..2da6a84e2c5 100644 --- a/libstdc++-v3/testsuite/30_threads/latch/3.cc +++ b/libstdc++-v3/testsuite/30_threads/latch/3.cc @@ -19,6 +19,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } #include #include diff --git a/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire.cc b/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire.cc index 03f781e7185..63f3fa3cbf8 100644 --- a/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire.cc +++ b/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire.cc @@ -19,6 +19,7 @@ // { dg-do run { target c++2a } } // { dg-require-effective-target pthread } // { dg-require-gthreads "" } +// { dg-add-options libatomic } #include #include diff --git a/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_for.cc b/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_for.cc index 02096a07f2c..e7edc9eeef1 100644 --- a/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_for.cc +++ b/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_for.cc @@ -19,6 +19,7 @@ // { dg-do run { target c++2a } } // { dg-require-effective-target pthread } // { dg-require-gthreads "" } +// { dg-add-options libatomic } #include #include diff --git a/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc b/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc index 7d76199f8b3..49ba33b4999 100644 --- a/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc +++ b/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc @@ -19,6 +19,7 @@ // { dg-do run { target c++2a } } // { dg-require-gthreads "" } // { dg-additional-options "-pthread" { target pthread } } +// { dg-add-options libatomic } #include #include