1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mcpu=generic -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -relocation-model=pic | FileCheck %s --check-prefix=X32
4 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck %s --check-prefix=X64
6 @i = thread_local global i32 15
7 @i2 = external thread_local global i32
11 ; X86: # %bb.0: # %entry
12 ; X86-NEXT: movl %gs:i@NTPOFF, %eax
16 ; X32: # %bb.0: # %entry
17 ; X32-NEXT: movl %fs:i@TPOFF, %eax
21 ; X64: # %bb.0: # %entry
22 ; X64-NEXT: movl %fs:i@TPOFF, %eax
25 %tmp1 = load i32, i32* @i
31 ; X86: # %bb.0: # %entry
32 ; X86-NEXT: movl %gs:0, %eax
33 ; X86-NEXT: leal i@NTPOFF(%eax), %eax
37 ; X32: # %bb.0: # %entry
38 ; X32-NEXT: movl %fs:0, %eax
39 ; X32-NEXT: leal i@TPOFF(%rax), %eax
43 ; X64: # %bb.0: # %entry
44 ; X64-NEXT: movq %fs:0, %rax
45 ; X64-NEXT: leaq i@TPOFF(%rax), %rax
53 ; X86: # %bb.0: # %entry
54 ; X86-NEXT: calll .L2$pb
55 ; X86-NEXT: .cfi_adjust_cfa_offset 4
58 ; X86-NEXT: .cfi_adjust_cfa_offset -4
60 ; X86-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L2$pb), %eax
61 ; X86-NEXT: movl i2@GOTNTPOFF(%eax), %eax
62 ; X86-NEXT: movl %gs:(%eax), %eax
66 ; X32: # %bb.0: # %entry
67 ; X32-NEXT: movl i2@{{.*}}(%rip), %eax
68 ; X32-NEXT: movl %fs:(%eax), %eax
72 ; X64: # %bb.0: # %entry
73 ; X64-NEXT: movq i2@{{.*}}(%rip), %rax
74 ; X64-NEXT: movl %fs:(%rax), %eax
77 %tmp1 = load i32, i32* @i2
83 ; X86: # %bb.0: # %entry
84 ; X86-NEXT: calll .L3$pb
85 ; X86-NEXT: .cfi_adjust_cfa_offset 4
88 ; X86-NEXT: .cfi_adjust_cfa_offset -4
90 ; X86-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp1-.L3$pb), %ecx
91 ; X86-NEXT: movl %gs:0, %eax
92 ; X86-NEXT: addl i2@GOTNTPOFF(%ecx), %eax
96 ; X32: # %bb.0: # %entry
97 ; X32-NEXT: movl %fs:0, %eax
98 ; X32-NEXT: addl i2@{{.*}}(%rip), %eax
102 ; X64: # %bb.0: # %entry
103 ; X64-NEXT: movq %fs:0, %rax
104 ; X64-NEXT: addq i2@{{.*}}(%rip), %rax
110 !llvm.module.flags = !{!0, !1}
111 !0 = !{i32 1, !"PIC Level", i32 1}
112 !1 = !{i32 1, !"PIE Level", i32 1}