brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 91f60a6 Raw
54 lines · plain
1# REQUIRES: x862## This tests that lld handles (re)exported libraries with rpath properly .3## The tests are as follows:4## - libAee re-exports libBee while defining the install-path with @rpath variable5##   - libBee re-exports libCee while defining the install-path with @rpath variable6##     - libCee contains _c_func symbol.7##8## We check that when linking a main which references _c_func, lld can find the symbol.9 10# RUN: rm -rf %t; split-file %s %t11# RUN: mkdir -p %t/cc/two/three12# RUN: mkdir -p %t/bb/two/three13# RUN: mkdir -p %t/aa/two/three14 15# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/c.s -o %t/c.o16# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/b.s -o %t/b.o17# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/a.s -o %t/a.o18# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o19 20# RUN: %lld -dylib -install_name @rpath/two/three/libCee.dylib %t/c.o -o %t/cc/two/three/libCee.dylib 21# RUN: %lld -dylib -install_name @rpath/two/three/libBee.dylib -L%t/cc/two/three -sub_library libCee -lCee %t/b.o -o %t/bb/two/three/libBee.dylib -rpath %t/cc22# RUN: %lld -dylib -install_name @rpath/two/three/libAee.dylib -L%t/bb/two/three -sub_library libBee -lBee %t/a.o -o %t/aa/two/three/libAee.dylib -rpath %t/aa23# RUN: %lld %t/main.o  -L%t/aa/two/three -lAee -o %t/a.out -rpath %t/aa -rpath %t/bb -rpath %t/cc24 25#--- c.s26.text27.global _c_func28_c_func:29  mov $0, %rax30  ret31 32#--- b.s33.text34.global _b_func35 36_b_func:37  mov $0, %rax38  ret39 40#--- a.s41.text42.global _a_func43_a_func:44  mov $0, %rax45  ret46 47#--- main.s48.globl _main49_main:50  callq _c_func51  callq _b_func52  callq _a_func53  ret54