60 lines · plain
1# REQUIRES: x862# Windows does not support rpath3# UNSUPPORTED: system-windows4 5# RUN: rm -rf %t; split-file %s %t6 7# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o8# RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/bar.s -o %t/bar.o9# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o10 11## 1. Test symlink with reexport to @rpath and rpath pointing to @loader_path.12## The @loader_path-relative path is looked after resolving the symlink.13 14# RUN: mkdir -p %t/Foo1.framework/Versions/A15# RUN: %lld -dylib -install_name @rpath/libbar1.dylib %t/bar.o -o %t/Foo1.framework/Versions/A/libbar1.dylib16 17# RUN: %lld -dylib -install_name %t/Foo1.framework/Versions/A/Foo1 %t/foo.o \18# RUN: -reexport_library %t/Foo1.framework/Versions/A/libbar1.dylib \19# RUN: -rpath @loader_path/. \20# RUN: -o %t/Foo1.framework/Versions/A/Foo121# RUN: ln -sf A %t/Foo1.framework/Versions/Current22# RUN: ln -sf Versions/Current/Foo1 %t/Foo1.framework/Foo123 24# RUN: %lld -lSystem -F%t -framework Foo1 %t/test.o -o %t/test125 26## 2. Test symlink with reexport to @loader_path-relative path directly.27## The @loader_path-relative path is looked after resolving the symlink.28## ld64 gets this wrong -- it calls realpath() but ignores the result.29## (ld64-609, Options.cpp, Options::findFile(), "@loader_path/" handling.)30 31# RUN: mkdir -p %t/Foo2.framework/Versions/A32# RUN: %lld -dylib -install_name @loader_path/libbar2.dylib %t/bar.o -o %t/Foo2.framework/Versions/A/libbar2.dylib33 34# RUN: %lld -dylib -install_name %t/Foo2.framework/Versions/A/Foo2 %t/foo.o \35# RUN: -reexport_library %t/Foo2.framework/Versions/A/libbar2.dylib \36# RUN: -o %t/Foo2.framework/Versions/A/Foo237# RUN: ln -sf A %t/Foo2.framework/Versions/Current38# RUN: ln -sf Versions/Current/Foo2 %t/Foo2.framework/Foo239 40# RUN: %lld -lSystem -F%t -framework Foo2 %t/test.o -o %t/test241 42#--- foo.s43.globl _foo44_foo:45 ret46 47#--- bar.s48.globl _bar49_bar:50 ret51 52#--- test.s53.globl _main54.text55_main:56 callq _foo57 callq _bar58 ret59 60