summaryrefslogtreecommitdiffstats
path: root/binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2011-12-20 10:27:58 -0800
committerJing Yu <jingyu@google.com>2011-12-20 10:27:58 -0800
commitcf3cdbf8b3cda61a619299e7966a83df66244036 (patch)
tree201e2bcfc955f16802d3257112d29736cb3a3ce8 /binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s
parente4df3e0a5bb640ccfa2f30ee67fe9b3146b152d6 (diff)
downloadtoolchain_binutils-cf3cdbf8b3cda61a619299e7966a83df66244036.zip
toolchain_binutils-cf3cdbf8b3cda61a619299e7966a83df66244036.tar.gz
toolchain_binutils-cf3cdbf8b3cda61a619299e7966a83df66244036.tar.bz2
Add binutils-2.21.
Use --enable-gold=default for dual linker support. Change-Id: Id1a744c7db58a0b5e7a3be174cdfa875f2f86e49
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s')
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s84
1 files changed, 84 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s b/binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s
new file mode 100644
index 0000000..f449772
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68hc11/relax-direct.s
@@ -0,0 +1,84 @@
+;;; Test 68HC11 linker relaxation from extended addressing to direct
+;;; addressing modes
+;;;
+ .sect .text
+ .globl _start
+_start:
+start:
+ lds stack
+ ldd _bar
+ beq F1
+ beq F2
+ std _bar
+ jsr _bar
+F1:
+ addd _toto
+ bne start
+ ;; All the following instructions will be relaxed and win 1 byte
+ ;; for each.
+ addd _toto+200
+ addd stack+256-20
+ adca _table+2
+ adcb _table+3
+ adda _table+4
+ addb _table+5
+ addd _table+6
+ anda _table+7
+ andb _table+8
+ cmpa _table+9
+ cmpb _table+10
+ cpd _table+11
+ cpx _table+12
+ cpy _table+13
+ eora _table+14
+ eorb _table+15
+ jsr _table+16
+ ldaa _table+17
+ ldab _table+18
+ ldd _table+19
+ lds _table+20
+ ldx _table+21
+ ldy _table+22
+ oraa _table+23
+ orab _table+24
+ sbcb _table+25
+ sbca _table+26
+ staa _table+27
+ stab _table+28
+ std _table+29
+ sts _table+30
+ stx _table+31
+ sty _table+32
+ suba _table+33
+ subb _table+34
+ subd _table+35
+ ;; 'bne' is assembled as far branch and must relax to
+ ;; a relative 8-bit branch.
+ bne _start
+ ;; Likewise for next branch
+ bra F1
+ rts
+
+;;; The following instructions will not be relaxed
+no_relax:
+ addd _stack_top+60
+ std _stack_top+40
+ ;; 'tst' does not support direct addressing mode.
+ tst _toto+1
+ bne no_relax
+ .skip 200
+F2:
+ bra _start
+
+ .sect .page0
+_bar:
+ .long 0
+_toto:
+ .long 0
+ .skip 32
+stack:
+ .skip 10
+_table:
+ .skip 200
+_stack_top:
+