Skip to content

Commit e421ffb

Browse files
committed
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 aee3dc4 + 4b8f12b commit e421ffb

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ run-make/libtest-json/Makefile
4444
run-make/libtest-junit/Makefile
4545
run-make/libtest-thread-limit/Makefile
4646
run-make/link-cfg/Makefile
47-
run-make/link-framework/Makefile
4847
run-make/long-linker-command-lines-cmd-exe/Makefile
4948
run-make/long-linker-command-lines/Makefile
5049
run-make/lto-linkage-used-attr/Makefile

tests/run-make/link-framework/Makefile

-23
This file was deleted.
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Check that linking to a framework actually makes it to the linker.
2+
3+
//@ only-apple
4+
5+
use run_make_support::{cmd, cwd, rustc, shallow_find_files};
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+
eprintln!("---> {:?}", shallow_find_files(cwd(), |_| true));
13+
cmd("otool").arg("-L").arg("no-link").run().assert_stdout_not_contains("CoreFoundation");
14+
15+
rustc().input("link-framework.rs").run();
16+
let out = cmd("otool")
17+
.arg("-L")
18+
.arg("link-framework")
19+
.run()
20+
.assert_stdout_contains("CoreFoundation")
21+
.assert_stdout_not_contains("weak");
22+
23+
rustc().input("link-weak-framework.rs").run();
24+
let out = cmd("otool")
25+
.arg("-L")
26+
.arg("link-weak-framework")
27+
.run()
28+
.assert_stdout_contains("CoreFoundation")
29+
.assert_stdout_contains("weak");
30+
31+
// When linking the framework both normally, and weakly, the weak linking takes preference.
32+
rustc().input("link-both.rs").run();
33+
let out = cmd("otool")
34+
.arg("-L")
35+
.arg("link-both")
36+
.run()
37+
.assert_stdout_contains("CoreFoundation")
38+
.assert_stdout_contains("weak");
39+
}

0 commit comments

Comments
 (0)