PR ld/1775
[binutils.git] / gas / testsuite / gas / xstormy16 / gcc.sh
blob1eb8972774c921b44df32123670177f1a6f7220e
1 #/bin/sh
2 # Generate test result data for xstormy16 GAS testing.
3 # It is intended to be run in the testsuite source directory.
5 # Syntax: build.sh /path/to/build/gas
7 if [ $# = 0 ] ; then
8 if [ ! -x ../gas/as-new ] ; then
9 echo "Usage: $0 [/path/to/gas/build]"
10 else
11 BUILD=`pwd`/../gas
13 else
14 BUILD=$1
17 if [ ! -x $BUILD/as-new ] ; then
18 echo "$BUILD is not a gas build directory"
19 exit 1
22 # Put results here, so we preserve the existing set for comparison.
23 rm -rf tmpdir
24 mkdir tmpdir
25 cd tmpdir
27 function gentest {
28 rm -f a.out
29 $BUILD/as-new ${1}.s -o a.out
30 echo "#as:" >${1}.d
31 echo "#objdump: -dr" >>${1}.d
32 echo "#name: $1" >>${1}.d
33 $BUILD/../binutils/objdump -dr a.out | sed -e 's/(/\\(/g' -e 's/)/\\)/g' -e 's/\$/\\$/g' -e 's/\[/\\\[/g' -e 's/\]/\\\]/g' -e 's/[+]/\\+/g' -e 's/[.]/\\./g' -e 's/[*]/\\*/g' | sed -e 's/^.*file format.*$/.*: +file format .*/' >>${1}.d
34 rm -f a.out
37 # Now come all the testcases.
38 cat > gcc.s <<EOF
39 mov.w r0,#-1
40 mov.w r0,#0xFFFF
41 add r0,#some_external_symbol
42 EOF
44 # Finally, generate the .d file.
45 gentest gcc