diff options
Diffstat (limited to 'libstdc++-v3/testsuite/lib/libstdc++.exp')
-rw-r--r-- | libstdc++-v3/testsuite/lib/libstdc++.exp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index cca70780ef4..8322fac04f9 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -1894,6 +1894,59 @@ proc check_v3_target_little_endian { } { return $et_little_endian } +proc check_v3_target_filesystem_ts { } { + global cxxflags + global DEFAULT_CXXFLAGS + global et_filesystem_ts + global tool + + if { ![info exists et_filesystem_ts_target_name] } { + set et_filesystem_ts_target_name "" + } + + # If the target has changed since we set the cached value, clear it. + set current_target [current_target_name] + if { $current_target != $et_filesystem_ts_target_name } { + verbose "check_v3_target_filesystem_ts: `$et_filesystem_ts_target_name'" 2 + set et_filesystem_ts_target_name $current_target + if [info exists et_filesystem_ts] { + verbose "check_v3_target_filesystem_ts: removing cached result" 2 + unset et_filesystem_ts + } + } + + if [info exists et_filesystem_ts] { + verbose "check_v3_target_filesystem_ts: using cached result" 2 + } else { + set et_filesystem_ts 0 + + # Set up and preprocess a C++ test program that depends + # on debug mode activated. + set src filesystem_ts[pid].cc + + set f [open $src "w"] + puts $f "#include <experimental/filesystem>" + puts $f "#if ! __cpp_lib_experimental_filesystem" + puts $f "# error No Filesystem TS support" + puts $f "#endif" + close $f + + set cxxflags_saved $cxxflags + set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror -std=gnu++11" + + set lines [v3_target_compile $src /dev/null preprocess ""] + set cxxflags $cxxflags_saved + file delete $src + + if [string match "" $lines] { + # No error message, preprocessing succeeded. + set et_filesystem_ts 1 + } + } + verbose "check_v3_target_filesystem_ts: $et_filesystem_ts" 2 + return $et_filesystem_ts +} + set additional_prunes "" if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \ |