| # Copyright (C) 2011-2026 Free Software Foundation, Inc. | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 2 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # 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, see <http://www.gnu.org/licenses/>. | |
| load_lib libitm-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 | |
| unset shlib_ext | |
| 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 | |
| } | |
| lappend ALWAYS_CFLAGS "compiler=$GXX_UNDER_TEST" | |
| # Initialize dg. | |
| dg-init | |
| # Gather a list of all tests. | |
| set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]] | |
| if { $blddir != "" } { | |
| set lang_include_flags [exec sh ${blddir}/../libstdc++-v3/scripts/testsuite_flags --build-includes] | |
| set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_paths}" | |
| } 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 | |
| # Main loop. | |
| dg-runtest $tests "" "" | |
| if { $blddir != "" } { | |
| unset lang_include_flags | |
| unset libstdc++_library_path | |
| unset lang_library_paths | |
| unset shlib_ext | |
| } | |
| # All done. | |
| dg-finish |