These tests actually use a form of atomic compare and exchange
operation, not just atomic loading and storing. Some targets (not
supported by e.g. libatomic) have atomic loading and storing, but not
compare and exchange, yielding linker errors for missing library
functions.
This change is just for existing uses of
dg-require-thread-fence. It does not fix any other tests
that should also be gated on dg-require-atomic-cmpxchg-word.
* testsuite/29_atomics/atomic/compare_exchange_padding.cc,
testsuite/29_atomics/atomic_flag/clear/1.cc,
testsuite/29_atomics/atomic_flag/cons/value_init.cc,
testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc,
testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc,
testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc,
testsuite/29_atomics/atomic_ref/generic.cc,
testsuite/29_atomics/atomic_ref/integral.cc,
testsuite/29_atomics/atomic_ref/pointer.cc: Replace
dg-require-thread-fence with dg-require-atomic-cmpxchg-word.
(cherry picked from commit
ba0cde8ba2d93b7193050eb5ef3cc6f7a2cdfe61)
// { dg-options "-std=gnu++20" }
// { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-do run { target c++11 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// Copyright (C) 2009-2023 Free Software Foundation, Inc.
//
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-atomic-cmpxchg-word "" }
#include <atomic>
#include <testsuite_hooks.h>
// { dg-do run { target c++11 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// Copyright (C) 2008-2023 Free Software Foundation, Inc.
//
// { dg-do run { target c++11 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// Copyright (C) 2008-2023 Free Software Foundation, Inc.
//
// { dg-options "-std=gnu++20" }
// { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
// { dg-add-options libatomic }
#include <atomic>