Skip to content

Commit d1047e4

Browse files
committed
rewrite issue-30063
1 parent 60faa27 commit d1047e4

File tree

4 files changed

+36
-37
lines changed

4 files changed

+36
-37
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ run-make/issue-25581/Makefile
103103
run-make/issue-26006/Makefile
104104
run-make/issue-26092/Makefile
105105
run-make/issue-28595/Makefile
106-
run-make/issue-30063/Makefile
107106
run-make/issue-33329/Makefile
108107
run-make/issue-35164/Makefile
109108
run-make/issue-36710/Makefile

tests/run-make/issue-30063/Makefile

-36
This file was deleted.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// When rustc receives 4 codegen-units, an output path and an emit flag all simultaneously,
2+
// this could cause an annoying recompilation issue, uselessly lengthening the build process.
3+
// This test tries to reproduce this issue with varied emit flags - if it passes, the codegen-units
4+
// are being appropriately reset to 1 after each pass.
5+
// See https://github.com/rust-lang/rust/issues/30063
6+
7+
//@ ignore-cross-compile
8+
9+
use run_make_support::{rustc, tmp_dir};
10+
use std::fs;
11+
12+
fn compile(emit: Option<&str>, output_dir: &str) {
13+
let mut rustc = rustc().codegen_units(4).output(tmp_dir().join(output_dir)).input("foo.rs");
14+
if let Some(emit) = emit {
15+
rustc.emit(emit);
16+
}
17+
rustc.run();
18+
}
19+
20+
fn main {
21+
let flags = [
22+
("foo-output", None),
23+
("asm-output", Some("asm")),
24+
("bc-output", Some("llvm-bc")),
25+
("ir-output", Some("llvm-ir")),
26+
("link-output", Some("link")),
27+
("obj-output", Some("obj")),
28+
("dep-output", Some("dep-info")),
29+
("multi-output", Some("asm,obj"))
30+
];
31+
for (output_dir, emit) in flags {
32+
fs::remove_file(output_dir).unwrap_or_default();
33+
compile(emit, output_dir);
34+
fs::remove_file(output_dir);
35+
}
36+
}

0 commit comments

Comments
 (0)