This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-24
lines changed
tests/run-make/link-framework Expand file tree Collapse file tree 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
8989run-make/libtest-padding/Makefile
9090run-make/libtest-thread-limit/Makefile
9191run-make/link-cfg/Makefile
92- run-make/link-framework/Makefile
9392run-make/link-path-order/Makefile
9493run-make/linkage-attr-on-static/Makefile
9594run-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+ }
You can’t perform that action at this time.
0 commit comments