From: Tobias Burnus Date: Fri, 30 Oct 2020 16:11:20 +0000 (+0100) Subject: testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not avail X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=24d762d1435257a8efd242c4a1a476c9b2037c03;p=gcc.git testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not avail gcc/testsuite/ * g++.dg/guality/guality.exp: Skip $rootme-based check if unset. * gcc.dg/guality/guality.exp: Likewise. * gfortran.dg/guality/guality.exp: Likewise. * lib/asan-dg.exp: Don't use $asan_saved_library_path if not set. * lib/tsan-dg.exp: Don't use $tsan_saved_library_path if not set. * lib/ubsan-dg.exp: Don't use $ubsan_saved_library_path if not set. --- diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp index 33571f1f28f..1d5b65fef57 100644 --- a/gcc/testsuite/g++.dg/guality/guality.exp +++ b/gcc/testsuite/g++.dg/guality/guality.exp @@ -38,7 +38,7 @@ global GDB if ![info exists ::env(GUALITY_GDB_NAME)] { if [info exists GDB] { set guality_gdb_name "$GDB" - } elseif [file exists $rootme/../gdb/gdb] { + } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { # If we're doing a combined build, and gdb is available, use it. set guality_gdb_name "$rootme/../gdb/gdb" } else { diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp index 89cd896d05c..ba87132aef2 100644 --- a/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc/testsuite/gcc.dg/guality/guality.exp @@ -38,7 +38,7 @@ global GDB if ![info exists ::env(GUALITY_GDB_NAME)] { if [info exists GDB] { set guality_gdb_name "$GDB" - } elseif [file exists $rootme/../gdb/gdb] { + } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { # If we're doing a combined build, and gdb is available, use it. set guality_gdb_name "$rootme/../gdb/gdb" } else { diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp index eaa7ae770d6..0375edfffe4 100644 --- a/gcc/testsuite/gfortran.dg/guality/guality.exp +++ b/gcc/testsuite/gfortran.dg/guality/guality.exp @@ -19,7 +19,7 @@ global GDB if ![info exists ::env(GUALITY_GDB_NAME)] { if [info exists GDB] { set guality_gdb_name "$GDB" - } elseif [file exists $rootme/../gdb/gdb] { + } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { # If we're doing a combined build, and gdb is available, use it. set guality_gdb_name "$rootme/../gdb/gdb" } else { diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp index 2124607245e..ce745dfdf8d 100644 --- a/gcc/testsuite/lib/asan-dg.exp +++ b/gcc/testsuite/lib/asan-dg.exp @@ -151,8 +151,10 @@ proc asan_finish { args } { unset TEST_ALWAYS_FLAGS } } - set ld_library_path $asan_saved_library_path - set_ld_library_path_env_vars + if [info exists asan_saved_library_path ] { + set ld_library_path $asan_saved_library_path + set_ld_library_path_env_vars + } clear_effective_target_cache } diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp index b5631a79bcf..6dcfd0a2f83 100644 --- a/gcc/testsuite/lib/tsan-dg.exp +++ b/gcc/testsuite/lib/tsan-dg.exp @@ -150,7 +150,9 @@ proc tsan_finish { args } { } else { unset dg-do-what-default } - set ld_library_path $tsan_saved_library_path - set_ld_library_path_env_vars + if [info exists tsan_saved_library_path ] { + set ld_library_path $tsan_saved_library_path + set_ld_library_path_env_vars + } clear_effective_target_cache } diff --git a/gcc/testsuite/lib/ubsan-dg.exp b/gcc/testsuite/lib/ubsan-dg.exp index f4ab29e2add..31740e02ab4 100644 --- a/gcc/testsuite/lib/ubsan-dg.exp +++ b/gcc/testsuite/lib/ubsan-dg.exp @@ -141,7 +141,9 @@ proc ubsan_finish { args } { unset TEST_ALWAYS_FLAGS } } - set ld_library_path $ubsan_saved_library_path - set_ld_library_path_env_vars + if [info exists ubsan_saved_library_path ] { + set ld_library_path $ubsan_saved_library_path + set_ld_library_path_env_vars + } clear_effective_target_cache }