diff options
author | Kaz Kojima <kkojima@rr.iij4u.or.jp> | 2014-08-01 19:17:47 +0900 |
---|---|---|
committer | Kaz Kojima <kkojima@rr.iij4u.or.jp> | 2014-08-01 19:17:47 +0900 |
commit | 8c7840168031ab93432214580bf14ce63d638d22 (patch) | |
tree | 94157661b29029d97b79ca23c2b3bcfefe3e0291 /ld/testsuite | |
parent | b131d1fcfa5978f105a9ac39057475f54bab9202 (diff) | |
download | gdb-8c7840168031ab93432214580bf14ce63d638d22.zip gdb-8c7840168031ab93432214580bf14ce63d638d22.tar.gz gdb-8c7840168031ab93432214580bf14ce63d638d22.tar.bz2 |
Fix PR10373 which is SH relax bug.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-sh/sh.exp | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-sh/sh1.s | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 773a638..9114c7d 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2014-08-01 Takashi Yoshii <yoshii.takashi@renesas.com> + PR 10373 + * ld-sh/sh1.s: Add jmp relaxing test. + * ld-sh/sh.exp: Likewise. + +2014-08-01 Takashi Yoshii <yoshii.takashi@renesas.com> + PR 10378 * ld-sh/adjsw8.s: New. * ld-sh/sh.exp: Add switch8 adjustment test. diff --git a/ld/testsuite/ld-sh/sh.exp b/ld/testsuite/ld-sh/sh.exp index a270400..417daf7 100644 --- a/ld/testsuite/ld-sh/sh.exp +++ b/ld/testsuite/ld-sh/sh.exp @@ -49,7 +49,7 @@ if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] { verbose "bad output from nm" fail $testsimple } else { - if {$nm_output(bar) != $nm_output(foo) + 4} { + if {$nm_output(bar) != $nm_output(foo) + 0xc} { send_log "foo == $nm_output(foo)\n" verbose "foo == $nm_output(foo)" send_log "bar == $nm_output(bar)\n" @@ -149,7 +149,7 @@ if [istarget sh*-*linux*] { } if {![ld_assemble $as "-relax tmpdir/start.s" tmpdir/start.o] \ - || ![ld_compile $CC "-O -mrelax $srcdir/$subdir/sh2.c" tmpdir/sh2.o]} { + || ![ld_compile $CC "-O -mrelax -foptimize-sibling-calls $srcdir/$subdir/sh2.c" tmpdir/sh2.o]} { unresolved $testlink unresolved $testjsr unresolved $testrun @@ -168,7 +168,8 @@ pass $testlink send_log "$objdump -d tmpdir/sh2\n" verbose "$objdump -d tmpdir/sh2" catch "exec $objdump -d tmpdir/sh2" exec_output -if [string match "*jsr*" $exec_output] { +if {[string match "*jsr*" $exec_output] + || [string match "*jmp*" $exec_output]} { fail $testjsr } else { pass $testjsr diff --git a/ld/testsuite/ld-sh/sh1.s b/ld/testsuite/ld-sh/sh1.s index d18e439..b1f718d 100644 --- a/ld/testsuite/ld-sh/sh1.s +++ b/ld/testsuite/ld-sh/sh1.s @@ -4,7 +4,12 @@ L1: mov.l L2,r0 .uses L1 jsr @r0 + nop + .uses L1 + jmp @r0 + nop rts + nop .align 2 L2: .long bar |