Some targets like arm-eabi with newlib and default settings rely on
__sync_synchronize() to ensure synchronization. Newlib does not
implement it by default, to make users aware they have to take special
care.
This makes a few tests fail to link.
This patch requires the missing thread-fence effective target in the
tests that need it, making them UNSUPPORTED instead of FAIL and
UNRESOLVED.
2023-09-10 Christophe Lyon <christophe.lyon@linaro.org>
libstdc++-v3/
* testsuite/29_atomics/atomic/compare_exchange_padding.cc: Likewise.
* testsuite/29_atomics/atomic/cons/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_float/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/value_init.cc: Likewise.
* testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc: Likewise.
* testsuite/29_atomics/atomic_ref/generic.cc: Likewise.
* testsuite/29_atomics/atomic_ref/integral.cc: Likewise.
* testsuite/29_atomics/atomic_ref/pointer.cc: Likewise.
(cherry picked from commit
62b29347c38394ae32858f2301aa9aa65205984e)
// { dg-options "-std=gnu++20" }
// { dg-do run { target c++20 } }
+// { dg-require-thread-fence "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
#include <atomic>
#include <testsuite_hooks.h>
// { dg-options "-std=gnu++20" }
// { dg-do run { target c++20 } }
+// { dg-require-thread-fence "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
// { dg-add-options libatomic }
#include <atomic>
// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
// { dg-add-options libatomic }
#include <atomic>