aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-sh
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@rr.iij4u.or.jp>2014-08-01 19:13:39 +0900
committerKaz Kojima <kkojima@rr.iij4u.or.jp>2014-08-01 19:13:39 +0900
commitb131d1fcfa5978f105a9ac39057475f54bab9202 (patch)
treea628ba1da811509052e75f196cf157e829843d47 /ld/testsuite/ld-sh
parent22d64076c87f4fe82a3dbb1bdf3df576d36ab4c0 (diff)
downloadgdb-b131d1fcfa5978f105a9ac39057475f54bab9202.zip
gdb-b131d1fcfa5978f105a9ac39057475f54bab9202.tar.gz
gdb-b131d1fcfa5978f105a9ac39057475f54bab9202.tar.bz2
Fix PR10378 which is SH relax bug.
Diffstat (limited to 'ld/testsuite/ld-sh')
-rw-r--r--ld/testsuite/ld-sh/adjsw8.s16
-rw-r--r--ld/testsuite/ld-sh/sh.exp20
2 files changed, 36 insertions, 0 deletions
diff --git a/ld/testsuite/ld-sh/adjsw8.s b/ld/testsuite/ld-sh/adjsw8.s
new file mode 100644
index 0000000..6518e26
--- /dev/null
+++ b/ld/testsuite/ld-sh/adjsw8.s
@@ -0,0 +1,16 @@
+L0: .byte L1-L0
+ .byte L2-L0
+ .byte L3-L0
+ .align 1
+L1: mov.l 1f,r1
+ .uses L1
+ jmp @r1
+ nop
+L2: mov.l 1f,r1
+ .uses L2
+ jmp @r1
+ nop
+L3: nop
+ .align 2
+1: .long 2f
+2:
diff --git a/ld/testsuite/ld-sh/sh.exp b/ld/testsuite/ld-sh/sh.exp
index 31181a9..a270400 100644
--- a/ld/testsuite/ld-sh/sh.exp
+++ b/ld/testsuite/ld-sh/sh.exp
@@ -110,6 +110,26 @@ if ![ld_simple_link $ld tmpdir/sh1.s1 $srec_relax_arg ] {
}
}
+set testadjsw8 "SH switch8 adjustment after relax"
+if ![ld_assemble $as "-relax $srcdir/$subdir/adjsw8.s" tmpdir/adjsw8.o] {
+ unresolved $testadjsw8
+} else {
+ if ![ld_simple_link $ld tmpdir/adjsw8 "-relax tmpdir/adjsw8.o"] {
+ fail $testadjsw8
+ } else {
+ send_log "exec $objdump -s tmpdir/adjsw8\n"
+ verbose "exec $objdump -s tmpdir/adjsw8"
+ catch "exec $objdump -s tmpdir/adjsw8" exec_output
+ if [string match "*04080c00*" $exec_output] {
+ pass $testadjsw8
+ } else {
+ send_log "bad switch table\n"
+ verbose "bad switch table"
+ fail $testadjsw8
+ }
+ }
+}
+
set testlink "SH relaxing"
set testjsr "SH confirm relaxing"
set testrun "SH relaxing execution"