2024-06-19 15:52:36 -05:00
|
|
|
// The `crate_name` rustc flag should have higher priority
|
|
|
|
// over `#![crate_name = "foo"]` defined inside the source code.
|
|
|
|
// This test has a conflict between crate_names defined in the .rs files
|
|
|
|
// and the compiler flags, and checks that the flag is favoured each time.
|
|
|
|
// See https://github.com/rust-lang/rust/pull/15518
|
|
|
|
|
2024-07-17 08:31:38 -05:00
|
|
|
use run_make_support::{bin_name, rfs, rustc};
|
2024-06-19 15:52:36 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
rustc().input("foo.rs").run();
|
2024-07-17 07:42:06 -05:00
|
|
|
rfs::remove_file(bin_name("foo"));
|
2024-06-19 15:52:36 -05:00
|
|
|
rustc().input("foo.rs").crate_name("bar").run();
|
2024-07-17 07:42:06 -05:00
|
|
|
rfs::remove_file(bin_name("bar"));
|
2024-06-19 15:52:36 -05:00
|
|
|
rustc().input("foo1.rs").run();
|
2024-07-17 07:42:06 -05:00
|
|
|
rfs::remove_file(bin_name("foo"));
|
2024-06-19 15:52:36 -05:00
|
|
|
rustc().input("foo1.rs").output(bin_name("bar1")).run();
|
2024-07-17 07:42:06 -05:00
|
|
|
rfs::remove_file(bin_name("bar1"));
|
2024-06-19 15:52:36 -05:00
|
|
|
}
|