xref: /aosp_15_r20/external/llvm/test/CodeGen/SystemZ/tls-01.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test local-exec TLS accesses.
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mcpu=z10 -mtriple=s390x-linux-gnu | FileCheck %s -check-prefix=CHECK-MAIN
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mcpu=z10 -mtriple=s390x-linux-gnu | FileCheck %s -check-prefix=CHECK-CP
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker@x = thread_local global i32 0
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; The offset must be loaded from the constant pool.  It doesn't really
9*9880d681SAndroid Build Coastguard Worker; matter whether we use LARL/AG or LGRL/AGR for the last part.
10*9880d681SAndroid Build Coastguard Workerdefine i32 *@foo() {
11*9880d681SAndroid Build Coastguard Worker; CHECK-CP: .LCP{{.*}}:
12*9880d681SAndroid Build Coastguard Worker; CHECK-CP: .quad x@NTPOFF
13*9880d681SAndroid Build Coastguard Worker;
14*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN-LABEL: foo:
15*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN: ear [[HIGH:%r[0-5]]], %a0
16*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN: sllg %r2, [[HIGH]], 32
17*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN: ear %r2, %a1
18*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN: larl %r1, .LCP{{.*}}
19*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN: ag %r2, 0(%r1)
20*9880d681SAndroid Build Coastguard Worker; CHECK-MAIN: br %r14
21*9880d681SAndroid Build Coastguard Worker  ret i32 *@x
22*9880d681SAndroid Build Coastguard Worker}
23