1 ; RUN: llc -relocation-model=static -verify-machineinstrs < %s --enable-shrink-wrap=false -mtriple=powerpc64le-unknown-linux-gnu | FileCheck %s
2 %struct.S = type { i8 }
4 @sg = internal thread_local global %struct.S zeroinitializer, align 1
5 @__dso_handle = external global i8
6 @__tls_guard = internal thread_local unnamed_addr global i1 false
7 @sum1 = internal thread_local global i32 0, align 4
9 declare void @_ZN1SC1Ev(%struct.S*)
10 declare void @_ZN1SD1Ev(%struct.S*)
11 declare i32 @_tlv_atexit(void (i8*)*, i8*, i8*)
13 ; CHECK-LABEL: _ZTW2sg
14 define cxx_fast_tlscc nonnull %struct.S* @_ZTW2sg() nounwind {
15 %.b.i = load i1, i1* @__tls_guard, align 1
16 ; CHECK: bc 12, 1, [[BB_end:.?LBB0_[0-9]+]]
17 br i1 %.b.i, label %__tls_init.exit, label %init.i
21 store i1 true, i1* @__tls_guard, align 1
22 tail call void @_ZN1SC1Ev(%struct.S* nonnull @sg) #2
24 %1 = tail call i32 @_tlv_atexit(void (i8*)* nonnull bitcast (void (%struct.S*)* @_ZN1SD1Ev to void (i8*)*), i8* nonnull getelementptr inbounds (%struct.S, %struct.S* @sg, i64 0, i32 0), i8* nonnull @__dso_handle) #2
25 ; CHECK: Folded Reload
27 br label %__tls_init.exit
34 ; CHECK-LABEL: _ZTW4sum1
35 define cxx_fast_tlscc nonnull i32* @_ZTW4sum1() nounwind {
39 define cxx_fast_tlscc i32* @_ZTW4sum2() #0 {
43 attributes #0 = { nounwind "no-frame-pointer-elim"="true" }