3 # RUN: rm -rf %t; split-file %s %t
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o
6 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/bar.s -o %t/bar.o
7 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
9 ## 1. Test symlink with reexport to @rpath and rpath pointing to @loader_path.
10 ## The @loader_path-relative path is looked after resolving the symlink.
12 # RUN: mkdir -p %t/Foo1.framework/Versions/A
13 # RUN: %lld -dylib -install_name @rpath/libbar1.dylib %t/bar.o -o %t/Foo1.framework/Versions/A/libbar1.dylib
15 # RUN: %lld -dylib -install_name %t/Foo1.framework/Versions/A/Foo1 %t/foo.o \
16 # RUN: -reexport_library %t/Foo1.framework/Versions/A/libbar1.dylib \
17 # RUN: -rpath @loader_path/. \
18 # RUN: -o %t/Foo1.framework/Versions/A/Foo1
19 # RUN: ln -sf A %t/Foo1.framework/Versions/Current
20 # RUN: ln -sf Versions/Current/Foo1 %t/Foo1.framework/Foo1
22 # RUN: %lld -lSystem -F%t -framework Foo1 %t/test.o -o %t/test1
24 ## 2. Test symlink with reexport to @loader_path-relative path directly.
25 ## The @loader_path-relative path is looked after resolving the symlink.
26 ## ld64 gets this wrong -- it calls realpath() but ignores the result.
27 ## (ld64-609, Options.cpp, Options::findFile(), "@loader_path/" handling.)
29 # RUN: mkdir -p %t/Foo2.framework/Versions/A
30 # RUN: %lld -dylib -install_name @loader_path/libbar2.dylib %t/bar.o -o %t/Foo2.framework/Versions/A/libbar2.dylib
32 # RUN: %lld -dylib -install_name %t/Foo2.framework/Versions/A/Foo2 %t/foo.o \
33 # RUN: -reexport_library %t/Foo2.framework/Versions/A/libbar2.dylib \
34 # RUN: -o %t/Foo2.framework/Versions/A/Foo2
35 # RUN: ln -sf A %t/Foo2.framework/Versions/Current
36 # RUN: ln -sf Versions/Current/Foo2 %t/Foo2.framework/Foo2
38 # RUN: %lld -lSystem -F%t -framework Foo2 %t/test.o -o %t/test2