2013-05-11 00:44:02 +08:00
|
|
|
# This tests verifies that TLS variables have correct offsets
|
2013-04-05 02:59:24 +08:00
|
|
|
RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 -static \
|
2013-09-23 12:24:15 +08:00
|
|
|
RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s -check-prefix=YAML
|
2013-02-01 15:14:14 +08:00
|
|
|
|
2013-04-05 03:17:58 +08:00
|
|
|
RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 -o %t \
|
2013-04-05 02:59:24 +08:00
|
|
|
RUN: --noinhibit-exec -e main -static && llvm-objdump -d %t | FileCheck %s
|
2013-02-01 15:13:49 +08:00
|
|
|
|
|
|
|
// Verify that the TLS accesses have the correct offsets.
|
|
|
|
|
2013-09-12 23:43:09 +08:00
|
|
|
YAML: type: got
|
|
|
|
YAML: references:
|
|
|
|
YAML: kind: R_X86_64_TPOFF64
|
|
|
|
YAML: target: tls2
|
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
YAML: name: main
|
|
|
|
YAML: references:
|
|
|
|
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_]+]]
|
|
|
|
|
2013-02-01 15:14:14 +08:00
|
|
|
|
2013-02-06 03:14:07 +08:00
|
|
|
// main
|
2013-02-01 15:14:14 +08:00
|
|
|
CHECK: addl %fs:-4
|
|
|
|
CHECK: addl %fs:-8
|
|
|
|
CHECK: addl %fs:-12
|
|
|
|
|
2013-02-06 03:14:07 +08:00
|
|
|
// GOTTPOFF
|
2013-02-01 15:14:14 +08:00
|
|
|
CHECK: movq {{[0-9]+}}(%rip)
|
2013-02-06 03:14:07 +08:00
|
|
|
|
|
|
|
// TLSLD
|
|
|
|
CHECK: movq %fs:0, %rax
|
|
|
|
CHECK: leaq -8(%rax), %rax
|