aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2014-11-01 16:25:26 +0100
committerThomas Schwinge <thomas@codesourcery.com>2023-05-12 09:15:31 +0200
commit5649dca8ae34c7313a96e654574aecb217a60023 (patch)
tree34659dfa345fcc01a1a56a9b0d874c1553bda77d
parentb1cdda9f361f678e4815a3d112ce92e8a73e782e (diff)
downloadgcc-5649dca8ae34c7313a96e654574aecb217a60023.zip
gcc-5649dca8ae34c7313a96e654574aecb217a60023.tar.gz
gcc-5649dca8ae34c7313a96e654574aecb217a60023.tar.bz2
libgomp C++, Fortran testsuites: Resolve 'lang_test_file_found' first
libgomp/ * testsuite/libgomp.c++/c++.exp: Resolve 'lang_test_file_found' first. * testsuite/libgomp.fortran/fortran.exp: Likewise. * testsuite/libgomp.oacc-c++/c++.exp: Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
-rw-r--r--libgomp/testsuite/libgomp.c++/c++.exp43
-rw-r--r--libgomp/testsuite/libgomp.fortran/fortran.exp30
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/c++.exp37
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/fortran.exp31
4 files changed, 68 insertions, 73 deletions
diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp
index 442e9f7..797a05c 100644
--- a/libgomp/testsuite/libgomp.c++/c++.exp
+++ b/libgomp/testsuite/libgomp.c++/c++.exp
@@ -1,12 +1,25 @@
load_lib libgomp-dg.exp
load_gcc_lib gcc-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"
+if { $blddir != "" } {
+ set lang_library_path "../libstdc++-v3/src/.libs"
+ set shlib_ext [get_shlib_extension]
+ # Look for a static libstdc++ first.
+ if [file exists "${blddir}/${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_found 1
+ } else {
+ puts "No libstdc++ library found, will not execute c++ tests"
+ }
+} elseif { [info exists GXX_UNDER_TEST] } {
+ set lang_test_file_found 1
+} else {
+ puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
+}
+set lang_link_flags "-lstdc++"
# If a testcase doesn't have special options, use these.
if ![info exists DEFAULT_CFLAGS] then {
@@ -24,22 +37,6 @@ lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
-if { $blddir != "" } {
- # Look for a static libstdc++ first.
- if [file exists "${blddir}/${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_found 1
- } else {
- puts "No libstdc++ library found, will not execute c++ tests"
- }
-} elseif { [info exists GXX_UNDER_TEST] } {
- set lang_test_file_found 1
-} else {
- puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
-}
-
if { $lang_test_file_found } {
# Gather a list of all tests.
set tests [lsort [concat \
@@ -72,7 +69,9 @@ if [info exists lang_include_flags] then {
unset lang_source_re
unset lang_include_flags
}
-unset lang_library_path
+if { $blddir != "" } {
+ unset lang_library_path
+}
unset lang_link_flags
unset lang_test_file_found
diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp
index 7ea00a2..16ce9d3 100644
--- a/libgomp/testsuite/libgomp.fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -2,23 +2,10 @@ load_lib libgomp-dg.exp
load_gcc_lib gcc-dg.exp
load_gcc_lib gfortran-dg.exp
-global shlib_ext
-global ALWAYS_CFLAGS
-
-set shlib_ext [get_shlib_extension]
-set lang_library_path "../libgfortran/.libs"
-set lang_link_flags "-lgfortran -foffload=-lgfortran"
set lang_test_file_found 0
-
-# Initialize dg.
-dg-init
-
-# Turn on OpenMP.
-lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
-
if { $blddir != "" } {
- set lang_source_re {^.*\.[fF](|90|95|03|08)$}
- set lang_include_flags "-fintrinsic-modules-path=${blddir}"
+ set lang_library_path "../libgfortran/.libs"
+ set shlib_ext [get_shlib_extension]
# Look for a static libgfortran first.
if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
set lang_test_file_found 1
@@ -33,6 +20,17 @@ if { $blddir != "" } {
} else {
puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
}
+if { $blddir != "" } {
+ set lang_source_re {^.*\.[fF](|90|95|03|08)$}
+ set lang_include_flags "-fintrinsic-modules-path=${blddir}"
+}
+set lang_link_flags "-lgfortran -foffload=-lgfortran"
+
+# Initialize dg.
+dg-init
+
+# Turn on OpenMP.
+lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
if { $lang_test_file_found } {
# Gather a list of all tests.
@@ -71,8 +69,8 @@ if { $lang_test_file_found } {
if { $blddir != "" } {
unset lang_source_re
unset lang_include_flags
+ unset lang_library_path
}
-unset lang_library_path
unset lang_link_flags
unset lang_test_file_found
diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
index 5d9dc5d..060aaa2 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -11,26 +11,10 @@ proc check_effective_target_c++ { } {
return 1
}
-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
-torture-init
-
-# Turn on OpenACC.
-lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
-
-# Switch into C++ mode. Otherwise, the libgomp.oacc-c-c++-common/*.c
-# files would be compiled as C files.
-set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
-set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
-
if { $blddir != "" } {
+ set lang_library_path "../libstdc++-v3/src/.libs"
+ set shlib_ext [get_shlib_extension]
# Look for a static libstdc++ first.
if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
set lang_test_file_found 1
@@ -45,6 +29,19 @@ if { $blddir != "" } {
} else {
puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
}
+set lang_link_flags "-lstdc++"
+
+# Initialize dg.
+dg-init
+torture-init
+
+# Turn on OpenACC.
+lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
+
+# Switch into C++ mode. Otherwise, the libgomp.oacc-c-c++-common/*.c
+# files would be compiled as C files.
+set SAVE_GCC_UNDER_TEST "$GCC_UNDER_TEST"
+set GCC_UNDER_TEST "$GCC_UNDER_TEST -x c++"
if { $lang_test_file_found } {
# Gather a list of all tests.
@@ -153,7 +150,9 @@ if [info exists lang_include_flags] then {
unset lang_source_re
unset lang_include_flags
}
-unset lang_library_path
+if { $blddir != "" } {
+ unset lang_library_path
+}
unset lang_link_flags
unset lang_test_file_found
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
index 1ac2320..9af5260 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
@@ -4,23 +4,10 @@ load_lib libgomp-dg.exp
load_gcc_lib gcc-dg.exp
load_gcc_lib gfortran-dg.exp
-global shlib_ext
-global ALWAYS_CFLAGS
-
-set shlib_ext [get_shlib_extension]
-set lang_library_path "../libgfortran/.libs"
-set lang_link_flags "-lgfortran -foffload=-lgfortran"
set lang_test_file_found 0
-
-# Initialize dg.
-dg-init
-
-# Turn on OpenACC.
-lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
-
if { $blddir != "" } {
- set lang_source_re {^.*\.[fF](|90|95|03|08)$}
- set lang_include_flags "-fintrinsic-modules-path=${blddir}"
+ set lang_library_path "../libgfortran/.libs"
+ set shlib_ext [get_shlib_extension]
# Look for a static libgfortran first.
if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
set lang_test_file_found 1
@@ -35,6 +22,18 @@ if { $blddir != "" } {
} else {
puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
}
+if { $blddir != "" } {
+ set lang_source_re {^.*\.[fF](|90|95|03|08)$}
+ set lang_include_flags "-fintrinsic-modules-path=${blddir}"
+}
+set lang_link_flags "-lgfortran -foffload=-lgfortran"
+
+# Initialize dg.
+dg-init
+
+# Turn on OpenACC.
+lappend ALWAYS_CFLAGS "additional_flags=-fopenacc"
+
if { $lang_test_file_found } {
# Gather a list of all tests.
@@ -120,8 +119,8 @@ if { $lang_test_file_found } {
if { $blddir != "" } {
unset lang_source_re
unset lang_include_flags
+ unset lang_library_path
}
-unset lang_library_path
unset lang_link_flags
unset lang_test_file_found