From d748c543b603704ac8ec8214cc8614ddf01aea47 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Tue, 21 May 2019 01:06:32 +0000 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. From-SVN: r271450 --- libstdc++-v3/ChangeLog | 5 +++ libstdc++-v3/testsuite/lib/libstdc++.exp | 42 +++++++++++++----------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index cf78ab458d3..5633216ca3d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2019-05-20 Thomas Rodgers + + * testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend): + Add check for Thread Building Blocks 2018 or later. + 2019-05-20 Jonathan Wakely * testsuite/experimental/names.cc: Only include Networking TS headers diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 87fbed696ed..011630f6d32 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -1581,25 +1581,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 " - 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 " + 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 + + 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 } set additional_prunes "" -- 2.30.2