Skip to content

Commit da0b9b6

Browse files
committed
Auto merge of #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 #81946
2 parents e43c200 + 2786870 commit da0b9b6

10 files changed

+19
-5
lines changed

src/bootstrap/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1232,13 +1232,15 @@ note: if you're sure you want to do this, please open an issue as to why. In the
12321232
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
12331233
if builder.is_fuse_ld_lld(compiler.host) {
12341234
hostflags.push("-Clink-args=-fuse-ld=lld".to_string());
1235+
hostflags.push("-Clink-arg=-Wl,--threads=1".to_string());
12351236
}
12361237
cmd.arg("--host-rustcflags").arg(hostflags.join(" "));
12371238

12381239
let mut targetflags = flags;
12391240
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
12401241
if builder.is_fuse_ld_lld(target) {
12411242
targetflags.push("-Clink-args=-fuse-ld=lld".to_string());
1243+
targetflags.push("-Clink-arg=-Wl,--threads=1".to_string());
12421244
}
12431245
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
12441246

src/test/ui/asm/sym.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// min-llvm-version: 10.0.1
2+
// FIXME(#84025): codegen-units=1 leads to linkage errors
3+
// compile-flags: -C codegen-units=2
24
// only-x86_64
35
// only-linux
46
// run-pass

src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
// revisions: no thin fat
2121
//[no]compile-flags: -C lto=no
22-
//[thin]compile-flags: -C lto=thin
22+
// FIXME(#83854) running this revision with 1 CGU triggers llvm assert in register allocator
23+
// when executed in i686-gnu-nopt runner.
24+
//[thin]compile-flags: -C lto=thin -Ccodegen-units=2
2325
//[fat]compile-flags: -C lto=fat
2426

2527
#![feature(core_panic)]

src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
//[no1]compile-flags: -C opt-level=1 -C lto=no
4141
//[no2]compile-flags: -C opt-level=2 -C lto=no
4242
//[no3]compile-flags: -C opt-level=3 -C lto=no
43-
//[thin0]compile-flags: -C opt-level=0 -C lto=thin
43+
// FIXME(#83854) running this revision with 1 CGU triggers llvm assert in register allocator
44+
// when executed in dist-i586-gnu-i586-i686-musl runner.
45+
//[thin0]compile-flags: -C opt-level=0 -C lto=thin -Ccodegen-units=2
4446
//[thin1]compile-flags: -C opt-level=1 -C lto=thin
4547
//[thin2]compile-flags: -C opt-level=2 -C lto=thin
4648
//[thin3]compile-flags: -C opt-level=3 -C lto=thin

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

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// build-fail
66
// aux-build:def_colliding_external.rs
7+
// FIXME(#83838) codegen-units=1 triggers llvm asserts
8+
// compile-flags: -Ccodegen-units=16
79

810
extern crate def_colliding_external as dep1;
911

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// build-fail
2-
2+
// FIXME(#83838) codegen-units=1 triggers llvm asserts
3+
// compile-flags: -Ccodegen-units=16
34
#![feature(linkage)]
45

56
mod dep1 {

src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: symbol `collision` is already defined
2-
--> $DIR/linkage-detect-local-generated-name-collision.rs:9:9
2+
--> $DIR/linkage-detect-local-generated-name-collision.rs:10:9
33
|
44
LL | pub static collision: *const i32;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/sanitize/hwaddress.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// needs-sanitizer-support
22
// needs-sanitizer-hwaddress
33
//
4-
// compile-flags: -Z sanitizer=hwaddress -O -g
4+
// FIXME(#83989): codegen-units=1 triggers linker errors on aarch64-gnu
5+
// compile-flags: -Z sanitizer=hwaddress -O -g -C codegen-units=16
56
//
67
// run-fail
78
// error-pattern: HWAddressSanitizer: tag-mismatch

src/tools/compiletest/src/runtest.rs

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

0 commit comments

Comments
 (0)