libgomp.exp (libgomp_init): Only set things that depend on blddir if blddir exists.

* testsuite/libgomp.exp (libgomp_init): Only set things that
	depend on blddir if blddir exists.
	(libgomp_target_compile): Likewise.
	* testsuite/libgomp.c++/c++.exp: Likewise.
	* testsuite/libgomp.fortran/fortran.exp: Likewise.

From-SVN: r139393
This commit is contained in:
Nathan Froyd 2008-08-21 15:37:05 +00:00 committed by Nathan Froyd
parent 129a37fc31
commit 8c9570dfda
4 changed files with 62 additions and 17 deletions

View File

@ -1,3 +1,11 @@
2008-08-12 Nathan Froyd <froydnj@codesourcery.com>
* testsuite/libgomp.exp (libgomp_init): Only set things that
depend on blddir if blddir exists.
(libgomp_target_compile): Likewise.
* testsuite/libgomp.c++/c++.exp: Likewise.
* testsuite/libgomp.fortran/fortran.exp: Likewise.
2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libgomp.texi: Update to GFDL 1.2. Update copyright years.

View File

@ -119,10 +119,13 @@ proc libgomp_init { args } {
}
set ALWAYS_CFLAGS ""
lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
if { $blddir != "" } {
lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
}
lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs -lgomp"
lappend ALWAYS_CFLAGS "ldflags=-lgomp"
# We use atomic operations in the testcases to validate results.
if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
@ -164,8 +167,11 @@ proc libgomp_target_compile { source dest type options } {
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 { [info exists lang_test_file] } {
if { $blddir != "" } {
lappend options "ldflags=-L${blddir}/${lang_library_path}"
}
lappend options "ldflags=${lang_link_flags}"
}
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {

View File

@ -12,23 +12,36 @@ dg-init
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}"
if { $blddir != "" } {
# 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"
}
} elseif { [info exists GXX_UNDER_TEST] } {
set lang_test_file_found 1
# Needs to exist for libgomp.exp.
set lang_test_file ""
} else {
puts "No libstdc++ library found, will not execute c++ tests"
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 [glob -nocomplain $srcdir/$subdir/*.C]]
set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
if { $blddir != "" } {
set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
} else {
set ld_library_path "$always_ld_library_path"
}
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars

View File

@ -1,18 +1,36 @@
set lang_library_path "../libgfortran/.libs"
set lang_test_file "${lang_library_path}/libgfortranbegin.a"
set lang_link_flags "-lgfortranbegin -lgfortran"
set lang_test_file_found 0
load_lib libgomp-dg.exp
# Initialize dg.
dg-init
if [file exists "${blddir}/${lang_test_file}"] {
if { $blddir != "" } {
if [file exists "${blddir}/${lang_library_path}/libgfortranbegin.a"] {
set lang_test_file "${lang_library_path}/libgfortranbegin.a"
set lang_test_file_found 1
} else {
puts "No libgfortranbegin library found, will not execute fortran tests"
}
} elseif [info exists GFORTRAN_UNDER_TEST] {
set lang_test_file_found 1
# Needs to exist for libgomp.exp.
set lang_test_file ""
} else {
puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
}
if { $lang_test_file_found } {
# Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
if { $blddir != "" } {
set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
} else {
set ld_library_path "$always_ld_library_path"
}
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars