|
3 | 3 |
|
4 | 4 | # RUN: rm -rf %t.dir && mkdir %t.dir |
5 | 5 | # RUN: rm -rf %t && split-file %s %t && cd %t |
6 | | -# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o a.o |
7 | | -# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/libsearch-st.s -o b.o |
8 | | -# RUN: llvm-ar rc %t.dir/libxyz.a b.o |
9 | | - |
10 | | -# RUN: echo 'GROUP("a.o")' > %t.t |
11 | | -# RUN: ld.lld -o %t2 %t.t |
12 | | -# RUN: llvm-readobj %t2 > /dev/null |
13 | | - |
14 | | -# RUN: echo 'INPUT("a.o")' > %t.t |
15 | | -# RUN: ld.lld -o %t2 %t.t |
16 | | -# RUN: llvm-readobj %t2 > /dev/null |
17 | | - |
18 | | -# RUN: echo 'GROUP("a.o" libxyz.a )' > %t.t |
19 | | -# RUN: not ld.lld -o /dev/null %t.t 2>/dev/null |
20 | | -# RUN: ld.lld -o %t2 %t.t -L%t.dir |
21 | | -# RUN: llvm-readobj %t2 > /dev/null |
22 | | - |
23 | | -# RUN: echo 'GROUP("a.o" =libxyz.a )' > %t.t |
24 | | -# RUN: not ld.lld -o /dev/null %t.t 2>/dev/null |
25 | | -# RUN: ld.lld -o %t2 %t.t --sysroot=%t.dir |
26 | | -# RUN: llvm-readobj %t2 > /dev/null |
27 | | - |
28 | | -# RUN: echo 'GROUP("a.o" -lxyz )' > %t.t |
29 | | -# RUN: not ld.lld -o /dev/null %t.t 2>/dev/null |
30 | | -# RUN: ld.lld -o %t2 %t.t -L%t.dir |
31 | | -# RUN: llvm-readobj %t2 > /dev/null |
32 | | - |
33 | | -# RUN: echo 'GROUP("a.o" libxyz.a )' > %t.t |
34 | | -# RUN: not ld.lld -o /dev/null %t.t 2>/dev/null |
35 | | -# RUN: ld.lld -o %t2 %t.t -L%t.dir |
36 | | -# RUN: llvm-readobj %t2 > /dev/null |
37 | | - |
38 | | -# RUN: echo 'GROUP("a.o" /libxyz.a )' > %t.t |
| 6 | +# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o |
| 7 | +# RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o |
| 8 | +# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/libsearch-st.s -o xyz.o |
| 9 | +# RUN: llvm-ar rc %t.dir/libb.a b.o |
| 10 | +# RUN: llvm-ar rc %t.dir/libxyz.a xyz.o |
| 11 | + |
| 12 | +# RUN: echo 'GROUP("a.o" libxyz.a -lxyz b.o )' > 1.t |
| 13 | +# RUN: not ld.lld 1.t 2>&1 | FileCheck %s --check-prefix=NOLIB |
| 14 | +# RUN: ld.lld 1.t -L%t.dir |
| 15 | +# RUN: llvm-nm a.out | FileCheck %s |
| 16 | + |
| 17 | +# RUN: echo 'GROUP( "a.o" b.o =libxyz.a )' > 2.t |
| 18 | +# RUN: not ld.lld 2.t 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=libxyz.a |
| 19 | +# RUN: ld.lld 2.t --sysroot=%t.dir |
| 20 | +# RUN: llvm-nm a.out | FileCheck %s |
| 21 | + |
| 22 | +# RUN: echo 'GROUP("%t.dir/3a.t")' > 3.t |
| 23 | +# RUN: echo 'INCLUDE "%t.dir/3a.t"' > 3i.t |
| 24 | +# RUN: echo 'GROUP(AS_NEEDED("a.o"))INPUT(/libb.a)' > %t.dir/3a.t |
| 25 | +# RUN: ld.lld 3.t --sysroot=%t.dir |
| 26 | +# RUN: llvm-nm a.out | FileCheck %s |
| 27 | +# RUN: not ld.lld 3i.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libb.a |
| 28 | + |
| 29 | +# RUN: echo 'GROUP("%t.dir/4a.t")INPUT(/libb.a)' > 4.t |
| 30 | +# RUN: echo 'GROUP(AS_NEEDED("a.o"))' > %t.dir/4a.t |
| 31 | +# RUN: not ld.lld 4.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libb.a |
| 32 | + |
| 33 | +# RUN: echo 'INCLUDE "%t.dir/5a.t" INPUT(/libb.a)' > 5.t |
| 34 | +# RUN: echo 'GROUP(a.o)' > %t.dir/5a.t |
| 35 | +# RUN: not ld.lld 5.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libb.a |
| 36 | + |
| 37 | +# CHECK: T _start |
| 38 | + |
| 39 | +# NOLIB: error: {{.*}}unable to find |
| 40 | + |
| 41 | +# RUN: echo 'GROUP("a.o" /libxyz.a )' > a.t |
39 | 42 | # RUN: echo 'GROUP("%t/a.o" /libxyz.a )' > %t.dir/xyz.t |
40 | | -# RUN: not ld.lld -o /dev/null %t.t 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libxyz.a |
41 | | -# RUN: not ld.lld -o /dev/null %t.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libxyz.a |
| 43 | +# RUN: not ld.lld a.t 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libxyz.a |
| 44 | +# RUN: not ld.lld a.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_OPEN -DFILE=/libxyz.a |
42 | 45 |
|
43 | 46 | ## Since %t.dir/%t does not exist, report an error, instead of falling back to %t |
44 | 47 | ## without the syroot prefix. |
45 | | -# RUN: not ld.lld -o /dev/null %t.dir/xyz.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_FIND_SYSROOT -DTMP=%t/a.o |
| 48 | +# RUN: not ld.lld %t.dir/xyz.t --sysroot=%t.dir 2>&1 | FileCheck %s --check-prefix=CANNOT_FIND_SYSROOT -DTMP=%t/a.o |
46 | 49 |
|
47 | 50 | # CANNOT_FIND_SYSROOT: error: {{.*}}xyz.t:1: cannot find [[TMP]] inside {{.*}}.dir |
48 | 51 | # CANNOT_FIND_SYSROOT-NEXT: >>> GROUP({{.*}} |
49 | 52 |
|
50 | | -# RUN: echo 'GROUP("2.t")' > 1.t |
51 | | -# RUN: echo 'GROUP("a.o")' > 2.t |
52 | | -# RUN: ld.lld 1.t |
53 | | -# RUN: llvm-readobj a.out > /dev/null |
54 | | - |
55 | | -# RUN: echo 'GROUP(AS_NEEDED("a.o"))' > 1.t |
56 | | -# RUN: ld.lld 1.t |
57 | | -# RUN: llvm-readobj a.out > /dev/null |
58 | | - |
59 | 53 | # CANNOT_OPEN: error: cannot open [[FILE]]: {{.*}} |
60 | 54 |
|
61 | 55 | #--- a.s |
62 | 56 | .globl _start |
63 | 57 | _start: |
64 | | - ret |
| 58 | + call b |
| 59 | + |
| 60 | +#--- b.s |
| 61 | +.globl b |
| 62 | +b: |
0 commit comments