Add checks for other variants of the sr and st instruction.
[deliverable/binutils-gdb.git] / gas / testsuite / gas / iq2000 / q10load-hazards.exp
1 # Test for warnings when producing load hazards (instructions that
2 # reference the target of load one stage further down the pipeline.
3
4 # Run GAS and check that it emits the desired warning for the test case.
5 # Arguments:
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.
11
12 proc iq2000_warning_test { file testname {warnpattern ""} } {
13 global comp_output
14
15 gas_run $file "-m10" ">/dev/null"
16 verbose "output was $comp_output" 2
17
18 if {$warnpattern == ""} {
19 if {$comp_output == ""} { pass $testname } else { fail $testname }
20 return
21 }
22
23 if {[regexp "Warning: $warnpattern" $comp_output]} {
24 pass $testname
25 } else {
26 fail $testname
27 }
28 }
29
30 if [istarget iq2000*-*-*] {
31 foreach file [glob -nocomplain -- $srcdir/$subdir/q10hazard*.s] {
32 set file [file tail $file]
33 switch -- $file {
34 "q10hazard0.s" {
35 set warnpattern "operand references R10 of previous load"
36 }
37 "q10hazard1.s" {
38 set warnpattern "operand references R1 of previous load"
39 }
40 "q10hazard2.s" {
41 set warnpattern "operand references R2 of previous load"
42 }
43 "q10hazard3.s" {
44 set warnpattern "operand references R31 of previous load"
45 }
46 "q10hazard4.s" {
47 set warnpattern "operand references R10 of previous load"
48 }
49 "q10hazard5.s" {
50 set warnpattern "operand references R1 of previous load"
51 }
52 default {
53 error "no expected result specified for $file"
54 return
55 }
56 }
57 iq2000_warning_test $file "assembler emits load hazard warning for $file" $warnpattern
58 }
59
60 set testname "assembler emits no warnings when there are no load hazards"
61 iq2000_warning_test q10nohazard.s $testname
62 }
This page took 0.062569 seconds and 4 git commands to generate.