Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dd07e74

Browse files
committedJun 25, 2024
Auto merge of #126898 - GuillaumeGomez:migrate-run-make-link-framework, r=<try>
Migrate `run-make/link-framework` to `rmake.rs` Part of #121876. r? `@Kobzol` try-job: x86_64-apple-1
2 parents bda221a + dd7d6b0 commit dd07e74

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ run-make/libtest-junit/Makefile
8989
run-make/libtest-padding/Makefile
9090
run-make/libtest-thread-limit/Makefile
9191
run-make/link-cfg/Makefile
92-
run-make/link-framework/Makefile
9392
run-make/link-path-order/Makefile
9493
run-make/linkage-attr-on-static/Makefile
9594
run-make/llvm-ident/Makefile

‎tests/run-make/link-framework/Makefile

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

Comments
 (0)
Failed to load comments.