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
9// RUN: ld.lld -o %t3 %t1.o %t2.o %t3.o
10// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST1 %s
11// TEST1: Name: bar
12// TEST1: Name: foo
13
14// RUN: ld.lld -o %t3 %t1.o -u bar --start-lib %t2.o %t3.o
15// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST2 %s
16// TEST2: Name: bar
17// TEST2-NOT: Name: foo
18
19// RUN: ld.lld -o %t3 %t1.o --start-lib %t2.o %t3.o
20// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST3 %s
21// TEST3-NOT: Name: bar
22// TEST3-NOT: Name: foo
23
24// RUN: not ld.lld %t1.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s
25// NESTED-LIB: nested --start-lib
26
27// RUN: not ld.lld %t1.o --start-group --start-lib 2>&1 | FileCheck -check-prefix=LIB-IN-GROUP %s
28// LIB-IN-GROUP: may not nest --start-lib in --start-group
29
30// RUN: not ld.lld --end-lib 2>&1 | FileCheck -check-prefix=END %s
31// END: stray --end-lib
32
33.globl _start
34_start:
35