diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 07073ef5d40c7..c8e14e9dfce88 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -89,7 +89,6 @@ run-make/libtest-junit/Makefile run-make/libtest-padding/Makefile run-make/libtest-thread-limit/Makefile run-make/link-cfg/Makefile -run-make/link-framework/Makefile run-make/link-path-order/Makefile run-make/linkage-attr-on-static/Makefile run-make/llvm-ident/Makefile diff --git a/tests/run-make/link-framework/Makefile b/tests/run-make/link-framework/Makefile deleted file mode 100644 index 96d832ad4a832..0000000000000 --- a/tests/run-make/link-framework/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# only-apple -# -# Check that linking to a framework actually makes it to the linker. - -include ../tools.mk - -all: - $(RUSTC) dep-link-framework.rs - $(RUSTC) dep-link-weak-framework.rs - - $(RUSTC) empty.rs - otool -L $(TMPDIR)/no-link | $(CGREP) -v CoreFoundation - - $(RUSTC) link-framework.rs - otool -L $(TMPDIR)/link-framework | $(CGREP) CoreFoundation | $(CGREP) -v weak - - $(RUSTC) link-weak-framework.rs - otool -L $(TMPDIR)/link-weak-framework | $(CGREP) CoreFoundation | $(CGREP) weak - -# When linking the framework both normally, and weakly, the weak linking takes preference - - $(RUSTC) link-both.rs - otool -L $(TMPDIR)/link-both | $(CGREP) CoreFoundation | $(CGREP) weak diff --git a/tests/run-make/link-framework/rmake.rs b/tests/run-make/link-framework/rmake.rs new file mode 100644 index 0000000000000..7989c5ea5c4f4 --- /dev/null +++ b/tests/run-make/link-framework/rmake.rs @@ -0,0 +1,29 @@ +// Check that linking to a framework actually makes it to the linker. + +//@ only-apple + +use run_make_support::{cmd, rustc}; + +fn main() { + rustc().input("dep-link-framework.rs").run(); + rustc().input("dep-link-weak-framework.rs").run(); + + rustc().input("empty.rs").run(); + cmd("otool").arg("-L").arg("no-link").run().assert_stdout_not_contains("CoreFoundation"); + + rustc().input("link-framework.rs").run(); + let out = cmd("otool").arg("-L").arg("link-framework").run(); + out.assert_stdout_contains("CoreFoundation"); + out.assert_stdout_not_contains("weak"); + + rustc().input("link-weak-framework.rs").run(); + let out = cmd("otool").arg("-L").arg("link-weak-framework").run(); + out.assert_stdout_contains("CoreFoundation"); + out.assert_stdout_contains("weak"); + + // When linking the framework both normally, and weakly, the weak linking takes preference. + rustc().input("link-both.rs").run(); + let out = cmd("otool").arg("-L").arg("link-both").run(); + out.assert_stdout_contains("CoreFoundation"); + out.assert_stdout_contains("weak"); +}