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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
605 B
Rust
Raw Normal View History

2024-07-16 14:07:10 -05:00
// 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");
}