File tree 3 files changed +38
-24
lines changed
tests/run-make/link-framework
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
46
46
run-make/libtest-junit/Makefile
47
47
run-make/libtest-thread-limit/Makefile
48
48
run-make/link-cfg/Makefile
49
- run-make/link-framework/Makefile
50
49
run-make/long-linker-command-lines-cmd-exe/Makefile
51
50
run-make/long-linker-command-lines/Makefile
52
51
run-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 ( ) . assert_stdout_not_contains ( "CoreFoundation" ) ;
13
+
14
+ rustc ( ) . input ( "link-framework.rs" ) . run ( ) ;
15
+ let out = 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
+ let out = 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
+ let out = 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