[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / obj-preempt-dso.s
blob76037629176c11e3abd09f1961e01310091aa0c3
1 # REQUIRES: x86
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
11 # CHECK: T a1{{$}}
12 # CHECK-NEXT: T a2{{$}}
13 # CHECK-NEXT: T b1{{$}}
14 # CHECK-NEXT: U b2{{$}}
15 # CHECK-NEXT: T c1@v1
16 # CHECK-NEXT: T c2@@v2
17 # CHECK-NEXT: T c3{{$}}
18 # CHECK-NEXT: T c4@@v3
19 # CHECK-NOT: {{.}}
21 #--- a.s
22 .globl _start, a1, a2, a3, b1, c1, c2, c3, c4
23 _start:
24 a1: a2: ## defined in b.so and a
25 .hidden a3
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
34 .data
35 .quad b2
37 #--- a.ver
38 v1 {};
39 v2 { c2; };
40 v3 { c4; };
42 #--- b.s
43 .globl a1, a2, a3, b1, b2, c1, c2, c3, c4
44 .type a1,@function
45 a1: a2: a3:
46 .protected b1, b2
47 b1:
48 b2:
49 .symver c1, c1@v1
50 c1:
51 c2:
52 c3:
53 c4:
55 #--- b.ver
56 v1 {};
57 v2 { c2; c3; c4; };