Skip to content

Commit

Permalink
rewrite crate-name-priority to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 20, 2024
1 parent f22b5af commit 3c0a4bc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ run-make/compiler-lookup-paths/Makefile
run-make/compiler-rt-works-on-mingw/Makefile
run-make/compressed-debuginfo/Makefile
run-make/crate-hash-rustc-version/Makefile
run-make/crate-name-priority/Makefile
run-make/cross-lang-lto-clang/Makefile
run-make/cross-lang-lto-pgo-smoketest/Makefile
run-make/cross-lang-lto-upstream-rlibs/Makefile
Expand Down
12 changes: 0 additions & 12 deletions tests/run-make/crate-name-priority/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions tests/run-make/crate-name-priority/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// 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

use run_make_support::{bin_name, fs_wrapper, rustc};

fn main() {
rustc().input("foo.rs").run();
fs_wrapper::remove_file(bin_name("foo"));
rustc().input("foo.rs").crate_name("bar").run();
fs_wrapper::remove_file(bin_name("bar"));
rustc().input("foo1.rs").run();
fs_wrapper::remove_file(bin_name("foo"));
rustc().input("foo1.rs").output(bin_name("bar1")).run();
fs_wrapper::remove_file(bin_name("bar1"));
}
2 changes: 0 additions & 2 deletions tests/run-make/relocation-model/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use run_make_support::{run, rustc};

fn main() {
// FIXME(Oneirical): This first one will likely fail on MSVC due to #28026.
// Remove this after try-job
rustc().arg("-Crelocation-model=static").input("foo.rs").run();
run("foo");
rustc().arg("-Crelocation-model=dynamic-no-pic").input("foo.rs").run();
Expand Down

0 comments on commit 3c0a4bc

Please sign in to comment.