* include/elf/arm.h: Correct names of R_ARM_LDC_G{0,1,2}
[binutils.git] / gas / testsuite / gas / arm / group-reloc-ldrs.s
blobfa74e7eabe0af0fc050ac66267ac5f47a2f16ff9
1 @ Tests for LDRS group relocations.
3 .text
5 .macro ldrtest2 load sym offset
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)]
13 .endm
15 .macro ldrtest load store sym offset
17 ldrtest2 \load \sym \offset
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)]
25 .endm
27 @ LDRD/STRD/LDRH/STRH/LDRSH/LDRSB only have 8 bits available for the
28 @ magnitude of the addend. So these should all (just) work.
30 ldrtest ldrd strd f "+ 255"
31 ldrtest ldrh strh f "+ 255"
32 ldrtest2 ldrsh f "+ 255"
33 ldrtest2 ldrsb f "+ 255"
35 ldrtest ldrd strd f "- 255"
36 ldrtest ldrh strh f "- 255"
37 ldrtest2 ldrsh f "- 255"
38 ldrtest2 ldrsb f "- 255"
40 @ The same as the above, but for a local symbol.
42 ldrtest ldrd strd localsym "+ 255"
43 ldrtest ldrh strh localsym "+ 255"
44 ldrtest2 ldrsh localsym "+ 255"
45 ldrtest2 ldrsb localsym "+ 255"
47 ldrtest ldrd strd localsym "- 255"
48 ldrtest ldrh strh localsym "- 255"
49 ldrtest2 ldrsh localsym "- 255"
50 ldrtest2 ldrsb localsym "- 255"
52 localsym:
53 mov r0, #0