diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-29 16:46:22 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-29 16:46:22 +0000 |
commit | ce948e6304b94adf2d3fa68dc075b1e9e1b31c99 (patch) | |
tree | 4988a1cca40e8c153f5ca0a33f4ffbd771073485 /test/CodeGen/ARM/aeabi-read-tp.ll | |
parent | 7ce26385c4c4a41d70b38325f6dd69271296637a (diff) |
ARM: support `-mlong-calls` with AEABI TLS on ELF
Support lowering AEABI TLS access (__aeabi_read_tp) with long calls.
This requires adjusting the call sequence to use an indirect call to get
full addressability.
Resolves PR31769!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/aeabi-read-tp.ll')
-rw-r--r-- | test/CodeGen/ARM/aeabi-read-tp.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/aeabi-read-tp.ll b/test/CodeGen/ARM/aeabi-read-tp.ll new file mode 100644 index 00000000000..5f9815b6cd7 --- /dev/null +++ b/test/CodeGen/ARM/aeabi-read-tp.ll @@ -0,0 +1,26 @@ +; RUN: llc -mtriple armv7---eabi -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-SHORT +; RUN: llc -mtriple thumbv7---eabi -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-SHORT +; RUN: llc -mtriple armv7---eabi -mattr=+long-calls -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-LONG +; RUN: llc -mtriple thumbv7---eabi -mattr=+long-calls -filetype asm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-LONG + +@i = thread_local local_unnamed_addr global i32 0, align 4 + +define i32 @f() local_unnamed_addr { +entry: + %0 = load i32, i32* @i, align 4 + ret i32 %0 +} + +; CHECK-LABEL: f: +; CHECK-SHORT: ldr r1, [[VAR:.LCPI[0-9]+_[0-9]+]] +; CHECK-SHORT-NEXT: bl __aeabi_read_tp +; CHECK-SHORT: [[VAR]]: +; CHECK-SHORT-NEXT: .long i(TPOFF) + +; CHECK-LONG: ldr [[REG:r[0-9]+]], [[FUN:.LCPI[0-9]+_[0-9]+]] +; CHECK-LONG-NEXT: ldr r1, [[VAR:.LCPI[0-9]+_[0-9]+]] +; CHECK-LONG-NEXT: blx [[REG]] +; CHECK-LONG: [[VAR]]: +; CHECK-LONG-NEXT: .long i(TPOFF) +; CHECK-LONG: [[FUN]]: +; CHECK-LONG-NEXT: .long __aeabi_read_tp |