mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
This is commitc8e759b421(Subversion r279708) "libgomp/test: Fix compilation for build sysroot" and follow-up commit749bd22ddc"libgomp/test: Remove a build sysroot fix regression" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC', 'CXX', 'FC'. PR testsuite/91884 PR testsuite/109951 libgomp/ * configure.ac: Revert earlier changes, instead 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libgomp.exp (libgomp_init): Remove "Fix up '-funconfigured-libstdc++-v3' in 'GXX_UNDER_TEST'" code. If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. * testsuite/libgomp-site-extra.exp.in (GCC_UNDER_TEST) (GXX_UNDER_TEST, GFORTRAN_UNDER_TEST): Don't set. (SYSROOT_CFLAGS_FOR_TARGET): Set. * testsuite/libgomp.c++/c++.exp (lang_source_re) (lang_include_flags): Set for build-tree testing. * testsuite/libgomp.oacc-c++/c++.exp (lang_source_re) (lang_include_flags): Likewise. Co-authored-by: Chung-Lin Tang <cltang@codesourcery.com>
59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
load_lib libgomp-dg.exp
|
|
load_gcc_lib gcc-dg.exp
|
|
|
|
if { $blddir != "" } {
|
|
set libstdc++_library_path "../libstdc++-v3/src/.libs"
|
|
set shlib_ext [get_shlib_extension]
|
|
if { ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.a"]
|
|
&& ![file exists "${blddir}/${libstdc++_library_path}/libstdc++.${shlib_ext}"] } {
|
|
verbose -log "No libstdc++ library found, will not execute c++ tests"
|
|
unset libstdc++_library_path
|
|
return
|
|
}
|
|
lappend lang_library_paths ${libstdc++_library_path}
|
|
} elseif { ![info exists GXX_UNDER_TEST] } {
|
|
verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
|
|
return
|
|
}
|
|
if { $blddir != "" } {
|
|
set lang_source_re {^.*\.[cC]$}
|
|
set lang_include_flags [exec sh ${blddir}/../libstdc++-v3/scripts/testsuite_flags --build-includes]
|
|
}
|
|
lappend ALWAYS_CFLAGS "compiler=$GXX_UNDER_TEST"
|
|
|
|
# If a testcase doesn't have special options, use these.
|
|
if ![info exists DEFAULT_CFLAGS] then {
|
|
set DEFAULT_CFLAGS "-O2"
|
|
}
|
|
|
|
# Initialize dg.
|
|
dg-init
|
|
|
|
# Turn on OpenMP.
|
|
lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
|
|
|
|
# Gather a list of all tests.
|
|
set tests [lsort [concat \
|
|
[find $srcdir/$subdir *.C] \
|
|
[find $srcdir/$subdir/../libgomp.c-c++-common *.c]]]
|
|
|
|
set ld_library_path $always_ld_library_path
|
|
if { $blddir != "" } {
|
|
append ld_library_path ":${blddir}/${libstdc++_library_path}"
|
|
}
|
|
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
|
|
set_ld_library_path_env_vars
|
|
|
|
# Main loop.
|
|
dg-runtest $tests "" $DEFAULT_CFLAGS
|
|
|
|
if { $blddir != "" } {
|
|
unset lang_source_re
|
|
unset lang_include_flags
|
|
unset libstdc++_library_path
|
|
unset lang_library_paths
|
|
}
|
|
|
|
# All done.
|
|
dg-finish
|