brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 9871fba Raw
82 lines · plain
1## Target specific relocation support is tested in MC/$target/*reloc-directive*.s2# RUN: llvm-mc -triple=x86_64 %s | FileCheck %s --check-prefix=ASM3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t4# RUN: llvm-readobj -r %t | FileCheck %s5 6# ASM:      .Ltmp0:7# ASM-NEXT:  .reloc .Ltmp0+3-2, R_X86_64_NONE, foo8# ASM-NEXT: .Ltmp1:9# ASM-NEXT:  .reloc .Ltmp1-1, R_X86_64_NONE, foo10# ASM-NEXT: .Ltmp2:11# ASM-NEXT:  .reloc 2+.Ltmp2, R_X86_64_NONE, local12 13# CHECK:      0x2 R_X86_64_NONE foo 0x014# CHECK-NEXT: 0x0 R_X86_64_NONE foo 0x015# CHECK-NEXT: 0x3 R_X86_64_NONE local 0x016# CHECK-NEXT: 0x1 R_X86_64_NONE unused 0x017# CHECK-NEXT: 0x4 R_X86_64_NONE data 0x118 19# CHECK:      .rela.my {20# CHECK:        0x0 R_X86_64_NONE foo 0x021# CHECK-NEXT:   0x4 R_X86_64_NONE foo 0x022# CHECK-NEXT:   0x8 R_X86_64_NONE foo 0x023# CHECK-NEXT: }24 25.text26.globl foo27foo:28local:29  ret30  .reloc .+3-2, R_X86_64_NONE, foo31  .reloc .-1, R_X86_64_NONE, foo32  .reloc 2+., R_X86_64_NONE, local33  .reloc ., BFD_RELOC_NONE, unused34  .space 335 36.data37.globl data38data:39  .reloc 1+foo+3, R_X86_64_NONE, data+140  .long 041 42## Constant offsets are relative to the section start.43.section .my44.word 045.reloc 0, BFD_RELOC_NONE, foo46.word 047.p2align 348.reloc 2+2, BFD_RELOC_NONE, foo49.p2align 450.reloc 8, BFD_RELOC_NONE, foo51 52.text53.globl a, b54a: ret55b: ret56x: ret57y: ret58 59# RUN: not llvm-mc -filetype=obj -triple=x86_64 --defsym=PARSE=1 %s 2>&1 | FileCheck %s --check-prefix=PARSE60# RUN: not llvm-mc -filetype=obj -triple=x86_64 --defsym=ERR=1 %s 2>&1 | FileCheck %s --check-prefix=ERR61 62.ifdef PARSE63# PARSE: {{.*}}.s:[[#@LINE+1]]:10: error: expected comma64.reloc 0 R_X86_64_NONE, a65 66# PARSE: {{.*}}.s:[[#@LINE+1]]:8: error: directional label undefined67.reloc 1f, R_X86_64_NONE, a68.endif69 70.ifdef ERR71.reloc -1, R_X86_64_NONE, a72# ERR: {{.*}}.s:[[#@LINE+1]]:9: error: .reloc offset is not relocatable73.reloc 2*., R_X86_64_NONE, a74# ERR: {{.*}}.s:[[#@LINE+1]]:9: error: .reloc offset is not relocatable75.reloc a+a, R_X86_64_NONE, a76# ERR: {{.*}}.s:[[#@LINE+1]]:9: error: .reloc offset is not relative to a section77.reloc b-a, R_X86_64_NONE, a78# ERR: {{.*}}.s:[[#@LINE+1]]:9: error: .reloc offset is not relative to a section79.reloc x-x, R_X86_64_NONE, a80 81.endif82