Upload Tizen:Base source
[external/binutils.git] / ld / testsuite / ld-m68hc11 / adj-brset.s
1 ;;; Test 68HC11 linker relaxation and fixup of brclr/brset branches
2 ;;; 
3         .sect .text
4         .globl _start
5 _start:
6 start:
7         brclr   140,x#200,L8    ; Branch adjustment covers the whole test
8 ;;; The 'addd' is relaxed and we win 1 byte.  The next brclr/brset
9 ;;; branch must be fixed and reduced by 1.  We check for different
10 ;;; addressing modes because the instruction has different opcode and
11 ;;; different lengths.
12 L1:
13         addd    _toto
14         brclr   20,x,#3,L1
15         brclr   90,x,#99,L3     ; Likewise with forward branch
16 L2:
17         addd    _toto
18         brclr   19,y,#4,L2
19         brclr   91,y,#98,L4
20 L3:
21         addd    _toto
22         brset   18,x,#5,L3
23         brset   92,x,#97,L5
24 L4:
25         addd    _toto
26         brset   17,y,#6,L4
27         brset   93,y,#96,L5
28 L5:
29         addd    _toto
30         brset   *_table,#7,L5
31         brset   *_table+10,#95,L7
32 L6:
33         addd    _toto
34         brclr   *_table+1,#8,L6
35         brset   *_table+11,#94,L8
36 L7:
37         addd    _toto
38         brclr   *_table+1,#8,L6
39 L8:
40         brclr   140,x#200,_start ; Branch adjustment covers the whole test
41         rts
42
43         .sect   .page0
44 _bar:
45         .long   0
46 _toto:
47         .long   0
48         .skip   32
49 stack:
50         .skip   10
51 _table: