summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2012-11-13 21:53:43 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2012-11-13 21:53:43 +0000
commit51abc9877e229bddf258d24386ab8d394e93ac33 (patch)
tree2dd5da57bbf4b0958b988160fd2a2b4950e2079e /test/MC
parenta8028e58844a544cb0fe4f27c580b1e861f1d3e5 (diff)
downloadllvm-51abc9877e229bddf258d24386ab8d394e93ac33.tar.gz
llvm-51abc9877e229bddf258d24386ab8d394e93ac33.tar.bz2
llvm-51abc9877e229bddf258d24386ab8d394e93ac33.tar.xz
Add test case to verify correct relocs being generated for
TLS symbols on PowerPC using the integrated assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/PowerPC/ppc64-tls-relocs-01.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/MC/PowerPC/ppc64-tls-relocs-01.ll b/test/MC/PowerPC/ppc64-tls-relocs-01.ll
new file mode 100644
index 0000000000..5e37311075
--- /dev/null
+++ b/test/MC/PowerPC/ppc64-tls-relocs-01.ll
@@ -0,0 +1,28 @@
+;; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj %s -o - | \
+;; RUN: elf-dump --dump-section-data | FileCheck %s
+
+;; FIXME: this file should be in .s form, change when asm parser is available.
+
+@t = thread_local global i32 0, align 4
+
+define i32* @f() nounwind {
+entry:
+ ret i32* @t
+}
+
+;; Check for a pair of R_PPC64_TPREL16_HA / R_PPC64_TPREL16_LO relocs
+;; against the thread-local symbol 't'.
+;; CHECK: '.rela.text'
+;; CHECK: Relocation 0
+;; CHECK-NEXT: 'r_offset',
+;; CHECK-NEXT: 'r_sym', 0x00000008
+;; CHECK-NEXT: 'r_type', 0x00000048
+;; CHECK: Relocation 1
+;; CHECK-NEXT: 'r_offset',
+;; CHECK-NEXT: 'r_sym', 0x00000008
+;; CHECK-NEXT: 'r_type', 0x00000046
+
+;; Check that we got the correct symbol.
+;; CHECK: Symbol 8
+;; CHECK-NEXT: 't'
+