On Thu, 14 Sept 2023 at 10:10, Christophe Lyon
<christophe.l...@linaro.org> wrote:
>
> 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.

OK for trunk, thanks.


>
> 2023-09-10  Christophe Lyon  <christophe.l...@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.
> ---
>  .../testsuite/29_atomics/atomic/compare_exchange_padding.cc      | 1 +
>  libstdc++-v3/testsuite/29_atomics/atomic/cons/value_init.cc      | 1 +
>  libstdc++-v3/testsuite/29_atomics/atomic_float/value_init.cc     | 1 +
>  .../testsuite/29_atomics/atomic_integral/cons/value_init.cc      | 1 +
>  .../testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc  | 1 +
>  libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc          | 1 +
>  libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc         | 1 +
>  libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc          | 1 +
>  8 files changed, 8 insertions(+)
>
> diff --git 
> a/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc
> index c4ab876db2a..2e7ff0307bc 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic/compare_exchange_padding.cc
> @@ -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>
> diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/value_init.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic/cons/value_init.cc
> index 47d5a5d5b28..b8019486ccf 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/value_init.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/value_init.cc
> @@ -17,6 +17,7 @@
>
>  // { dg-options "-std=gnu++2a" }
>  // { dg-do run { target c++2a } }
> +// { dg-require-thread-fence "" }
>
>  #include <atomic>
>
> 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 1cd1efb5422..6e89f2fc2a8 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-require-thread-fence "" }
>  // { dg-add-options libatomic }
>
>  #include <atomic>
> diff --git 
> a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/value_init.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/value_init.cc
> index 96615a7d09f..2f6a48d36d8 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/value_init.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/value_init.cc
> @@ -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>
> diff --git 
> a/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc
> index 0dab8a23e10..8469ebf8a14 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/compare_exchange_padding.cc
> @@ -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>
> diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc
> index 14f417d1739..adae07f8754 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/generic.cc
> @@ -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>
> diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc
> index e03ca921eb9..a98adb7fbba 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/integral.cc
> @@ -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>
> diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc 
> b/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc
> index 8cd0e124986..b9c7d844b8c 100644
> --- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc
> +++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/pointer.cc
> @@ -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>
> --
> 2.34.1
>

Reply via email to