summaryrefslogtreecommitdiffstats
path: root/gas/testsuite/gas/arm/group-reloc-ldrs.s
blob: fa74e7eabe0af0fc050ac66267ac5f47a2f16ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@ Tests for LDRS group relocations.

	.text

	.macro ldrtest2 load sym offset

	\load	r0, [r0, #:pc_g1:(\sym \offset)]
	\load	r0, [r0, #:pc_g2:(\sym \offset)]
	\load	r0, [r0, #:sb_g0:(\sym \offset)]
	\load	r0, [r0, #:sb_g1:(\sym \offset)]
	\load	r0, [r0, #:sb_g2:(\sym \offset)]

	.endm

	.macro ldrtest load store sym offset

	ldrtest2 \load \sym \offset

	\store	r0, [r0, #:pc_g1:(\sym \offset)]
	\store	r0, [r0, #:pc_g2:(\sym \offset)]
	\store	r0, [r0, #:sb_g0:(\sym \offset)]
	\store	r0, [r0, #:sb_g1:(\sym \offset)]
	\store	r0, [r0, #:sb_g2:(\sym \offset)]

	.endm

@ LDRD/STRD/LDRH/STRH/LDRSH/LDRSB only have 8 bits available for the 
@ magnitude of the addend.  So these should all (just) work.

	ldrtest ldrd strd f "+ 255"
	ldrtest ldrh strh f "+ 255"
	ldrtest2 ldrsh f "+ 255"
	ldrtest2 ldrsb f "+ 255"

	ldrtest ldrd strd f "- 255"
	ldrtest ldrh strh f "- 255"
	ldrtest2 ldrsh f "- 255"
	ldrtest2 ldrsb f "- 255"

@ The same as the above, but for a local symbol.

	ldrtest ldrd strd localsym "+ 255"
	ldrtest ldrh strh localsym "+ 255"
	ldrtest2 ldrsh localsym "+ 255"
	ldrtest2 ldrsb localsym "+ 255"

	ldrtest ldrd strd localsym "- 255"
	ldrtest ldrh strh localsym "- 255"
	ldrtest2 ldrsh localsym "- 255"
	ldrtest2 ldrsb localsym "- 255"

localsym:
	mov	r0, #0

OpenPOWER on IntegriCloud