brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · c555d7f Raw
40 lines · plain
1; RUN: llc < %s -mtriple=i386-linux-musl -relocation-model=pic -x86-relax-relocations=true | FileCheck --check-prefixes=CHECK,X86 %s2; RUN: llc < %s -mtriple=x86_64-linux-musl -relocation-model=pic -x86-relax-relocations=true | FileCheck --check-prefixes=CHECK,X64 %s3 4;; If GOTPCRELX is disabled, don't use GOT for __tls_get_addr to work around5;; a ld.bfd bug (binutils PR24784).6; RUN: llc < %s -mtriple=i386-linux-musl -relocation-model=pic -x86-relax-relocations=false | FileCheck --check-prefixes=CHECK,X86-PLT %s7; RUN: llc < %s -mtriple=x86_64-linux-musl -relocation-model=pic -x86-relax-relocations=false | FileCheck --check-prefixes=CHECK,X64-PLT %s8 9@gd = thread_local global i32 010@ld = internal thread_local global i32 011 12define ptr @get_gd() {13entry:14; CHECK-LABEL: get_gd:15; X86: leal gd@TLSGD(%ebx), %eax16; X86: calll *___tls_get_addr@GOT(%ebx)17; X86-PLT: calll ___tls_get_addr@PLT18 19; X64: leaq gd@TLSGD(%rip), %rdi20; X64: callq *__tls_get_addr@GOTPCREL(%rip)21; X64-PLT: callq __tls_get_addr@PLT22  ret ptr @gd23}24 25define ptr @get_ld() {26; FIXME: This function uses a single thread-local variable, we might want to fall back to general-dynamic.27; CHECK-LABEL: get_ld:28; X86: leal ld@TLSLDM(%ebx), %eax29; X86: calll *___tls_get_addr@GOT(%ebx)30; X86-PLT: calll ___tls_get_addr@PLT31 32; X64: leaq ld@TLSLD(%rip), %rdi33; X64: callq *__tls_get_addr@GOTPCREL(%rip)34; X64-PLT: callq __tls_get_addr@PLT35  ret ptr @ld36}37 38!llvm.module.flags = !{!1}39!1 = !{i32 7, !"RtLibUseGOT", i32 1}40