3 # RUN: rm -rf %t && split-file %s %t && cd %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
5 # RUN: echo '.globl weak; weak:' | llvm-mc -filetype=obj -triple=x86_64 - -o weak.o
6 # RUN: echo '.global foo; foo:' | llvm-mc -filetype=obj -triple=x86_64 - -o 1.o
7 # RUN: echo '.global bar; bar:' | llvm-mc -filetype=obj -triple=x86_64 - -o 2.o
8 # RUN: echo '.global baz; baz:' | llvm-mc -filetype=obj -triple=x86_64 - -o 3.o
9 # RUN: llvm-ar rc weak.a weak.o
10 # RUN: llvm-ar rc 1.a 1.o 2.o 3.o
11 # RUN: llvm-ar rc lib2.a
13 # RUN: ld.lld a.o %t/weak.a 1.a -L. --print-archive-stats=a.txt -o /dev/null
14 # RUN: FileCheck --input-file=a.txt -DT=%t %s --match-full-lines --strict-whitespace
16 ## Fetches 0 member from %t/weak.a and 2 members from %t1.a
17 # CHECK:members extracted archive
18 # CHECK-NEXT:1 0 [[T]]/weak.a
20 # CHECK-NEXT:0 0 {{.*}}lib2.a
23 # RUN: ld.lld a.o %t/weak.a 1.a -L. --print-archive-stats=- -o /dev/null | diff a.txt -
25 ## The second 1.a has 0 fetched member.
26 # RUN: ld.lld a.o %t/weak.a -L. -l:1.a -l:1.a --print-archive-stats=- -o /dev/null | \
27 # RUN: FileCheck --check-prefix=CHECK2 %s
28 # CHECK2: members extracted archive
29 # CHECK2-NEXT: 1 0 {{.*}}weak.a
30 # CHECK2-NEXT: 3 2 {{.*}}1.a
31 # CHECK2-NEXT: 3 0 {{.*}}1.a
32 # CHECK2-NEXT: 0 0 {{.*}}lib2.a
34 # RUN: not ld.lld -shared a.o -L. --print-archive-stats=/ -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
35 # ERR: error: --print-archive-stats=: cannot open /: {{.*}}
45 .section ".deplibs","MS",@llvm_dependent_libraries,1