[llvm-commits] [llvm] r167875 - /llvm/trunk/test/MC/PowerPC/ppc64-tls-relocs-01.ll

Ulrich Weigand ulrich.weigand at de.ibm.com
Tue Nov 13 13:53:43 PST 2012


Author: uweigand
Date: Tue Nov 13 15:53:43 2012
New Revision: 167875

URL: http://llvm.org/viewvc/llvm-project?rev=167875&view=rev
Log:
Add test case to verify correct relocs being generated for
TLS symbols on PowerPC using the integrated assembler.

Added:
    llvm/trunk/test/MC/PowerPC/ppc64-tls-relocs-01.ll

Added: llvm/trunk/test/MC/PowerPC/ppc64-tls-relocs-01.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/PowerPC/ppc64-tls-relocs-01.ll?rev=167875&view=auto
==============================================================================
--- llvm/trunk/test/MC/PowerPC/ppc64-tls-relocs-01.ll (added)
+++ llvm/trunk/test/MC/PowerPC/ppc64-tls-relocs-01.ll Tue Nov 13 15:53:43 2012
@@ -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.
+
+ at 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'
+





More information about the llvm-commits mailing list