summaryrefslogtreecommitdiffstats
path: root/ld/testsuite/ld-h8300
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-h8300')
-rw-r--r--ld/testsuite/ld-h8300/h8300.exp4
-rw-r--r--ld/testsuite/ld-h8300/relax-4-coff.d52
-rw-r--r--ld/testsuite/ld-h8300/relax-4.d51
-rw-r--r--ld/testsuite/ld-h8300/relax-4.s72
4 files changed, 178 insertions, 1 deletions
diff --git a/ld/testsuite/ld-h8300/h8300.exp b/ld/testsuite/ld-h8300/h8300.exp
index 53909619af..a8e8ddaf60 100644
--- a/ld/testsuite/ld-h8300/h8300.exp
+++ b/ld/testsuite/ld-h8300/h8300.exp
@@ -1,5 +1,5 @@
# Expect script for ld-h8300 tests
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,6 +29,8 @@ run_dump_test relax
if {[istarget *-elf]} {
run_dump_test relax-2
run_dump_test relax-3
+ run_dump_test relax-4
} else {
run_dump_test relax-3-coff
+ run_dump_test relax-4-coff
}
diff --git a/ld/testsuite/ld-h8300/relax-4-coff.d b/ld/testsuite/ld-h8300/relax-4-coff.d
new file mode 100644
index 0000000000..fccccbc10d
--- /dev/null
+++ b/ld/testsuite/ld-h8300/relax-4-coff.d
@@ -0,0 +1,52 @@
+# name: H8300 Relaxation Test 4
+# source: relax-4.s
+# ld: --relax -m h8300s
+# objdump: -d --no-show-raw-insn
+
+.*: file format .*-h8300
+
+Disassembly of section .text:
+
+00000100 <_start>:
+ 100: f8 03 mov.b #0x3,r0l
+ 102: fa 05 mov.b #0x5,r2l
+ 104: 7f ff 60 80 bset r0l,@0xff:8
+ 108: 7f 00 60 a0 bset r2l,@0x0:8
+ 10c: 7e ff 63 a0 btst r2l,@0xff:8
+ 110: 7e 00 63 80 btst r0l,@0x0:8
+ 114: 6a 18 00 00 70 50 bset #0x5,@0x0:16
+ 11a: 6a 18 7f ff 70 50 bset #0x5,@0x7fff:16
+ 120: 6a 18 80 00 70 50 bset #0x5,@0x8000:16
+ 126: 6a 18 fe ff 70 50 bset #0x5,@0xfeff:16
+ 12c: 7f 00 70 50 bset #0x5,@0x0:8
+ 130: 7f ff 70 50 bset #0x5,@0xff:8
+ 134: 6a 10 00 00 76 50 band #0x5,@0x0:16
+ 13a: 6a 10 7f ff 76 50 band #0x5,@0x7fff:16
+ 140: 6a 10 80 00 76 50 band #0x5,@0x8000:16
+ 146: 6a 10 fe ff 76 50 band #0x5,@0xfeff:16
+ 14c: 7e 00 76 50 band #0x5,@0x0:8
+ 150: 7e ff 76 50 band #0x5,@0xff:8
+ 154: 7f ff 60 a0 bset r2l,@0xff:8
+ 158: 7f 00 60 80 bset r0l,@0x0:8
+ 15c: 7e ff 63 80 btst r0l,@0xff:8
+ 160: 7e 00 63 a0 btst r2l,@0x0:8
+ 164: 6a 18 00 00 70 60 bset #0x6,@0x0:16
+ 16a: 6a 18 7f ff 70 60 bset #0x6,@0x7fff:16
+ 170: 6a 38 00 00 80 00 70 60 bset #0x6,@0x8000:32
+ 178: 6a 38 00 00 ff 00 70 60 bset #0x6,@0xff00:32
+ 180: 6a 38 00 ff ff 00 70 60 bset #0x6,@0xffff00:32
+ 188: 6a 38 ff ff 7f ff 70 60 bset #0x6,@0xffff7fff:32
+ 190: 6a 18 80 00 70 60 bset #0x6,@0x8000:16
+ 196: 6a 18 fe ff 70 60 bset #0x6,@0xfeff:16
+ 19c: 7f 00 70 60 bset #0x6,@0x0:8
+ 1a0: 7f ff 70 60 bset #0x6,@0xff:8
+ 1a4: 6a 10 00 00 76 60 band #0x6,@0x0:16
+ 1aa: 6a 10 7f ff 76 60 band #0x6,@0x7fff:16
+ 1b0: 6a 30 00 00 80 00 76 60 band #0x6,@0x8000:32
+ 1b8: 6a 30 00 00 ff 00 76 60 band #0x6,@0xff00:32
+ 1c0: 6a 30 00 ff ff 00 76 60 band #0x6,@0xffff00:32
+ 1c8: 6a 30 ff ff 7f ff 76 60 band #0x6,@0xffff7fff:32
+ 1d0: 6a 10 80 00 76 60 band #0x6,@0x8000:16
+ 1d6: 6a 10 fe ff 76 60 band #0x6,@0xfeff:16
+ 1dc: 7e 00 76 60 band #0x6,@0x0:8
+ 1e0: 7e ff 76 60 band #0x6,@0xff:8
diff --git a/ld/testsuite/ld-h8300/relax-4.d b/ld/testsuite/ld-h8300/relax-4.d
new file mode 100644
index 0000000000..e7269a7f0d
--- /dev/null
+++ b/ld/testsuite/ld-h8300/relax-4.d
@@ -0,0 +1,51 @@
+# name: H8300 Relaxation Test 4
+# ld: --relax -m h8300self
+# objdump: -d --no-show-raw-insn
+
+.*: file format .*-h8300
+
+Disassembly of section .text:
+
+00000100 <_start>:
+ 100: f8 03 mov.b #0x3,r0l
+ 102: fa 05 mov.b #0x5,r2l
+ 104: 7f ff 60 80 bset r0l,@0xff:8
+ 108: 7f 00 60 a0 bset r2l,@0x0:8
+ 10c: 7e ff 63 a0 btst r2l,@0xff:8
+ 110: 7e 00 63 80 btst r0l,@0x0:8
+ 114: 6a 18 00 00 70 50 bset #0x5,@0x0:16
+ 11a: 6a 18 7f ff 70 50 bset #0x5,@0x7fff:16
+ 120: 6a 18 80 00 70 50 bset #0x5,@0x8000:16
+ 126: 6a 18 fe ff 70 50 bset #0x5,@0xfeff:16
+ 12c: 7f 00 70 50 bset #0x5,@0x0:8
+ 130: 7f ff 70 50 bset #0x5,@0xff:8
+ 134: 6a 10 00 00 76 50 band #0x5,@0x0:16
+ 13a: 6a 10 7f ff 76 50 band #0x5,@0x7fff:16
+ 140: 6a 10 80 00 76 50 band #0x5,@0x8000:16
+ 146: 6a 10 fe ff 76 50 band #0x5,@0xfeff:16
+ 14c: 7e 00 76 50 band #0x5,@0x0:8
+ 150: 7e ff 76 50 band #0x5,@0xff:8
+ 154: 7f ff 60 a0 bset r2l,@0xff:8
+ 158: 7f 00 60 80 bset r0l,@0x0:8
+ 15c: 7e ff 63 80 btst r0l,@0xff:8
+ 160: 7e 00 63 a0 btst r2l,@0x0:8
+ 164: 6a 18 00 00 70 60 bset #0x6,@0x0:16
+ 16a: 6a 18 7f ff 70 60 bset #0x6,@0x7fff:16
+ 170: 6a 38 00 00 80 00 70 60 bset #0x6,@0x8000:32
+ 178: 6a 38 00 00 ff 00 70 60 bset #0x6,@0xff00:32
+ 180: 6a 38 00 ff ff 00 70 60 bset #0x6,@0xffff00:32
+ 188: 6a 38 ff ff 7f ff 70 60 bset #0x6,@0xffff7fff:32
+ 190: 6a 18 80 00 70 60 bset #0x6,@0x8000:16
+ 196: 6a 18 fe ff 70 60 bset #0x6,@0xfeff:16
+ 19c: 7f 00 70 60 bset #0x6,@0x0:8
+ 1a0: 7f ff 70 60 bset #0x6,@0xff:8
+ 1a4: 6a 10 00 00 76 60 band #0x6,@0x0:16
+ 1aa: 6a 10 7f ff 76 60 band #0x6,@0x7fff:16
+ 1b0: 6a 30 00 00 80 00 76 60 band #0x6,@0x8000:32
+ 1b8: 6a 30 00 00 ff 00 76 60 band #0x6,@0xff00:32
+ 1c0: 6a 30 00 ff ff 00 76 60 band #0x6,@0xffff00:32
+ 1c8: 6a 30 ff ff 7f ff 76 60 band #0x6,@0xffff7fff:32
+ 1d0: 6a 10 80 00 76 60 band #0x6,@0x8000:16
+ 1d6: 6a 10 fe ff 76 60 band #0x6,@0xfeff:16
+ 1dc: 7e 00 76 60 band #0x6,@0x0:8
+ 1e0: 7e ff 76 60 band #0x6,@0xff:8
diff --git a/ld/testsuite/ld-h8300/relax-4.s b/ld/testsuite/ld-h8300/relax-4.s
new file mode 100644
index 0000000000..32b5b0604d
--- /dev/null
+++ b/ld/testsuite/ld-h8300/relax-4.s
@@ -0,0 +1,72 @@
+; Relaxation is possible for following bit manipulation instructions
+; BAND, BCLR, BIAND, BILD, BIOR, BIST, BIXOR, BLD, BNOT, BOR, BSET, BST, BTST, BXOR
+ .h8300s
+ .globl _start
+ _start:
+ # s3-s6 aren't valid 16-bit addresses.
+ mov.b #0x3,r0l
+ mov.b #0x5,r2l
+;
+; Relaxation of aa:16
+;
+ bset r0l,@s10:16
+ bset r2l,@s9:16
+ btst r2l,@s10:16
+ btst r0l,@s9:16
+
+ bset #5,@s1:16
+ bset #5,@s2:16
+ bset #5,@s7:16
+ bset #5,@s8:16
+ bset #5,@s9:16
+ bset #5,@s10:16
+
+ band #5,@s1:16
+ band #5,@s2:16
+ band #5,@s7:16
+ band #5,@s8:16
+ band #5,@s9:16
+ band #5,@s10:16
+;
+; Relaxation of aa:32
+;
+ bset r2l,@s10:32
+ bset r0l,@s9:32
+ btst r0l,@s10:32
+ btst r2l,@s9:32
+
+ bset #6,@s1:32
+ bset #6,@s2:32
+ bset #6,@s3:32
+ bset #6,@s4:32
+ bset #6,@s5:32
+ bset #6,@s6:32
+ bset #6,@s7:32
+ bset #6,@s8:32
+ bset #6,@s9:32
+ bset #6,@s10:32
+
+ band #6,@s1:32
+ band #6,@s2:32
+ band #6,@s3:32
+ band #6,@s4:32
+ band #6,@s5:32
+ band #6,@s6:32
+ band #6,@s7:32
+ band #6,@s8:32
+ band #6,@s9:32
+ band #6,@s10:32
+
+ .equ s1,0
+ .equ s2,0x7fff
+ .equ s3,0x8000
+ .equ s4,0xff00
+ .equ s5,0xffff00
+ .equ s6,0xffff7fff
+ .equ s7,0xffff8000
+ .equ s8,0xfffffeff
+ .equ s9,0xffffff00
+ .equ s10,0xffffffff
+
+ .end
+
OpenPOWER on IntegriCloud