45 lines · plain
1// RUN: llvm-mc -triple=powerpc64-pc-linux -filetype=obj %s -o - | \2// RUN: llvm-readobj -r - | FileCheck %s3 4// Test correct relocation generation for thread-local storage5// using the initial-exec model and integrated assembly.6 7 .file "/home/espindola/llvm/llvm/test/CodeGen/PowerPC/tls-ie-obj.ll"8 .text9 .globl main10 .align 211 .type main,@function12 .section .opd,"aw",@progbits13main: # @main14 .align 315 .quad .L.main16 .quad .TOC.@tocbase17 .quad 018 .text19.L.main:20# %bb.0: # %entry21 li 3, 022 addis 4, 2, a@got@tprel@ha23 ld 4, a@got@tprel@l(4)24 add 4, 4, a@tls25 stw 3, -4(1)26 lwz 3, 0(4)27 extsw 3, 328 blr29 .long 030 .quad 031.Ltmp0:32 .size main, .Ltmp0-.L.main33 34 35// Verify generation of R_PPC64_GOT_TPREL16_DS and R_PPC64_TLS for36// accessing external variable a.37//38// CHECK: Relocations [39// CHECK: Section {{.*}} .rela.text {40// CHECK: 0x{{[0-9,A-F]+}} R_PPC64_GOT_TPREL16_HA a41// CHECK: 0x{{[0-9,A-F]+}} R_PPC64_GOT_TPREL16_LO_DS a42// CHECK: 0x{{[0-9,A-F]+}} R_PPC64_TLS a43// CHECK: }44// CHECK: ]45