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 # CHECK: 0x2 R_X86_64_NONE foo 0x0
15 # CHECK-NEXT: 0x0 R_X86_64_NONE foo 0x0
16 # CHECK-NEXT: 0x3 R_X86_64_NONE foo 0x0
17 # CHECK-NEXT: 0x4 R_X86_64_NONE data 0x1
23 .reloc .+3-2, R_X86_64_NONE, foo
24 .reloc .-1, R_X86_64_NONE, foo
25 .reloc 2+., R_X86_64_NONE, foo
26 .reloc 1+foo+3, R_X86_64_NONE, data+1
33 # RUN: not llvm-mc -filetype=obj -triple=x86_64 --defsym=ERR=1 %s 2>&1 | FileCheck %s --check-prefix=ERR
43 # ERR: {{.*}}.s:[[#@LINE+1]]:10: error: expected comma
44 .reloc 0 R_X86_64_NONE, a
46 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is negative
47 .reloc -1, R_X86_64_NONE, a
48 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not relocatable
49 .reloc 2*., R_X86_64_NONE, a
50 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not relocatable
51 .reloc a+a, R_X86_64_NONE, a
52 ## GNU as accepts a-a but rejects b-a.
53 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not representable
54 .reloc a-a, R_X86_64_NONE, a
55 ## TODO GNU as accepts x-x and y-x.
56 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: .reloc offset is not representable
57 .reloc x-x, R_X86_64_NONE, a
59 # ERR: {{.*}}.s:[[#@LINE+1]]:8: error: directional label undefined
60 .reloc 1f, R_X86_64_NONE, a