Skip to content

Commit 19becd4

Browse files
Migrate run-make/link-framework to rmake.rs
1 parent ae7b1c1 commit 19becd4

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ run-make/libtest-json/Makefile
4646
run-make/libtest-junit/Makefile
4747
run-make/libtest-thread-limit/Makefile
4848
run-make/link-cfg/Makefile
49-
run-make/link-framework/Makefile
5049
run-make/long-linker-command-lines-cmd-exe/Makefile
5150
run-make/long-linker-command-lines/Makefile
5251
run-make/lto-linkage-used-attr/Makefile

tests/run-make/link-framework/Makefile

-23
This file was deleted.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
}

0 commit comments

Comments
 (0)