Upload Tizen:Base source
[external/binutils.git] / gas / testsuite / gas / arm / group-reloc-ldrs-encoding-bad.s
1 @ Tests that are meant to fail during encoding of LDRS group relocations.
2
3         .text
4
5         .macro ldrtest2 load sym offset
6
7         \load   r0, [r0, #:pc_g1:(\sym \offset)]
8         \load   r0, [r0, #:pc_g2:(\sym \offset)]
9         \load   r0, [r0, #:sb_g0:(\sym \offset)]
10         \load   r0, [r0, #:sb_g1:(\sym \offset)]
11         \load   r0, [r0, #:sb_g2:(\sym \offset)]
12
13         .endm
14
15         .macro ldrtest load store sym offset
16
17         ldrtest2 \load \sym \offset
18
19         \store  r0, [r0, #:pc_g1:(\sym \offset)]
20         \store  r0, [r0, #:pc_g2:(\sym \offset)]
21         \store  r0, [r0, #:sb_g0:(\sym \offset)]
22         \store  r0, [r0, #:sb_g1:(\sym \offset)]
23         \store  r0, [r0, #:sb_g2:(\sym \offset)]
24
25         .endm
26
27 @ LDRD/STRD/LDRH/STRH/LDRSH/LDRSB only have 8 bits available for the 
28 @ magnitude of the addend.  So these should all (just) fail.
29
30         ldrtest ldrd strd f "+ 256"
31         ldrtest ldrh strh f "+ 256"
32         ldrtest2 ldrsh f "+ 256"
33         ldrtest2 ldrsb f "+ 256"
34
35         ldrtest ldrd strd f "- 256"
36         ldrtest ldrh strh f "- 256"
37         ldrtest2 ldrsh f "- 256"
38         ldrtest2 ldrsb f "- 256"
39
40 @ The same as the above, but for a local symbol.
41
42         ldrtest ldrd strd localsym "+ 256"
43         ldrtest ldrh strh localsym "+ 256"
44         ldrtest2 ldrsh localsym "+ 256"
45         ldrtest2 ldrsb localsym "+ 256"
46
47         ldrtest ldrd strd localsym "- 256"
48         ldrtest ldrh strh localsym "- 256"
49         ldrtest2 ldrsh localsym "- 256"
50         ldrtest2 ldrsb localsym "- 256"
51
52 localsym:
53         mov     r0, #0
54