xref: /llvm-project/llvm/test/CodeGen/ARM/dso-local-func.ll (revision df00dac828d7d0f88106d34b12a4eafaa8dd93ea)
17925341dSAlex Richardson;; Check that we emit a $local alias for a dso_local function definition
27925341dSAlex Richardson; RUN: llc -mtriple=armv7-linux-gnueabi -relocation-model=static < %s \
37925341dSAlex Richardson; RUN:   | FileCheck %s --check-prefixes=CHECK,STATIC
47925341dSAlex Richardson; RUN: llc -mtriple=armv7-linux-gnueabi -relocation-model=pic < %s \
57925341dSAlex Richardson; RUN:   | FileCheck %s --check-prefixes=CHECK,PIC
67925341dSAlex Richardson
77925341dSAlex Richardsondefine dso_local ptr @dsolocal_func() nounwind {
87925341dSAlex Richardson; CHECK-LABEL: 	.globl	dsolocal_func
97925341dSAlex Richardson; CHECK-NEXT: 	.p2align	2
107925341dSAlex Richardson; CHECK-NEXT: 	.type	dsolocal_func,%function
117925341dSAlex Richardson; CHECK-NEXT: 	.code	32
127925341dSAlex Richardson; CHECK-NEXT: dsolocal_func:
139a2b14afSAlex Richardson; PIC-NEXT: .Ldsolocal_func$local:
140483b008SAlex Richardson; PIC-NEXT: .type .Ldsolocal_func$local,%function
157925341dSAlex Richardson; CHECK-NEXT: 	.fnstart
167925341dSAlex Richardson; CHECK-NEXT: @ %bb.0:
177925341dSAlex Richardson; STATIC-NEXT: 	movw	r0, :lower16:dsolocal_func
187925341dSAlex Richardson; STATIC-NEXT: 	movt	r0, :upper16:dsolocal_func
197925341dSAlex Richardson; STATIC-NEXT: 	bx	lr
207925341dSAlex Richardson; PIC-NEXT:     ldr	r0, .LCPI0_0
217925341dSAlex Richardson; PIC-NEXT:   .LPC0_0:
227925341dSAlex Richardson; PIC-NEXT:     add	r0, pc, r0
237925341dSAlex Richardson; PIC-NEXT:     bx	lr
247925341dSAlex Richardson; PIC-NEXT:     .p2align	2
257925341dSAlex Richardson; PIC-NEXT:   @ %bb.1:
267925341dSAlex Richardson; PIC-NEXT:   .LCPI0_0:
27*df00dac8SAlex Richardson; PIC-NEXT:     .long	.Ldsolocal_func$local-(.LPC0_0+8)
287925341dSAlex Richardson; CHECK-NEXT: .Lfunc_end0:
297925341dSAlex Richardson; CHECK-NEXT: 	.size	dsolocal_func, .Lfunc_end0-dsolocal_func
300483b008SAlex Richardson; PIC-NEXT:     .size .Ldsolocal_func$local, .Lfunc_end0-dsolocal_func
317925341dSAlex Richardson; CHECK-NEXT: 	.cantunwind
327925341dSAlex Richardson; CHECK-NEXT: 	.fnend
337925341dSAlex Richardson  ret ptr @dsolocal_func
347925341dSAlex Richardson}
35