aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/gasp/gasp.exp
blob: 85d0b97f8a50cf1d436551b44637bf5ad2d0140c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Test gasp.

# GASP is now deprecated (and not built by default)
# so if it does not exist, do not test it.
global GASP
if {![info exists GASP] || ! [file exists $GASP] } then {
    return 1
}

proc gasp_test { filename testname opt }  {
    global GASP
    global srcdir
    global host_triplet

    send_log "$srcdir/lib/run $GASP -I$srcdir/gasp -s $opt $filename.asm -o gasp.out\n"
    catch "exec $srcdir/lib/run $GASP -I$srcdir/gasp -s $opt $filename.asm -o gasp.out" errs
    catch "exec diff gasp.out $filename.out" diffs
    set diffs [prune_warnings $diffs]
    if ![string match "" $diffs] {
	send_log "$diffs\n"
	verbose $diffs
	fail $testname
	return 0
    } else {
	pass $testname
    }

}

foreach src [ lsort [ glob $srcdir/gasp/*.asm ] ] {
    regsub -all ".asm" $src "" t
    regsub "^.*/(\[^/\]*)$" $t "gasp \\1" testname
    gasp_test $t $testname ""
}

foreach src [ lsort [ glob $srcdir/gasp/mri/*.asm ] ] {
    regsub -all ".asm" $src "" t
    regsub "^.*/(\[^/\]*)$" $t "gasp MRI \\1" testname
    gasp_test $t $testname "-M"
}

# FIXME: this is here cause of a bug in DejaGnu 1.1.1. When it is no longer
#        in use, then this can be removed.
if [info exists errorInfo] then {
    unset errorInfo
}