1 ; Test general-dynamic TLS accesses.
3 ; RUN: llc < %s -mcpu=z10 -mtriple=s390x-linux-gnu -relocation-model=pic | FileCheck %s -check-prefix=CHECK-MAIN
4 ; RUN: llc < %s -mcpu=z10 -mtriple=s390x-linux-gnu -relocation-model=pic | FileCheck %s -check-prefix=CHECK-CP
6 @x = thread_local global i32 0
8 ; Call __tls_get_offset to retrieve the symbol's TLS offset.
10 ; CHECK-CP: .LCP{{.*}}:
11 ; CHECK-CP: .quad x@TLSGD
13 ; CHECK-MAIN-LABEL: foo:
14 ; CHECK-MAIN-DAG: larl %r12, _GLOBAL_OFFSET_TABLE_
15 ; CHECK-MAIN-DAG: lgrl %r2, .LCP{{.*}}
16 ; CHECK-MAIN: brasl %r14, __tls_get_offset@PLT:tls_gdcall:x
17 ; CHECK-MAIN: ear [[HIGH:%r[0-5]]], %a0
18 ; CHECK-MAIN: sllg [[TP:%r[0-5]]], [[HIGH]], 32
19 ; CHECK-MAIN: ear [[TP]], %a1
20 ; CHECK-MAIN: agr %r2, [[TP]]