3 # RUN: rm -rf %t && mkdir %t
5 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/main.o
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
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
15 # RUN: not %lld -lSystem -dyld_env DYLD_FRAMEWORK_PATH,./Foo %t/main.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=MALFORMED
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
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)
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)
33 # MALFORMED: error: -dyld_env's argument is malformed. Expected -dyld_env <ENV_VAR>=<VALUE>, got `DYLD_FRAMEWORK_PATH,./Foo`
35 # DYLIB: error: -dyld_env can only be used when creating executable output
37 .section __TEXT,__text