+#
+# is_elf_format
+# true if the object format is known to be ELF
+#
+proc is_elf_format {} {
+ if { ![istarget *-*-sysv4*] \
+ && ![istarget *-*-unixware*] \
+ && ![istarget *-*-elf*] \
+ && ![istarget *-*-eabi*] \
+ && ![istarget hppa*64*-*-hpux*] \
+ && ![istarget *-*-linux*] \
+ && ![istarget frv-*-uclinux*] \
+ && ![istarget *-*-irix5*] \
+ && ![istarget *-*-irix6*] \
+ && ![istarget *-*-netbsd*] \
+ && ![istarget *-*-openbsd*] \
+ && ![istarget *-*-solaris2*] } {
+ return 0
+ }
+
+ if { [istarget *-*-linux*aout*] \
+ || [istarget *-*-linux*oldld*] } {
+ return 0
+ }
+
+ if { ![istarget *-*-netbsdelf*] \
+ && ([istarget *-*-netbsd*aout*] \
+ || [istarget *-*-netbsdpe*] \
+ || [istarget arm*-*-netbsd*] \
+ || [istarget sparc-*-netbsd*] \
+ || [istarget i*86-*-netbsd*] \
+ || [istarget m68*-*-netbsd*] \
+ || [istarget vax-*-netbsd*] \
+ || [istarget ns32k-*-netbsd*]) } {
+ return 0
+ }
+
+ if { [istarget arm-*-openbsd*] \
+ || [istarget i386-*-openbsd\[0-2\].*] \
+ || [istarget i386-*-openbsd3.\[0-3\]] \
+ || [istarget m68*-*-openbsd*] \
+ || [istarget ns32k-*-openbsd*] \
+ || [istarget sparc-*-openbsd\[0-2\].*] \
+ || [istarget sparc-*-openbsd3.\[0-1\]] \
+ || [istarget vax-*-openbsd*] } {
+ return 0
+ }
+
+ return 1
+}
+
+# run_dump_tests TESTCASES EXTRA_OPTIONS
+# Wrapper for run_dump_test, which is suitable for invoking as
+# run_dump_tests [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+# EXTRA_OPTIONS are passed down to run_dump_test. Honors runtest_file_p.
+# Body cribbed from dg-runtest.
+
+proc run_dump_tests { testcases {extra_options {}} } {
+ global runtests
+
+ foreach testcase $testcases {
+ # If testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $testcase] {
+ continue
+ }
+ run_dump_test [file rootname [file tail $testcase]] $extra_options
+ }
+}
+