1 ## Target specific relocation support is tested in MC/$target/*reloc-directive*.s
2 # RUN: llvm-mc -triple=x86_64 %s | FileCheck %s --check-prefix=ASM
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
4 # RUN: llvm-readobj -r %t | FileCheck %s
7 # ASM-NEXT: .reloc (.Ltmp0+3)-2, R_X86_64_NONE, foo
9 # ASM-NEXT: .reloc .Ltmp1-1, R_X86_64_NONE, foo
11 # ASM-NEXT: .reloc 2+.Ltmp2, R_X86_64_NONE, foo
12 # ASM-NEXT: .reloc (1+foo)+3, R_X86_64_NONE, data+1
14 # ASM-NEXT: .reloc .Ltmp3, BFD_RELOC_NONE, unused
16 # CHECK: 0x2 R_X86_64_NONE foo 0x0
17 # CHECK-NEXT: 0x0 R_X86_64_NONE foo 0x0
18 # CHECK-NEXT: 0x3 R_X86_64_NONE foo 0x0
19 # CHECK-NEXT: 0x4 R_X86_64_NONE data 0x1
20 # CHECK-NEXT: 0x1 R_X86_64_NONE unused 0x0
26 .reloc .+3-2, R_X86_64_NONE, foo
27 .reloc .-1, R_X86_64_NONE, foo
28 .reloc 2+., R_X86_64_NONE, foo
29 .reloc 1+foo+3, R_X86_64_NONE, data+1
30 .reloc ., BFD_RELOC_NONE, unused
37 # RUN: not llvm-mc -filetype=obj -triple=x86_64 --defsym=ERR=1 %s 2>&1 | FileCheck %s --check-prefix=ERR
47 # ERR: {{.*}}.s:[[#@LINE+1]]:10: error: expected comma
48 .reloc 0 R_X86_64_NONE, a
50 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is negative
51 .reloc -1, R_X86_64_NONE, a
52 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not relocatable
53 .reloc 2*., R_X86_64_NONE, a
54 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not relocatable
55 .reloc a+a, R_X86_64_NONE, a
56 ## GNU as accepts a-a but rejects b-a.
57 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not representable
58 .reloc a-a, R_X86_64_NONE, a
59 ## TODO GNU as accepts x-x and y-x.
60 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not representable
61 .reloc x-x, R_X86_64_NONE, a
63 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: directional label undefined
64 .reloc 1f, R_X86_64_NONE, a