# 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.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
# 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.
global gluefile wrap_flags
global ALWAYS_CFLAGS
global GCC_UNDER_TEST
- global lang_test_file
- global lang_library_path
+ global lang_library_paths
global lang_link_flags
+ global lang_include_flags
- if { [info exists lang_test_file] } {
- if { $blddir != "" } {
+ if { [info exists lang_include_flags] } {
+ lappend options "additional_flags=${lang_include_flags}"
+ }
+
+ if { [info exists lang_library_paths] } {
+ foreach lang_library_path $lang_library_paths {
+ # targets that use lib[...].a%s in their specs need a -B option
+ # for uninstalled testing.
+ lappend options "additional_flags=-B${blddir}/${lang_library_path}"
lappend options "ldflags=-L${blddir}/${lang_library_path}"
}
+ }
+
+ if { [info exists lang_link_flags] } {
lappend options "ldflags=${lang_link_flags}"
}
set options [concat "$ALWAYS_CFLAGS" $options]
}
- set options [dg-additional-files-options $options $source $dest $type]
+ if { $source != "" } {
+ set options [dg-additional-files-options $options $source $dest $type]
+ }
set result [target_compile $source $dest $type $options]
# 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.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
load_lib libitm-dg.exp
load_gcc_lib gcc-dg.exp
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"
+ if { ![file exists "${blddir}/${lang_library_path}/libstdc++.a"]
+ && ![file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] } {
+ verbose -log "No libstdc++ library found, will not execute c++ tests"
+ unset lang_library_path
+ return
}
-} elseif { [info exists GXX_UNDER_TEST] } {
- set lang_test_file_found 1
- # Needs to exist for libitm.exp.
- set lang_test_file ""
+ lappend lang_library_paths ${lang_library_path}
+} elseif { ![info exists GXX_UNDER_TEST] } {
+ verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
+ return
+}
+
+# Gather a list of all tests.
+set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
+
+if { $blddir != "" } {
+ set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
} else {
- puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
+ set ld_library_path "$always_ld_library_path"
}
-if { $lang_test_file_found } {
- # Gather a list of all tests.
- set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
+append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+set_ld_library_path_env_vars
- set stdcxxadder ""
- if { $blddir != "" } {
- set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
- set stdcxxadder "-B ${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
+set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
+if { [file exists $flags_file] } {
+ set lang_include_flags [exec sh $flags_file --build-includes]
+}
- set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
- if { [file exists $flags_file] } {
- set libstdcxx_includes [exec sh $flags_file --build-includes]
- } else {
- set libstdcxx_includes ""
- }
+# Main loop.
+dg-runtest $tests "" ""
- # Main loop.
- dg-runtest $tests $stdcxxadder $libstdcxx_includes
+if { $blddir != "" } {
+ unset lang_include_flags
+ unset lang_library_path
+ unset lang_library_paths
}
# All done.