[PATCH] Check TBB version in tbb-backed effective target check

Jonathan Wakely jwakely@redhat.com
Wed Apr 24 20:36:00 GMT 2019


On 24/04/19 11:40 -0700, Thomas Rodgers wrote:
>
>	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
>	Add check for Thread Building Blocks 2018 or later.
>

>From bd3de7b67f184ed1387b63dc3bda1d12f7ebee04 Mon Sep 17 00:00:00 2001
>From: Thomas Rodgers <trodgers@redhat.com>
>Date: Wed, 24 Apr 2019 11:34:14 -0700
>Subject: [PATCH] Check TBB version in tbb-backed effective target check
>
>	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
>	Add check for Thread Building Blocks 2018 or later.
>---
> libstdc++-v3/testsuite/lib/libstdc++.exp | 42 +++++++++++++-----------
> 1 file changed, 23 insertions(+), 19 deletions(-)
>
>diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
>index d0efc90a1ba..c48b4d78bbb 100644
>--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
>+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
>@@ -1607,25 +1607,29 @@ proc check_effective_target_random_device { } {
> 
> # Return 1 if tbb parallel backend is available
> proc check_effective_target_tbb-backend { } {
>-		global cxxflags
>-
>-		# Set up and preprocess a C++ test program that depends
>-		# on tbb
>-		set src tbb_backend[pid].cc
>-
>-		set f [open $src "w"]
>-		puts $f "#include <tbb/tbb.h>"
>-		close $f
>-		set lines [v3_target_compile $src /dev/null preprocess ""]
>-		file delete $src
>-
>-		if [string match "" $lines] {
>-				# No error message, preprocessing succeeded.
>-				verbose "check_v3_tbb-backend: `1'" 2
>-				return 1
>-		}
>-		verbose "check_v3_tbb-backend: `0'" 2
>-		return 0
>+    global cxxflags
>+
>+    # Set up and preprocess a C++ test program that depends
>+    # on tbb
>+    set src tbb_backend[pid].cc
>+
>+    set f [open $src "w"]
>+    puts $f "#include <tbb/tbb.h>"
>+    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"
>+    close $f
>+    

This line above has four spaces, but can be just an empty line.

OK for trunk with that tweak, thanks.



More information about the Libstdc++ mailing list