]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/26149 (libgomp.c/ordered-2.c fails on x86_64-linux-gnu with -m32)
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue, 11 Mar 2008 15:35:51 +0000 (15:35 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Tue, 11 Mar 2008 15:35:51 +0000 (15:35 +0000)
PR target/26149

Backport:

2007-03-18 Uros Bizjak <ubizjak@gmail.com>

* testsuite/config/default.exp: New file.
* testsuite/lib/libgomp.exp: New file.
* testsuite/lib/libgomp.dg (load_gcc_lib, libgomp_init,
libgomp_target_compile, libgomp_option_help, libgomp_option_proc,
load_lib *, load_gcc_lib *): Move to libgomp.exp.
(libgomp_load): Remove.
* testsuite/lib/libgomp.exp (libgomp_init): Compute
always_ld_library_path, not ld_library_path. Set additional_flags
to -march=i486 for ilp32 x86_64-*-* and i386-*-* targets.
(target_compile): Do not call libgomp_init. Append
lang_library_path and lang_link_flags to options.
* testsuite/libgomp.c/c.exp: Set DEFAULT_FLAGS to -O2. Set
ld_library_path from always_ld_library_path. Set LD_LIBRARY_PATH here.
* testsuite/libgomp.c++/c++.exp: Set ld_library_path from
always_ld_library_path. Set LD_LIBRARY_PATH here.
* testsuite/libgomp.fortran/fortran.exp: Ditto.
* testsuite/libgomp.c/atomic-1.c: Set dg-options to
"-O2 -march=pentium" for ilp32 x86 targets. Simplify check for CX8 flag.
* testsuite/libgomp.c/pr29947-1.c: Remove default dg-options.
* testsuite/libgomp.c/pr29947-1.c: Ditto.
* testsuite/libgomp.c/atomic-10.c: Ditto.

2007-03-22 Andreas Tobler <a.tobler@schweiz.org>

* testsuite/lib/libgomp.exp (libgomp_init): Add -shared-libgcc for
*-*-darwin*.
* testsuite/libgomp.c++/c++.exp: Look for shared libstdc++ library
and use it if found.

2007-04-06  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

PR testsuite/31369
* testsuite/libgomp.c++/c++.exp: Don't use concat when setting
ld_library_path.
* testsuite/libgomp.fortran/fortran.exp: Likewise.

2007-03-21  Jakub Jelinek  <jakub@redhat.com>

* testsuite/libgomp.fortran/appendix-a/a.22.8.f90: Add
dg-final cleanup-modules line.
* testsuite/libgomp.fortran/appendix-a/a.40.1.f90: Likewise.
* testsuite/libgomp.fortran/appendix-a/a.31.5.f90: Likewise.
* testsuite/libgomp.fortran/appendix-a/a.31.4.f90: Likewise.
* testsuite/libgomp.fortran/threadprivate2.f90: Likewise.
* testsuite/libgomp.fortran/reduction5.f90: Likewise.
* testsuite/libgomp.fortran/threadprivate3.f90: Likewise.
* testsuite/libgomp.fortran/threadprivate1.f90: Likewise.

2007-10-25  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/33275
* testsuite/libgomp.fortran/omp_parse3.f90 (test_threadprivate):
Make x and y integers rather than (implicit) reals.  Add private (j)
clause to the last omp parallel.

From-SVN: r133114

20 files changed:
libgomp/ChangeLog
libgomp/testsuite/config/default.exp [new file with mode: 0644]
libgomp/testsuite/lib/libgomp-dg.exp
libgomp/testsuite/lib/libgomp.exp [new file with mode: 0644]
libgomp/testsuite/libgomp.c++/c++.exp
libgomp/testsuite/libgomp.c/atomic-1.c
libgomp/testsuite/libgomp.c/atomic-10.c
libgomp/testsuite/libgomp.c/c.exp
libgomp/testsuite/libgomp.c/pr29947-1.c
libgomp/testsuite/libgomp.c/pr29947-2.c
libgomp/testsuite/libgomp.fortran/appendix-a/a.22.8.f90
libgomp/testsuite/libgomp.fortran/appendix-a/a.31.4.f90
libgomp/testsuite/libgomp.fortran/appendix-a/a.31.5.f90
libgomp/testsuite/libgomp.fortran/appendix-a/a.40.1.f90
libgomp/testsuite/libgomp.fortran/fortran.exp
libgomp/testsuite/libgomp.fortran/omp_parse3.f90
libgomp/testsuite/libgomp.fortran/reduction5.f90
libgomp/testsuite/libgomp.fortran/threadprivate1.f90
libgomp/testsuite/libgomp.fortran/threadprivate2.f90
libgomp/testsuite/libgomp.fortran/threadprivate3.f90

index 1400fcf8dfb2ee289a38097ed2317bf5476255cc..dbcbcd9e4548bba37a9df69813fa185b202b7ed4 100644 (file)
@@ -1,3 +1,66 @@
+2008-03-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       PR target/26149
+
+       Backport:
+
+       2007-03-18 Uros Bizjak <ubizjak@gmail.com>
+
+       * testsuite/config/default.exp: New file.
+       * testsuite/lib/libgomp.exp: New file.
+       * testsuite/lib/libgomp.dg (load_gcc_lib, libgomp_init,
+       libgomp_target_compile, libgomp_option_help, libgomp_option_proc,
+       load_lib *, load_gcc_lib *): Move to libgomp.exp.
+       (libgomp_load): Remove.
+       * testsuite/lib/libgomp.exp (libgomp_init): Compute
+       always_ld_library_path, not ld_library_path. Set additional_flags
+       to -march=i486 for ilp32 x86_64-*-* and i386-*-* targets.
+       (target_compile): Do not call libgomp_init. Append
+       lang_library_path and lang_link_flags to options.
+       * testsuite/libgomp.c/c.exp: Set DEFAULT_FLAGS to -O2. Set
+       ld_library_path from always_ld_library_path. Set LD_LIBRARY_PATH here.
+       * testsuite/libgomp.c++/c++.exp: Set ld_library_path from
+       always_ld_library_path. Set LD_LIBRARY_PATH here.
+       * testsuite/libgomp.fortran/fortran.exp: Ditto.
+       * testsuite/libgomp.c/atomic-1.c: Set dg-options to
+       "-O2 -march=pentium" for ilp32 x86 targets. Simplify check for CX8 flag.
+       * testsuite/libgomp.c/pr29947-1.c: Remove default dg-options.
+       * testsuite/libgomp.c/pr29947-1.c: Ditto.
+       * testsuite/libgomp.c/atomic-10.c: Ditto.
+
+       2007-03-22 Andreas Tobler <a.tobler@schweiz.org>
+
+       * testsuite/lib/libgomp.exp (libgomp_init): Add -shared-libgcc for
+       *-*-darwin*.
+       * testsuite/libgomp.c++/c++.exp: Look for shared libstdc++ library
+       and use it if found.
+
+       2007-04-06  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR testsuite/31369
+       * testsuite/libgomp.c++/c++.exp: Don't use concat when setting
+       ld_library_path.
+       * testsuite/libgomp.fortran/fortran.exp: Likewise.
+
+       2007-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       * testsuite/libgomp.fortran/appendix-a/a.22.8.f90: Add
+       dg-final cleanup-modules line.
+       * testsuite/libgomp.fortran/appendix-a/a.40.1.f90: Likewise.
+       * testsuite/libgomp.fortran/appendix-a/a.31.5.f90: Likewise.
+       * testsuite/libgomp.fortran/appendix-a/a.31.4.f90: Likewise.
+       * testsuite/libgomp.fortran/threadprivate2.f90: Likewise.
+       * testsuite/libgomp.fortran/reduction5.f90: Likewise.
+       * testsuite/libgomp.fortran/threadprivate3.f90: Likewise.
+       * testsuite/libgomp.fortran/threadprivate1.f90: Likewise.
+
+       2007-10-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR libgomp/33275
+       * testsuite/libgomp.fortran/omp_parse3.f90 (test_threadprivate):
+       Make x and y integers rather than (implicit) reals.  Add private (j)
+       clause to the last omp parallel.
+
 2008-02-01  Release Manager
 
        * GCC 4.2.3 released.
diff --git a/libgomp/testsuite/config/default.exp b/libgomp/testsuite/config/default.exp
new file mode 100644 (file)
index 0000000..3f54559
--- /dev/null
@@ -0,0 +1,17 @@
+#   Copyright (C) 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  
+
+load_lib "standard.exp"
index f8c6a427d18adc9b5cf8cc86831a7bd434075c23..ebf78e17e6d8db2ca4c1697dcf468c209b2aaeee 100644 (file)
@@ -1,221 +1,3 @@
-# Damn dejagnu for not having proper library search paths for load_lib.
-# We have to explicitly load everything that gcc-dg.exp wants to load.
-
-proc load_gcc_lib { filename } {
-    global srcdir loaded_libs
-
-    load_file $srcdir/../../gcc/testsuite/lib/$filename
-    set loaded_libs($filename) ""
-}
-
-load_lib dg.exp
-load_gcc_lib file-format.exp
-load_gcc_lib target-supports.exp
-load_gcc_lib target-supports-dg.exp
-load_gcc_lib scanasm.exp
-load_gcc_lib scandump.exp
-load_gcc_lib scanrtl.exp
-load_gcc_lib scantree.exp
-load_gcc_lib scanipa.exp
-load_gcc_lib prune.exp
-load_gcc_lib target-libpath.exp
-load_gcc_lib wrapper.exp
-load_gcc_lib gcc-defs.exp
-load_gcc_lib gcc-dg.exp
-load_gcc_lib gfortran-dg.exp
-
-set dg-do-what-default run
-
-#
-# GCC_UNDER_TEST is the compiler under test.
-#
-
-set libgomp_compile_options ""
-
-#
-# libgomp_init -- This gets run more than it should be....
-#
-
-if [info exists TOOL_OPTIONS] {
-    set multilibs [get_multilibs $TOOL_OPTIONS]
-} else {
-    set multilibs [get_multilibs]
-}
-
-proc libgomp_init { args } {
-    global srcdir blddir objdir tool_root_dir
-    global libgomp_initialized
-    global tmpdir
-    global gluefile wrap_flags
-    global ALWAYS_CFLAGS
-    global CFLAGS
-    global TOOL_EXECUTABLE TOOL_OPTIONS
-    global GCC_UNDER_TEST
-    global TESTING_IN_BUILD_TREE
-    global target_triplet
-    global ld_library_path
-    global lang_test_file
-    global lang_library_path
-    global lang_link_flags
-
-    set blddir [lookfor_file [get_multilibs] libgomp]
-
-    # We set LC_ALL and LANG to C so that we get the same error
-    # messages as expected.
-    setenv LC_ALL C
-    setenv LANG C
-
-    if ![info exists GCC_UNDER_TEST] then {
-       if [info exists TOOL_EXECUTABLE] {
-           set GCC_UNDER_TEST $TOOL_EXECUTABLE
-       } else {
-           set GCC_UNDER_TEST "[find_gcc]"
-       }
-    }
-
-    if ![info exists tmpdir] {
-       set tmpdir "/tmp"
-    }
-
-    if [info exists gluefile] {
-       unset gluefile
-    }
-
-    if {![info exists CFLAGS]} {
-       set CFLAGS ""
-    }
-
-    # Locate libgcc.a so we don't need to account for different values of
-    # SHLIB_EXT on different platforms
-    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
-    if {$gccdir != ""} {
-        set gccdir [file dirname $gccdir]
-    }
-
-    # Compute what needs to be put into LD_LIBRARY_PATH
-    set ld_library_path ".:${blddir}/.libs"
-
-    if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
-       append ld_library_path ":${blddir}/${lang_library_path}"
-    }
-
-    # Compute what needs to be added to the existing LD_LIBRARY_PATH.
-    if {$gccdir != ""} {
-       append ld_library_path ":${gccdir}"
-       set compiler [lindex $GCC_UNDER_TEST 0]
-
-       if { [is_remote host] == 0 && [which $compiler] != 0 } {
-         foreach i "[exec $compiler --print-multi-lib]" {
-           set mldir ""
-           regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
-           set mldir [string trimright $mldir "\;@"]
-           if { "$mldir" == "." } {
-             continue
-           }
-           if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
-             append ld_library_path ":${gccdir}/${mldir}"
-           }
-         }
-       }
-    }
-    set_ld_library_path_env_vars
-
-    set ALWAYS_CFLAGS ""
-    lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
-    lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
-    lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
-    lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs -lgomp"
-    if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
-       lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/${lang_library_path} ${lang_link_flags}"
-    }
-
-    # We use atomic operations in the testcases to validate results.
-    if [istarget i?86-*-*] {
-       lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
-    }
-    if [istarget sparc*-*-*] {
-       lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
-    }
-
-    if [info exists TOOL_OPTIONS] {
-       lappend ALWAYS_CFLAGS "additional_flags=$TOOL_OPTIONS"
-    }
-
-    # Make sure that lines are not wrapped.  That can confuse the
-    # error-message parsing machinery.
-    lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0"
-
-    # And, gee, turn on OpenMP.
-    lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
-}
-
-#
-# libgomp_target_compile -- compile a source file
-#
-
-proc libgomp_target_compile { source dest type options } {
-    global tmpdir
-    global libgomp_compile_options
-    global gluefile wrap_flags
-    global ALWAYS_CFLAGS
-    global GCC_UNDER_TEST
-
-    libgomp_init
-
-    if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
-       lappend options "libs=${gluefile}"
-       lappend options "ldflags=${wrap_flags}"
-    }
-
-    lappend options "additional_flags=[libio_include_flags]"
-    lappend options "compiler=$GCC_UNDER_TEST"
-
-    set options [concat $libgomp_compile_options $options]
-
-    set options [concat "$ALWAYS_CFLAGS" $options]
-
-    set options [dg-additional-files-options $options $source]
-
-    set result [target_compile $source $dest $type $options]
-
-    return $result
-}
-
-# ??? The same as in standard.exp.  Why doesn't anyone else have to 
-# define this?
-
-proc libgomp_load { program args } {
-    if { [llength $args] > 0 } {
-        set program_args [lindex $args 0]
-    } else {
-        set program_args ""
-    }
-
-    if { [llength $args] > 1 } {
-        set input_file [lindex $args 1]
-    } else {
-        set input_file ""
-    }
-    return [remote_load target $program $program_args $input_file]
-}
-
-proc libgomp_option_help { } {
-    send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n"
-}
-
-proc libgomp_option_proc { option } {
-    if [regexp "^--additional_options," $option] {
-       global libgomp_compile_options
-       regsub "--additional_options," $option "" option
-       foreach x [split $option ","] {
-           lappend libgomp_compile_options "additional_flags=$x"
-       }
-       return 1
-    } else {
-       return 0
-    }
-}
-
 proc libgomp-dg-test { prog do_what extra_tool_flags } {
     return [gcc-dg-test-1 libgomp_target_compile $prog $do_what $extra_tool_flags]
 }
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
new file mode 100644 (file)
index 0000000..2e9f9d8
--- /dev/null
@@ -0,0 +1,202 @@
+# Damn dejagnu for not having proper library search paths for load_lib.
+# We have to explicitly load everything that gcc-dg.exp wants to load.
+
+proc load_gcc_lib { filename } {
+    global srcdir loaded_libs
+
+    load_file $srcdir/../../gcc/testsuite/lib/$filename
+    set loaded_libs($filename) ""
+}
+
+load_lib dg.exp
+load_gcc_lib file-format.exp
+load_gcc_lib target-supports.exp
+load_gcc_lib target-supports-dg.exp
+load_gcc_lib scanasm.exp
+load_gcc_lib scandump.exp
+load_gcc_lib scanrtl.exp
+load_gcc_lib scantree.exp
+load_gcc_lib scanipa.exp
+load_gcc_lib prune.exp
+load_gcc_lib target-libpath.exp
+load_gcc_lib wrapper.exp
+load_gcc_lib gcc-defs.exp
+load_gcc_lib gcc-dg.exp
+load_gcc_lib gfortran-dg.exp
+
+set dg-do-what-default run
+
+#
+# GCC_UNDER_TEST is the compiler under test.
+#
+
+set libgomp_compile_options ""
+
+#
+# libgomp_init
+#
+
+if [info exists TOOL_OPTIONS] {
+    set multilibs [get_multilibs $TOOL_OPTIONS]
+} else {
+    set multilibs [get_multilibs]
+}
+
+proc libgomp_init { args } {
+    global srcdir blddir objdir tool_root_dir
+    global libgomp_initialized
+    global tmpdir
+    global blddir
+    global gluefile wrap_flags
+    global ALWAYS_CFLAGS
+    global CFLAGS
+    global TOOL_EXECUTABLE TOOL_OPTIONS
+    global GCC_UNDER_TEST
+    global TESTING_IN_BUILD_TREE
+    global target_triplet
+    global always_ld_library_path
+
+    set blddir [lookfor_file [get_multilibs] libgomp]
+
+    # We set LC_ALL and LANG to C so that we get the same error
+    # messages as expected.
+    setenv LC_ALL C
+    setenv LANG C
+
+    if ![info exists GCC_UNDER_TEST] then {
+       if [info exists TOOL_EXECUTABLE] {
+           set GCC_UNDER_TEST $TOOL_EXECUTABLE
+       } else {
+           set GCC_UNDER_TEST "[find_gcc]"
+       }
+    }
+
+    if ![info exists tmpdir] {
+       set tmpdir "/tmp"
+    }
+
+    if [info exists gluefile] {
+       unset gluefile
+    }
+
+    if {![info exists CFLAGS]} {
+       set CFLAGS ""
+    }
+
+    # Locate libgcc.a so we don't need to account for different values of
+    # SHLIB_EXT on different platforms
+    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+    if {$gccdir != ""} {
+        set gccdir [file dirname $gccdir]
+    }
+
+    # Compute what needs to be put into LD_LIBRARY_PATH
+    set always_ld_library_path ".:${blddir}/.libs"
+
+    # Compute what needs to be added to the existing LD_LIBRARY_PATH.
+    if {$gccdir != ""} {
+       append always_ld_library_path ":${gccdir}"
+       set compiler [lindex $GCC_UNDER_TEST 0]
+
+       if { [is_remote host] == 0 && [which $compiler] != 0 } {
+         foreach i "[exec $compiler --print-multi-lib]" {
+           set mldir ""
+           regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
+           set mldir [string trimright $mldir "\;@"]
+           if { "$mldir" == "." } {
+             continue
+           }
+           if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+             append always_ld_library_path ":${gccdir}/${mldir}"
+           }
+         }
+       }
+    }
+
+    set ALWAYS_CFLAGS ""
+    lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
+    lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
+    lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
+    lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs -lgomp"
+
+    # We use atomic operations in the testcases to validate results.
+    if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
+        && [check_effective_target_ilp32] } {
+       lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
+    }
+
+    if [istarget *-*-darwin*] {
+       lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
+    }
+
+    if [istarget sparc*-*-*] {
+       lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
+    }
+
+    if [info exists TOOL_OPTIONS] {
+       lappend ALWAYS_CFLAGS "additional_flags=$TOOL_OPTIONS"
+    }
+
+    # Make sure that lines are not wrapped.  That can confuse the
+    # error-message parsing machinery.
+    lappend ALWAYS_CFLAGS "additional_flags=-fmessage-length=0"
+
+    # And, gee, turn on OpenMP.
+    lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
+}
+
+#
+# libgomp_target_compile -- compile a source file
+#
+
+proc libgomp_target_compile { source dest type options } {
+    global blddir
+    global libgomp_compile_options
+    global gluefile wrap_flags
+    global ALWAYS_CFLAGS
+    global GCC_UNDER_TEST
+    global lang_test_file
+    global lang_library_path
+    global lang_link_flags
+
+    if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
+       lappend options "ldflags=-L${blddir}/${lang_library_path} ${lang_link_flags}"
+    }
+
+    if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
+       lappend options "libs=${gluefile}"
+       lappend options "ldflags=${wrap_flags}"
+    }
+
+    lappend options "additional_flags=[libio_include_flags]"
+    lappend options "compiler=$GCC_UNDER_TEST"
+
+    set options [concat $libgomp_compile_options $options]
+
+    if [info exists ALWAYS_CFLAGS] {
+       set options [concat "$ALWAYS_CFLAGS" $options]
+    }
+
+    set options [dg-additional-files-options $options $source]
+
+    set result [target_compile $source $dest $type $options]
+
+    return $result
+}
+
+proc libgomp_option_help { } {
+    send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n"
+}
+
+proc libgomp_option_proc { option } {
+    if [regexp "^--additional_options," $option] {
+       global libgomp_compile_options
+       regsub "--additional_options," $option "" option
+       foreach x [split $option ","] {
+           lappend libgomp_compile_options "additional_flags=$x"
+       }
+       return 1
+    } else {
+       return 0
+    }
+}
index ecb4aa9a9c72e70356337f97766ca1d3004c8231..f11482c7315ffc86395e8feaf3fb57879ec94e09 100644 (file)
@@ -1,17 +1,36 @@
-set lang_library_path  "../libstdc++-v3/src/.libs"
-set lang_test_file     "${lang_library_path}/libstdc++.a"
-set lang_link_flags    "-lstdc++"
-
 load_lib libgomp-dg.exp
 
