diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e723c3ec5c..ee6dbb5a8a2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-01 H.J. Lu + + (restore_ld_library_path_env_vars): Always restore GCC_EXEC_PREFIX + to its original value, or unset if it was not defined. + 2009-03-31 Jason Merrill * g++.old-deja/g++.other/using9.C: Add expected errors. diff --git a/gcc/testsuite/lib/target-libpath.exp b/gcc/testsuite/lib/target-libpath.exp index c95cba6d784..6a01d9498e7 100644 --- a/gcc/testsuite/lib/target-libpath.exp +++ b/gcc/testsuite/lib/target-libpath.exp @@ -213,16 +213,16 @@ proc restore_ld_library_path_env_vars { } { global orig_gcc_exec_prefix global env - if { $orig_environment_saved == 0 } { - return - } - if { $orig_gcc_exec_prefix_saved } { setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix" } elseif [info exists env(GCC_EXEC_PREFIX)] { unsetenv GCC_EXEC_PREFIX } + if { $orig_environment_saved == 0 } { + return + } + if { $orig_ld_library_path_saved } { setenv LD_LIBRARY_PATH "$orig_ld_library_path" } elseif [info exists env(LD_LIBRARY_PATH)] {