9 TESTS_DIR=`dirname "$0"`/tests
15 # Catch a request for the random tests.
16 if [[ $infile == --random* ]] ; then
17 local outfile=$TESTS_DIR/random.out
19 local outfile=`echo $infile | sed 's/\.in/\.out/'`
22 if [[ ! -e "$outfile" ]] ; then
23 echo "$0: error: no out file $outfile"
27 # sed used to strip extra leading zeros from exponential values 'e+00' (see bug 602786)
28 if $LIRASM $options --execute $infile | tr -d '\r' | sed -e 's/e+00*/e+0/g' > testoutput.txt && cmp -s testoutput.txt $outfile ; then
29 echo "TEST-PASS | lirasm | lirasm $options --execute $infile"
31 echo "TEST-UNEXPECTED-FAIL | lirasm | lirasm $options --execute $infile"
32 echo "expected output"
43 for infile in "$TESTS_DIR"/"$testdir"/*.in ; do
44 runtest $infile "$options"
48 if [[ $($LIRASM --show-arch 2>/dev/null) == "i386" ]] ; then
53 runtests "littleendian"
54 runtest "--random 1000000"
55 runtest "--random 1000000 --optimize"
58 runtests "." "--nosse"
59 runtests "hardfloat" "--nosse"
60 runtests "32-bit" "--nosse"
61 runtests "littleendian" "--nosse"
62 runtest "--random 1000000" "--nosse"
64 elif [[ $($LIRASM --show-arch 2>/dev/null) == "X64" ]] ; then
69 runtests "littleendian"
70 runtest "--random 1000000"
71 runtest "--random 1000000 --optimize"
73 elif [[ $($LIRASM --show-arch 2>/dev/null) == "arm" ]] ; then
74 # ARMv7 with VFP. We could test without VFP but such a platform seems
75 # unlikely. ARM is bi-endian but usually configured as little-endian.
79 runtests "littleendian"
80 runtest "--random 1000000"
81 runtest "--random 1000000" "--optimize"
83 # ARMv6 with VFP. ARMv6 without VFP doesn't seem worth testing.
84 # Random tests are reduced.
85 runtests "." "--arch 6"
86 runtests "hardfloat" "--arch 6"
87 runtests "32-bit" "--arch 6"
88 runtests "littleendian" "--arch 6"
89 runtest "--random 100000" "--arch 6"
91 # ARMv5 without VFP. ARMv5 with VFP doesn't seem worth testing.
92 # Random tests are reduced.
93 runtests "." "--arch 5 --novfp"
94 runtests "softfloat" "--arch 5 --novfp"
95 runtests "32-bit" "--arch 5 --novfp"
96 runtests "littleendian" "--arch 5 --novfp"
97 runtest "--random 100000" "--arch 5 --novfp"
99 elif [[ $($LIRASM --show-arch 2>/dev/null) == "ppc" ]] ; then
100 # PPC is bi-endian but usually configured as big-endian.
103 if [[ $($LIRASM --show-word-size) == "32" ]] ; then
109 runtest "--random 1000000"
110 runtest "--random 1000000 --optimize"
112 elif [[ $($LIRASM --show-arch 2>/dev/null) == "sparc" ]] ; then
113 # Sparc is bi-endian but usually configured as big-endian.
118 runtest "--random 1000000"
119 runtest "--random 1000000 --optimize"
121 elif [[ $($LIRASM --show-arch 2>/dev/null) == "mips" ]] ; then
122 # MIPS is bi-endian but usually configured as big-endian.
123 # XXX: should we run softfloat tests as well? Seems to depend on
124 # the configuration...
129 runtest "--random 1000000"
130 runtest "--random 1000000 --optimize"
132 elif [[ $($LIRASM --show-arch 2>/dev/null) == "sh4" ]] ; then
133 # SH4 is bi-endian but usually configured as big-endian.
138 runtest "--random 1000000"
139 runtest "--random 1000000 --optimize"