summaryrefslogtreecommitdiffstats
path: root/llvm/test
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
commitbff84e1914217256258deaace8098b14e14f5b51 (patch)
treee8b5699e1f081870effbc6c1b43d3a344eed98f1 /llvm/test
parent4288b9786f390c00438d85deeaf53d179d73e090 (diff)
downloadbcm5719-llvm-bff84e1914217256258deaace8098b14e14f5b51.tar.gz
bcm5719-llvm-bff84e1914217256258deaace8098b14e14f5b51.zip
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. llvm-svn: 146572
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/Mips/tls.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/tls.ll b/llvm/test/CodeGen/Mips/tls.ll
index b0474b4c443..3fa852b454c 100644
--- a/llvm/test/CodeGen/Mips/tls.ll
+++ b/llvm/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
+}
+
OpenPOWER on IntegriCloud