+global shlib_ext
+
+set shlib_ext [get_shlib_extension]
+set lang_link_flags "-lstdc++"
+set lang_test_file_found 0
+set lang_library_path "../libstdc++-v3/src/.libs"
+
 # Initialize dg.
 dg-init
 
-if [file exists "${blddir}/${lang_test_file}"] {
+set blddir [lookfor_file [get_multilibs] libgomp]
 
+# Look for a static libstdc++ first.
+if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
+    set lang_test_file "${lang_library_path}/libstdc++.a"
+    set lang_test_file_found 1
+# We may have a shared only build, so look for a shared libstdc++.
+} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
+    set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+    set lang_test_file_found 1
+} else {
+    puts "No libstdc++ library found, will not execute c++ tests"
+}
+
+if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
 
+    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+    set_ld_library_path_env_vars
+
     # Main loop.
     gfortran-dg-runtest $tests ""
 }
index 82642a4e48de74d29497236c4d621be67ac0bda2..dfbcf851c44ce1adb1269fa91d6f703edf4a345e 100644 (file)
@@ -1,7 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fopenmp" } */
-/* { dg-options "-O2 -fopenmp -march=pentium" { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 -fopenmp" { target lp64 } } */
+/* { dg-options "-O2 -march=pentium" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
 
 #ifdef __i386__
 #include "../../../gcc/testsuite/gcc.dg/i386-cpuid.h"
@@ -47,7 +45,7 @@ main (void)
 
   cpu_facilities = i386_cpuid ();
 
-  if ((cpu_facilities & bit_CX8) == 0)
+  if (!(cpu_facilities & bit_CX8))
     return 0;
 #endif
 
index 6565279b9e8abc3795f109b1a73b1bdc897a50f7..58edeed6c36e7a3c6a0b641e2580f084eea1ac44 100644 (file)
@@ -1,5 +1,4 @@
 /* { dg-do run } */
