On Fri, Nov 27, 2026 at 10:51 PM Jonathan Wakely <[email protected]> wrote:

> This adjusts the pstl tests so that they can be run using either the
> OpenMP backend or the TBB backend. To select a backend explicitly, add
> -D_GLIBCXX_USE_TBB_PAR_BACKEND or -D_GLIBCXX_USE_OPENMP_PAR_BACKEND to
> the runtest flags. If neither is given explicitly use TBB if <tbb/tbb.h>
> and libtbb are available on the host, otherwise use OpenMP if libgomp is
> available in the build tree, otherwise make the test UNSUPPORTED.
>
> libstdc++-v3/ChangeLog:
>
>         *
> testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc:
>         Replace options and effective target for TBB to also work with
>         OpenMP.
>         *
> testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc:
>         Likewise.
>         *
> testsuite/20_util/specialized_algorithms/pstl/uninitialized_fill_destroy.cc:
>         Likewise.
>         * testsuite/25_algorithms/default_template_value.cc: Disable
>         both TBB and OpenMP backends to force serial backend.
>         * testsuite/25_algorithms/pstl/110512.cc: Likewise.
>         * testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc:
>         Replace options and effective target for TBB to also work with
>         OpenMP.
>         * testsuite/25_algorithms/pstl/alg_merge/merge.cc: Likewise.
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/includes.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/is_sorted.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/set_difference.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/set_intersection.cc:
>         Likewise.
>         *
> testsuite/25_algorithms/pstl/alg_sorting/set_symmetric_difference.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/set_union.cc:
>         Likewise.
>         * testsuite/25_algorithms/pstl/alg_sorting/sort.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/108236.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/move_only.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/reduce.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/scan.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc:
>         Likewise.
>         * testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc:
>         Likewise.
>         * testsuite/Makefile.am (check-DEJAGNU): Add libgomp_flags to
>         the environment.
>         * testsuite/Makefile.in: Regenerate.
>         * testsuite/lib/dg-options.exp (add_options_for_pstl): New proc.
>         * testsuite/lib/libstdc++.exp (check_effective_target_tbb_backend):
>         Return 0 if _GLIBCXX_USE_OPENMP_PAR_BACKEND was defined explicitly.
>         (check_effective_target_openmp_backend): New proc.
>         (check_effective_target_pstl_backend): New proc.
> ---
>
> Tested x86_64-linux.
>
LGTM

