xref: /llvm-project/llvm/test/CodeGen/RISCV/elf-preemption.ll (revision 1456b68686808fa7c6ed7327aba65b639f81d5b8)
1ec27c5f1SFangrui Song; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2ec27c5f1SFangrui Song; RUN: llc -mtriple=riscv32 -relocation-model=static < %s \
3ec27c5f1SFangrui Song; RUN:   | FileCheck %s --check-prefix=RV32-STATIC
4ec27c5f1SFangrui Song; RUN: llc -mtriple=riscv32 -relocation-model=pic < %s \
5ec27c5f1SFangrui Song; RUN:   | FileCheck %s --check-prefix=RV32-PIC
6ec27c5f1SFangrui Song; RUN: llc -mtriple=riscv64 -relocation-model=static < %s \
7ec27c5f1SFangrui Song; RUN:   | FileCheck %s --check-prefix=RV64-STATIC
8ec27c5f1SFangrui Song; RUN: llc -mtriple=riscv64 -relocation-model=pic < %s \
9ec27c5f1SFangrui Song; RUN:   | FileCheck %s --check-prefix=RV64-PIC
10ec27c5f1SFangrui Song
11ec27c5f1SFangrui Song@preemptable_var = dso_preemptable global i32 42
12*1456b686SNikita Popovdefine ptr @get_preemptable_var() nounwind {
13ec27c5f1SFangrui Song; RV32-STATIC-LABEL: get_preemptable_var:
14ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
15ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(preemptable_var)
16ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(preemptable_var)
17ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
18ec27c5f1SFangrui Song;
19ec27c5f1SFangrui Song; RV32-PIC-LABEL: get_preemptable_var:
20ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
21260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi0:
22ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %got_pcrel_hi(preemptable_var)
23260a6410SLuís Marques; RV32-PIC-NEXT:    lw a0, %pcrel_lo(.Lpcrel_hi0)(a0)
24ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
25ec27c5f1SFangrui Song;
26ec27c5f1SFangrui Song; RV64-STATIC-LABEL: get_preemptable_var:
27ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
28ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(preemptable_var)
29ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(preemptable_var)
30ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
31ec27c5f1SFangrui Song;
32ec27c5f1SFangrui Song; RV64-PIC-LABEL: get_preemptable_var:
33ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
34260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi0:
35ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %got_pcrel_hi(preemptable_var)
36260a6410SLuís Marques; RV64-PIC-NEXT:    ld a0, %pcrel_lo(.Lpcrel_hi0)(a0)
37ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
38*1456b686SNikita Popov  ret ptr @preemptable_var
39ec27c5f1SFangrui Song}
40ec27c5f1SFangrui Song
41ec27c5f1SFangrui Song@dsolocal_var = dso_local global i32 42
42*1456b686SNikita Popovdefine ptr @get_dsolocal_var() nounwind {
43ec27c5f1SFangrui Song; RV32-STATIC-LABEL: get_dsolocal_var:
44ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
45ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(dsolocal_var)
46ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(dsolocal_var)
47ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
48ec27c5f1SFangrui Song;
49ec27c5f1SFangrui Song; RV32-PIC-LABEL: get_dsolocal_var:
50ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
51260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi1:
52ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %pcrel_hi(.Ldsolocal_var$local)
53260a6410SLuís Marques; RV32-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi1)
54ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
55ec27c5f1SFangrui Song;
56ec27c5f1SFangrui Song; RV64-STATIC-LABEL: get_dsolocal_var:
57ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
58ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(dsolocal_var)
59ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(dsolocal_var)
60ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
61ec27c5f1SFangrui Song;
62ec27c5f1SFangrui Song; RV64-PIC-LABEL: get_dsolocal_var:
63ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
64260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi1:
65ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %pcrel_hi(.Ldsolocal_var$local)
66260a6410SLuís Marques; RV64-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi1)
67ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
68*1456b686SNikita Popov  ret ptr @dsolocal_var
69ec27c5f1SFangrui Song}
70ec27c5f1SFangrui Song
71ec27c5f1SFangrui Song@weak_dsolocal_var = weak dso_local global i32 42
72*1456b686SNikita Popovdefine ptr @get_weak_dsolocal_var() nounwind {
73ec27c5f1SFangrui Song; RV32-STATIC-LABEL: get_weak_dsolocal_var:
74ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
75ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(weak_dsolocal_var)
76ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(weak_dsolocal_var)
77ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
78ec27c5f1SFangrui Song;
79ec27c5f1SFangrui Song; RV32-PIC-LABEL: get_weak_dsolocal_var:
80ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
81260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi2:
82ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %pcrel_hi(weak_dsolocal_var)
83260a6410SLuís Marques; RV32-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi2)
84ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
85ec27c5f1SFangrui Song;
86ec27c5f1SFangrui Song; RV64-STATIC-LABEL: get_weak_dsolocal_var:
87ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
88ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(weak_dsolocal_var)
89ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(weak_dsolocal_var)
90ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
91ec27c5f1SFangrui Song;
92ec27c5f1SFangrui Song; RV64-PIC-LABEL: get_weak_dsolocal_var:
93ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
94260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi2:
95ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %pcrel_hi(weak_dsolocal_var)
96260a6410SLuís Marques; RV64-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi2)
97ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
98*1456b686SNikita Popov  ret ptr @weak_dsolocal_var
99ec27c5f1SFangrui Song}
100ec27c5f1SFangrui Song
101ec27c5f1SFangrui Song@hidden_var = hidden global i32 42
102*1456b686SNikita Popovdefine ptr @get_hidden_var() nounwind {
103ec27c5f1SFangrui Song; RV32-STATIC-LABEL: get_hidden_var:
104ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
105ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(hidden_var)
106ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(hidden_var)
107ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
108ec27c5f1SFangrui Song;
109ec27c5f1SFangrui Song; RV32-PIC-LABEL: get_hidden_var:
110ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
111260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi3:
112ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %pcrel_hi(hidden_var)
113260a6410SLuís Marques; RV32-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi3)
114ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
115ec27c5f1SFangrui Song;
116ec27c5f1SFangrui Song; RV64-STATIC-LABEL: get_hidden_var:
117ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
118ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(hidden_var)
119ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(hidden_var)
120ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
121ec27c5f1SFangrui Song;
122ec27c5f1SFangrui Song; RV64-PIC-LABEL: get_hidden_var:
123ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
124260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi3:
125ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %pcrel_hi(hidden_var)
126260a6410SLuís Marques; RV64-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi3)
127ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
128*1456b686SNikita Popov  ret ptr @hidden_var
129ec27c5f1SFangrui Song}
130ec27c5f1SFangrui Song
131ec27c5f1SFangrui Song@protected_var = protected global i32 42
132*1456b686SNikita Popovdefine ptr @get_protected_var() nounwind {
133ec27c5f1SFangrui Song; RV32-STATIC-LABEL: get_protected_var:
134ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
135ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(protected_var)
136ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(protected_var)
137ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
138ec27c5f1SFangrui Song;
139ec27c5f1SFangrui Song; RV32-PIC-LABEL: get_protected_var:
140ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
141260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi4:
142ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %pcrel_hi(protected_var)
143260a6410SLuís Marques; RV32-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi4)
144ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
145ec27c5f1SFangrui Song;
146ec27c5f1SFangrui Song; RV64-STATIC-LABEL: get_protected_var:
147ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
148ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(protected_var)
149ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(protected_var)
150ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
151ec27c5f1SFangrui Song;
152ec27c5f1SFangrui Song; RV64-PIC-LABEL: get_protected_var:
153ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
154260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi4:
155ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %pcrel_hi(protected_var)
156260a6410SLuís Marques; RV64-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi4)
157ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
158*1456b686SNikita Popov  ret ptr @protected_var
159ec27c5f1SFangrui Song}
160ec27c5f1SFangrui Song
161*1456b686SNikita Popovdefine dso_preemptable ptr @preemptable_func() nounwind {
162ec27c5f1SFangrui Song; RV32-STATIC-LABEL: preemptable_func:
163ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
164ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(preemptable_func)
165ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(preemptable_func)
166ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
167ec27c5f1SFangrui Song;
168ec27c5f1SFangrui Song; RV32-PIC-LABEL: preemptable_func:
169ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
170260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi5:
171ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %got_pcrel_hi(preemptable_func)
172260a6410SLuís Marques; RV32-PIC-NEXT:    lw a0, %pcrel_lo(.Lpcrel_hi5)(a0)
173ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
174ec27c5f1SFangrui Song;
175ec27c5f1SFangrui Song; RV64-STATIC-LABEL: preemptable_func:
176ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
177ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(preemptable_func)
178ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(preemptable_func)
179ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
180ec27c5f1SFangrui Song;
181ec27c5f1SFangrui Song; RV64-PIC-LABEL: preemptable_func:
182ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
183260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi5:
184ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %got_pcrel_hi(preemptable_func)
185260a6410SLuís Marques; RV64-PIC-NEXT:    ld a0, %pcrel_lo(.Lpcrel_hi5)(a0)
186ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
187*1456b686SNikita Popov  ret ptr @preemptable_func
188ec27c5f1SFangrui Song}
189ec27c5f1SFangrui Song
190*1456b686SNikita Popovdefine dso_local ptr @dsolocal_func() nounwind {
191ec27c5f1SFangrui Song; RV32-STATIC-LABEL: dsolocal_func:
192ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
193ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(dsolocal_func)
194ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(dsolocal_func)
195ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
196ec27c5f1SFangrui Song;
197ec27c5f1SFangrui Song; RV32-PIC-LABEL: dsolocal_func:
198ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
199260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi6:
200ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %pcrel_hi(.Ldsolocal_func$local)
201260a6410SLuís Marques; RV32-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi6)
202ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
203ec27c5f1SFangrui Song;
204ec27c5f1SFangrui Song; RV64-STATIC-LABEL: dsolocal_func:
205ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
206ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(dsolocal_func)
207ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(dsolocal_func)
208ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
209ec27c5f1SFangrui Song;
210ec27c5f1SFangrui Song; RV64-PIC-LABEL: dsolocal_func:
211ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
212260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi6:
213ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %pcrel_hi(.Ldsolocal_func$local)
214260a6410SLuís Marques; RV64-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi6)
215ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
216*1456b686SNikita Popov  ret ptr @dsolocal_func
217ec27c5f1SFangrui Song}
218ec27c5f1SFangrui Song
219*1456b686SNikita Popovdefine weak dso_local ptr @weak_dsolocal_func() nounwind {
220ec27c5f1SFangrui Song; RV32-STATIC-LABEL: weak_dsolocal_func:
221ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
222ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lui a0, %hi(weak_dsolocal_func)
223ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi a0, a0, %lo(weak_dsolocal_func)
224ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
225ec27c5f1SFangrui Song;
226ec27c5f1SFangrui Song; RV32-PIC-LABEL: weak_dsolocal_func:
227ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
228260a6410SLuís Marques; RV32-PIC-NEXT:  .Lpcrel_hi7:
229ec27c5f1SFangrui Song; RV32-PIC-NEXT:    auipc a0, %pcrel_hi(weak_dsolocal_func)
230260a6410SLuís Marques; RV32-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi7)
231ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
232ec27c5f1SFangrui Song;
233ec27c5f1SFangrui Song; RV64-STATIC-LABEL: weak_dsolocal_func:
234ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
235ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    lui a0, %hi(weak_dsolocal_func)
236ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi a0, a0, %lo(weak_dsolocal_func)
237ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
238ec27c5f1SFangrui Song;
239ec27c5f1SFangrui Song; RV64-PIC-LABEL: weak_dsolocal_func:
240ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
241260a6410SLuís Marques; RV64-PIC-NEXT:  .Lpcrel_hi7:
242ec27c5f1SFangrui Song; RV64-PIC-NEXT:    auipc a0, %pcrel_hi(weak_dsolocal_func)
243260a6410SLuís Marques; RV64-PIC-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi7)
244ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
245*1456b686SNikita Popov  ret ptr @weak_dsolocal_func
246ec27c5f1SFangrui Song}
247ec27c5f1SFangrui Song
248ec27c5f1SFangrui Song;; call .Ldsolocal_func$local either resolves to a constant at assembly time
249ec27c5f1SFangrui Song;; or produces a relocation referencing a non-preemptible local symbol.
250ec27c5f1SFangrui Songdefine dso_local void @call_dsolocal_func() nounwind {
251ec27c5f1SFangrui Song; RV32-STATIC-LABEL: call_dsolocal_func:
252ec27c5f1SFangrui Song; RV32-STATIC:       # %bb.0:
253ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi sp, sp, -16
254ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    sw ra, 12(sp) # 4-byte Folded Spill
255ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    call dsolocal_func
256ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    lw ra, 12(sp) # 4-byte Folded Reload
257ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    addi sp, sp, 16
258ec27c5f1SFangrui Song; RV32-STATIC-NEXT:    ret
259ec27c5f1SFangrui Song;
260ec27c5f1SFangrui Song; RV32-PIC-LABEL: call_dsolocal_func:
261ec27c5f1SFangrui Song; RV32-PIC:       # %bb.0:
262ec27c5f1SFangrui Song; RV32-PIC-NEXT:    addi sp, sp, -16
263ec27c5f1SFangrui Song; RV32-PIC-NEXT:    sw ra, 12(sp) # 4-byte Folded Spill
264ec27c5f1SFangrui Song; RV32-PIC-NEXT:    call .Ldsolocal_func$local
265ec27c5f1SFangrui Song; RV32-PIC-NEXT:    lw ra, 12(sp) # 4-byte Folded Reload
266ec27c5f1SFangrui Song; RV32-PIC-NEXT:    addi sp, sp, 16
267ec27c5f1SFangrui Song; RV32-PIC-NEXT:    ret
268ec27c5f1SFangrui Song;
269ec27c5f1SFangrui Song; RV64-STATIC-LABEL: call_dsolocal_func:
270ec27c5f1SFangrui Song; RV64-STATIC:       # %bb.0:
271ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi sp, sp, -16
272ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    sd ra, 8(sp) # 8-byte Folded Spill
273ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    call dsolocal_func
274ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ld ra, 8(sp) # 8-byte Folded Reload
275ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    addi sp, sp, 16
276ec27c5f1SFangrui Song; RV64-STATIC-NEXT:    ret
277ec27c5f1SFangrui Song;
278ec27c5f1SFangrui Song; RV64-PIC-LABEL: call_dsolocal_func:
279ec27c5f1SFangrui Song; RV64-PIC:       # %bb.0:
280ec27c5f1SFangrui Song; RV64-PIC-NEXT:    addi sp, sp, -16
281ec27c5f1SFangrui Song; RV64-PIC-NEXT:    sd ra, 8(sp) # 8-byte Folded Spill
282ec27c5f1SFangrui Song; RV64-PIC-NEXT:    call .Ldsolocal_func$local
283ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ld ra, 8(sp) # 8-byte Folded Reload
284ec27c5f1SFangrui Song; RV64-PIC-NEXT:    addi sp, sp, 16
285ec27c5f1SFangrui Song; RV64-PIC-NEXT:    ret
286*1456b686SNikita Popov  call ptr @dsolocal_func()
287ec27c5f1SFangrui Song  ret void
288ec27c5f1SFangrui Song}
289