1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll
Strahinja Petrovic 608819b00b [PowerPC] Add secure plt support for TLS symbols
This patch supports secure plt mode for TLS symbols.

Differential Revision: https://reviews.llvm.org/D45520

llvm-svn: 355513
2019-03-06 15:00:10 +00:00

18 lines
594 B
LLVM

; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=SECURE-PLT-TLS %s
@a = thread_local local_unnamed_addr global i32 6, align 4
define i32 @main() local_unnamed_addr #0 {
entry:
%0 = load i32, i32* @a, align 4
ret i32 %0
}
!llvm.module.flags = !{!0}
!0 = !{i32 7, !"PIC Level", i32 2}
; SECURE-PLT-TLS: mflr 30
; SECURE-PLT-TLS-NEXT: addis 30, 30, .LTOC-.L0$pb@ha
; SECURE-PLT-TLS-NEXT: addi 30, 30, .LTOC-.L0$pb@l
; SECURE-PLT-TLS-NEXT: bl .L{{.*}}
; SECURE-PLT-TLS: bl __tls_get_addr(a@tlsgd)@PLT+32768