2 # RUN: rm -rf %t; split-file %s %t
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
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
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
27 # Check linking against a .tbd
28 # RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT
29 # RUN: not %lld -o %t/libtest_debug.exe %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT
30 # RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-EXPLICIT
31 # RUN: %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name allowed
32 # RUN: %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name all
33 # RUN: %lld -o %t/all %t/test.o -L%t -lallowable_client
34 # RUN: %lld -o %t/allowed %t/test.o -L%t -lallowable_client
35 # RUN: %lld -o %t/liballowed_debug.exe %t/test.o -L%t -lallowable_client
37 # NOTALLOWED-IMPLICIT: error: cannot link directly with 'liballowable_client.dylib' because test is not an allowed client
38 # NOTALLOWED-EXPLICIT: error: cannot link directly with 'liballowable_client.dylib' because notallowed is not an allowed client
46 #--- liballowable_client.tbd
49 "allowable_clients": [
56 "compatibility_versions": [
69 "not_app_extension_safe"
75 "name": "lib/liballowable_client.dylib"
80 "min_deployment": "10.11",
81 "target": "x86_64-macos"