libstdc++: Skip PSTL tests when installed TBB is too old [PR 96718]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 21 Aug 2020 11:01:05 +0000 (12:01 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 21 Aug 2020 11:01:05 +0000 (12:01 +0100)
These tests do not actually require TBB, because they only inspect the
feature test macros present in the headers. However, if TBB is installed
then its headers will be included, and the version will be checked. If
the version is too old, compilation fails due to a #error directive.

This change disables the tests if TBB is not present, so that we skip
them instead of failing.

libstdc++-v3/ChangeLog:

PR libstdc++/96718
* testsuite/25_algorithms/pstl/feature_test-2.cc: Require
tbb-backend effective target.
* testsuite/25_algorithms/pstl/feature_test-3.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test-5.cc: Likewise.
* testsuite/25_algorithms/pstl/feature_test.cc: Likewise.

libstdc++-v3/testsuite/25_algorithms/pstl/feature_test-2.cc
libstdc++-v3/testsuite/25_algorithms/pstl/feature_test-3.cc
libstdc++-v3/testsuite/25_algorithms/pstl/feature_test-5.cc
libstdc++-v3/testsuite/25_algorithms/pstl/feature_test.cc

index 3e74f89bc41185a6c2ae158b62907ce09e3c10a4..88c5ea5b1d1923b9e917c0d435101c6d326cd2c6 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++17" }
 // { dg-do preprocess { target c++17 } }
+// { dg-require-effective-target tbb-backend }
 
 #include <numeric>
 
index 7693fe03548587ba1f5406ac94ca9307e1058564..4d75a1862116f2183d6ad516664daaef8777d2b0 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++17" }
 // { dg-do preprocess { target c++17 } }
+// { dg-require-effective-target tbb-backend }
 
 #include <execution>
 
index 2d991958e75c15a1e7ac462bd865c1efc2adeef3..f6f910204fe75ab6b72a76a0948e0ab30bb3db0f 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++17" }
 // { dg-do preprocess { target c++17 } }
+// { dg-require-effective-target tbb-backend }
 
 #include <memory>
 
index c3a9be5e45a256d3661d6a44d7e08e74c354dd2c..817bda3474e71aa9e7eff4c816ee0f3e7cfa565b 100644 (file)
@@ -17,6 +17,7 @@
 
 // { dg-options "-std=gnu++17" }
 // { dg-do preprocess { target c++17 } }
+// { dg-require-effective-target tbb-backend }
 
 #include <algorithm>