diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-05-11 10:11:01 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-05-11 10:11:01 +0000 |
commit | 228756c744a1f877f7150c8fc91e074ff58c9d66 (patch) | |
tree | 3debe862fb7976ba9a2b41730b13f98ed37c4ed8 /test/CodeGen/X86/tls-pie.ll | |
parent | 169e9ba2b2c78675a0fa5ad8aebb987fe9c00e23 (diff) |
Implement initial-exec TLS model for 32-bit PIC x86
This fixes a TODO from 2007 :) Previously, LLVM would emit the wrong
code here (see the update to test/CodeGen/X86/tls-pie.ll).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/tls-pie.ll')
-rw-r--r-- | test/CodeGen/X86/tls-pie.ll | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/CodeGen/X86/tls-pie.ll b/test/CodeGen/X86/tls-pie.ll index e2e58a541a..374cd36ed3 100644 --- a/test/CodeGen/X86/tls-pie.ll +++ b/test/CodeGen/X86/tls-pie.ll @@ -35,8 +35,12 @@ entry: define i32 @f3() { ; X32: f3: -; X32: movl i2@INDNTPOFF, %eax -; X32-NEXT: movl %gs:(%eax), %eax +; X32: calll .L{{[0-9]+}}$pb +; X32-NEXT: .L{{[0-9]+}}$pb: +; X32-NEXT: popl %eax +; X32-NEXT: .Ltmp{{[0-9]+}}: +; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax +; X32-NEXT: leal %gs:i2@GOTNTPOFF(%eax), %eax ; X32-NEXT: ret ; X64: f3: ; X64: movq i2@GOTTPOFF(%rip), %rax @@ -50,8 +54,13 @@ entry: define i32* @f4() { ; X32: f4: -; X32: movl %gs:0, %eax -; X32-NEXT: addl i2@INDNTPOFF, %eax +; X32: calll .L{{[0-9]+}}$pb +; X32-NEXT: .L{{[0-9]+}}$pb: +; X32-NEXT: popl %eax +; X32-NEXT: .Ltmp{{[0-9]+}}: +; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax +; X32-NEXT: leal i2@GOTNTPOFF(%eax), %eax +; X32-NEXT: addl %gs:0, %eax ; X32-NEXT: ret ; X64: f4: ; X64: movq %fs:0, %rax |