OSDN Git Service

2008-07-31 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jul 2008 18:43:08 +0000 (18:43 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jul 2008 18:43:08 +0000 (18:43 +0000)
* testsuite/lib/libstdc++.exp (libstdc++_init): Set v3-libgomp.
(check_v3_target_parallel_mode): Robustify, just follow the
structure of testsuite/Makefile.am.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138428 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/lib/libstdc++.exp

index 8c90e3a..93892d1 100644 (file)
@@ -1,3 +1,9 @@
+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.
index afcaa19..9412ce9 100644 (file)
@@ -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 <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