1 # Test for warnings when producing load hazards (instructions that
2 # reference the target of load one stage further down the pipeline.
3 # Written by Ben Elliston (bje@redhat.com)
5 # Run GAS and check that it emits the desired warning for the test case.
7 # file -- name of the test case to assemble.
8 # testname -- a string describing the test.
9 # warnpattern -- a regular expression, suitable for use by the Tcl
10 # regexp command, to decide if the warning string was emitted by
11 # the assembler to stderr.
13 proc iq2000_warning_test { file testname {warnpattern ""} } {
16 gas_run $file "" ">/dev/null"
17 verbose "output was $comp_output" 2
19 if {$warnpattern == ""} {
20 if {$comp_output == ""} { pass $testname } else { fail $testname }
24 if {[regexp "Warning: $warnpattern" $comp_output]} {
31 if [istarget iq2000*-*-*] {
32 foreach file [lsort [glob -nocomplain -- $srcdir/$subdir/hazard*.s]] {
33 set file [file tail $file]
36 set warnpattern "operand references R10 of previous load"
39 set warnpattern "operand references R1 of previous load"
42 set warnpattern "operand references R2 of previous load"
45 set warnpattern "instruction implicitly accesses R31 of previous load"
48 set warnpattern "operand references R10 of previous load"
51 set warnpattern "operand references R8 of previous load"
54 error "no expected result specified for $file"
58 iq2000_warning_test $file "assembler emits load hazard warning for $file" $warnpattern
61 set testname "assembler emits no warnings when there are no load hazards"
62 iq2000_warning_test nohazard.s $testname