[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / exclude-libs-versym.s
blob7cea6bfa111eb65cb206e745b86099028b4533a9
1 # REQUIRES: x86
2 ## --exclude-libs can hide version symbols.
4 # RUN: rm -rf %t && split-file %s %t
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
6 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o
7 # RUN: llvm-ar rc %t/b.a %t/b.o
8 # RUN: ld.lld -shared %t/a.o %t/b.a --version-script=%t/ver -o %t.so
9 # RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
10 # RUN: ld.lld -shared %t/a.o %t/b.a --exclude-libs=b.a --version-script=%t/ver -o %t.so
11 # RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s --check-prefix=NO
13 # CHECK: foo@@v2
14 # CHECK: bar@v1
15 # NO-NOT: foo@@v2
16 # NO-NOT: bar@v1
18 #--- a.s
19 .globl _start
20 _start:
21 call foo
23 #--- b.s
24 .symver bar_v1, bar@v1
25 .globl foo, bar_v1
26 foo:
27 bar_v1:
28 ret
30 #--- ver
31 v1 {};
32 v2 { foo; };