+2008-07-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * 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 <paolo.carlini@oracle.com>
* include/debug/set.h: Minor formatting fixes.
# 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
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
proc check_v3_target_parallel_mode { } {
global cxxflags
- global DEFAULT_CXXFLAGS
+ global v3-libgomp
global et_parallel_mode
global tool
} 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 <omp.h>"
- 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