about summary refs log tree commit diff
path: root/tests/run-make/manual-link/rmake.rs
blob: 1d3621722630acd91510df27fd1cabe51c96782d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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");
}