Add support for implicit TLS model used with MS VC runtime.
[oota-llvm.git] / test / CodeGen / X86 / tls11.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 = thread_local global i16 15
7
8 define i16 @f() {
9 entry:
10         %tmp1 = load i16* @i
11         ret i16 %tmp1
12 }
13 ; X32_LINUX: movzwl %gs:i@NTPOFF, %eax
14 ; X64_LINUX: movzwl %fs:i@TPOFF, %eax
15 ; X32_WIN: movl __tls_index, %eax
16 ; X32_WIN: movl %fs:__tls_array, %ecx
17 ; X32_WIN: movzwl _i@SECREL(%eax), %eax
18 ; X64_WIN: movl _tls_index(%rip), %eax
19 ; X64_WIN: movq %gs:88, %rcx
20 ; X64_WIN: movabsq $i@SECREL, %rcx
21 ; X64_WIN: movzwl (%rax,%rcx), %eax