-/* { dg-options "-O2 -fopenmp" } */
 
 extern void abort (void);
 int x1, x2, x3, x4, x5;
index 8056a86054da4476f1298c94f269fd8b3941db9a..9eaab6252c35893a0ca47d1458656db0d4d802ad 100644 (file)
@@ -8,7 +8,7 @@ load_lib libgomp-dg.exp
 
 # If a testcase doesn't have special options, use these.
 if ![info exists DEFAULT_CFLAGS] then {
-    set DEFAULT_CFLAGS "-O2 -fopenmp"
+    set DEFAULT_CFLAGS "-O2"
 }
 
 # Initialize dg.
@@ -17,6 +17,9 @@ dg-init
 # Gather a list of all tests.
 set tests [lsort [find $srcdir/$subdir *.c]]
 
+set ld_library_path $always_ld_library_path
+set_ld_library_path_env_vars
+
 # Main loop.
 dg-runtest $tests "" $DEFAULT_CFLAGS
 
index 78b40ac5ae5a9f126a65e258192858a7581949a5..509c6322982bb07b5201177cb2aead825d2fff65 100644 (file)
@@ -1,5 +1,5 @@
 /* PR libgomp/29947 */
-/* { dg-options "-O2 -fopenmp" } */
+
 /* { dg-do run } */
 
 extern void abort (void);
