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.
This commit is contained in:
Thomas Schwinge 2014-11-01 16:25:26 +01:00
parent b1cdda9f36
commit 5649dca8ae
4 changed files with 68 additions and 73 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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