Commit | Line | Data |
---|---|---|
a99bcdd0 SC |
1 | # Test for warnings when placing yield instructions into IQ2000's |
2 | # branch delay slot. Written by Ben Elliston (bje@redhat.com) | |
3 | ||
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. | |
11 | ||
12 | proc iq2000_error_test { file testname {pattern ""} } { | |
13 | global comp_output | |
14 | ||
15 | gas_run $file "" ">/dev/null" | |
16 | verbose "output was $comp_output" 2 | |
17 | ||
18 | if {$pattern == ""} { | |
19 | if {$comp_output == ""} { pass $testname } else { fail $testname } | |
20 | return | |
21 | } | |
22 | ||
23 | if {[regexp "Error: $pattern" $comp_output]} { | |
24 | pass $testname | |
25 | } else { | |
26 | fail $testname | |
27 | } | |
28 | } | |
29 | ||
30 | if [istarget iq2000*-*-*] { | |
31 | foreach file [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." | |
36 | } | |
37 | set testname "assembler emits no warnings for non-yield instruction in delay slot" | |
38 | iq2000_error_test noyield.s $testname | |
39 | } |