|
1 | 1 | # REQUIRES: x86
|
2 |
| -# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o |
3 |
| -# RUN: not %lld -o %t %t.o -L%S/Inputs -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED1 |
4 |
| -# RUN: not %lld -o %t %t.o -L%S/Inputs -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED2 |
5 |
| -# RUN: %lld -o %t %t.o -L%S/Inputs -lallowable_client -client_name allowed |
6 |
| -# RUN: %lld -o %t %t.o -L%S/Inputs -lallowable_client -client_name all |
| 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 |
7 | 4 |
|
8 |
| -# NOTALLOWED1: error: cannot link directly with 'liballowable_client.dylib' because {{.*}} is not an allowed client |
9 |
| -# NOTALLOWED2: error: cannot link directly with 'liballowable_client.dylib' because notallowed is not an allowed client |
| 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 |
10 | 14 |
|
| 15 | +# Check linking against a .tbd |
| 16 | +# RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
| 17 | +# RUN: not %lld -o %t/libtest_debug.exe %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT |
| 18 | +# RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-EXPLICIT |
| 19 | +# RUN: %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name allowed |
| 20 | +# RUN: %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name all |
| 21 | +# RUN: %lld -o %t/all %t/test.o -L%t -lallowable_client |
| 22 | +# RUN: %lld -o %t/allowed %t/test.o -L%t -lallowable_client |
| 23 | +# RUN: %lld -o %t/liballowed_debug.exe %t/test.o -L%t -lallowable_client |
| 24 | + |
| 25 | +# NOTALLOWED-IMPLICIT: error: cannot link directly with 'liballowable_client.dylib' because test is not an allowed client |
| 26 | +# NOTALLOWED-EXPLICIT: error: cannot link directly with 'liballowable_client.dylib' because notallowed is not an allowed client |
| 27 | + |
| 28 | +#--- test.s |
11 | 29 | .text
|
12 |
| -.global _main |
| 30 | +.globl _main |
13 | 31 | _main:
|
14 |
| - mov $0, %rax |
15 | 32 | ret
|
| 33 | + |
| 34 | +#--- liballowable_client.tbd |
| 35 | +{ |
| 36 | + "main_library": { |
| 37 | + "allowable_clients": [ |
| 38 | + { |
| 39 | + "clients": [ |
| 40 | + "allowed" |
| 41 | + ] |
| 42 | + } |
| 43 | + ], |
| 44 | + "compatibility_versions": [ |
| 45 | + { |
| 46 | + "version": "0" |
| 47 | + } |
| 48 | + ], |
| 49 | + "current_versions": [ |
| 50 | + { |
| 51 | + "version": "0" |
| 52 | + } |
| 53 | + ], |
| 54 | + "flags": [ |
| 55 | + { |
| 56 | + "attributes": [ |
| 57 | + "not_app_extension_safe" |
| 58 | + ] |
| 59 | + } |
| 60 | + ], |
| 61 | + "install_names": [ |
| 62 | + { |
| 63 | + "name": "lib/liballowable_client.dylib" |
| 64 | + } |
| 65 | + ], |
| 66 | + "target_info": [ |
| 67 | + { |
| 68 | + "min_deployment": "10.11", |
| 69 | + "target": "x86_64-macos" |
| 70 | + } |
| 71 | + ] |
| 72 | + }, |
| 73 | + "tapi_tbd_version": 5 |
| 74 | +} |
0 commit comments