llvm-project/lld/test/elf/tls.test

42 lines
964 B
Plaintext

RUN: lld -core -target x86_64-linux %p/Inputs/tls.x86-64 -output=- \
RUN: -noinhibit-exec -entry=main -emit-yaml -output-type=static \
RUN: | FileCheck %s -check-prefix=YAML
RUN: lld -core -target x86_64-linux %p/Inputs/tls.x86-64 -output=%t \
RUN: -noinhibit-exec -entry=main -output-type=static && llvm-objdump -d %t \
RUN: | FileCheck %s
// Verify that the TLS accesses have the correct offsets.
YAML: name: main
YAML: kind: R_X86_64_TPOFF32
YAML: offset: 9
YAML: target: tls1
YAML: kind: R_X86_64_TPOFF32
YAML: offset: 17
YAML: target: tls0
YAML: kind: R_X86_64_TPOFF32
YAML: offset: 25
YAML: target: tls2
YAML: name: GOTTPOFF
YAML: kind: R_X86_64_PC32
YAML: target: [[GOTNAME:[a-zA-Z0-9_]+]]
YAML: name: [[GOTNAME]]
YAML: type: got
YAML: kind: R_X86_64_TPOFF64
YAML: target: tls2
// main
CHECK: addl %fs:-4
CHECK: addl %fs:-8
CHECK: addl %fs:-12
// GOTTPOFF
CHECK: movq {{[0-9]+}}(%rip)
// TLSLD
CHECK: movq %fs:0, %rax
CHECK: leaq -8(%rax), %rax