Skip to content

Commit

Permalink
Migrate run-make/override-aliased-flags to rmake.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 29, 2024
1 parent 38d0f87 commit 4ee077a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 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 @@ -114,7 +114,6 @@ run-make/obey-crate-type-flag/Makefile
run-make/optimization-remarks-dir-pgo/Makefile
run-make/optimization-remarks-dir/Makefile
run-make/output-type-permutations/Makefile
run-make/override-aliased-flags/Makefile
run-make/panic-abort-eh_frame/Makefile
run-make/pass-linker-flags-flavor/Makefile
run-make/pass-linker-flags-from-dep/Makefile
Expand Down
23 changes: 0 additions & 23 deletions tests/run-make/override-aliased-flags/Makefile

This file was deleted.

24 changes: 24 additions & 0 deletions tests/run-make/override-aliased-flags/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@ ignore-cross-compile

use run_make_support::rustc;

// FIXME: it would be good to check that it's actually the rightmost flags
// that are used when multiple flags are specified, but I can't think of a
// reliable way to check this.
fn main() {
// Test that `-O` and `-C opt-level` can be specified multiple times.
// The rightmost flag will be used over any previous flags.
rustc().arg("-O").arg("-O").input("main.rs").run();
rustc().arg("-O").arg("-C").arg("opt-level=0").input("main.rs").run();
rustc().arg("-C").arg("opt-level=0").arg("-O").input("main.rs").run();
rustc().arg("-C").arg("opt-level=0").arg("-C").arg("opt-level=2").input("main.rs").run();
rustc().arg("-C").arg("opt-level=2").arg("-C").arg("opt-level=0").input("main.rs").run();

// Test that `-g` and `-C debuginfo` can be specified multiple times.
// The rightmost flag will be used over any previous flags.
rustc().arg("-g").arg("-g").input("main.rs").run();
rustc().arg("-g").arg("-C").arg("debuginfo=0").input("main.rs").run();
rustc().arg("-C").arg("debuginfo=0").arg("-g").input("main.rs").run();
rustc().arg("-C").arg("debuginfo=0").arg("-C").arg("debuginfo=2").input("main.rs").run();
rustc().arg("-C").arg("debuginfo=2").arg("-C").arg("debuginfo=0").input("main.rs").run();
}

0 comments on commit 4ee077a

Please sign in to comment.