aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/lib
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1993-04-05 17:25:37 +0000
committerKen Raeburn <raeburn@cygnus>1993-04-05 17:25:37 +0000
commitacf11ed1aaeca0ff9d12d415983f8eceff899884 (patch)
tree7c4471ae50ebdbeb9c0c57f61f7bd40019898651 /gas/testsuite/lib
parentd5bc321563c772601df4909951d5fe2012dc4053 (diff)
downloadgdb-acf11ed1aaeca0ff9d12d415983f8eceff899884.zip
gdb-acf11ed1aaeca0ff9d12d415983f8eceff899884.tar.gz
gdb-acf11ed1aaeca0ff9d12d415983f8eceff899884.tar.bz2
from gas/testscripts -- may be useful someday
Diffstat (limited to 'gas/testsuite/lib')
-rwxr-xr-xgas/testsuite/lib/doboth20
-rwxr-xr-xgas/testsuite/lib/doobjcmp89
-rwxr-xr-xgas/testsuite/lib/dostriptest15
-rwxr-xr-xgas/testsuite/lib/dotest44
-rwxr-xr-xgas/testsuite/lib/dounsreloc9
-rwxr-xr-xgas/testsuite/lib/dounssym9
6 files changed, 186 insertions, 0 deletions
diff --git a/gas/testsuite/lib/doboth b/gas/testsuite/lib/doboth
new file mode 100755
index 0000000..a8c3358
--- /dev/null
+++ b/gas/testsuite/lib/doboth
@@ -0,0 +1,20 @@
+#!/bin/sh
+# $Id$
+
+x=$1 ; shift
+y=$1 ; shift
+
+rm tmp.0 > /dev/null 2>&1
+ln -s $x tmp.0
+$* tmp.0 > tmp.1
+
+rm tmp.0
+ln -s $y tmp.0
+$* tmp.0 > tmp.2
+
+rm tmp.0
+
+diff -c tmp.1 tmp.2
+exit
+
+#eof
diff --git a/gas/testsuite/lib/doobjcmp b/gas/testsuite/lib/doobjcmp
new file mode 100755
index 0000000..9fbe46b
--- /dev/null
+++ b/gas/testsuite/lib/doobjcmp
@@ -0,0 +1,89 @@
+#!/bin/sh
+# $Id$
+# compare two object files, in depth.
+
+x=$1
+y=$2
+BOTH="$1 $2"
+
+
+# if they cmp, we're fine.
+if (cmp $BOTH > /dev/null)
+then
+ exit 0
+fi
+
+# otherwise, we must look closer.
+if (doboth $BOTH size)
+then
+ echo Sizes ok.
+else
+ echo Sizes differ:
+ size $BOTH
+# exit 1
+fi
+
+if (doboth $BOTH objdump +header)
+then
+ echo Headers ok.
+else
+ echo Header differences.
+# exit 1
+fi
+
+if (doboth $BOTH objdump +text > /dev/null)
+then
+ echo Text ok.
+else
+ echo Text differences.
+# doboth $BOTH objdump +text
+# exit 1
+fi
+
+if (doboth $BOTH objdump +data > /dev/null)
+then
+ echo Data ok.
+else
+ echo Data differences.
+# doboth $BOTH objdump +data
+# exit 1
+fi
+
+if (doboth $BOTH objdump +symbols > /dev/null)
+then
+ echo Symbols ok.
+else
+ echo -n Symbol differences...
+
+ if (doboth $BOTH dounsortsymbols)
+ then
+ echo but symbols are simply ordered differently.
+# echo Now what to do about relocs'?'
+# exit 1
+ else
+ echo and symbols differ in content.
+ exit 1
+ fi
+fi
+
+# of course, if there were symbol diffs, then the reloc symbol indexes
+# will be off.
+
+if (doboth $BOTH objdump -r > /dev/null)
+then
+ echo Reloc ok.
+else
+ echo -n Reloc differences...
+
+ if (doboth $BOTH dounsortreloc)
+ then
+ echo but relocs are simply ordered differently.
+ else
+ echo and relocs differ in content.
+ exit 1
+ fi
+fi
+
+exit
+
+# eof
diff --git a/gas/testsuite/lib/dostriptest b/gas/testsuite/lib/dostriptest
new file mode 100755
index 0000000..4b89df8
--- /dev/null
+++ b/gas/testsuite/lib/dostriptest
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $Id$
+
+x=striptest.xx.$$
+y=striptest.yy.$$
+
+cp $1 $x
+strip $x
+cp $2 $y
+strip $y
+
+doobjcmp $x $y
+exit
+
+#eof
diff --git a/gas/testsuite/lib/dotest b/gas/testsuite/lib/dotest
new file mode 100755
index 0000000..8c7a28c
--- /dev/null
+++ b/gas/testsuite/lib/dotest
@@ -0,0 +1,44 @@
+#!/bin/sh
+# ad hoc debug tool
+# $Id$
+
+x=$1
+y=$2
+
+xout=`basename $x`.xxx.$$
+yout=`basename $x`.yyy.$$
+
+mkdir $xout
+mkdir $yout
+
+for i in *.s
+do
+ echo Testing $i...
+ object=`basename $i .s`.o
+ $x $i -o $xout/$object
+ $y $i -o $yout/$object
+
+# if they cmp, we're ok. Otherwise we have to look closer.
+
+ if (cmp $xout/$object $yout/$object)
+ then
+ echo $i is ok.
+ else
+ if (doobjcmp $xout/$object $yout/$object)
+ then
+ echo Not the same but objcmp ok.
+ else
+ exit 1
+ fi
+ fi
+
+ echo
+done
+
+rm -rf $xout $yout
+
+exit 0
+
+# EOF
+
+
diff --git a/gas/testsuite/lib/dounsreloc b/gas/testsuite/lib/dounsreloc
new file mode 100755
index 0000000..d8da0a9
--- /dev/null
+++ b/gas/testsuite/lib/dounsreloc
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $Id$
+# objdump the reloc table, but strip off the headings and reloc
+# numbers and sort the result. Intended for use in comparing reloc
+# tables that may not be in the same order.
+
+objdump +reloc +omit-relocation-numbers +omit-symbol-numbers $1 \
+ | sort
+#eof
diff --git a/gas/testsuite/lib/dounssym b/gas/testsuite/lib/dounssym
new file mode 100755
index 0000000..8fb6db3
--- /dev/null
+++ b/gas/testsuite/lib/dounssym
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $Id$
+# objdump the symbol table, but strip off the headings and symbol
+# numbers and sort the result. Intended for use in comparing symbol
+# tables that may not be in the same order.
+
+objdump +symbols +omit-symbol-numbers $1 \
+ | sort
+#eof