3 files changed +29
-24
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ run-make/libtest-junit/Makefile
89
89
run-make/libtest-padding/Makefile
90
90
run-make/libtest-thread-limit/Makefile
91
91
run-make/link-cfg/Makefile
92
- run-make/link-framework/Makefile
93
92
run-make/link-path-order/Makefile
94
93
run-make/linkage-attr-on-static/Makefile
95
94
run-make/llvm-ident/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // Check that linking to a framework actually makes it to the linker.
2
+
3
+ //@ only-apple
4
+
5
+ use run_make_support:: { cmd, rustc} ;
6
+
7
+ fn main ( ) {
8
+ rustc ( ) . input ( "dep-link-framework.rs" ) . run ( ) ;
9
+ rustc ( ) . input ( "dep-link-weak-framework.rs" ) . run ( ) ;
10
+
11
+ rustc ( ) . input ( "empty.rs" ) . run ( ) ;
12
+ cmd ( "otool" ) . arg ( "-L" ) . arg ( "no-link" ) . run ( ) . assert_stdout_not_contains ( "CoreFoundation" ) ;
13
+
14
+ rustc ( ) . input ( "link-framework.rs" ) . run ( ) ;
15
+ let out = cmd ( "otool" ) . arg ( "-L" ) . arg ( "link-framework" ) . run ( ) ;
16
+ out. assert_stdout_contains ( "CoreFoundation" ) ;
17
+ out. assert_stdout_not_contains ( "weak" ) ;
18
+
19
+ rustc ( ) . input ( "link-weak-framework.rs" ) . run ( ) ;
20
+ let out = cmd ( "otool" ) . arg ( "-L" ) . arg ( "link-weak-framework" ) . run ( ) ;
21
+ out. assert_stdout_contains ( "CoreFoundation" ) ;
22
+ out. assert_stdout_contains ( "weak" ) ;
23
+
24
+ // When linking the framework both normally, and weakly, the weak linking takes preference.
25
+ rustc ( ) . input ( "link-both.rs" ) . run ( ) ;
26
+ let out = cmd ( "otool" ) . arg ( "-L" ) . arg ( "link-both" ) . run ( ) ;
27
+ out. assert_stdout_contains ( "CoreFoundation" ) ;
28
+ out. assert_stdout_contains ( "weak" ) ;
29
+ }
0 commit comments