rust/tests/run-make/extern-flag-disambiguates/rmake.rs

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

31 lines
841 B
Rust
Raw Normal View History

//@ ignore-cross-compile
2024-07-23 13:50:00 -05:00
use run_make_support::{cwd, run, rustc};
// Attempt to build this dependency tree:
//
2024-07-23 13:50:00 -05:00
// A.1 A.2
// |\ |
// | \ |
// B \ C
// \ | /
// \|/
// D
//
// Note that A.1 and A.2 are crates with the same name.
// original Makefile at https://github.com/rust-lang/rust/issues/14469
2024-07-23 13:50:00 -05:00
fn main() {
2024-07-23 13:50:00 -05:00
rustc().metadata("1").extra_filename("-1").input("a.rs").run();
rustc().metadata("2").extra_filename("-2").input("a.rs").run();
rustc().input("b.rs").extern_("a", "liba-1.rlib").run();
rustc().input("c.rs").extern_("a", "liba-2.rlib").run();
println!("before");
rustc().cfg("before").input("d.rs").extern_("a", "liba-1.rlib").run();
run("d");
println!("after");
rustc().cfg("after").input("d.rs").extern_("a", "liba-1.rlib").run();
run("d");
}