2 # RUN: rm -rf %t && split-file %s %t && cd %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o
5 # RUN: ld.lld -shared --version-script=b.ver b.o -o b.so
6 # RUN: ld.lld --version-script=a.ver a.o b.so -o a0
7 # RUN: llvm-nm -D a0 | FileCheck %s
8 # RUN: ld.lld --version-script=a.ver b.so a.o -o a1
9 # RUN: llvm-nm -D a1 | FileCheck %s
12 # CHECK-NEXT: T a2{{$}}
13 # CHECK-NEXT: T b1{{$}}
14 # CHECK-NEXT: U b2{{$}}
16 # CHECK-NEXT: T c2@@v2
17 # CHECK-NEXT: T c3{{$}}
18 # CHECK-NEXT: T c4@@v3
22 .globl _start, a1, a2, a3, b1, c1, c2, c3, c4
24 a1
: a2
: ## defined in b.so and a
26 a3
: ## defined in b.so; hidden in a
27 b1
: ## protected in b.so; defined in a
28 .symver c1, c1@v1, remove
29 c1
: ## non-default version in b.so and a
30 c2
: ## default version in b.so and a
31 c3
: ## default version in b.so; unversioned in a
32 c4
: ## default version in b.so; another version in a
43 .globl a1, a2, a3, b1, b2, c1, c2, c3, c4