Skip to content

Commit 15b0f7e

Browse files
Rollup merge of rust-lang#127041 - GuillaumeGomez:run-make-override-aliased-flags, r=Kobzol
Migrate `run-make/override-aliased-flags` to `rmake.rs` Part of rust-lang#121876. I voluntarily didn't use the helper methods to make it obvious what's tested. r? ``@jieyouxu``
2 parents 5f4d142 + ae64514 commit 15b0f7e

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ run-make/obey-crate-type-flag/Makefile
117117
run-make/optimization-remarks-dir-pgo/Makefile
118118
run-make/optimization-remarks-dir/Makefile
119119
run-make/output-type-permutations/Makefile
120-
run-make/override-aliased-flags/Makefile
121120
run-make/overwrite-input/Makefile
122121
run-make/panic-abort-eh_frame/Makefile
123122
run-make/pass-linker-flags-flavor/Makefile

tests/run-make/override-aliased-flags/Makefile

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ ignore-cross-compile
2+
3+
use run_make_support::rustc;
4+
5+
// FIXME: it would be good to check that it's actually the rightmost flags
6+
// that are used when multiple flags are specified, but I can't think of a
7+
// reliable way to check this.
8+
fn main() {
9+
// Test that `-O` and `-C opt-level` can be specified multiple times.
10+
// The rightmost flag will be used over any previous flags.
11+
rustc().arg("-O").arg("-O").input("main.rs").run();
12+
rustc().arg("-O").arg("-C").arg("opt-level=0").input("main.rs").run();
13+
rustc().arg("-C").arg("opt-level=0").arg("-O").input("main.rs").run();
14+
rustc().arg("-C").arg("opt-level=0").arg("-C").arg("opt-level=2").input("main.rs").run();
15+
rustc().arg("-C").arg("opt-level=2").arg("-C").arg("opt-level=0").input("main.rs").run();
16+
17+
// Test that `-g` and `-C debuginfo` can be specified multiple times.
18+
// The rightmost flag will be used over any previous flags.
19+
rustc().arg("-g").arg("-g").input("main.rs").run();
20+
rustc().arg("-g").arg("-C").arg("debuginfo=0").input("main.rs").run();
21+
rustc().arg("-C").arg("debuginfo=0").arg("-g").input("main.rs").run();
22+
rustc().arg("-C").arg("debuginfo=0").arg("-C").arg("debuginfo=2").input("main.rs").run();
23+
rustc().arg("-C").arg("debuginfo=2").arg("-C").arg("debuginfo=0").input("main.rs").run();
24+
}

0 commit comments

Comments
 (0)