ld/testsuite/
[binutils.git] / gas / testsuite / gas / iq2000 / yield.exp
blob30fae38b81b61348c3fb2b8ad5c5b4c1e030da27
1 # Test for warnings when placing yield instructions into IQ2000's
2 # branch delay slot. Written by Ben Elliston (bje@redhat.com)
4 # Run GAS and check that it emits the desired error for the test case.
5 # Arguments:
6 # file -- name of the test case to assemble.
7 # testname -- a string describing the test.
8 # pattern -- a regular expression, suitable for use by the Tcl
9 # regexp command, to decide if the error string was emitted by
10 # the assembler to stderr.
12 proc iq2000_error_test { file testname {pattern ""} } {
13 global comp_output
15 gas_run $file "" ">/dev/null"
16 verbose "output was $comp_output" 2
18 if {$pattern == ""} {
19 if {$comp_output == ""} { pass $testname } else { fail $testname }
20 return
23 if {[regexp "Error: $pattern" $comp_output]} {
24 pass $testname
25 } else {
26 fail $testname
30 if [istarget iq2000*-*-*] {
31 foreach file [lsort [glob -nocomplain -- $srcdir/$subdir/yield*.s]] {
32 set file [file tail $file]
33 iq2000_error_test $file \
34 "assembler emits yield instruction in delay slot error for $file" \
35 "the yielding instruction \[a-zA-Z0-9\]+ may not be in a delay slot."
37 set testname "assembler emits no warnings for non-yield instruction in delay slot"
38 iq2000_error_test noyield.s $testname