|
1 | 1 | # REQUIRES: x86
|
2 | 2 |
|
3 |
| -# RUN: mkdir -p %t |
| 3 | +################ Place dynlib in %tD, and archive in %tA |
| 4 | +# RUN: mkdir -p %t %tA %tD |
4 | 5 | #
|
5 | 6 | # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %p/Inputs/libhello.s -o %t/hello.o
|
6 | 7 | # RUN: lld -flavor darwinnew -dylib -install_name @executable_path/libhello.dylib %t/hello.o -o %t/libhello.dylib
|
7 | 8 | #
|
8 | 9 | # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %p/Inputs/libgoodbye.s -o %t/goodbye.o
|
9 |
| -# RUN: lld -flavor darwinnew -dylib -install_name @executable_path/libgoodbye.dylib %t/goodbye.o -o %t/libgoodbye.dylib |
10 |
| -# RUN: llvm-ar --format=darwin crs %t/libgoodbye.a %t/goodbye.o |
| 10 | +# RUN: lld -flavor darwinnew -dylib -install_name @executable_path/libgoodbye.dylib %t/goodbye.o -o %tD/libgoodbye.dylib |
| 11 | +# RUN: llvm-ar --format=darwin crs %tA/libgoodbye.a %t/goodbye.o |
11 | 12 | #
|
12 | 13 | # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o
|
13 |
| -# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z -L%t -lhello -lgoodbye -lSystem %t/test.o |
14 |
| -# |
15 |
| -# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck %s |
16 | 14 |
|
17 |
| -# CHECK: @executable_path/libhello.dylib |
18 |
| -# CHECK: @executable_path/libgoodbye.dylib |
19 |
| -# CHECK: /usr/lib/libSystem.B.dylib |
| 15 | +################ default, which is the same as -search_paths_first |
| 16 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 17 | +# RUN: -L%tA -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o |
| 18 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s |
| 19 | + |
| 20 | +################ Test all permutations of -L%t{A,D} with -search_paths_first |
| 21 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 22 | +# RUN: -L%tA -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first |
| 23 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s |
| 24 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 25 | +# RUN: -L%tD -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first |
| 26 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s |
| 27 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 28 | +# RUN: -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first |
| 29 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s |
| 30 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 31 | +# RUN: -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first |
| 32 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s |
| 33 | + |
| 34 | +################ Test all permutations of -L%t{A,D} with -search_dylibs_first |
| 35 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 36 | +# RUN: -L%tA -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first |
| 37 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s |
| 38 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 39 | +# RUN: -L%tD -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first |
| 40 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s |
| 41 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 42 | +# RUN: -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first |
| 43 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s |
| 44 | +# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ |
| 45 | +# RUN: -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first |
| 46 | +# RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s |
| 47 | + |
| 48 | +# DYLIB: @executable_path/libhello.dylib |
| 49 | +# DYLIB: @executable_path/libgoodbye.dylib |
| 50 | +# DYLIB: /usr/lib/libSystem.B.dylib |
| 51 | + |
| 52 | +# ARCHIVE: @executable_path/libhello.dylib |
| 53 | +# ARCHIVE-NOT: @executable_path/libgoodbye.dylib |
| 54 | +# ARCHIVE: /usr/lib/libSystem.B.dylib |
20 | 55 |
|
21 | 56 | .section __TEXT,__text
|
22 | 57 | .global _main
|
|
0 commit comments