diff options
| author | Strahinja Petrovic <strahinja.petrovic@rt-rk.com> | 2017-07-28 12:54:57 +0000 |
|---|---|---|
| committer | Strahinja Petrovic <strahinja.petrovic@rt-rk.com> | 2017-07-28 12:54:57 +0000 |
| commit | 25e9e1b8660a1b01479bc006268f21643a32f125 (patch) | |
| tree | 136748e8aa900bde3e7ffa704fbc4e4317f315e2 /llvm/test/CodeGen | |
| parent | f288ace639e0e5e6d033977ea49f767a3705c240 (diff) | |
| download | bcm5719-llvm-25e9e1b8660a1b01479bc006268f21643a32f125.tar.gz bcm5719-llvm-25e9e1b8660a1b01479bc006268f21643a32f125.zip | |
[ARM] Add the option to directly access TLS pointer
This patch enables choice for accessing thread local
storage pointer (like '-mtp' in gcc).
Differential Revision: https://reviews.llvm.org/D34408
llvm-svn: 309381
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/ARM/readtp.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/readtp.ll b/llvm/test/CodeGen/ARM/readtp.ll new file mode 100644 index 00000000000..01ebf6e765f --- /dev/null +++ b/llvm/test/CodeGen/ARM/readtp.ll @@ -0,0 +1,22 @@ +; RUN: llc -mtriple=armeb-linux-gnueabihf -O2 -mattr=+read-tp-hard %s -o - | FileCheck %s -check-prefix=CHECK-HARD +; RUN: llc -mtriple=armeb-linux-gnueabihf -O2 %s -o - | FileCheck %s -check-prefix=CHECK-SOFT + + +; __thread int counter; +; void foo() { +; counter = 5; +; } + + +@counter = thread_local local_unnamed_addr global i32 0, align 4 + +define void @foo() local_unnamed_addr #0 { +entry: + store i32 5, i32* @counter, align 4 + ret void +} + + +; CHECK-LABEL: foo: +; CHECK-HARD: mrc p15, #0, {{r[0-9]+}}, c13, c0, #3 +; CHECK-SOFT: bl __aeabi_read_tp
\ No newline at end of file |

