summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/tls.ll
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-12-14 18:26:41 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-12-14 18:26:41 +0000
commit3faac0a78c7a70d3dcd2af102a132bb9da2d639c (patch)
treeb15dc400dbf40c049c0a22c4543bd17220107f41 /test/CodeGen/Mips/tls.ll
parent5dca1c9f633e3657189afaf9a672a7715c7be22d (diff)
Add support for local dynamic TLS model in LowerGlobalTLSAddress. Direct object
emission is not supported yet, but a patch that adds the support should follow soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/tls.ll')
-rw-r--r--test/CodeGen/Mips/tls.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/tls.ll b/test/CodeGen/Mips/tls.ll
index b0474b4c443..3fa852b454c 100644
--- a/test/CodeGen/Mips/tls.ll
+++ b/test/CodeGen/Mips/tls.ll
@@ -44,3 +44,22 @@ entry:
; STATIC: addu $[[R1:[0-9]+]], $3, $[[R0]]
; STATIC: lw $2, 0($[[R1]])
}
+
+@f3.i = internal thread_local unnamed_addr global i32 1, align 4
+
+define i32 @f3() nounwind {
+entry:
+; CHECK: f3:
+
+; PIC: addiu $4, $gp, %tlsldm(f3.i)
+; PIC: jalr $25
+; PIC: lui $[[R0:[0-9]+]], %dtprel_hi(f3.i)
+; PIC: addu $[[R1:[0-9]+]], $[[R0]], $2
+; PIC: addiu ${{[0-9]+}}, $[[R1]], %dtprel_lo(f3.i)
+
+ %0 = load i32* @f3.i, align 4
+ %inc = add nsw i32 %0, 1
+ store i32 %inc, i32* @f3.i, align 4
+ ret i32 %inc
+}
+