Skip to content

Commit a9dac65

Browse files
authored
Rollup merge of rust-lang#81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrum
reduce threads spawned by ui-tests The test harness already spawns enough tests to keep all cores busy. Individual tests should keep their own threading to a minimum to avoid context switch overhead. When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine. Resolves rust-lang#81946
2 parents f8bf349 + be7fe62 commit a9dac65

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

src/bootstrap/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1156,13 +1156,15 @@ note: if you're sure you want to do this, please open an issue as to why. In the
11561156
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
11571157
if builder.is_fuse_ld_lld(compiler.host) {
11581158
hostflags.push("-Clink-args=-fuse-ld=lld".to_string());
1159+
hostflags.push("-Clink-arg=-Wl,--threads=1".to_string());
11591160
}
11601161
cmd.arg("--host-rustcflags").arg(hostflags.join(" "));
11611162

11621163
let mut targetflags = flags;
11631164
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
11641165
if builder.is_fuse_ld_lld(target) {
11651166
targetflags.push("-Clink-args=-fuse-ld=lld".to_string());
1167+
targetflags.push("-Clink-arg=-Wl,--threads=1".to_string());
11661168
}
11671169
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
11681170

src/test/ui/asm/sym.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// min-llvm-version: 10.0.1
2+
// compile-flags: -C codegen-units=2
23
// only-x86_64
34
// only-linux
45
// run-pass

src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-fail
22
// compile-flags: -C opt-level=3
3+
// min-llvm-version: 11.0
34
// error-pattern: index out of bounds: the len is 0 but the index is 16777216
45
// ignore-wasm no panic or subprocess support
56
// ignore-emscripten no panic or subprocess support

src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// build-fail
66
// aux-build:def_colliding_external.rs
7+
// compile-flags: -Ccodegen-units=2
78

89
extern crate def_colliding_external as dep1;
910

src/tools/compiletest/src/runtest.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,7 @@ impl<'test> TestCx<'test> {
19521952
if !self.props.compile_flags.iter().any(|s| s.starts_with("--error-format")) {
19531953
rustc.args(&["--error-format", "json"]);
19541954
}
1955+
rustc.arg("-Ccodegen-units=1");
19551956
rustc.arg("-Zui-testing");
19561957
rustc.arg("-Zdeduplicate-diagnostics=no");
19571958
rustc.arg("-Zemit-future-incompat-report");

0 commit comments

Comments
 (0)