>
>  .../pstl/uninitialized_construct.cc           |  4 +-
>  .../pstl/uninitialized_copy_move.cc           |  4 +-
>  .../pstl/uninitialized_fill_destroy.cc        |  4 +-
>  .../25_algorithms/default_template_value.cc   |  1 +
>  .../testsuite/25_algorithms/pstl/110512.cc    |  1 +
>  .../pstl/alg_merge/inplace_merge.cc           |  4 +-
>  .../25_algorithms/pstl/alg_merge/merge.cc     |  4 +-
>  .../pstl/alg_modifying_operations/copy_if.cc  |  4 +-
>  .../alg_modifying_operations/copy_move.cc     |  4 +-
>  .../pstl/alg_modifying_operations/fill.cc     |  4 +-
>  .../pstl/alg_modifying_operations/generate.cc |  4 +-
>  .../is_partitioned.cc                         |  4 +-
>  .../alg_modifying_operations/partition.cc     |  4 +-
>  .../partition_copy.cc                         |  4 +-
>  .../pstl/alg_modifying_operations/remove.cc   |  4 +-
>  .../alg_modifying_operations/remove_copy.cc   |  4 +-
>  .../pstl/alg_modifying_operations/replace.cc  |  4 +-
>  .../alg_modifying_operations/replace_copy.cc  |  4 +-
>  .../pstl/alg_modifying_operations/rotate.cc   |  4 +-
>  .../alg_modifying_operations/rotate_copy.cc   |  4 +-
>  .../alg_modifying_operations/swap_ranges.cc   |  4 +-
>  .../transform_binary.cc                       |  4 +-
>  .../transform_unary.cc                        |  4 +-
>  .../pstl/alg_modifying_operations/unique.cc   |  4 +-
>  .../unique_copy_equal.cc                      |  4 +-
>  .../pstl/alg_nonmodifying/adjacent_find.cc    |  4 +-
>  .../pstl/alg_nonmodifying/all_of.cc           |  4 +-
>  .../pstl/alg_nonmodifying/any_of.cc           |  4 +-
>  .../pstl/alg_nonmodifying/count.cc            |  4 +-
>  .../pstl/alg_nonmodifying/equal.cc            |  4 +-
>  .../pstl/alg_nonmodifying/find.cc             |  4 +-
>  .../pstl/alg_nonmodifying/find_end.cc         |  4 +-
>  .../pstl/alg_nonmodifying/find_first_of.cc    |  4 +-
>  .../pstl/alg_nonmodifying/find_if.cc          |  4 +-
>  .../pstl/alg_nonmodifying/for_each.cc         |  4 +-
>  .../pstl/alg_nonmodifying/mismatch.cc         |  4 +-
>  .../pstl/alg_nonmodifying/none_of.cc          |  4 +-
>  .../pstl/alg_nonmodifying/nth_element.cc      |  4 +-
>  .../pstl/alg_nonmodifying/reverse.cc          |  4 +-
>  .../pstl/alg_nonmodifying/reverse_copy.cc     |  4 +-
>  .../pstl/alg_nonmodifying/search_n.cc         |  4 +-
>  .../pstl/alg_sorting/includes.cc              |  4 +-
>  .../25_algorithms/pstl/alg_sorting/is_heap.cc |  4 +-
>  .../pstl/alg_sorting/is_sorted.cc             |  4 +-
>  .../alg_sorting/lexicographical_compare.cc    |  4 +-
>  .../pstl/alg_sorting/minmax_element.cc        |  4 +-
>  .../pstl/alg_sorting/partial_sort.cc          |  4 +-
>  .../pstl/alg_sorting/partial_sort_copy.cc     |  4 +-
>  .../pstl/alg_sorting/set_difference.cc        |  4 +-
>  .../pstl/alg_sorting/set_intersection.cc      |  4 +-
>  .../alg_sorting/set_symmetric_difference.cc   |  4 +-
>  .../pstl/alg_sorting/set_union.cc             |  4 +-
>  .../25_algorithms/pstl/alg_sorting/sort.cc    |  4 +-
>  .../26_numerics/pstl/numeric_ops/108236.cc    |  4 +-
>  .../pstl/numeric_ops/adjacent_difference.cc   |  4 +-
>  .../26_numerics/pstl/numeric_ops/move_only.cc |  4 +-
>  .../26_numerics/pstl/numeric_ops/reduce.cc    |  4 +-
>  .../26_numerics/pstl/numeric_ops/scan.cc      |  4 +-
>  .../pstl/numeric_ops/transform_reduce.cc      |  4 +-
>  .../pstl/numeric_ops/transform_scan.cc        |  4 +-
>  libstdc++-v3/testsuite/Makefile.am            | 11 ++--
>  libstdc++-v3/testsuite/Makefile.in            | 11 ++--
>  libstdc++-v3/testsuite/lib/dg-options.exp     | 10 ++++
>  libstdc++-v3/testsuite/lib/libstdc++.exp      | 54 +++++++++++++++++++
>  64 files changed, 194 insertions(+), 126 deletions(-)
>
> diff --git
> a/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc
> b/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc
> index 0bc1e3266d93..39fc5bf9d41f 100644
> ---
> a/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc
> +++
> b/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- uninitialized_construct.pass.cpp
> ----------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc
> b/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc
> index 53d297b7e8be..29ae5ef973e7 100644
> ---
> a/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc
> +++
> b/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- uninitialized_copy_move.pass.cpp
> ----------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_fill_destroy.cc
> b/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_fill_destroy.cc
> index dfadb554a117..8275098542de 100644
> ---
> a/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_fill_destroy.cc
> +++
> b/libstdc++-v3/testsuite/20_util/specialized_algorithms/pstl/uninitialized_fill_destroy.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- uninitialized_fill_destroy.pass.cpp
> -------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/default_template_value.cc
> b/libstdc++-v3/testsuite/25_algorithms/default_template_value.cc
> index 60f3d95ddb3e..408f676fbe18 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/default_template_value.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/default_template_value.cc
> @@ -1,3 +1,4 @@
> +// { dg-options "-U_GLIBCXX_USE_TBB_PAR_BACKEND
> -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -U_GLIBCXX_USE_OPENMP_PAR_BACKEND
> -D_GLIBCXX_USE_OPENMP_PAR_BACKEND=0" }
>  // { dg-do compile { target c++26 } }
>
>  #include <algorithm>
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/110512.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/110512.cc
> index 862ff0a6e72b..5f6d884cc9a3 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/110512.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/110512.cc
> @@ -1,3 +1,4 @@
> +// { dg-options "-U_GLIBCXX_USE_TBB_PAR_BACKEND
> -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -U_GLIBCXX_USE_OPENMP_PAR_BACKEND
> -D_GLIBCXX_USE_OPENMP_PAR_BACKEND=0" }
>  // { dg-do compile { target c++17 } }
>
>  // Bug 110512 - C++20 random access iterators run sequentially with PSTL
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
> index a01974552d38..a1640c4337b4 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- inplace_merge.pass.cpp
> --------------------------------------------===//
>  //
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
> index eab12608515a..0c839f76e81c 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/merge.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- merge.pass.cpp
> ----------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
> index d554cb29925a..b95ad152d27e 100644
> ---> 
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- copy_if.pass.cpp
> --------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
> index 6c0e4048b544..b7da6f6a9a3c 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- copy_move.pass.cpp
> ------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
> index d5b40658d57e..75c37e7f2e00 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/fill.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- fill.pass.cpp
> -----------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
> index c04e51207c21..9b1ca57ba153 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/generate.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- generate.pass.cpp
> -------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
> index b4d85d93bfdc..ea34a9605dbb 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- is_partitioned.pass.cpp
> -------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
> index d69f4060a10f..8dd7c24241b4 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- partition.pass.cpp
> ------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
> index 597de6833fe7..6c1e3510677d 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- partition_copy.pass.cpp
> -------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
> index c8ad1c71e050..0dd705b1ffd4 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- remove.pass.cpp
> ---------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
> index 37d7b6679dd1..11393c504cb5 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/remove_copy.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- remove_copy.pass.cpp
> ----------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
> index c90965f2a00e..b716ac8be132 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- replace.pass.cpp
> --------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
> index 18f6b5491685..dcd03ed3fcd5 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- replace_copy.pass.cpp
> ---------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
> index 6b2fe8f6ea4c..39b8b16ed094 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- rotate.pass.cpp
> ---------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
> index 297670458708..cccebebc22f4 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc
> @@ -1,9 +1,9 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
>  // { dg-timeout-factor 5 { target debug_mode } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- rotate_copy.pass.cpp
> ----------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
> index e371c3b2b048..1cbe3155778d 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/swap_ranges.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- swap_ranges.pass.cpp
> ----------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
> index 16b815c5d514..3c2f16ccc5af 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_binary.cc
> @@ -1,9 +1,9 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
>  // { dg-timeout-factor 5 { target debug_mode } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- transform_binary.pass.cpp
> -----------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
> index ddd8249b6787..81913791fdca 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/transform_unary.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- transform_unary.pass.cpp
> ------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
> index 16fd5e5dcf34..502127a2d83e 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- unique.pass.cpp
> ---------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
> index 782726ee63b1..ea601ab53349 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- unique_copy_equal.pass.cpp
> ----------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
> index a79f11bb1ed4..25dd2dd60730 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/adjacent_find.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- adjacent_find.pass.cpp
> --------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
> index 0f03d00cdbc8..f0fb51b64d1a 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- all_of.pass.cpp
> ---------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
> index a4bbb7d176e7..ee30d7f20699 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- any_of.pass.cpp
> ---------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
> index b99754c51f15..a30311331216 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- count.pass.cpp
> ----------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
> index 0e5ad030ee7d..359833411615 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- equal.pass.cpp
> ----------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
> index 1ad06768cd41..b7e7913dc0d6 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- find.pass.cpp
> -----------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
> index 765927c3b670..5accef6b3e27 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 4 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- find_end.pass.cpp
> -------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
> index 83f197e9a492..58f100703373 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- find_first_of.pass.cpp
> --------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
> index 3ad7c99dff69..cb2c8fae1614 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- find_if.pass.cpp
> --------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
> index 51c51221b3c3..a50d9faa46d8 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/for_each.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- for_each.pass.cpp
> -------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
> index 441f5d1e3782..f679d7778a3e 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/mismatch.cc
> @@ -1,9 +1,9 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
>  // { dg-timeout-factor 5 { target debug_mode } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- mismatch.pass.cpp
> -------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
> index a49b6b2d45fc..01a715f90d5e 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- none_of.pass.cpp
> --------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> index 517499b76d24..950007b8a02a 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- nth_element.pass.cpp
> ----------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
> index be6bb95d8b06..5aa5717aa455 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- reverse.pass.cpp
> --------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
> index be29230806e4..94912948c8f8 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- reverse_copy.pass.cpp
> ---------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
> index 899c754c0b1e..bb5d1f821643 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- search_n.pass.cpp
> -------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> index 1567c369c4cd..9ed26da26b3b 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/includes.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- includes.pass.cpp
> -------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc
> index 251896ff25b6..d42cc0caabdc 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- is_heap.pass.cpp
> --------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_sorted.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_sorted.cc
> index d88144ebc277..b94ecf2fb072 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_sorted.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/is_sorted.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- is_sorted.pass.cpp
> ------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
> index 78edeb025d78..7fa7dd67a5ff 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc
> @@ -1,9 +1,9 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
>  // { dg-timeout-factor 5 { target debug_mode } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- lexicographical_compare.pass.cpp
> ----------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
> index 51bdeaa96a13..37b757e2742e 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc
> @@ -1,9 +1,9 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
>  // { dg-timeout-factor 5 { target debug_mode } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- minmax_element.pass.cpp
> -------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> index 53f8a861c47a..68d0497edeeb 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>  // { dg-xfail-run-if "see PR 90276" { debug_mode } }
>
>  //===-- partial_sort.pass.cpp
> ---------------------------------------------===//
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
> index 6c1ec46607bc..1d9c344cbc1c 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- partial_sort_copy.pass.cpp
> ----------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_difference.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_difference.cc
> index 3849c73b734f..ea8166aa2787 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_difference.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_difference.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- set.pass.cpp
> ------------------------------------------------------===//>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_intersection.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_intersection.cc
> index 8e34c135279d..dba30b7080f5 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_intersection.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_intersection.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- set.pass.cpp
> ------------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_symmetric_difference.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_symmetric_difference.cc
> index ad3befcb690b..fe44bcfeea9b 100644
> ---
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_symmetric_difference.cc
> +++
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_symmetric_difference.cc
> @@ -1,9 +1,9 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
>  // { dg-timeout-factor 5 { target debug_mode } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- set.pass.cpp
> ------------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_union.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_union.cc
> index 2ea9c9a8a52b..9a0a17b8fbbe 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_union.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/set_union.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- set.pass.cpp
> ------------------------------------------------------===//
>  //
> diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/sort.cc
> b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/sort.cc
> index 94257bd1ac34..764d9e48c4ec 100644
> --- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/sort.cc
> +++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/sort.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- sort.pass.cpp
> -----------------------------------------------------===//
>  //
> diff --git a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/108236.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/108236.cc
> index cbef8ab67dde..2eb98b3fa05e 100644
> --- a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/108236.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/108236.cc
> @@ -1,6 +1,6 @@
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  // Bug 108236 std::exclusive_scan with execution policy does not work
> in-place
>
> diff --git
> a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc
> index 22a235a7978e..d6ce35439bfc 100644
> ---
> a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc
> +++
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- adjacent_difference.pass.cpp
> --------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/move_only.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/move_only.cc
> index 38ad3c2877e7..3c5132c292cb 100644
> --- a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/move_only.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/move_only.cc
> @@ -1,6 +1,6 @@
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  #include <numeric>
>  #include <execution>
> diff --git a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/reduce.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/reduce.cc
> index b43e5bb4e34e..b24bc1ce6666 100644
> --- a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/reduce.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/reduce.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- reduce.pass.cpp
> ---------------------------------------------------===//
>  //
> diff --git a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/scan.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/scan.cc
> index bcd5ad116d8f..a9bbed644eca 100644
> --- a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/scan.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/scan.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- scan.pass.cpp
> -----------------------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc
> index 7497d60d8e9a..4cce8fefd820 100644
> ---
> a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc
> +++
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_reduce.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- transform_reduce.pass.cpp
> -----------------------------------------===//
>  //
> diff --git
> a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc
> b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc
> index e785a95f450b..585cba5ea6a8 100644
> --- a/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc
> @@ -1,8 +1,8 @@
>  // -*- C++ -*-
> -// { dg-options "-ltbb" }
>  // { dg-do run { target c++17 } }
>  // { dg-timeout-factor 3 }
> -// { dg-require-effective-target tbb_backend }
> +// { dg-require-effective-target pstl_backend }
> +// { dg-add-options pstl }
>
>  //===-- transform_scan.pass.cpp
> -------------------------------------------===//
>  //
> diff --git a/libstdc++-v3/testsuite/Makefile.am
> b/libstdc++-v3/testsuite/Makefile.am
> index e8b6eb9e8ad4..4516b638de0c 100644
> --- a/libstdc++-v3/testsuite/Makefile.am
> +++ b/libstdc++-v3/testsuite/Makefile.am
> @@ -97,6 +97,11 @@ new-abi-baseline:
>         @test ! -f $*/site.exp || mv $*/site.exp $*/site.bak
>         @mv $*/site.exp.tmp $*/site.exp
>
> +libgomp_dir=${glibcxx_builddir}/../libgomp
> +libgomp_flags=-B${glibcxx_builddir}/../libgomp \
> +             -I${glibcxx_builddir}/../libgomp \
> +             -L${glibcxx_builddir}/../libgomp/.libs -lgomp
> +
>  check_p_numbers0:=1 2 3 4 5 6 7 8 9
>  check_p_numbers1:=0 $(check_p_numbers0)
>  check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix
> $(i),$(check_p_numbers1)))
> @@ -131,6 +136,7 @@ check-DEJAGNU $(check_DEJAGNU_normal_targets):
> check-DEJAGNU%: site.exp
>           exit 0; \
>         fi; \
>         srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
> +       libgomp_flags="$(libgomp_flags)"; export libgomp_flags; \
>         EXPECT=$(EXPECT); export EXPECT; \
>         runtest=$(RUNTEST); \
>         if [ -z "$$runtest" ]; then runtest=runtest; fi; \
> @@ -200,11 +206,6 @@ check-simd:
> $(srcdir)/experimental/simd/generate_makefile.sh \
>  debug_flags = "unix/-D_GLIBCXX_DEBUG"
>
>  # Runs the testsuite in parallel mode.
> -libgomp_dir=${glibcxx_builddir}/../libgomp
> -libgomp_flags=-B${glibcxx_builddir}/../libgomp \
> -              -I${glibcxx_builddir}/../libgomp \
> -             -L${glibcxx_builddir}/../libgomp/.libs -lgomp
> -
>  atomic_flags=$(ATOMIC_FLAGS)
>  parallel_flags="unix/-D_GLIBCXX_PARALLEL/-fopenmp"
>
> diff --git a/libstdc++-v3/testsuite/Makefile.in
> b/libstdc++-v3/testsuite/Makefile.in
> index 051524c921e5..0bb7aaa200d6 100644
> --- a/libstdc++-v3/testsuite/Makefile.in
> +++ b/libstdc++-v3/testsuite/Makefile.in
> @@ -397,6 +397,11 @@ lists_of_files = \
>
>  extract_symvers = $(glibcxx_builddir)/scripts/extract_symvers
>  baseline_subdir := $(shell $(CXX) $(baseline_subdir_switch))
> +libgomp_dir = ${glibcxx_builddir}/../libgomp
> +libgomp_flags = -B${glibcxx_builddir}/../libgomp \
> +             -I${glibcxx_builddir}/../libgomp \
> +             -L${glibcxx_builddir}/../libgomp/.libs -lgomp
> +
>  check_p_numbers0 := 1 2 3 4 5 6 7 8 9
>  check_p_numbers1 := 0 $(check_p_numbers0)
>  check_p_numbers2 := $(foreach i,$(check_p_numbers0),$(addprefix
> $(i),$(check_p_numbers1)))
> @@ -425,11 +430,6 @@ check_performance_script =
> ${glibcxx_srcdir}/scripts/check_performance
>  debug_flags = "unix/-D_GLIBCXX_DEBUG"
>
>  # Runs the testsuite in parallel mode.
> -libgomp_dir = ${glibcxx_builddir}/../libgomp
> -libgomp_flags = -B${glibcxx_builddir}/../libgomp \
> -              -I${glibcxx_builddir}/../libgomp \
> -             -L${glibcxx_builddir}/../libgomp/.libs -lgomp
> -
>  atomic_flags = $(ATOMIC_FLAGS)
>  parallel_flags = "unix/-D_GLIBCXX_PARALLEL/-fopenmp"
>
> @@ -682,6 +682,7 @@ check-DEJAGNU $(check_DEJAGNU_normal_targets):
> check-DEJAGNU%: site.exp
>           exit 0; \
>         fi; \
>         srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
> +       libgomp_flags="$(libgomp_flags)"; export libgomp_flags; \
>         EXPECT=$(EXPECT); export EXPECT; \
>         runtest=$(RUNTEST); \
>         if [ -z "$$runtest" ]; then runtest=runtest; fi; \
> diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp
> b/libstdc++-v3/testsuite/lib/dg-options.exp
> index a9563026174d..eb94a21fb666 100644
> --- a/libstdc++-v3/testsuite/lib/dg-options.exp
> +++ b/libstdc++-v3/testsuite/lib/dg-options.exp
> @@ -380,6 +380,16 @@ proc add_options_for_using-deprecated { flags } {
>      return "$flags -U_GLIBCXX_USE_DEPRECATED -D_GLIBCXX_USE_DEPRECATED=1"
>  }
>
> +# Add options to enable use of either TBB or OpenMP for parallel algos.
> +proc add_options_for_pstl { flags } {
> +    if [check_effective_target_tbb_backend] {
> +       return "$flags -D_GLIBCXX_USE_TBB_PAR_BACKEND -ltbb"
> +    } elseif [check_effective_target_openmp_backend] {
> +       global env
> +       return "$flags -D_GLIBCXX_USE_OPENMP_PAR_BACKEND -fopenmp
> $env(libgomp_flags)"
> +    }
> +}
> +
>  # Add options for strict -std=c++NN dialects.
>  # This is a dummy option that does nothing, but it causes v3-dg-runtest
>  # to alter its behaviour.
> diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp
> b/libstdc++-v3/testsuite/lib/libstdc++.exp
> index ab94bef3907d..7d18f637ec8c 100644
> --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> @@ -1556,6 +1556,12 @@ proc check_effective_target_tbb_backend { } {
>
>          set f [open $src "w"]
>          puts $f "#include <tbb/tbb.h>"
> +        puts $f "#if _GLIBCXX_USE_OPENMP_PAR_BACKEND"
> +        puts $f "#  error OpenMP backend explicitly requested"
> +        puts $f "#endif"
> +        puts $f "#if defined _GLIBCXX_USE_TBB_PAR_BACKEND &&
> !_GLIBCXX_USE_TBB_PAR_BACKEND"
> +        puts $f "#  error TBB backend explicitly disabled"
> +        puts $f "#endif"
>          puts $f "#if TBB_INTERFACE_VERSION < 10000"
>          puts $f "#  error Intel(R) Threading Building Blocks 2018 is
> required; older versions are not supported."
>          puts $f "#endif"
> @@ -1579,6 +1585,54 @@ proc check_effective_target_tbb_backend { } {
>      }]
>  }
>
> +# Return 1 if openmp parallel backend is available, 0 otherwise.
> +proc check_effective_target_openmp_backend { } {
> +    return [check_v3_target_prop_cached et_openmp {
> +        global env
> +        if {![info exists env(libgomp_flags)]} { return 0 }
> +
> +        # Set up and compile a C++ test program that depends on OpenMP
> +        set src openmp_backend[pid].cc
> +        set exe openmp_backend[pid].x
> +
> +        set f [open $src "w"]
> +        puts $f "#if _GLIBCXX_USE_TBB_PAR_BACKEND"
> +        puts $f "#  error TBB backend explicitly requested"
> +        puts $f "#endif"
> +        puts $f "#if defined _GLIBCXX_USE_OPENMP_PAR_BACKEND &&
> !_GLIBCXX_USE_OPENMP_PAR_BACKEND"
> +        puts $f "#  error OpenMP backend explicitly disabled"
> +        puts $f "#endif"
> +        puts $f "#include <omp.h>"
> +        puts $f "int main ()"
> +        puts $f "{"
> +        puts $f "  return 0;"
> +        puts $f "}"
> +        close $f
> +
> +        set libgomp_flags ""
> +        foreach flag $env(libgomp_flags) {
> +            append libgomp_flags "additional_flags=$flag"
> +        }
> +
> +        set lines [v3_target_compile $src $exe executable
> "additional_flags=-std=c++17 additional_flags=-fopenmp $libgomp_flags"]
> +        file delete $src
> +
> +        if [string match "" $lines] {
> +            # No error message, compilation succeeded.
> +            verbose "check_et_openmp_backend: `1'" 2
> +            return 1
> +        }
> +        verbose "check_et_openmp_backend: `0'" 2
> +        return 0
> +    }]
> +}
> +
> +# Return 1 if either tbb or openmp parallel backend is available, 0
> otherwise.
> +proc check_effective_target_pstl_backend { } {
> +    return [expr { [check_effective_target_tbb_backend]
> +                 || [check_effective_target_openmp_backend] }]
> +}
> +
>  # Return 1 if futex syscall is available
>  proc check_effective_target_futex { } {
>      return [check_v3_target_prop_cached et_futex {
> --
> 2.56.1
>
>

Reply via email to