PR 6943
[binutils.git] / binutils / sanity.sh
blob8edb490dd20b5659b05fbaa4e633e1f76ed6c66e
1 #!/bin/sh
2 ### quick sanity test for the binutils.
3 ###
4 # This file was written K. Richard Pixley.
5 # Copyright 2007 Free Software Foundation, Inc.
7 # This program is part of GNU Binutils.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22 # 02110-1301, USA. */
24 ### fail on errors
25 set -e
27 ### first arg is directory in which binaries to be tested reside.
28 case "$1" in
29 "") BIN=. ;;
30 *) BIN="$1" ;;
31 esac
33 ### size
34 for i in size objdump nm ar strip ranlib ; do
35 ${BIN}/size ${BIN}/$i > /dev/null
36 done
38 ### objdump
39 for i in size objdump nm ar strip ranlib ; do
40 ${BIN}/objdump -ahifdrtxsl ${BIN}/$i > /dev/null
41 done
43 ### nm
44 for i in size objdump nm ar strip ranlib ; do
45 ${BIN}/nm ${BIN}/$i > /dev/null
46 done
48 ### strip
49 TMPDIR=./binutils-$$
50 mkdir ${TMPDIR}
52 cp ${BIN}/strip ${TMPDIR}/strip
54 for i in size objdump nm ar ranlib ; do
55 cp ${BIN}/$i ${TMPDIR}/$i
56 ${BIN}/strip ${TMPDIR}/$i
57 cp ${BIN}/$i ${TMPDIR}/$i
58 ${TMPDIR}/strip ${TMPDIR}/$i
59 done
61 ### ar
63 ### ranlib
65 rm -rf ${TMPDIR}
67 exit 0