Skip to content

Commit

Permalink
rewrite manual-link to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 17, 2024
1 parent d7f75f9 commit 8cb0543
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ run-make/lto-linkage-used-attr/Makefile
run-make/lto-no-link-whole-rlib/Makefile
run-make/lto-smoke-c/Makefile
run-make/macos-deployment-target/Makefile
run-make/manual-link/Makefile
run-make/min-global-align/Makefile
run-make/missing-crate-dependency/Makefile
run-make/native-link-modifier-bundle/Makefile
Expand Down
7 changes: 0 additions & 7 deletions tests/run-make/manual-link/Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions tests/run-make/manual-link/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// A smoke test for the `-l` command line rustc flag, which manually links to the selected
// library. Useful for native libraries, this is roughly equivalent to `#[link]` in Rust code.
// If compilation succeeds, the flag successfully linked the native library.
// See https://github.com/rust-lang/rust/pull/18470

//@ ignore-cross-compile
// Reason: the compiled binary is executed

use run_make_support::{build_native_static_lib, run, rustc};

fn main() {
build_native_static_lib("bar");
rustc().input("foo.rs").arg("-lstatic=bar").run();
rustc().input("main.rs").run();
run("main");
}

0 comments on commit 8cb0543

Please sign in to comment.