|
1 | 1 | # REQUIRES: x86 |
2 | 2 | # RUN: rm -rf %t; split-file %s %t |
3 | 3 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o |
| 4 | +# RUN: touch %t/empty.s; llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/empty.s -o %t/empty.o |
4 | 5 |
|
5 | | -# Check linking against a .dylib |
6 | | -# RUN: not %lld -o %t/test %t/test.o -L%S/Inputs -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
7 | | -# RUN: not %lld -o %t/libtest_debug.exe %t/test.o -L%S/Inputs -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
8 | | -# RUN: not %lld -o %t/test %t/test.o -L%S/Inputs -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-EXPLICIT |
9 | | -# RUN: %lld -o %t/test %t/test.o -L%S/Inputs -lallowable_client -client_name allowed |
10 | | -# RUN: %lld -o %t/test %t/test.o -L%S/Inputs -lallowable_client -client_name all |
11 | | -# RUN: %lld -o %t/all %t/test.o -L%S/Inputs -lallowable_client |
12 | | -# RUN: %lld -o %t/allowed %t/test.o -L%S/Inputs -lallowable_client |
13 | | -# RUN: %lld -o %t/liballowed_debug.exe %t/test.o -L%S/Inputs -lallowable_client |
| 6 | +# Check that `-allowable_client` generates LC_SUB_CLIENT. |
| 7 | +# We create our .dylib in a `lib` subdirectory to make sure we test linking against the `.dylib` instead of the `.tbd` below. |
| 8 | +# RUN: mkdir -p %t/lib; %lld -dylib -o %t/lib/liballowable_client.dylib %t/empty.o -allowable_client allowed -allowable_client also_allowed |
| 9 | +# RUN: llvm-objdump --macho --all-headers %t/lib/liballowable_client.dylib | FileCheck %s |
| 10 | +# CHECK: LC_SUB_CLIENT |
| 11 | +# CHECK-NEXT: cmdsize 24 |
| 12 | +# CHECK-NEXT: client allowed |
| 13 | +# CHECK: LC_SUB_CLIENT |
| 14 | +# CHECK-NEXT: cmdsize 32 |
| 15 | +# CHECK-NEXT: client also_allowed |
| 16 | + |
| 17 | +# Check linking against the .dylib we created above |
| 18 | +# RUN: not %lld -o %t/test %t/test.o -L%t/lib -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
| 19 | +# RUN: not %lld -o %t/libtest_debug.exe %t/test.o -L%t/lib -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
| 20 | +# RUN: not %lld -o %t/test %t/test.o -L%t/lib -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-EXPLICIT |
| 21 | +# RUN: %lld -o %t/test %t/test.o -L%t/lib -lallowable_client -client_name allowed |
| 22 | +# RUN: %lld -o %t/test %t/test.o -L%t/lib -lallowable_client -client_name all |
| 23 | +# RUN: %lld -o %t/all %t/test.o -L%t/lib -lallowable_client |
| 24 | +# RUN: %lld -o %t/allowed %t/test.o -L%t/lib -lallowable_client |
| 25 | +# RUN: %lld -o %t/liballowed_debug.exe %t/test.o -L%t/lib -lallowable_client |
14 | 26 |
|
15 | 27 | # Check linking against a .tbd |
16 | 28 | # RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
|
0 commit comments