File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11# REQUIRES: x86
2+ ## 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 variable
5+ ## - libBee re-exports libCee while defining the install-path with @rpath variable
6+ ## - libCee contains _c_func symbol.
7+ ##
8+ ## We check that when linking a main which references _c_func, lld can find the symbol.
9+
210# RUN: rm -rf %t; split-file %s %t
311# RUN: mkdir -p %t/cc/two/three
412# RUN: mkdir -p %t/bb/two/three
715# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/c.s -o %t/c.o
816# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/b.s -o %t/b.o
917# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/a.s -o %t/a.o
18+ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o
1019
1120# RUN: %lld -dylib -install_name @rpath/two/three/libCee.dylib %t/c.o -o %t/cc/two/three/libCee.dylib
1221# 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/cc
13- # 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
22+ # 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/aa
23+ # RUN: %lld %t/main.o -L%t/aa/two/three -lAee -o a.out -rpath %t/aa -rpath %t/bb -rpath %t/cc
1424
1525#--- c.s
1626.text
@@ -33,3 +43,11 @@ _b_func:
3343_a_func:
3444 mov $0 , %rax
3545 ret
46+
47+ #--- main.s
48+ .globl _main
49+ _main:
50+ callq _c_func
51+ callq _b_func
52+ callq _a_func
53+ ret
You can’t perform that action at this time.
0 commit comments