llvm/test/CodeGen/AArch64/macho-global-symbols.ll
Tim Northover 87dff1dfcd AArch64: use linker-private symbols for globals in MachO.
We don't use section-relative relocations on AArch64, so all symbols must be at
least visible to the linker (i.e. properly global or l_whatever, but not
L_whatever).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303118 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 21:51:38 +00:00

18 lines
547 B
LLVM

; RUN: llc -mtriple=arm64-apple-ios %s -o - | FileCheck %s
; All global symbols must be at-most linker-private for AArch64 because we don't
; use section-relative relocations in MachO.
define i8* @private_sym() {
; CHECK-LABEL: private_sym:
; CHECK: adrp [[HIBITS:x[0-9]+]], l_var@PAGE
; CHECK: add x0, [[HIBITS]], l_var@PAGEOFF
ret i8* getelementptr([2 x i8], [2 x i8]* @var, i32 0, i32 0)
}
; CHECK: .section __TEXT,__cstring
; CHECK: l_var:
; CHECK: .asciz "\002"
@var = private unnamed_addr constant [2 x i8] [i8 2, i8 0]