aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/lib
diff options
context:
space:
mode:
authorJeffrey Wheat <cassidy@cygnus>1993-08-05 04:14:51 +0000
committerJeffrey Wheat <cassidy@cygnus>1993-08-05 04:14:51 +0000
commit671fe6e9a3c9608322d666a2e3096b29d592183a (patch)
treead12ce3810f72558ab7ee871b874e7134e3741df /ld/testsuite/lib
parent8bf66be8aa5ddcaec7c574fe3c3b6bf722e1f5d0 (diff)
downloadgdb-671fe6e9a3c9608322d666a2e3096b29d592183a.zip
gdb-671fe6e9a3c9608322d666a2e3096b29d592183a.tar.gz
gdb-671fe6e9a3c9608322d666a2e3096b29d592183a.tar.bz2
New files for ld testsuites
Diffstat (limited to 'ld/testsuite/lib')
-rw-r--r--ld/testsuite/lib/.Sanitize35
-rw-r--r--ld/testsuite/lib/ld.exp48
2 files changed, 83 insertions, 0 deletions
diff --git a/ld/testsuite/lib/.Sanitize b/ld/testsuite/lib/.Sanitize
new file mode 100644
index 0000000..39bb515
--- /dev/null
+++ b/ld/testsuite/lib/.Sanitize
@@ -0,0 +1,35 @@
+# .Sanitize for ld dejagnu testsuites
+
+# Each directory to survive it's way into a release will need a file
+# like this one called "./.Sanitize". All keyword lines must exist,
+# and must exist in the order specified by this file. Each directory
+# in the tree will be processed, top down, in the following order.
+
+# Hash started lines like this one are comments and will be deleted
+# before anything else is done. Blank lines will also be squashed
+# out.
+
+# The lines between the "Do-first:" line and the "Things-to-keep:"
+# line are executed as a /bin/sh shell script before anything else is
+# done in this directory.
+
+Do-first:
+
+# All files listed between the "Things-to-keep:" line and the
+# "Do-last:" line will be kept. All other files will be removed.
+# Directories listed in this section will have their own Sanitize
+# called. Directories not listed will be removed in their entirety
+# with rm -rf.
+
+Things-to-keep:
+
+ld.exp
+
+Things-to-lose:
+
+# The lines between the "Do-last:" line and the end of the file
+# are executed as a /bin/sh shell script after everything else is
+# done.
+
+Do-last:
+# eof
diff --git a/ld/testsuite/lib/ld.exp b/ld/testsuite/lib/ld.exp
new file mode 100644
index 0000000..68a2668
--- /dev/null
+++ b/ld/testsuite/lib/ld.exp
@@ -0,0 +1,48 @@
+#
+# default_ld_version
+# extract and print the version number of ld
+#
+proc default_ld_version { ld } {
+ if { [file exists $ld] == 0 } then {
+ error "$ld does not exist"
+ exit 1
+ }
+
+ set tmp [exec $ld --version]
+ regexp "version.*$" $tmp version
+
+ if [info exists version] then {
+ clone_output "$ld $version\n"
+ }
+}
+
+#
+# default_ld_start
+# link a program using ld
+#
+proc default_ld_start { ld target } {
+
+ global OFILES
+ global BFDLIB
+ global LIBIBERTY
+ global HOSTING_EMU
+ global HOSTING_CRT0
+ global HOSTING_LIBS
+
+ set objects "$HOSTING_CRT0 $OFILES"
+ set library "$BFDLIB $LIBIBERTY $HOSTING_LIBS"
+
+ if { [file exists $ld] == 0 } then {
+ error "$ld does not exist"
+ exit 1
+ }
+
+ send_log "### EXEC \"$ld $HOSTING_EMU -o $target $objects $library\"\n"
+ verbose "### EXEC \"$ld $HOSTING_EMU -o $target $objects $library\"" 1
+
+ catch "exec $ld $HOSTING_EMU -o $target $objects $library" ld_output
+ if ![string match "" $ld_output] then {
+ send_log "$ld_output\n"
+ verbose "$ld_output" 1
+ }
+}