From 823e8b041a03c4e5f33d95cdc6fb996ecbcf0fa5 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 22 Jan 2024 10:13:06 +0100 Subject: [PATCH 1/3] Allow disjoint flag in codegen test --- tests/codegen/array-map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codegen/array-map.rs b/tests/codegen/array-map.rs index 4d218e6a951b2..bdae43054d0b2 100644 --- a/tests/codegen/array-map.rs +++ b/tests/codegen/array-map.rs @@ -10,7 +10,7 @@ pub fn short_integer_map(x: [u32; 8]) -> [u32; 8] { // CHECK: load <8 x i32> // CHECK: shl <8 x i32> - // CHECK: or <8 x i32> + // CHECK: or{{( disjoint)?}} <8 x i32> // CHECK: store <8 x i32> x.map(|x| 2 * x + 1) } From 31f5f033e9a712cf586534e505a81f6e241f9db1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 23 Jan 2024 10:17:05 +0100 Subject: [PATCH 2/3] Remove uses of no-system-llvm It looks like none of these are actually needed. --- tests/codegen/alloc-optimisation.rs | 2 -- tests/codegen/array-map.rs | 1 - tests/codegen/dealloc-no-unwind.rs | 1 - tests/codegen/fewer-names.rs | 1 - tests/codegen/integer-overflow.rs | 1 - tests/codegen/issues/issue-116878.rs | 1 - tests/codegen/issues/issue-44056-macos-tls-align.rs | 1 - tests/codegen/issues/issue-69101-bounds-check.rs | 1 - tests/codegen/match-optimizes-away.rs | 1 - tests/codegen/ptr-read-metadata.rs | 1 - tests/codegen/slice-as_chunks.rs | 1 - tests/codegen/slice-iter-len-eq-zero.rs | 1 - tests/codegen/slice-iter-nonnull.rs | 1 - tests/codegen/slice-position-bounds-check.rs | 1 - tests/codegen/vec-iter-collect-len.rs | 1 - tests/codegen/vec-optimizes-away.rs | 1 - tests/rustdoc/doc-cfg-target-feature.rs | 1 - tests/ui/for-loop-while/issue-69841.rs | 1 - tests/ui/issue-76387-llvm-miscompile.rs | 1 - 19 files changed, 20 deletions(-) diff --git a/tests/codegen/alloc-optimisation.rs b/tests/codegen/alloc-optimisation.rs index f88d695d87e1e..900eb687a45bb 100644 --- a/tests/codegen/alloc-optimisation.rs +++ b/tests/codegen/alloc-optimisation.rs @@ -1,5 +1,3 @@ -// -// no-system-llvm // compile-flags: -O #![crate_type = "lib"] diff --git a/tests/codegen/array-map.rs b/tests/codegen/array-map.rs index bdae43054d0b2..9846cc7f5c836 100644 --- a/tests/codegen/array-map.rs +++ b/tests/codegen/array-map.rs @@ -1,5 +1,4 @@ // compile-flags: -C opt-level=3 -C target-cpu=x86-64-v3 -// no-system-llvm // only-x86_64 // ignore-debug (the extra assertions get in the way) diff --git a/tests/codegen/dealloc-no-unwind.rs b/tests/codegen/dealloc-no-unwind.rs index 3812ef44ff2ac..c2656908f16d7 100644 --- a/tests/codegen/dealloc-no-unwind.rs +++ b/tests/codegen/dealloc-no-unwind.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O #![crate_type="lib"] diff --git a/tests/codegen/fewer-names.rs b/tests/codegen/fewer-names.rs index df1080bff2b1c..05643fab96a1d 100644 --- a/tests/codegen/fewer-names.rs +++ b/tests/codegen/fewer-names.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -Coverflow-checks=no -O // revisions: YES NO // [YES]compile-flags: -Zfewer-names=yes diff --git a/tests/codegen/integer-overflow.rs b/tests/codegen/integer-overflow.rs index 183de56db9685..b5c351b5e35de 100644 --- a/tests/codegen/integer-overflow.rs +++ b/tests/codegen/integer-overflow.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O -C overflow-checks=on #![crate_type = "lib"] diff --git a/tests/codegen/issues/issue-116878.rs b/tests/codegen/issues/issue-116878.rs index d5f679459f731..5864f53232493 100644 --- a/tests/codegen/issues/issue-116878.rs +++ b/tests/codegen/issues/issue-116878.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O // ignore-debug: the debug assertions get in the way #![crate_type = "lib"] diff --git a/tests/codegen/issues/issue-44056-macos-tls-align.rs b/tests/codegen/issues/issue-44056-macos-tls-align.rs index 1a3923f1bb1ab..44aa9766d3c0d 100644 --- a/tests/codegen/issues/issue-44056-macos-tls-align.rs +++ b/tests/codegen/issues/issue-44056-macos-tls-align.rs @@ -1,6 +1,5 @@ // // only-macos -// no-system-llvm // compile-flags: -O #![crate_type = "rlib"] diff --git a/tests/codegen/issues/issue-69101-bounds-check.rs b/tests/codegen/issues/issue-69101-bounds-check.rs index a3aca3a2912a6..655de45fd51e9 100644 --- a/tests/codegen/issues/issue-69101-bounds-check.rs +++ b/tests/codegen/issues/issue-69101-bounds-check.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O // ignore-debug: the debug assertions get in the way #![crate_type = "lib"] diff --git a/tests/codegen/match-optimizes-away.rs b/tests/codegen/match-optimizes-away.rs index 8f66c518ccf48..400606b42d550 100644 --- a/tests/codegen/match-optimizes-away.rs +++ b/tests/codegen/match-optimizes-away.rs @@ -1,5 +1,4 @@ // -// no-system-llvm // compile-flags: -O #![crate_type="lib"] diff --git a/tests/codegen/ptr-read-metadata.rs b/tests/codegen/ptr-read-metadata.rs index 73d1db6df277b..94152ed11ba13 100644 --- a/tests/codegen/ptr-read-metadata.rs +++ b/tests/codegen/ptr-read-metadata.rs @@ -1,5 +1,4 @@ // compile-flags: -O -Z merge-functions=disabled -// no-system-llvm // ignore-debug (the extra assertions get in the way) #![crate_type = "lib"] diff --git a/tests/codegen/slice-as_chunks.rs b/tests/codegen/slice-as_chunks.rs index efac9f3d68da8..e832f90d07a52 100644 --- a/tests/codegen/slice-as_chunks.rs +++ b/tests/codegen/slice-as_chunks.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O // only-64bit (because the LLVM type of i64 for usize shows up) // ignore-debug: the debug assertions get in the way diff --git a/tests/codegen/slice-iter-len-eq-zero.rs b/tests/codegen/slice-iter-len-eq-zero.rs index c7515ce35a35f..77febf5170da7 100644 --- a/tests/codegen/slice-iter-len-eq-zero.rs +++ b/tests/codegen/slice-iter-len-eq-zero.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O // ignore-debug: the debug assertions add extra comparisons #![crate_type = "lib"] diff --git a/tests/codegen/slice-iter-nonnull.rs b/tests/codegen/slice-iter-nonnull.rs index 1e691cc34c995..93c8828ccd336 100644 --- a/tests/codegen/slice-iter-nonnull.rs +++ b/tests/codegen/slice-iter-nonnull.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O // ignore-debug (these add extra checks that make it hard to verify) #![crate_type = "lib"] diff --git a/tests/codegen/slice-position-bounds-check.rs b/tests/codegen/slice-position-bounds-check.rs index b494f42b2965d..57904e5e49999 100644 --- a/tests/codegen/slice-position-bounds-check.rs +++ b/tests/codegen/slice-position-bounds-check.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -O -C panic=abort #![crate_type = "lib"] diff --git a/tests/codegen/vec-iter-collect-len.rs b/tests/codegen/vec-iter-collect-len.rs index 73348ddd063dc..3a0d6c3091927 100644 --- a/tests/codegen/vec-iter-collect-len.rs +++ b/tests/codegen/vec-iter-collect-len.rs @@ -1,5 +1,4 @@ // ignore-debug: the debug assertions get in the way -// no-system-llvm // compile-flags: -O #![crate_type="lib"] diff --git a/tests/codegen/vec-optimizes-away.rs b/tests/codegen/vec-optimizes-away.rs index 6f477a796b65d..3be342dabeb62 100644 --- a/tests/codegen/vec-optimizes-away.rs +++ b/tests/codegen/vec-optimizes-away.rs @@ -1,5 +1,4 @@ // ignore-debug: the debug assertions get in the way -// no-system-llvm // compile-flags: -O #![crate_type = "lib"] diff --git a/tests/rustdoc/doc-cfg-target-feature.rs b/tests/rustdoc/doc-cfg-target-feature.rs index f1b000dc82362..98d230c978b7e 100644 --- a/tests/rustdoc/doc-cfg-target-feature.rs +++ b/tests/rustdoc/doc-cfg-target-feature.rs @@ -1,7 +1,6 @@ // only-x86_64 // compile-flags:--test // should-fail -// no-system-llvm // #49723: rustdoc didn't add target features when extracting or running doctests diff --git a/tests/ui/for-loop-while/issue-69841.rs b/tests/ui/for-loop-while/issue-69841.rs index 1aca16ca80451..942b99b742bc6 100644 --- a/tests/ui/for-loop-while/issue-69841.rs +++ b/tests/ui/for-loop-while/issue-69841.rs @@ -2,7 +2,6 @@ // LLVM bug which needed a fix to be backported. // run-pass -// no-system-llvm fn main() { let buffer = [49u8, 10]; diff --git a/tests/ui/issue-76387-llvm-miscompile.rs b/tests/ui/issue-76387-llvm-miscompile.rs index a9b4686c97021..a7fc9da633963 100644 --- a/tests/ui/issue-76387-llvm-miscompile.rs +++ b/tests/ui/issue-76387-llvm-miscompile.rs @@ -1,4 +1,3 @@ -// no-system-llvm // compile-flags: -C opt-level=3 // aux-build: issue-76387.rs // run-pass From f4f589a028f56f6957942d0ceafbb5e83b906777 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 23 Jan 2024 11:19:51 +0100 Subject: [PATCH 3/3] Remove support for no-system-llvm Also add tests for min-system-llvm-version. --- src/tools/compiletest/src/header.rs | 3 --- src/tools/compiletest/src/header/tests.rs | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index e70e01e8757e0..ff907152ca916 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -1109,9 +1109,6 @@ fn ignore_lldb(config: &Config, line: &str) -> IgnoreDecision { } fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision { - if config.system_llvm && line.starts_with("no-system-llvm") { - return IgnoreDecision::Ignore { reason: "ignored when the system LLVM is used".into() }; - } if let Some(needed_components) = config.parse_name_value_directive(line, "needs-llvm-components") { diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 8882f1582acc7..c859e8acadebd 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -242,15 +242,6 @@ fn aux_build() { ); } -#[test] -fn no_system_llvm() { - let config: Config = cfg().system_llvm(false).build(); - assert!(!check_ignore(&config, "// no-system-llvm")); - - let config: Config = cfg().system_llvm(true).build(); - assert!(check_ignore(&config, "// no-system-llvm")); -} - #[test] fn llvm_version() { let config: Config = cfg().llvm_version("8.1.2").build(); @@ -266,6 +257,18 @@ fn llvm_version() { assert!(!check_ignore(&config, "// min-llvm-version: 9.0")); } +#[test] +fn system_llvm_version() { + let config: Config = cfg().system_llvm(true).llvm_version("17.0.0").build(); + assert!(check_ignore(&config, "// min-system-llvm-version: 18.0")); + + let config: Config = cfg().system_llvm(true).llvm_version("18.0.0").build(); + assert!(!check_ignore(&config, "// min-system-llvm-version: 18.0")); + + let config: Config = cfg().llvm_version("17.0.0").build(); + assert!(!check_ignore(&config, "// min-system-llvm-version: 18.0")); +} + #[test] fn ignore_target() { let config: Config = cfg().target("x86_64-unknown-linux-gnu").build();