1 ; RUN: llc < %s -mtriple x86_64-apple-darwin -mcpu=core2 | FileCheck %s
3 %struct.A = type { [48 x i8], i32, i32, i32 }
5 @c = external thread_local global %struct.A, align 4
7 define void @main() nounwind ssp {
10 call void @llvm.memset.p0i8.i64(i8* getelementptr inbounds (%struct.A, %struct.A* @c, i32 0, i32 0, i32 0), i8 0, i64 60, i32 1, i1 false)
12 ; CHECK: movq _c@TLVP(%rip), %rdi
13 ; CHECK-NEXT: callq *(%rdi)
14 ; CHECK-NEXT: movl $0, 56(%rax)
15 ; CHECK-NEXT: movq $0, 48(%rax)
19 define i32 @test() nounwind readonly ssp {
22 ; CHECK: movq _a@TLVP(%rip),
24 ; CHECK: movl (%rax), [[REGISTER:%[a-z]+]]
25 ; CHECK: movq _b@TLVP(%rip),
27 ; CHECK: subl (%rax), [[REGISTER]]
28 %0 = load i32, i32* @a, align 4
29 %1 = load i32, i32* @b, align 4
30 %sub = sub nsw i32 %0, %1
34 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
36 @a = thread_local global i32 0 ; <i32*> [#uses=0]
37 @b = thread_local global i32 0 ; <i32*> [#uses=0]
39 ; CHECK: .tbss _a$tlv$init, 4, 2
40 ; CHECK: .section __DATA,__thread_vars,thread_local_variables
43 ; CHECK: .quad __tlv_bootstrap
45 ; CHECK: .quad _a$tlv$init
47 ; CHECK: .tbss _b$tlv$init, 4, 2
50 ; CHECK: .quad __tlv_bootstrap
52 ; CHECK: .quad _b$tlv$init