* Added the "c_gen.pl" perl script into this directory, so the current
[binutils-gdb.git] / binutils / sanity.sh
blobfab6b92d64252c5b7878488cebbeb03118b6be58
1 #!/bin/sh
2 ### quick sanity test for the binutils.
3 ###
4 ### This file was written and is maintained by K. Richard Pixley,
5 ### rich@cygnus.com.
7 ### fail on errors
8 set -e
10 ### first arg is directory in which binaries to be tested reside.
11 case "$1" in
12 "") BIN=. ;;
13 *) BIN="$1" ;;
14 esac
16 ### size
17 for i in size objdump nm ar strip ranlib ; do
18 ${BIN}/size ${BIN}/$i > /dev/null
19 done
21 ### objdump
22 for i in size objdump nm ar strip ranlib ; do
23 ${BIN}/objdump -ahifdrtxsl ${BIN}/$i > /dev/null
24 done
26 ### nm
27 for i in size objdump nm ar strip ranlib ; do
28 ${BIN}/nm ${BIN}/$i > /dev/null
29 done
31 ### strip
32 TMPDIR=/tmp/binutils-$$
33 mkdir ${TMPDIR}
35 cp ${BIN}/strip ${TMPDIR}/strip
37 for i in size objdump nm ar ranlib ; do
38 cp ${BIN}/$i ${TMPDIR}/$i
39 ${BIN}/strip ${TMPDIR}/$i
40 cp ${BIN}/$i ${TMPDIR}/$i
41 ${TMPDIR}/strip ${TMPDIR}/$i
42 done
44 ### ar
46 ### ranlib
48 rm -rf ${TMPDIR}
50 exit 0