[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / symbol-location.s
blob4620982bf3f206e0a2a7eaa32c7cb84ae3bbfe39
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: echo 'foo = _start;' > %t.script
4 # RUN: not ld.lld -shared -T %t.script %t.o -o /dev/null 2>&1 | FileCheck %s
6 ## Here we check that symbol 'foo' location is reported properly.
8 # CHECK: error: relocation R_X86_64_PC32 cannot be used against symbol 'foo'
9 # CHECK: >>> defined in {{.*}}.script:1
10 # CHECK: >>> referenced by {{.*}}.o:(.text+0x1)
12 .text
13 .globl _start
14 _start:
15 .byte 0xe8
16 .long foo - .