[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / x86-64-reloc-8-16.s
blob7c4eeb0a5963025e41384d139600f174dfa2ef45
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/abs255.s -o %t255.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/abs256.s -o %t256.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/abs257.s -o %t257.o
7 # RUN: ld.lld %t.o %t256.o -o %t
8 # RUN: llvm-readelf -x .data %t | FileCheck %s
9 # CHECK: 0x{{[0-9a-f]+}} ff80ffff 0080
11 # RUN: not ld.lld %t.o %t255.o -o /dev/null 2>&1 | FileCheck --check-prefix=OVERFLOW1 %s
12 # OVERFLOW1: relocation R_X86_64_8 out of range: -129 is not in [-128, 255]
13 # OVERFLOW1: relocation R_X86_64_16 out of range: -32769 is not in [-32768, 65535]
15 # RUN: not ld.lld %t.o %t257.o -o /dev/null 2>&1 | FileCheck --check-prefix=OVERFLOW2 %s
16 # OVERFLOW2: relocation R_X86_64_8 out of range: 256 is not in [-128, 255]
17 # OVERFLOW2: relocation R_X86_64_16 out of range: 65536 is not in [-32768, 65535]
19 .globl _start
20 _start:
21 .data
22 .byte foo - 1
23 .byte foo - 384
24 .word foo + 0xfeff
25 .word foo - 0x8100