Commit | Line | Data |
---|---|---|
4962c51a MS |
1 | @ Tests for LDR group relocations. |
2 | ||
3 | .text | |
4 | ||
5 | .macro ldrtest load store sym offset | |
6 | ||
7 | \load r0, [r0, #:pc_g0:(\sym \offset)] | |
8 | \load r0, [r0, #:pc_g1:(\sym \offset)] | |
9 | \load r0, [r0, #:pc_g2:(\sym \offset)] | |
10 | \load r0, [r0, #:sb_g0:(\sym \offset)] | |
11 | \load r0, [r0, #:sb_g1:(\sym \offset)] | |
12 | \load r0, [r0, #:sb_g2:(\sym \offset)] | |
13 | ||
14 | \store r0, [r0, #:pc_g0:(\sym \offset)] | |
15 | \store r0, [r0, #:pc_g1:(\sym \offset)] | |
16 | \store r0, [r0, #:pc_g2:(\sym \offset)] | |
17 | \store r0, [r0, #:sb_g0:(\sym \offset)] | |
18 | \store r0, [r0, #:sb_g1:(\sym \offset)] | |
19 | \store r0, [r0, #:sb_g2:(\sym \offset)] | |
20 | ||
21 | .endm | |
22 | ||
23 | @ LDR/STR/LDRB/STRB only have 12 bits available for the magnitude of the addend. | |
24 | @ So these should all (just) work. | |
25 | ||
26 | ldrtest ldr str f "+ 4095" | |
27 | ldrtest ldrb strb f "+ 4095" | |
28 | ldrtest ldr str f "- 4095" | |
29 | ldrtest ldrb strb f "- 4095" | |
30 | ||
31 | @ The same as the above, but for a local symbol. These should not be | |
32 | @ resolved by the assembler but instead left to the linker. | |
33 | ||
34 | ldrtest ldr str localsym "+ 4095" | |
35 | ldrtest ldrb strb localsym "+ 4095" | |
36 | ldrtest ldr str localsym "- 4095" | |
37 | ldrtest ldrb strb localsym "- 4095" | |
38 | ||
39 | localsym: | |
40 | mov r0, #0 | |
41 |