diff options
| author | bors <bors@rust-lang.org> | 2021-04-09 16:22:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-09 16:22:23 +0000 |
| commit | da0b9b6485585a3557e882acbf5054e826625031 (patch) | |
| tree | 55d63cae2845cc91ff9a1b191f6e7905da78c8c7 | |
| parent | e43c2005f250b51e24d294da0b228e0a2dc4d9b2 (diff) | |
| parent | 27868700ec1e1fede8e94cfe704a9a8939bba32f (diff) | |
| download | rust-da0b9b6485585a3557e882acbf5054e826625031.tar.gz rust-da0b9b6485585a3557e882acbf5054e826625031.zip | |
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
10 files changed, 19 insertions, 5 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 117201ab3cd..b9d7ecf8c0e 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1232,6 +1232,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display())); if builder.is_fuse_ld_lld(compiler.host) { hostflags.push("-Clink-args=-fuse-ld=lld".to_string()); + hostflags.push("-Clink-arg=-Wl,--threads=1".to_string()); } cmd.arg("--host-rustcflags").arg(hostflags.join(" ")); @@ -1239,6 +1240,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display())); if builder.is_fuse_ld_lld(target) { targetflags.push("-Clink-args=-fuse-ld=lld".to_string()); + targetflags.push("-Clink-arg=-Wl,--threads=1".to_string()); } cmd.arg("--target-rustcflags").arg(targetflags.join(" ")); diff --git a/src/test/ui/asm/sym.rs b/src/test/ui/asm/sym.rs index 634ef010e6f..18be201d640 100644 --- a/src/test/ui/asm/sym.rs +++ b/src/test/ui/asm/sym.rs @@ -1,4 +1,6 @@ // min-llvm-version: 10.0.1 +// FIXME(#84025): codegen-units=1 leads to linkage errors +// compile-flags: -C codegen-units=2 // only-x86_64 // only-linux // run-pass diff --git a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs index 74c6e501c91..7b731a1d71d 100644 --- a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs +++ b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs @@ -19,7 +19,9 @@ // revisions: no thin fat //[no]compile-flags: -C lto=no -//[thin]compile-flags: -C lto=thin +// FIXME(#83854) running this revision with 1 CGU triggers llvm assert in register allocator +// when executed in i686-gnu-nopt runner. +//[thin]compile-flags: -C lto=thin -Ccodegen-units=2 //[fat]compile-flags: -C lto=fat #![feature(core_panic)] diff --git a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs index bc15fcb0e39..32e6d0c90b2 100644 --- a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs +++ b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs @@ -40,7 +40,9 @@ //[no1]compile-flags: -C opt-level=1 -C lto=no //[no2]compile-flags: -C opt-level=2 -C lto=no //[no3]compile-flags: -C opt-level=3 -C lto=no -//[thin0]compile-flags: -C opt-level=0 -C lto=thin +// FIXME(#83854) running this revision with 1 CGU triggers llvm assert in register allocator +// when executed in dist-i586-gnu-i586-i686-musl runner. +//[thin0]compile-flags: -C opt-level=0 -C lto=thin -Ccodegen-units=2 //[thin1]compile-flags: -C opt-level=1 -C lto=thin //[thin2]compile-flags: -C opt-level=2 -C lto=thin //[thin3]compile-flags: -C opt-level=3 -C lto=thin diff --git a/src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs b/src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs index 6e030f1cc48..e04dec24e44 100644 --- a/src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs +++ b/src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs @@ -1,5 +1,6 @@ // run-fail // compile-flags: -C opt-level=3 +// min-llvm-version: 11.0 // error-pattern: index out of bounds: the len is 0 but the index is 16777216 // ignore-wasm no panic or subprocess support // ignore-emscripten no panic or subprocess support diff --git a/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs b/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs index 7b2f5365aca..3a0910658b7 100644 --- a/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs +++ b/src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs @@ -4,6 +4,8 @@ // build-fail // aux-build:def_colliding_external.rs +// FIXME(#83838) codegen-units=1 triggers llvm asserts +// compile-flags: -Ccodegen-units=16 extern crate def_colliding_external as dep1; diff --git a/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs b/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs index b712f3225ed..c1df9ccef22 100644 --- a/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs +++ b/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs @@ -1,5 +1,6 @@ // build-fail - +// FIXME(#83838) codegen-units=1 triggers llvm asserts +// compile-flags: -Ccodegen-units=16 #![feature(linkage)] mod dep1 { diff --git a/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr b/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr index d008acc6e7c..7e395e67378 100644 --- a/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr +++ b/src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr @@ -1,5 +1,5 @@ error: symbol `collision` is already defined - --> $DIR/linkage-detect-local-generated-name-collision.rs:9:9 + --> $DIR/linkage-detect-local-generated-name-collision.rs:10:9 | LL | pub static collision: *const i32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/sanitize/hwaddress.rs b/src/test/ui/sanitize/hwaddress.rs index ad5d0245457..88769b7cb45 100644 --- a/src/test/ui/sanitize/hwaddress.rs +++ b/src/test/ui/sanitize/hwaddress.rs @@ -1,7 +1,8 @@ // needs-sanitizer-support // needs-sanitizer-hwaddress // -// compile-flags: -Z sanitizer=hwaddress -O -g +// FIXME(#83989): codegen-units=1 triggers linker errors on aarch64-gnu +// compile-flags: -Z sanitizer=hwaddress -O -g -C codegen-units=16 // // run-fail // error-pattern: HWAddressSanitizer: tag-mismatch diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 7c8cd699fe0..ecbaccf744d 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1951,6 +1951,7 @@ impl<'test> TestCx<'test> { if !self.props.compile_flags.iter().any(|s| s.starts_with("--error-format")) { rustc.args(&["--error-format", "json"]); } + rustc.arg("-Ccodegen-units=1"); rustc.arg("-Zui-testing"); rustc.arg("-Zdeduplicate-diagnostics=no"); rustc.arg("-Zemit-future-incompat-report"); |
