Add support for implicit TLS model used with MS VC runtime.
[oota-llvm.git] / test / CodeGen / X86 / tls6.ll
1 ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s
2 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s
3 ; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s
4 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s
5
6 @i = internal thread_local global i32 15
7
8 define i32* @f() {
9 entry:
10         ret i32* @i
11 }
12 ; X32_LINUX: movl %gs:0, %eax
13 ; X32_LINUX: leal i@NTPOFF(%eax), %eax
14 ; X64_LINUX: movq %fs:0, %rax
15 ; X64_LINUX: leaq i@TPOFF(%rax), %rax
16 ; X32_WIN: movl __tls_index, %eax
17 ; X32_WIN: movl %fs:__tls_array, %ecx
18 ; X32_WIN: leal _i@SECREL(%eax), %eax
19 ; X64_WIN: movl _tls_index(%rip), %eax
20 ; X64_WIN: movq %gs:88, %rcx
21 ; X64_WIN: addq $i@SECREL, %rax