Skip to content

Commit aeca91e

Browse files
committed
rewrite manual-link to rmake
1 parent 06dcdbb commit aeca91e

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

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ run-make/lto-linkage-used-attr/Makefile
7272
run-make/lto-no-link-whole-rlib/Makefile
7373
run-make/lto-smoke-c/Makefile
7474
run-make/macos-deployment-target/Makefile
75-
run-make/manual-link/Makefile
7675
run-make/min-global-align/Makefile
7776
run-make/missing-crate-dependency/Makefile
7877
run-make/native-link-modifier-bundle/Makefile

tests/run-make/manual-link/Makefile

-7
This file was deleted.

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

+16
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)