index 231cd5d272171913e69662003bcc94c3815bd520..09749831173580839ff1cccc9e79a9c4c30872a1 100644 (file)
@@ -1,5 +1,5 @@
 /* PR libgomp/29947 */
-/* { dg-options "-O2 -fopenmp" } */
+
 /* { dg-do run } */
 
 extern void abort (void);
index cf6d90ee828064697deda03e9b85b32dd31e0bc6..18c812ac46d8ce0d99a0b0528a84d0d168d35413 100644 (file)
@@ -23,3 +23,4 @@
         CALL SUB1(N)
         END PROGRAM A22_8_GOOD
 
+! { dg-final { cleanup-modules "a22_module8" } }
index 69882c1e6b95db7b1f4a88d7a70835277e6c4687..c03ba2adfd1510b50fcbb74cdf9952c1bb7a729a 100644 (file)
@@ -10,3 +10,5 @@
             N = MAX(N,I)
         END DO
         END PROGRAM A31_4
+
+! { dg-final { cleanup-modules "m" } }
index 91a97cd829d1fefe56bb8bee4677accfec3455a1..d81849528921470146bb20327ded9918af97527a 100644 (file)
@@ -12,3 +12,5 @@
             END DO
             PRINT *, R
             END PROGRAM A31_5
+
+! { dg-final { cleanup-modules "mod" } }
index 38fbca3fceda0cfa62413fcfb35c949dcf091219..c5ecb3c3ed6c1516a434928ccff80edbbb8862c6 100644 (file)
@@ -50,3 +50,5 @@
           CALL INCR_B(P, WORK3())
 !$OMP END PARALLEL SECTIONS
       END SUBROUTINE A40
