Skip to content

Commit 8cb0543

Browse files
committed
rewrite manual-link to rmake
1 parent d7f75f9 commit 8cb0543

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ run-make/lto-linkage-used-attr/Makefile
7373
run-make/lto-no-link-whole-rlib/Makefile
7474
run-make/lto-smoke-c/Makefile
7575
run-make/macos-deployment-target/Makefile
76-
run-make/manual-link/Makefile
7776
run-make/min-global-align/Makefile
7877
run-make/missing-crate-dependency/Makefile
7978
run-make/native-link-modifier-bundle/Makefile

tests/run-make/manual-link/Makefile

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/run-make/manual-link/rmake.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// A smoke test for the `-l` command line rustc flag, which manually links to the selected
2+
// library. Useful for native libraries, this is roughly equivalent to `#[link]` in Rust code.
3+
// If compilation succeeds, the flag successfully linked the native library.
4+
// See https://github.com/rust-lang/rust/pull/18470
5+
6+
//@ ignore-cross-compile
7+
// Reason: the compiled binary is executed
8+
9+
use run_make_support::{build_native_static_lib, run, rustc};
10+
11+
fn main() {
12+
build_native_static_lib("bar");
13+
rustc().input("foo.rs").arg("-lstatic=bar").run();
14+
rustc().input("main.rs").run();
15+
run("main");
16+
}

0 commit comments

Comments
 (0)