OSDN Git Service

* ld-cris/weakref1.d, ld-cris/libdso-1.d, ld-cris/gotrel2.s,
[pf3gnuchains/pf3gnuchains4x.git] / ld / testsuite / ld-cris / cris.exp
index 296f703..2278dab 100644 (file)
@@ -23,8 +23,33 @@ if ![istarget cris-*-*] {
 }
 
 set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+
+# First, execute those tests that are named to indicate that they create a
+# DSO.  Copy the file from the run_dump_test "tmpdir/dump" to a unique
+# expected name.
+# FIXME: Add option "output: filename" to run_dump_test.
+# FIXME: Add option "ldtail: option" to run_dump_test, so we can link
+# libraries in the right order.
+foreach atest $rd_test_list {
+    # We need to check against runtest_file_p too, or we'd mindlessly copy
+    # the last tmpdir/dump in selective test-runs.
+    if { [string match $srcdir/$subdir/*dso-*.d $atest] \
+           && [runtest_file_p $runtests [file tail $atest]] } {
+       verbose [file rootname $atest]
+       run_dump_test [file rootname $atest]
+       set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $atest]].so"
+       send_log "$cmd\n"
+       set cmdret [catch "exec $cmd" comp_output]
+       send_log "$comp_output\n"
+       # FIXME: What if it fails?  Need we do something?
+    }
+}
+
+# Then run the ordinary tests.  This round, exclude the dso-* tests.
 foreach atest $rd_test_list {
     # We need to strip the ".d", but can leave the dirname.
-    verbose [file rootname $atest]
-    run_dump_test [file rootname $atest]
+    if { ! [string match $srcdir/$subdir/*dso-*.d $atest] } {
+       verbose [file rootname $atest]
+       run_dump_test [file rootname $atest]
+    }
 }