xref: /llvm-project/lld/test/ELF/start-lib.s (revision b05071de89e9c26ef8b3f7ab2ff6a56241b54ea8)
1// REQUIRES: x86
2
3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
4// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
5// RUN:   %p/Inputs/start-lib1.s -o %t2.o
6// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
7// RUN:   %p/Inputs/start-lib2.s -o %t3.o
8// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
9// RUN:   %p/Inputs/eager.s -o %t-eager.o
10
11// RUN: ld.lld -o %t3 %t1.o %t2.o %t3.o %t-eager.o
12// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST1 %s
13// TEST1: Name: foo
14// TEST1: Name: bar
15
16// RUN: ld.lld -o %t3 %t1.o -u bar --start-lib %t2.o %t3.o %t-eager.o
17// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST2 %s
18// TEST2-NOT: Name: foo
19// TEST2: Name: bar
20
21// RUN: ld.lld -o %t3 %t1.o --start-lib %t2.o %t3.o %t-eager.o
22// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST3 %s
23// TEST3-NOT: Name: foo
24// TEST3-NOT: Name: bar
25
26// RUN: not ld.lld %t1.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s
27// NESTED-LIB: nested --start-lib
28
29// RUN: not ld.lld %t1.o --start-group --start-lib 2>&1 | FileCheck -check-prefix=LIB-IN-GROUP %s
30// LIB-IN-GROUP: may not nest --start-lib in --start-group
31
32// RUN: not ld.lld --end-lib 2>&1 | FileCheck -check-prefix=END %s
33// END: stray --end-lib
34
35.globl _start
36_start:
37  callq eager
38