diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8c90e3a99cc..93892d125fe 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2008-07-31 Paolo Carlini + + * testsuite/lib/libstdc++.exp (libstdc++_init): Set v3-libgomp. + (check_v3_target_parallel_mode): Robustify, just follow the + structure of testsuite/Makefile.am. + 2008-07-29 Paolo Carlini * include/debug/set.h: Minor formatting fixes. diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index afcaa19d136..9412ce976ad 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -81,7 +81,7 @@ proc v3-copy-files {srcfiles} { # Called once, during runtest.exp setup. proc libstdc++_init { testfile } { global env - global v3-sharedlib + global v3-sharedlib v3-libgomp global srcdir blddir objdir tool_root_dir global cc cxx cxxflags cxxpchflags cxxldflags global includes @@ -135,10 +135,13 @@ proc libstdc++_init { testfile } { v3track gccdir 3 # Locate libgomp. This is only required for parallel mode. + set v3-libgomp 0 set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so] if {$libgompdir != ""} { + set v3-libgomp 1 set libgompdir [file dirname $libgompdir] append ld_library_path_tmp ":${libgompdir}" + verbose -log "libgomp support detected" } v3track libgompdir 3 @@ -968,7 +971,7 @@ proc check_v3_target_debug_mode { } { proc check_v3_target_parallel_mode { } { global cxxflags - global DEFAULT_CXXFLAGS + global v3-libgomp global et_parallel_mode global tool @@ -993,29 +996,9 @@ proc check_v3_target_parallel_mode { } { } else { set et_parallel_mode 0 - # Set up and compile a C++ test program that depends - # on parallel mode working. - set src parallel_mode[pid].cc - set exe parallel_mode[pid].exe - - set f [open $src "w"] - puts $f "#include " - puts $f "int main()" - puts $f "{ return 0; }" - close $f - - set cxxflags_saved $cxxflags - set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror" - - set lines [v3_target_compile $src $exe executable ""] - set cxxflags $cxxflags_saved - file delete $src - - if [string match "" $lines] { - # No error message, compilation succeeded. + # If 'make check-parallel' is running the test succeeds. + if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } { set et_parallel_mode 1 - } else { - verbose "check_v3_target_parallel_mode: compilation failed" 2 } } verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2