]> git.lizzy.rs Git - rust.git/commitdiff
reduce threads spawned by ui-tests
authorThe8472 <git@infinite-source.de>
Fri, 26 Mar 2021 18:01:55 +0000 (19:01 +0100)
committerThe8472 <git@infinite-source.de>
Fri, 9 Apr 2021 02:58:53 +0000 (04:58 +0200)
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

src/bootstrap/test.rs
src/test/ui/asm/sym.rs
src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs
src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs
src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.rs
src/test/ui/linkage-attr/linkage-detect-local-generated-name-collision.stderr
src/test/ui/sanitize/hwaddress.rs
src/tools/compiletest/src/runtest.rs

index 86d940cd733da56608338d5cdbb219fff4adab23..03799a302982db35b3b8eaaec48635838d997d2f 100644 (file)
@@ -1156,6 +1156,7 @@ fn run(self, builder: &Builder<'_>) {
         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(" "));
 
@@ -1163,6 +1164,7 @@ fn run(self, builder: &Builder<'_>) {
         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(" "));
 
index 634ef010e6feaa96405a8ac6c5807711314b51cf..18be201d640c45a89bd5f6b62816a78748c93362 100644 (file)
@@ -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
index 74c6e501c9136289665bdecc706e88ddec372bf0..7b731a1d71da30ca45626e075a34f80fce05f9f0 100644 (file)
@@ -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)]
index bc15fcb0e399618a2e926517549264ad9d991449..32e6d0c90b255ffe33bea1e074c424cbffb37b97 100644 (file)
@@ -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
index 6e030f1cc487573adfdf21f91b0fbbcf45e3004c..e04dec24e445e9d1e625f715cf0a4e958adca493 100644 (file)
@@ -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
index 7b2f5365acaa33e7fa5d1fbd92054c50044f522e..3a0910658b7a9f1a45edd1f2c9ab77fea461107d 100644 (file)
@@ -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;
 
index b712f3225ed16186dd24af8e99d36f85232940c3..c1df9ccef22737772036b1e2e11847fa421936c4 100644 (file)
@@ -1,5 +1,6 @@
 // build-fail
-
+// FIXME(#83838) codegen-units=1 triggers llvm asserts
+// compile-flags: -Ccodegen-units=16
 #![feature(linkage)]
 
 mod dep1 {
index d008acc6e7c82d08a8f108bda8ca86b8386943a8..7e395e67378f8f58362db8719bd6118b527ed882 100644 (file)
@@ -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;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index ad5d0245457ec9a65b789ff07564255ed63cda41..88769b7cb4554562bf54b12e6f087eee82fb5d9e 100644 (file)
@@ -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
index 7aa3d4ab09e41025c990ca125a54b084be53a8d8..d0f61a8c595eab37fcc896134614de1fe3b91be0 100644 (file)
@@ -1952,6 +1952,7 @@ fn make_compile_args(
                 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");