Skip to content

Commit 95f84c3

Browse files
committed
reduce threads spawned by ui-tests
the test harness already spawns enough tests for all cores, individual tests should keep their own threading to a minimum to avoid context switch overhead some tests fail with 1 CGU, so explicit compile flags have been added to keep their old behavior # Conflicts: # src/test/ui/asm/sym.rs
1 parent aef1140 commit 95f84c3

File tree

6 files changed

+7
-1
lines changed

6 files changed

+7
-1
lines changed

src/bootstrap/test.rs

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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=16
78

89
extern crate def_colliding_external as dep1;
910

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// build-fail
2-
2+
// compile-flags: -Ccodegen-units=16
33
#![feature(linkage)]
44

55
mod dep1 {

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 0 deletions
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)