e8b007eb32f8fe48e55c061d5939ba30a0206817
[platform/upstream/binutils.git] / gas / testsuite / gasp / gasp.exp
1 # Test gasp.
2
3 # GASP is now deprecated (and not built by default)
4 # so if it does not exist, do not test it.
5 global GASP
6 if {![info exists GASP] || ! [file exists $GASP] } then {
7     return 1
8 }
9
10 proc gasp_test { filename testname opt }  {
11     global GASP
12     global srcdir
13     global host_triplet
14
15     send_log "$srcdir/lib/run $GASP -I$srcdir/gasp -s $opt $filename.asm -o gasp.out\n"
16     catch "exec $srcdir/lib/run $GASP -I$srcdir/gasp -s $opt $filename.asm -o gasp.out" errs
17     catch "exec diff gasp.out $filename.out" diffs
18     set diffs [prune_warnings $diffs]
19     if ![string match "" $diffs] {
20         send_log "$diffs\n"
21         verbose $diffs
22         fail $testname
23         return 0
24     } else {
25         pass $testname
26     }
27
28 }
29
30 foreach src [ lsort [ glob $srcdir/gasp/*.asm ] ] {
31     regsub -all ".asm" $src "" t
32     regsub "^.*/(\[^/\]*)$" $t "gasp \\1" testname
33     gasp_test $t $testname ""
34 }
35
36 foreach src [ lsort [ glob $srcdir/gasp/mri/*.asm ] ] {
37     regsub -all ".asm" $src "" t
38     regsub "^.*/(\[^/\]*)$" $t "gasp MRI \\1" testname
39     gasp_test $t $testname "-M"
40 }