]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Replace many dg-require-thread-fence with dg-require-atomic-cmpxchg-word
authorHans-Peter Nilsson <hp@axis.com>
Wed, 4 Oct 2023 02:16:18 +0000 (04:16 +0200)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Wed, 7 Feb 2024 17:33:11 +0000 (18:33 +0100)
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)

libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc
libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.cc
libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/value_init.cc
libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc
libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.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 2e7ff0307bc140d81d2a7e6171f0763b0530c46f..72b8ea9df4224000a2e86885d4a921c891a55630 100644 (file)
@@ -1,6 +1,6 @@
 // { 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>
index 89ed381fe057f7c73a7870dc6c6e99c79c862c6b..2e154178dbd75ab5a514e1a2d0bb1212f9a9408e 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run { target c++11 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 
 // Copyright (C) 2009-2023 Free Software Foundation, Inc.
 //
index 565d1ac441712eb78d5cb3585502b79565a34af6..e322ca2054a914caf740d2ab77e8094382fc9e58 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-require-atomic-cmpxchg-word "" }
 
 #include <atomic>
 #include <testsuite_hooks.h>
index 6f723eb5f4e7aac27760cbfd104cb969c12d730a..6cb1ae2b6dda0acb22e325408bb57be23a569665 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run { target c++11 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 
 // Copyright (C) 2008-2023 Free Software Foundation, Inc.
 //
index 6f723eb5f4e7aac27760cbfd104cb969c12d730a..6cb1ae2b6dda0acb22e325408bb57be23a569665 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run { target c++11 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 
 // Copyright (C) 2008-2023 Free Software Foundation, Inc.
 //
index 5a2abb401951c895e9fbebc413df57546103190d..f20974b16ae64ebcc26cc6d642fe1721cf17beef 100644 (file)
@@ -1,6 +1,6 @@
 // { 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>
index adae07f8754af3f096eab985b4fc347c286f7f41..04ae5abb96a6e2e57df6f7e646061c06dcd78d46 100644 (file)
@@ -17,7 +17,7 @@
 
 // { 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>
index a98adb7fbba3d7a27f7828d5335ae98856a6c0b0..1728a095ea957c3b6c36978dc6c879eed5750708 100644 (file)
@@ -17,7 +17,7 @@
 
 // { 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>
index b9c7d844b8c5f19e9090a45b81c9653eb01cc274..a54083291810737c4dde131b9bc3c0607bb7c686 100644 (file)
@@ -17,7 +17,7 @@
 
 // { 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>