File tree Expand file tree Collapse file tree 3 files changed +38
-24
lines changed
tests/run-make/link-framework Expand file tree Collapse file tree 3 files changed +38
-24
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ run-make/libtest-json/Makefile
4646run-make/libtest-junit/Makefile
4747run-make/libtest-thread-limit/Makefile
4848run-make/link-cfg/Makefile
49- run-make/link-framework/Makefile
5049run-make/long-linker-command-lines-cmd-exe/Makefile
5150run-make/long-linker-command-lines/Makefile
5251run-make/lto-linkage-used-attr/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_fail ( ) . assert_stdout_not_contains ( "CoreFoundation" ) ;
13+
14+ rustc ( ) . input ( "link-framework.rs" ) . run ( ) ;
15+ cmd ( "otool" )
16+ . arg ( "-L" )
17+ . arg ( "link-framework" )
18+ . run ( )
19+ . assert_stdout_contains ( "CoreFoundation" )
20+ . assert_stdout_not_contains ( "weak" ) ;
21+
22+ rustc ( ) . input ( "link-weak-framework.rs" ) . run ( ) ;
23+ cmd ( "otool" )
24+ . arg ( "-L" )
25+ . arg ( "link-weak-framework" )
26+ . run ( )
27+ . assert_stdout_contains ( "CoreFoundation" )
28+ . assert_stdout_contains ( "weak" ) ;
29+
30+ // When linking the framework both normally, and weakly, the weak linking takes preference.
31+ rustc ( ) . input ( "link-both.rs" ) . run ( ) ;
32+ cmd ( "otool" )
33+ . arg ( "-L" )
34+ . arg ( "link-both" )
35+ . run ( )
36+ . assert_stdout_contains ( "CoreFoundation" )
37+ . assert_stdout_contains ( "weak" ) ;
38+ }
You can’t perform that action at this time.
0 commit comments