2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck -DFILE=%t.o %s
5 # CHECK: error: [[FILE]]:(.text+0x2): invalid prefix with R_X86_64_CODE_4_GOTTPOFF!
6 # CHECK-NEXT: error: [[FILE]]:(.text+0x8): invalid prefix with R_X86_64_CODE_6_GOTTPOFF!
7 # CHECK-NEXT: error: [[FILE]]:(.text+0x12): R_X86_64_CODE_4_GOTTPOFF must be used in MOVQ or ADDQ instructions only
8 # CHECK-NEXT: error: [[FILE]]:(.text+0x1a): R_X86_64_CODE_6_GOTTPOFF must be used in ADDQ instructions with NDD/NF/NDD+NF only
10 ## These negative tests are to check if the invalid prefix and unsupported
11 ## instructions for TLS relocation types with APX instructions are handled as
15 .section .tbss,"awT",@nobits
25 addq
0(%rip
), %rax
, %r16
26 .reloc .-4, R_X86_64_CODE_4_GOTTPOFF, tls0-4
29 .reloc .-4, R_X86_64_CODE_6_GOTTPOFF, tls0-4
32 .reloc .-4, R_X86_64_CODE_4_GOTTPOFF, tls0-4
34 andq
0(%rip
), %rax
, %r16
35 .reloc .-4, R_X86_64_CODE_6_GOTTPOFF, tls0-4