xref: /aosp_15_r20/external/llvm/test/MC/AArch64/inline-asm-modifiers.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj -mattr=+fp-armv8 < %s | llvm-objdump -r - | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker	.file	"<stdin>"
4*9880d681SAndroid Build Coastguard Worker	.text
5*9880d681SAndroid Build Coastguard Worker	.globl	test_inline_modifier_L
6*9880d681SAndroid Build Coastguard Worker	.type	test_inline_modifier_L,@function
7*9880d681SAndroid Build Coastguard Workertest_inline_modifier_L:                 // @test_inline_modifier_L
8*9880d681SAndroid Build Coastguard Worker// BB#0:
9*9880d681SAndroid Build Coastguard Worker	//APP
10*9880d681SAndroid Build Coastguard Worker	add x0, x0, #:lo12:var_simple
11*9880d681SAndroid Build Coastguard Worker	//NO_APP
12*9880d681SAndroid Build Coastguard Worker	//APP
13*9880d681SAndroid Build Coastguard Worker	ldr x0, [x0, #:got_lo12:var_got]
14*9880d681SAndroid Build Coastguard Worker	//NO_APP
15*9880d681SAndroid Build Coastguard Worker	//APP
16*9880d681SAndroid Build Coastguard Worker	add x0, x0, #:tlsdesc_lo12:var_tlsgd
17*9880d681SAndroid Build Coastguard Worker	//NO_APP
18*9880d681SAndroid Build Coastguard Worker	//APP
19*9880d681SAndroid Build Coastguard Worker	add x0, x0, #:dtprel_lo12:var_tlsld
20*9880d681SAndroid Build Coastguard Worker	//NO_APP
21*9880d681SAndroid Build Coastguard Worker	//APP
22*9880d681SAndroid Build Coastguard Worker	ldr x0, [x0, #:gottprel_lo12:var_tlsie]
23*9880d681SAndroid Build Coastguard Worker	//NO_APP
24*9880d681SAndroid Build Coastguard Worker	//APP
25*9880d681SAndroid Build Coastguard Worker	add x0, x0, #:tprel_lo12:var_tlsle
26*9880d681SAndroid Build Coastguard Worker	//NO_APP
27*9880d681SAndroid Build Coastguard Worker	ret
28*9880d681SAndroid Build Coastguard Worker.Ltmp0:
29*9880d681SAndroid Build Coastguard Worker	.size	test_inline_modifier_L, .Ltmp0-test_inline_modifier_L
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_ADD_ABS_LO12_NC var_simple
32*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_LD64_GOT_LO12_NC var_got
33*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSDESC_ADD_LO12_NC var_tlsgd
34*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSLD_ADD_DTPREL_LO12 var_tlsld
35*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC var_tlsie
36*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSLE_ADD_TPREL_LO12 var_tlsle
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker	.globl	test_inline_modifier_G
39*9880d681SAndroid Build Coastguard Worker	.type	test_inline_modifier_G,@function
40*9880d681SAndroid Build Coastguard Workertest_inline_modifier_G:                 // @test_inline_modifier_G
41*9880d681SAndroid Build Coastguard Worker// BB#0:
42*9880d681SAndroid Build Coastguard Worker	//APP
43*9880d681SAndroid Build Coastguard Worker	add x0, x0, #:dtprel_hi12:var_tlsld, lsl #12
44*9880d681SAndroid Build Coastguard Worker	//NO_APP
45*9880d681SAndroid Build Coastguard Worker	//APP
46*9880d681SAndroid Build Coastguard Worker	add x0, x0, #:tprel_hi12:var_tlsle, lsl #12
47*9880d681SAndroid Build Coastguard Worker	//NO_APP
48*9880d681SAndroid Build Coastguard Worker	ret
49*9880d681SAndroid Build Coastguard Worker.Ltmp1:
50*9880d681SAndroid Build Coastguard Worker	.size	test_inline_modifier_G, .Ltmp1-test_inline_modifier_G
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSLD_ADD_DTPREL_HI12 var_tlsld
53*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSLE_ADD_TPREL_HI12 var_tlsle
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker	.globl	test_inline_modifier_A
56*9880d681SAndroid Build Coastguard Worker	.type	test_inline_modifier_A,@function
57*9880d681SAndroid Build Coastguard Workertest_inline_modifier_A:                 // @test_inline_modifier_A
58*9880d681SAndroid Build Coastguard Worker// BB#0:
59*9880d681SAndroid Build Coastguard Worker	//APP
60*9880d681SAndroid Build Coastguard Worker	adrp x0, var_simple
61*9880d681SAndroid Build Coastguard Worker	//NO_APP
62*9880d681SAndroid Build Coastguard Worker	//APP
63*9880d681SAndroid Build Coastguard Worker	adrp x0, :got:var_got
64*9880d681SAndroid Build Coastguard Worker	//NO_APP
65*9880d681SAndroid Build Coastguard Worker	//APP
66*9880d681SAndroid Build Coastguard Worker	adrp x0, :tlsdesc:var_tlsgd
67*9880d681SAndroid Build Coastguard Worker	//NO_APP
68*9880d681SAndroid Build Coastguard Worker	//APP
69*9880d681SAndroid Build Coastguard Worker	adrp x0, :gottprel:var_tlsie
70*9880d681SAndroid Build Coastguard Worker	//NO_APP
71*9880d681SAndroid Build Coastguard Worker	ret
72*9880d681SAndroid Build Coastguard Worker.Ltmp2:
73*9880d681SAndroid Build Coastguard Worker	.size	test_inline_modifier_A, .Ltmp2-test_inline_modifier_A
74*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_ADR_PREL_PG_HI21 var_simple
75*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_ADR_GOT_PAGE var_got
76*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSDESC_ADR_PAGE21 var_tlsgd
77*9880d681SAndroid Build Coastguard Worker// CHECK: R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 var_tlsie
78*9880d681SAndroid Build Coastguard Worker
79*9880d681SAndroid Build Coastguard Worker	.globl	test_inline_modifier_wx
80*9880d681SAndroid Build Coastguard Worker	.type	test_inline_modifier_wx,@function
81*9880d681SAndroid Build Coastguard Workertest_inline_modifier_wx:                // @test_inline_modifier_wx
82*9880d681SAndroid Build Coastguard Worker// BB#0:
83*9880d681SAndroid Build Coastguard Worker	mov	 w2, w0
84*9880d681SAndroid Build Coastguard Worker	//APP
85*9880d681SAndroid Build Coastguard Worker	add w2, w2, w2
86*9880d681SAndroid Build Coastguard Worker	//NO_APP
87*9880d681SAndroid Build Coastguard Worker	mov	 w2, w0
88*9880d681SAndroid Build Coastguard Worker	//APP
89*9880d681SAndroid Build Coastguard Worker	add w2, w2, w2
90*9880d681SAndroid Build Coastguard Worker	//NO_APP
91*9880d681SAndroid Build Coastguard Worker	//APP
92*9880d681SAndroid Build Coastguard Worker	add x0, x0, x0
93*9880d681SAndroid Build Coastguard Worker	//NO_APP
94*9880d681SAndroid Build Coastguard Worker	mov	 x0, x1
95*9880d681SAndroid Build Coastguard Worker	//APP
96*9880d681SAndroid Build Coastguard Worker	add x0, x0, x0
97*9880d681SAndroid Build Coastguard Worker	//NO_APP
98*9880d681SAndroid Build Coastguard Worker	mov	 x0, x1
99*9880d681SAndroid Build Coastguard Worker	//APP
100*9880d681SAndroid Build Coastguard Worker	add w0, w0, w0
101*9880d681SAndroid Build Coastguard Worker	//NO_APP
102*9880d681SAndroid Build Coastguard Worker	//APP
103*9880d681SAndroid Build Coastguard Worker	add x1, x1, x1
104*9880d681SAndroid Build Coastguard Worker	//NO_APP
105*9880d681SAndroid Build Coastguard Worker	//APP
106*9880d681SAndroid Build Coastguard Worker	add w0, wzr, wzr
107*9880d681SAndroid Build Coastguard Worker	//NO_APP
108*9880d681SAndroid Build Coastguard Worker	//APP
109*9880d681SAndroid Build Coastguard Worker	add x0, xzr, xzr
110*9880d681SAndroid Build Coastguard Worker	//NO_APP
111*9880d681SAndroid Build Coastguard Worker	ret
112*9880d681SAndroid Build Coastguard Worker.Ltmp3:
113*9880d681SAndroid Build Coastguard Worker	.size	test_inline_modifier_wx, .Ltmp3-test_inline_modifier_wx
114*9880d681SAndroid Build Coastguard Worker
115*9880d681SAndroid Build Coastguard Worker	.globl	test_inline_modifier_bhsdq
116*9880d681SAndroid Build Coastguard Worker	.type	test_inline_modifier_bhsdq,@function
117*9880d681SAndroid Build Coastguard Workertest_inline_modifier_bhsdq:             // @test_inline_modifier_bhsdq
118*9880d681SAndroid Build Coastguard Worker// BB#0:
119*9880d681SAndroid Build Coastguard Worker	//APP
120*9880d681SAndroid Build Coastguard Worker	ldr b0, [sp]
121*9880d681SAndroid Build Coastguard Worker	//NO_APP
122*9880d681SAndroid Build Coastguard Worker	//APP
123*9880d681SAndroid Build Coastguard Worker	ldr h0, [sp]
124*9880d681SAndroid Build Coastguard Worker	//NO_APP
125*9880d681SAndroid Build Coastguard Worker	//APP
126*9880d681SAndroid Build Coastguard Worker	ldr s0, [sp]
127*9880d681SAndroid Build Coastguard Worker	//NO_APP
128*9880d681SAndroid Build Coastguard Worker	//APP
129*9880d681SAndroid Build Coastguard Worker	ldr d0, [sp]
130*9880d681SAndroid Build Coastguard Worker	//NO_APP
131*9880d681SAndroid Build Coastguard Worker	//APP
132*9880d681SAndroid Build Coastguard Worker	ldr q0, [sp]
133*9880d681SAndroid Build Coastguard Worker	//NO_APP
134*9880d681SAndroid Build Coastguard Worker	//APP
135*9880d681SAndroid Build Coastguard Worker	ldr b0, [sp]
136*9880d681SAndroid Build Coastguard Worker	//NO_APP
137*9880d681SAndroid Build Coastguard Worker	//APP
138*9880d681SAndroid Build Coastguard Worker	ldr h0, [sp]
139*9880d681SAndroid Build Coastguard Worker	//NO_APP
140*9880d681SAndroid Build Coastguard Worker	//APP
141*9880d681SAndroid Build Coastguard Worker	ldr s0, [sp]
142*9880d681SAndroid Build Coastguard Worker	//NO_APP
143*9880d681SAndroid Build Coastguard Worker	//APP
144*9880d681SAndroid Build Coastguard Worker	ldr d0, [sp]
145*9880d681SAndroid Build Coastguard Worker	//NO_APP
146*9880d681SAndroid Build Coastguard Worker	//APP
147*9880d681SAndroid Build Coastguard Worker	ldr q0, [sp]
148*9880d681SAndroid Build Coastguard Worker	//NO_APP
149*9880d681SAndroid Build Coastguard Worker	ret
150*9880d681SAndroid Build Coastguard Worker.Ltmp4:
151*9880d681SAndroid Build Coastguard Worker	.size	test_inline_modifier_bhsdq, .Ltmp4-test_inline_modifier_bhsdq
152*9880d681SAndroid Build Coastguard Worker
153*9880d681SAndroid Build Coastguard Worker	.globl	test_inline_modifier_c
154*9880d681SAndroid Build Coastguard Worker	.type	test_inline_modifier_c,@function
155*9880d681SAndroid Build Coastguard Workertest_inline_modifier_c:                 // @test_inline_modifier_c
156*9880d681SAndroid Build Coastguard Worker// BB#0:
157*9880d681SAndroid Build Coastguard Worker	//APP
158*9880d681SAndroid Build Coastguard Worker	adr x0, 3
159*9880d681SAndroid Build Coastguard Worker	//NO_APP
160*9880d681SAndroid Build Coastguard Worker	ret
161*9880d681SAndroid Build Coastguard Worker.Ltmp5:
162*9880d681SAndroid Build Coastguard Worker	.size	test_inline_modifier_c, .Ltmp5-test_inline_modifier_c
163*9880d681SAndroid Build Coastguard Worker
164*9880d681SAndroid Build Coastguard Worker	.hidden	var_simple              // @var_simple
165*9880d681SAndroid Build Coastguard Worker	.type	var_simple,@object
166*9880d681SAndroid Build Coastguard Worker	.bss
167*9880d681SAndroid Build Coastguard Worker	.globl	var_simple
168*9880d681SAndroid Build Coastguard Worker	.align	2
169*9880d681SAndroid Build Coastguard Workervar_simple:
170*9880d681SAndroid Build Coastguard Worker	.word	0                       // 0x0
171*9880d681SAndroid Build Coastguard Worker	.size	var_simple, 4
172*9880d681SAndroid Build Coastguard Worker
173*9880d681SAndroid Build Coastguard Worker	.type	var_got,@object         // @var_got
174*9880d681SAndroid Build Coastguard Worker	.globl	var_got
175*9880d681SAndroid Build Coastguard Worker	.align	2
176*9880d681SAndroid Build Coastguard Workervar_got:
177*9880d681SAndroid Build Coastguard Worker	.word	0                       // 0x0
178*9880d681SAndroid Build Coastguard Worker	.size	var_got, 4
179*9880d681SAndroid Build Coastguard Worker
180*9880d681SAndroid Build Coastguard Worker	.type	var_tlsgd,@object       // @var_tlsgd
181*9880d681SAndroid Build Coastguard Worker	.section	.tbss,"awT",@nobits
182*9880d681SAndroid Build Coastguard Worker	.globl	var_tlsgd
183*9880d681SAndroid Build Coastguard Worker	.align	2
184*9880d681SAndroid Build Coastguard Workervar_tlsgd:
185*9880d681SAndroid Build Coastguard Worker	.word	0                       // 0x0
186*9880d681SAndroid Build Coastguard Worker	.size	var_tlsgd, 4
187*9880d681SAndroid Build Coastguard Worker
188*9880d681SAndroid Build Coastguard Worker	.type	var_tlsld,@object       // @var_tlsld
189*9880d681SAndroid Build Coastguard Worker	.globl	var_tlsld
190*9880d681SAndroid Build Coastguard Worker	.align	2
191*9880d681SAndroid Build Coastguard Workervar_tlsld:
192*9880d681SAndroid Build Coastguard Worker	.word	0                       // 0x0
193*9880d681SAndroid Build Coastguard Worker	.size	var_tlsld, 4
194*9880d681SAndroid Build Coastguard Worker
195*9880d681SAndroid Build Coastguard Worker	.type	var_tlsie,@object       // @var_tlsie
196*9880d681SAndroid Build Coastguard Worker	.globl	var_tlsie
197*9880d681SAndroid Build Coastguard Worker	.align	2
198*9880d681SAndroid Build Coastguard Workervar_tlsie:
199*9880d681SAndroid Build Coastguard Worker	.word	0                       // 0x0
200*9880d681SAndroid Build Coastguard Worker	.size	var_tlsie, 4
201*9880d681SAndroid Build Coastguard Worker
202*9880d681SAndroid Build Coastguard Worker	.type	var_tlsle,@object       // @var_tlsle
203*9880d681SAndroid Build Coastguard Worker	.globl	var_tlsle
204*9880d681SAndroid Build Coastguard Worker	.align	2
205*9880d681SAndroid Build Coastguard Workervar_tlsle:
206*9880d681SAndroid Build Coastguard Worker	.word	0                       // 0x0
207*9880d681SAndroid Build Coastguard Worker	.size	var_tlsle, 4
208*9880d681SAndroid Build Coastguard Worker
209*9880d681SAndroid Build Coastguard Worker
210