llvm-project
41 строка · 1.6 Кб
1# REQUIRES: x86
2
3# RUN: rm -rf %t && mkdir %t
4
5# RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/main.o
6
7# RUN: %lld -lSystem -dyld_env DYLD_FRAMEWORK_PATH=./Foo.framework %t/main.o -o %t/one_dyld_env.out
8# RUN: llvm-otool -l %t/one_dyld_env.out | FileCheck %s --check-prefix=ONE-ENV
9
10# RUN: %lld -lSystem -dyld_env DYLD_FRAMEWORK_PATH=./Foo.framework \
11# RUN: -dyld_env DYLD_FRAMEWORK_PATH=./Bar.framework \
12# RUN: %t/main.o -o %t/two_dyld_envs.out
13# RUN: llvm-otool -l %t/two_dyld_envs.out | FileCheck %s --check-prefix=TWO-ENV
14
15# RUN: not %lld -lSystem -dyld_env DYLD_FRAMEWORK_PATH,./Foo %t/main.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=MALFORMED
16
17# RUN: not %lld -dylib -lSystem -dyld_env DYLD_FRAMEWORK_PATH=./Foo %t/main.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB
18
19# ONE-ENV: Load command 11
20# ONE-ENV-NEXT: cmd LC_DYLD_ENVIRONMENT
21# ONE-ENV-NEXT: cmdsize 48
22# ONE-ENV-NEXT: name DYLD_FRAMEWORK_PATH=./Foo.framework (offset 12)
23
24# TWO-ENV: Load command 11
25# TWO-ENV-NEXT: cmd LC_DYLD_ENVIRONMENT
26# TWO-ENV-NEXT: cmdsize 48
27# TWO-ENV-NEXT: name DYLD_FRAMEWORK_PATH=./Foo.framework (offset 12)
28# TWO-ENV-NEXT: Load command 12
29# TWO-ENV-NEXT: cmd LC_DYLD_ENVIRONMENT
30# TWO-ENV-NEXT: cmdsize 48
31# TWO-ENV-NEXT: name DYLD_FRAMEWORK_PATH=./Bar.framework (offset 12)
32
33# MALFORMED: error: -dyld_env's argument is malformed. Expected -dyld_env <ENV_VAR>=<VALUE>, got `DYLD_FRAMEWORK_PATH,./Foo`
34
35# DYLIB: error: -dyld_env can only be used when creating executable output
36
37.section __TEXT,__text
38
39.global _main
40_main:
41ret
42