diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2012-02-11 17:26:53 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2012-02-11 17:26:53 +0000 |
commit | d4a19b6a72d19a6f90b676aac37118664b7b7a84 (patch) | |
tree | 9c63b3d4288efc19f18610519a9aeeafb6a7df45 /test | |
parent | 6b30274e27fc65752abb2e1fe48b538ccd824a24 (diff) | |
download | external_llvm-d4a19b6a72d19a6f90b676aac37118664b7b7a84.zip external_llvm-d4a19b6a72d19a6f90b676aac37118664b7b7a84.tar.gz external_llvm-d4a19b6a72d19a6f90b676aac37118664b7b7a84.tar.bz2 |
Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/tls1.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/X86/tls11.ll | 17 | ||||
-rw-r--r-- | test/CodeGen/X86/tls12.ll | 17 | ||||
-rw-r--r-- | test/CodeGen/X86/tls13.ll | 21 | ||||
-rw-r--r-- | test/CodeGen/X86/tls14.ll | 21 | ||||
-rw-r--r-- | test/CodeGen/X86/tls2.ll | 20 | ||||
-rw-r--r-- | test/CodeGen/X86/tls3.ll | 19 | ||||
-rw-r--r-- | test/CodeGen/X86/tls4.ll | 20 | ||||
-rw-r--r-- | test/CodeGen/X86/tls5.ll | 15 | ||||
-rw-r--r-- | test/CodeGen/X86/tls6.ll | 20 |
10 files changed, 134 insertions, 52 deletions
diff --git a/test/CodeGen/X86/tls1.ll b/test/CodeGen/X86/tls1.ll index 0cae5c4..f39658e 100644 --- a/test/CodeGen/X86/tls1.ll +++ b/test/CodeGen/X86/tls1.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movl %gs:i@NTPOFF, %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movl %fs:i@TPOFF, %eax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = thread_local global i32 15 @@ -10,3 +10,11 @@ entry: %tmp1 = load i32* @i ret i32 %tmp1 } +; X32_LINUX: movl %gs:i@NTPOFF, %eax +; X64_LINUX: movl %fs:i@TPOFF, %eax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: movl _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movabsq $i@SECREL, %rcx + diff --git a/test/CodeGen/X86/tls11.ll b/test/CodeGen/X86/tls11.ll index 514a168..cc14826 100644 --- a/test/CodeGen/X86/tls11.ll +++ b/test/CodeGen/X86/tls11.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movzwl %gs:i@NTPOFF, %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movzwl %fs:i@TPOFF, %eax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = thread_local global i16 15 @@ -10,3 +10,12 @@ entry: %tmp1 = load i16* @i ret i16 %tmp1 } +; X32_LINUX: movzwl %gs:i@NTPOFF, %eax +; X64_LINUX: movzwl %fs:i@TPOFF, %eax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: movzwl _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movq %gs:88, %rcx +; X64_WIN: movabsq $i@SECREL, %rcx +; X64_WIN: movzwl (%rax,%rcx), %eax diff --git a/test/CodeGen/X86/tls12.ll b/test/CodeGen/X86/tls12.ll index c29f6ad..3da789e 100644 --- a/test/CodeGen/X86/tls12.ll +++ b/test/CodeGen/X86/tls12.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movb %gs:i@NTPOFF, %al} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movb %fs:i@TPOFF, %al} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = thread_local global i8 15 @@ -10,3 +10,12 @@ entry: %tmp1 = load i8* @i ret i8 %tmp1 } +; X32_LINUX: movb %gs:i@NTPOFF, %al +; X64_LINUX: movb %fs:i@TPOFF, %al +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: movb _i@SECREL(%eax), %al +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movq %gs:88, %rcx +; X64_WIN: movabsq $i@SECREL, %rcx +; X64_WIN: movb (%rax,%rcx), %al diff --git a/test/CodeGen/X86/tls13.ll b/test/CodeGen/X86/tls13.ll index 08778ec..0f6a98a 100644 --- a/test/CodeGen/X86/tls13.ll +++ b/test/CodeGen/X86/tls13.ll @@ -1,9 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movswl %gs:i@NTPOFF, %eax} %t -; RUN: grep {movzwl %gs:j@NTPOFF, %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movswl %fs:i@TPOFF, %edi} %t2 -; RUN: grep {movzwl %fs:j@TPOFF, %edi} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = thread_local global i16 0 @j = thread_local global i16 0 @@ -22,3 +20,14 @@ entry: declare void @g(i32) declare void @h(i32) + +; X32_LINUX: movswl %gs:i@NTPOFF, %eax +; X32_LINUX: movzwl %gs:j@NTPOFF, %eax +; X64_LINUX: movswl %fs:i@TPOFF, %edi +; X64_LINUX: movzwl %fs:j@TPOFF, %edi +; X32_WIN: movswl _i@SECREL(%esi), %eax +; X32_WIN: movzwl _j@SECREL(%esi), %eax +; X64_WIN: movabsq $i@SECREL, %rax +; X64_WIN: movswl (%rsi,%rax), %ecx +; X64_WIN: movabsq $j@SECREL, %rax +; X64_WIN: movzwl (%rsi,%rax), %ecx diff --git a/test/CodeGen/X86/tls14.ll b/test/CodeGen/X86/tls14.ll index 88426dd..6462571 100644 --- a/test/CodeGen/X86/tls14.ll +++ b/test/CodeGen/X86/tls14.ll @@ -1,9 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movsbl %gs:i@NTPOFF, %eax} %t -; RUN: grep {movzbl %gs:j@NTPOFF, %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movsbl %fs:i@TPOFF, %edi} %t2 -; RUN: grep {movzbl %fs:j@TPOFF, %edi} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = thread_local global i8 0 @j = thread_local global i8 0 @@ -22,3 +20,14 @@ entry: declare void @g(i32) declare void @h(i32) + +; X32_LINUX: movsbl %gs:i@NTPOFF, %eax +; X32_LINUX: movzbl %gs:j@NTPOFF, %eax +; X64_LINUX: movsbl %fs:i@TPOFF, %edi +; X64_LINUX: movzbl %fs:j@TPOFF, %edi +; X32_WIN: movsbl _i@SECREL(%esi), %eax +; X32_WIN: movzbl _j@SECREL(%esi), %eax +; X64_WIN: movabsq $i@SECREL, %rax +; X64_WIN: movsbl (%rsi,%rax), %ecx +; X64_WIN: movabsq $j@SECREL, %rax +; X64_WIN: movzbl (%rsi,%rax), %ecx diff --git a/test/CodeGen/X86/tls2.ll b/test/CodeGen/X86/tls2.ll index 5a94296..e882f53 100644 --- a/test/CodeGen/X86/tls2.ll +++ b/test/CodeGen/X86/tls2.ll @@ -1,9 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movl %gs:0, %eax} %t -; RUN: grep {leal i@NTPOFF(%eax), %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movq %fs:0, %rax} %t2 -; RUN: grep {leaq i@TPOFF(%rax), %rax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = thread_local global i32 15 @@ -11,3 +9,13 @@ define i32* @f() { entry: ret i32* @i } +; X32_LINUX: movl %gs:0, %eax +; X32_LINUX: leal i@NTPOFF(%eax), %eax +; X64_LINUX: movq %fs:0, %rax +; X64_LINUX: leaq i@TPOFF(%rax), %rax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: leal _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movq %gs:88, %rcx +; X64_WIN: addq $i@SECREL, %rax diff --git a/test/CodeGen/X86/tls3.ll b/test/CodeGen/X86/tls3.ll index 7327cc4..ee3f28f 100644 --- a/test/CodeGen/X86/tls3.ll +++ b/test/CodeGen/X86/tls3.ll @@ -1,9 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movl i@INDNTPOFF, %eax} %t -; RUN: grep {movl %gs:(%eax), %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movq i@GOTTPOFF(%rip), %rax} %t2 -; RUN: grep {movl %fs:(%rax), %eax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = external thread_local global i32 ; <i32*> [#uses=2] @@ -12,3 +10,12 @@ entry: %tmp1 = load i32* @i ; <i32> [#uses=1] ret i32 %tmp1 } +; X32_LINUX: movl i@INDNTPOFF, %eax +; X32_LINUX: movl %gs:(%eax), %eax +; X64_LINUX: movq i@GOTTPOFF(%rip), %rax +; X64_LINUX: movl %fs:(%rax), %eax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: movl _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movabsq $i@SECREL, %rcx diff --git a/test/CodeGen/X86/tls4.ll b/test/CodeGen/X86/tls4.ll index d2e40e3..2b53ec5 100644 --- a/test/CodeGen/X86/tls4.ll +++ b/test/CodeGen/X86/tls4.ll @@ -1,9 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movl %gs:0, %eax} %t -; RUN: grep {addl i@INDNTPOFF, %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movq %fs:0, %rax} %t2 -; RUN: grep {addq i@GOTTPOFF(%rip), %rax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = external thread_local global i32 ; <i32*> [#uses=2] @@ -11,3 +9,13 @@ define i32* @f() { entry: ret i32* @i } +; X32_LINUX: movl %gs:0, %eax +; X32_LINUX: addl i@INDNTPOFF, %eax +; X64_LINUX: movq %fs:0, %rax +; X64_LINUX: addq i@GOTTPOFF(%rip), %rax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: leal _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movq %gs:88, %rcx +; X64_WIN: addq $i@SECREL, %rax diff --git a/test/CodeGen/X86/tls5.ll b/test/CodeGen/X86/tls5.ll index 4d2cc02..3cc6dab 100644 --- a/test/CodeGen/X86/tls5.ll +++ b/test/CodeGen/X86/tls5.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movl %gs:i@NTPOFF, %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movl %fs:i@TPOFF, %eax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s @i = internal thread_local global i32 15 @@ -10,3 +10,10 @@ entry: %tmp1 = load i32* @i ret i32 %tmp1 } +; X32_LINUX: movl %gs:i@NTPOFF, %eax +; X64_LINUX: movl %fs:i@TPOFF, %eax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: movl _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movabsq $i@SECREL, %rcx diff --git a/test/CodeGen/X86/tls6.ll b/test/CodeGen/X86/tls6.ll index 505106e..c98ad7c 100644 --- a/test/CodeGen/X86/tls6.ll +++ b/test/CodeGen/X86/tls6.ll @@ -1,9 +1,7 @@ -; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu > %t -; RUN: grep {movl %gs:0, %eax} %t -; RUN: grep {leal i@NTPOFF(%eax), %eax} %t -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu > %t2 -; RUN: grep {movq %fs:0, %rax} %t2 -; RUN: grep {leaq i@TPOFF(%rax), %rax} %t2 +; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s +; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s @i = internal thread_local global i32 15 @@ -11,3 +9,13 @@ define i32* @f() { entry: ret i32* @i } +; X32_LINUX: movl %gs:0, %eax +; X32_LINUX: leal i@NTPOFF(%eax), %eax +; X64_LINUX: movq %fs:0, %rax +; X64_LINUX: leaq i@TPOFF(%rax), %rax +; X32_WIN: movl __tls_index, %eax +; X32_WIN: movl %fs:__tls_array, %ecx +; X32_WIN: leal _i@SECREL(%eax), %eax +; X64_WIN: movl _tls_index(%rip), %eax +; X64_WIN: movq %gs:88, %rcx +; X64_WIN: addq $i@SECREL, %rax |