]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add dg-require-thread-fence in several tests
authorChristophe Lyon <christophe.lyon@linaro.org>
Thu, 14 Sep 2023 08:59:20 +0000 (08:59 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Thu, 14 Sep 2023 09:31:48 +0000 (09:31 +0000)
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.

libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc
libstdc++-v3/testsuite/29_atomics/atomic/cons/value_init.cc
libstdc++-v3/testsuite/29_atomics/atomic_float/value_init.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/value_init.cc
libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc
libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc
libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc
libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc

index c4ab876db2acbcc887502cf10d94477503f97599..2e7ff0307bc140d81d2a7e6171f0763b0530c46f 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-options "-std=gnu++20" }
 // { dg-do run { target c++20 } }
+// { dg-require-thread-fence "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index 47d5a5d5b288c89879b854abacb1f9df417a9c97..b8019486ccf296ebc74c051d6d8eaf8fe3138796 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
 
 #include <atomic>
 
index 1cd1efb542277e3590a72d8edde215d6ae9ef3b0..6e89f2fc2a88fc419a647a3d7bd8c3f16b2250c3 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index 96615a7d09fc2d4e5c7345fac565bbbf553a1b8b..2f6a48d36d85b9d4b50cb73164e0b551a963ec45 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
 
 #include <atomic>
 #include <testsuite_hooks.h>
index 0dab8a23e109196d7dd14a41d1479f5ea9ca2be3..8469ebf8a14d6b796f9eb76ae07f9354ee57a277 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-options "-std=gnu++20" }
 // { dg-do run { target c++20 } }
+// { dg-require-thread-fence "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index 14f417d17390b5fc0ece6b2bb30505e5c3eaa5b1..adae07f8754af3f096eab985b4fc347c286f7f41 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index e03ca921eb9bfb8e552ff8fc40c7a2916414649a..a98adb7fbba3d7a27f7828d5335ae98856a6c0b0 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index 8cd0e124986202b433dcc99202dc21ab395d0a4c..b9c7d844b8c5f19e9090a45b81c9653eb01cc274 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-thread-fence "" }
 // { dg-add-options libatomic }
 
 #include <atomic>