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 warning for the test case.
6 # file -- name of the test case to assemble.
7 # testname -- a string describing the test.
8 # warnpattern -- a regular expression, suitable for use by the Tcl
9 # regexp command, to decide if the warning string was emitted by
10 # the assembler to stderr.
12 proc iq2000_warning_test { file testname {warnpattern ""} } {
15 gas_run $file "-m10" ">/dev/null"
16 verbose "output was $comp_output" 2
18 if {$warnpattern == ""} {
19 if {$comp_output == ""} { pass $testname } else { fail $testname }
23 if {[regexp "Warning: $warnpattern" $comp_output]} {
30 if [istarget iq2000*-*-*] {
31 foreach file [glob -nocomplain -- $srcdir/$subdir/q10yield*.s] {
32 set file [file tail $file]
33 iq2000_warning_test $file \
34 "assembler emits yield instruction in delay slot warning for $file" \
35 "instruction \[a-zA-Z0-9\]+ may not follow a branch/jump"
37 set testname "assembler emits no warnings for non-yield instruction in delay slot"
38 iq2000_warning_test q10noyield.s $testname