+
+! { dg-final { cleanup-modules "data" } }
index bf95aab000d615a309a867a8156491d99ceea663..ec0f878c82195803699e2033dce30f31e3373530 100644 (file)
@@ -12,6 +12,9 @@ if [file exists "${blddir}/${lang_test_file}"] {
     # Gather a list of all tests.
     set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03}]]
 
+    set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+    set_ld_library_path_env_vars
+
     # Main loop.
     gfortran-dg-runtest $tests ""
 }
index 98c94b93b796f87f1af50bad0039b647877edc7f..a39ff103ecd3740d12bda78ed546f6b985146029 100644 (file)
@@ -55,7 +55,7 @@ contains
   subroutine test_threadprivate
     common /tlsblock/ x, y
 !$omp threadprivate (/tlsblock/)
-    integer :: i, j
+    integer :: i, j, x, y
     logical :: m, n
     call omp_set_num_threads (4)
     call omp_set_dynamic (.false.)
@@ -83,7 +83,8 @@ contains
 !$omp end parallel
     m = m .or. n
     n = .false.
-!$omp parallel num_threads (4), copyin (z) reduction (.or. : n)
+!$omp parallel num_threads (4), copyin (z) reduction (.or. : n) &
+!$omp&private (j)
     if (z .ne. 4096) n = .true.
     if (omp_get_num_threads () .eq. i) then
       j = omp_get_thread_num ()
