]> 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)
committerHans-Peter Nilsson <hp@bitrange.com>
Fri, 13 Oct 2023 00:20:30 +0000 (02:20 +0200)
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.

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 01f7475631e624885c4de10a8906f29bb96dedf1..859629e625f8704ed8a5da94967dc04166ce2ba8 100644 (file)
@@ -1,5 +1,5 @@
 // { 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 f3f38b54dbcdae1db50f6f9657dac767a43f867d..6439873be133e7adac08b8c6bc02ba1eb9677b5f 100644 (file)
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { 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 2a3d1d468c22f6e90e08e3858192054b287fadb2..25ccd2e9433610e7be54dbbbb895fd12b3e3ea4e 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index f8751756d02cbcf97748a1d61836a96365047679..c342b1aae292337ec4ac417ca51031a2578a6e75 100644 (file)
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index eb22afca03a2a4bfbd79353b1e168b836bffc117..134fb16506c3ed6c9a23293779c10e0b3a359ce8 100644 (file)
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 // { dg-add-options libatomic }
 
 #include <atomic>
index 6fe00b557567f73eef8022bad79cb64d7639ae5a..fd26a053151f8ce905224ac2e7bc039f87751edf 100644 (file)
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
-// { dg-require-thread-fence "" }
+// { dg-require-atomic-cmpxchg-word "" }
 // { dg-add-options libatomic }
 
 #include <atomic>