]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/archive.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / archive.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/archive.s -o %t2
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/archive2.s -o %t3
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/archive3.s -o %t4
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/archive4.s -o %t5
7
8 # RUN: rm -f %t.a
9 # RUN: llvm-ar rcs %t.a %t2 %t3 %t4
10
11 # RUN: ld.lld %t %t.a %t5 -o %t.out
12 # RUN: llvm-nm %t.out | FileCheck %s
13
14 # RUN: rm -f %t.thin
15 # RUN: llvm-ar --format=gnu rcsT %t.thin %t2 %t3 %t4
16
17 # RUN: ld.lld %t %t.thin %t5 -o %t.out
18 # RUN: llvm-nm %t.out | FileCheck %s
19
20 # Nothing here. Just needed for the linker to create a undefined _start symbol.
21
22 .quad end
23
24 .weak foo
25 .quad foo
26
27 .weak bar
28 .quad bar
29
30
31 # CHECK:      T _start
32 # CHECK-NEXT: T bar
33 # CHECK-NEXT: T end
34 # CHECK-NEXT: w foo
35
36
37 # Test that the hitting the first object file after having a lazy symbol for
38 # _start is handled correctly.
39 # RUN: ld.lld %t.a %t -o %t.out
40 # RUN: llvm-nm %t.out | FileCheck --check-prefix=AR-FIRST %s
41
42 # AR-FIRST:      T _start
43 # AR-FIRST-NEXT: w bar
44 # AR-FIRST-NEXT: T end
45 # AR-FIRST-NEXT: w foo