index bfdd43a93fa332e46456dab2a5f38bb83a3654a4..24c2ff612e26bc1f23cf0f4fd89d5866b872c5ac 100644 (file)
@@ -39,3 +39,5 @@ contains
     if (m .ne. 3 .or. n .ne. 15) call abort
   end subroutine test2
 end
+
+! { dg-final { cleanup-modules "reduction5" } }
index 99a20185509b97ea7696be02092f3548f2a3ec1e..32161426bdef512b22eba67b63f4b161db178610 100644 (file)
@@ -17,3 +17,5 @@ end module threadprivate1
 !$omp end parallel
   if (l) call abort ()
 end
+
+! { dg-final { cleanup-modules "threadprivate1" } }
index f3a4af0fc132ca45c19a444bddcd3f63b3c59ead..fb3f7ae8f8a20d5aae69d7083c7a53ead40e30dd 100644 (file)
@@ -92,3 +92,5 @@ end module threadprivate2
   deallocate (foo)
   if (allocated (foo)) call abort
 end
+
+! { dg-final { cleanup-modules "threadprivate2" } }
index d20a6520a8a3311f5db4fe0f40c8e4d5a14f85e4..7edfbf680ff385406a8f0fae124ccd772aece4d2 100644 (file)
@@ -104,3 +104,5 @@ end module threadprivate3
 
   if (l) call abort
 end
+
+! { dg-final { cleanup-modules "threadprivate3" } }