-if ![ld_simple_link $ld tmpdir/2.x "$ldflags tmpdir/2.o"] {
- fail $test2
-} else {
- if ![ld_nm $nm tmpdir/2.x] {
- unresolved $test2
- } else {
- if {[info exists nm_output(foo)] } {
- send_log "foo == $nm_output(foo)\n"
- verbose "foo == $nm_output(foo)"
- fail $test2
+foreach testitem $seltests {
+ set testname [lindex $testitem 0]
+ set testtype [lindex $testitem 1]
+ set testfile [lindex $testitem 2]
+ set objfile "tmpdir/[file rootname $testfile].o"
+ set ldfile "tmpdir/[file rootname $testfile].x"
+ set failed 0
+
+ set ldargs [lindex $testitem 3]
+ set mustsyms [lindex $testitem 4]
+ set mustnotsyms [lindex $testitem 5]
+ set xfails [lindex $testitem 6]
+
+ foreach xfail_target $xfails {
+ setup_xfail $xfail_target
+ }
+
+ # It's either C or C++ at the moment.
+ if { $testtype == "C++" } {
+ set compiler "$CXX"
+ # Starting with 3.4.0, -fvtable-gc is no longer supported and thus
+ # the functionality we try to test for cannot be expected to work.
+ set version [remote_exec host "$CXX -dumpversion"]
+ set version [lindex $version 1]
+ if { [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+))\\." $version] \
+ || [regexp "^(\[1-9\]\[0-9\]+|\[4-9\])" $version] } {
+ set testflags "$cflags $cxxflags"
+ setup_xfail {*-*-*}