1// REQUIRES: x86
2
3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
5// RUN:   %p/Inputs/exclude-libs.s -o %t2.o
6// RUN: llvm-as --data-layout=elf %p/Inputs/exclude-libs.ll -o %t3.o
7// RUN: mkdir -p %t.dir
8// RUN: rm -f %t.dir/exc.a
9// RUN: llvm-ar rcs %t.dir/exc.a %t2.o %t3.o
10
11// RUN: ld.lld -shared %t.o %t.dir/exc.a -o %t.exe
12// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=DEFAULT %s
13
14// RUN: ld.lld -shared %t.o %t.dir/exc.a -o %t.exe --exclude-libs=foo,bar
15// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=DEFAULT %s
16
17// RUN: ld.lld -shared %t.o %t.dir/exc.a -o %t.exe --exclude-libs foo,bar,exc.a
18// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=EXCLUDE %s
19
20// RUN: ld.lld -shared %t.o %t.dir/exc.a -o %t.exe --exclude-libs foo:bar:exc.a
21// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=EXCLUDE %s
22
23// RUN: ld.lld -shared %t.o %t.dir/exc.a -o %t.exe --exclude-libs=ALL
24// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=EXCLUDE %s
25
26// RUN: ld.lld -shared %t.o %t2.o %t3.o %t.dir/exc.a -o %t.exe --exclude-libs=ALL
27// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=DEFAULT %s
28
29// RUN: ld.lld -shared --whole-archive %t.o %t.dir/exc.a -o %t.exe --exclude-libs foo,bar,exc.a
30// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=EXCLUDE %s
31
32// RUN: ld.lld -shared --whole-archive %t.o %t.dir/exc.a -o %t.exe --exclude-libs=ALL
33// RUN: llvm-readobj --dyn-syms %t.exe | FileCheck --check-prefix=EXCLUDE %s
34
35// DEFAULT: Name: fn
36// DEFAULT: Name: fn2
37// DEFAULT: Name: foo
38// EXCLUDE-NOT: Name: fn
39// EXCLUDE-NOT: Name: fn2
40// EXCLUDE: Name: foo
41
42.globl fn, fn2, foo
43foo:
44  call fn@PLT
45  call fn2@PLT
46