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.
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 ""} } {
15 gas_run $file "" ">/dev/null"
16 verbose "output was $comp_output" 2
19 if {$comp_output == ""} { pass $testname } else { fail $testname }
23 if {[regexp "Error: $pattern" $comp_output]} {
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