On 28/07/20 21:44 -0400, David Edelsohn via Libstdc++ wrote:
atomic_float/value_init.cc requires libatomic on some targets, i.e.,
when it tries to perform an atomic operation with a 64 bit floating
point double type on a 32 bit target.  This patch adds AIX to the list
of targets that require the libatomic option and adds the option to
the atomic_float/value_init.cc testcase.

Bootstrapped on powerpc-ibm-aix7.2.0.0

Okay?

Thanks, David

   2020-07-28  David Edelsohn  <dje....@gmail.com>
                       Jonathan Wakely  <jwak...@redhat.com>

           * testsuite/lib/dg-options.exp (add_options_for_libatomic): Add
           target powerpc-ibm-aix*.
           * testsuite/29_atomics/atomic_float/value_init.cc: Add options
           for libatomic.

diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_float/value_init.cc
b/libstdc++-v3/testsuite/29_atomics/atomic_float/value_init.cc
index 237c0dd13ed..38af9bdc8d4 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_float/value_init.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_float/value_init.cc
@@ -17,6 +17,7 @@

// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
+// { dg-add-options libatomic }

#include <atomic>
#include <testsuite_hooks.h>

diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp
b/libstdc++-v3/testsuite/lib/dg-options.exp
index 9bfae71adf3..bf6219c3042 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -260,7 +260,8 @@ proc add_options_for_net_ts { flags } {
# Add to FLAGS all the target-specific flags to link to libatomic, if required.

proc add_options_for_libatomic { flags } {
-    if { [istarget hppa*-*-hpux*] || [istarget riscv*-*-*] } {
+    if { [istarget hppa*-*-hpux*] || [istarget riscv*-*-*]
+        || [istarget powerpc-ibm-aix*] } {

Could you add || [istarget powerpc*-darwin*] here too please?

Iain agreed that's needed.

OK with that change, thanks.


       return "$flags -L../../libatomic/.libs -latomic"
    }
    return $flags


Reply via email to