[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / exclude-discarded-error2.s
blob5474cfe8170fe0e0110bd4cf73920351edcc46de
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: echo '.section .foo,"ae"; .weak foo; foo:' | \
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o
5 # RUN: not ld.lld %t.o %t1.o -o /dev/null 2>&1 | FileCheck %s
7 # Because foo defined in %t1.o is weak, it does not override global undefined
8 # in %t.o
9 # CHECK-NOT: discarded section
10 # CHECK: undefined symbol: foo
12 .globl _start
13 _start:
14 jmp foo