From: Matthew Malcomson <mmalcom...@nvidia.com>

This is not to go into the upstream.  This was used for testing.
This patch set is supposed to be upstreamed in combination with a
patchset automatically linking in libatomic when compiling.

The two patchsets are being worked on in parallel.  Some of the tests in
this series are failing due to needing libatomic.  Manually adding in
the link against libatomic, and running the testsuite natively with
`make install` having been run means I can check these tests should run
once libatomic is getting linked in.

This commit is here for that use-case if anyone wanted to test it.  Not
for commit.

Signed-off-by: Matthew Malcomson <mmalcom...@nvidia.com>
---
 gcc/testsuite/gcc.dg/atomic-op-fp.c                   | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf.c                  | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf128.c               | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf16.c                | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf16b.c               | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf32.c                | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf32x.c               | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf64.c                | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpf64x.c               | 1 +
 gcc/testsuite/gcc.dg/atomic-op-fpl.c                  | 1 +
 libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc   | 1 +
 libstdc++-v3/testsuite/29_atomics/atomic_ref/float.cc | 1 +
 12 files changed, 12 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/atomic-op-fp.c 
b/gcc/testsuite/gcc.dg/atomic-op-fp.c
index 9947bb91f96..10675f9ff36 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fp.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fp.c
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_double_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 
 /* Test the execution of the __atomic_*OP builtin routines for a double.  */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf.c
index 2a88d0a00fd..44960cfb33f 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf.c
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 
 /* Test the execution of the __atomic_*OP builtin routines for a float.  */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf128.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf128.c
index abf5a1855da..4225c2a407f 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf128.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf128.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float128_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target float128_runtime } */
 /* { dg-add-options float128 } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf16.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf16.c
index 375fdce8c9f..053a157ac48 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf16.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf16.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float16_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target float16_runtime } */
 /* { dg-add-options float16 } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf16b.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf16b.c
index 13dfd9b0ac2..5ab81a8773e 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf16b.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf16b.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_bfloat16_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target bfloat16_runtime } */
 /* { dg-add-options bfloat16 } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf32.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf32.c
index d9a89467a88..91b2dd60724 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf32.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf32.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float32_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target float32_runtime } */
 /* { dg-add-options float32 } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf32x.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf32x.c
index 296e34342b5..7a7b3d098ce 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf32x.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf32x.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float32x_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target float32x_runtime } */
 /* { dg-add-options float32x } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf64.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf64.c
index a4dbcad89b6..740bc38f5fe 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf64.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf64.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float64_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target float64_runtime } */
 /* { dg-add-options float64 } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpf64x.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpf64x.c
index 6d059e32bd5..69edbbfd740 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpf64x.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpf64x.c
@@ -4,6 +4,7 @@
 /* { dg-additional-options "-std=c23" } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_float64x_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 /* { dg-require-effective-target float64x_runtime } */
 /* { dg-add-options float64x } */
diff --git a/gcc/testsuite/gcc.dg/atomic-op-fpl.c 
b/gcc/testsuite/gcc.dg/atomic-op-fpl.c
index d311b76c215..b3d4cf689a0 100644
--- a/gcc/testsuite/gcc.dg/atomic-op-fpl.c
+++ b/gcc/testsuite/gcc.dg/atomic-op-fpl.c
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* Can use fallback if libatomic is available, otherwise need hardware 
support.  */
 /* { dg-require-effective-target sync_long_double_runtime { target { ! 
libatomic_available } } } */
+/* { dg-additional-options "-latomic" { target libatomic_available } } */
 /* { dg-additional-options "-fno-atomic-fp-fetchop-exceptions" { target { ! 
libatomic_available } } } */
 
 /* Test the execution of the __atomic_*OP builtin routines for a long double.  
*/
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc 
b/libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc
index dd600b33086..a7d028301ef 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc
@@ -17,6 +17,7 @@
 
 // { dg-add-options ieee }
 // { dg-do run { target c++20 } }
+// { dg-additional-options "-latomic" { target libatomic_available } }
 
 #include <atomic>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/float.cc 
b/libstdc++-v3/testsuite/29_atomics/atomic_ref/float.cc
index fe2fe238128..7c60d0e78e9 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/float.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/float.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
+// { dg-additional-options "-latomic" { target libatomic_available } }
 
 #include <atomic>
 #include <testsuite_hooks.h>
-- 
2.43.0

Reply via email to