File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
# 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
+
2
10
# RUN: rm -rf %t; split-file %s %t
3
11
# RUN: mkdir -p %t/cc/two/three
4
12
# RUN: mkdir -p %t/bb/two/three
7
15
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/c.s -o %t/c.o
8
16
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/b.s -o %t/b.o
9
17
# 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
10
19
11
20
# RUN: %lld -dylib -install_name @rpath/two/three/libCee.dylib %t/c.o -o %t/cc/two/three/libCee.dylib
12
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/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
14
24
15
25
#--- c.s
16
26
.text
@@ -33,3 +43,11 @@ _b_func:
33
43
_a_func:
34
44
mov $0 , %rax
35
45
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