+proc do_function_reloc_bug {} {
+ set testname "funcrelocbug.s: Test for reloc bug in non-plabel function reference (part 2)"
+ set x 0
+
+ if [gas_test_old "funcrelocbug.s" "" "Test for reloc bug in non-plabel function reference (part 1)"] {
+ objdump_start_no_subdir "a.out" "-r"
+
+ # Make sure GAS generated a correct relocation for the reference.
+ # branch/call
+ while 1 {
+ expect {
+ -re "^000000cc\[^\n\]*f2___4\[^\n+\]*\n"
+ { set x [expr $x+1] }
+ -re "^000000d0\[^\n\]*f2___4\[^\n+\]*\n"
+ { set x [expr $x+1] }
+ -re "\[^\n\]*\n" { }
+ timeout { perror "timeout\n"; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ objdump_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x==2] then { pass $testname } else { fail $testname }
+
+ set testname "funcrelocbug.s: Test for reloc bug in non-plabel function reference (part3)"
+ set x 0
+
+ objdump_start_no_subdir "a.out" "-d"
+ # Make sure we didn't put anything in the instruction itself!
+ while 1 {
+ expect {
+ -re "^000000cc\[^\n\]*ldil 0,r20\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "^000000d0\[^\n\]*ldo 0\[\(\]+r20\[\)\]+,r19\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "\[^\n\]*\n" { }
+ timeout { perror "timeout\n"; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ objdump_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x==2] then { pass $testname } else { fail $testname }
+ }
+
+}
+