Skip to content

Commit cff3c4b

Browse files
authored
Rollup merge of rust-lang#120265 - nikic:no-no-system-llvm, r=nagisa
Remove no-system-llvm We currently have a bunch of codegen tests that use no-system-llvm -- however, all of those tests also pass with system LLVM 16. I've opted to remove `no-system-llvm` entirely, as there's basically no valid use case for it anymore: * The only thing this option could have legitimately been used for (testing the target feature support that requires an LLVM patch) doesn't use it, and the need for this will go away with LLVM 18 anyway. * In cases where the test depends on optimizations/fixes from newer LLVM versions, `min-llvm-version` should be used instead. * In case it depends on optimization/fixes from newer LLVM versions that have been backported into our fork, `min-system-llvm-version` (with the major version larger than the one in our fork) should be used instead. r? ``@cuviper``
2 parents c0e9c75 + f4f589a commit cff3c4b

21 files changed

+13
-33
lines changed

src/tools/compiletest/src/header.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,6 @@ fn ignore_lldb(config: &Config, line: &str) -> IgnoreDecision {
11091109
}
11101110

11111111
fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
1112-
if config.system_llvm && line.starts_with("no-system-llvm") {
1113-
return IgnoreDecision::Ignore { reason: "ignored when the system LLVM is used".into() };
1114-
}
11151112
if let Some(needed_components) =
11161113
config.parse_name_value_directive(line, "needs-llvm-components")
11171114
{

src/tools/compiletest/src/header/tests.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,6 @@ fn aux_build() {
242242
);
243243
}
244244

245-
#[test]
246-
fn no_system_llvm() {
247-
let config: Config = cfg().system_llvm(false).build();
248-
assert!(!check_ignore(&config, "// no-system-llvm"));
249-
250-
let config: Config = cfg().system_llvm(true).build();
251-
assert!(check_ignore(&config, "// no-system-llvm"));
252-
}
253-
254245
#[test]
255246
fn llvm_version() {
256247
let config: Config = cfg().llvm_version("8.1.2").build();
@@ -266,6 +257,18 @@ fn llvm_version() {
266257
assert!(!check_ignore(&config, "// min-llvm-version: 9.0"));
267258
}
268259

260+
#[test]
261+
fn system_llvm_version() {
262+
let config: Config = cfg().system_llvm(true).llvm_version("17.0.0").build();
263+
assert!(check_ignore(&config, "// min-system-llvm-version: 18.0"));
264+
265+
let config: Config = cfg().system_llvm(true).llvm_version("18.0.0").build();
266+
assert!(!check_ignore(&config, "// min-system-llvm-version: 18.0"));
267+
268+
let config: Config = cfg().llvm_version("17.0.0").build();
269+
assert!(!check_ignore(&config, "// min-system-llvm-version: 18.0"));
270+
}
271+
269272
#[test]
270273
fn ignore_target() {
271274
let config: Config = cfg().target("x86_64-unknown-linux-gnu").build();

tests/codegen/alloc-optimisation.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//
2-
// no-system-llvm
31
// compile-flags: -O
42
#![crate_type = "lib"]
53

tests/codegen/array-map.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// compile-flags: -C opt-level=3 -C target-cpu=x86-64-v3
2-
// no-system-llvm
32
// only-x86_64
43
// ignore-debug (the extra assertions get in the way)
54

@@ -10,7 +9,7 @@
109
pub fn short_integer_map(x: [u32; 8]) -> [u32; 8] {
1110
// CHECK: load <8 x i32>
1211
// CHECK: shl <8 x i32>
13-
// CHECK: or <8 x i32>
12+
// CHECK: or{{( disjoint)?}} <8 x i32>
1413
// CHECK: store <8 x i32>
1514
x.map(|x| 2 * x + 1)
1615
}

tests/codegen/dealloc-no-unwind.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O
32

43
#![crate_type="lib"]

tests/codegen/fewer-names.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -Coverflow-checks=no -O
32
// revisions: YES NO
43
// [YES]compile-flags: -Zfewer-names=yes

tests/codegen/integer-overflow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O -C overflow-checks=on
32

43
#![crate_type = "lib"]

tests/codegen/issues/issue-116878.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O
32
// ignore-debug: the debug assertions get in the way
43
#![crate_type = "lib"]

tests/codegen/issues/issue-44056-macos-tls-align.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//
22
// only-macos
3-
// no-system-llvm
43
// compile-flags: -O
54

65
#![crate_type = "rlib"]

tests/codegen/issues/issue-69101-bounds-check.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O
32
// ignore-debug: the debug assertions get in the way
43
#![crate_type = "lib"]

tests/codegen/match-optimizes-away.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//
2-
// no-system-llvm
32
// compile-flags: -O
43
#![crate_type="lib"]
54

tests/codegen/ptr-read-metadata.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// compile-flags: -O -Z merge-functions=disabled
2-
// no-system-llvm
32
// ignore-debug (the extra assertions get in the way)
43

54
#![crate_type = "lib"]

tests/codegen/slice-as_chunks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O
32
// only-64bit (because the LLVM type of i64 for usize shows up)
43
// ignore-debug: the debug assertions get in the way

tests/codegen/slice-iter-len-eq-zero.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O
32
// ignore-debug: the debug assertions add extra comparisons
43
#![crate_type = "lib"]

tests/codegen/slice-iter-nonnull.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O
32
// ignore-debug (these add extra checks that make it hard to verify)
43
#![crate_type = "lib"]

tests/codegen/slice-position-bounds-check.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -O -C panic=abort
32
#![crate_type = "lib"]
43

tests/codegen/vec-iter-collect-len.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// ignore-debug: the debug assertions get in the way
2-
// no-system-llvm
32
// compile-flags: -O
43
#![crate_type="lib"]
54

tests/codegen/vec-optimizes-away.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// ignore-debug: the debug assertions get in the way
2-
// no-system-llvm
32
// compile-flags: -O
43
#![crate_type = "lib"]
54

tests/rustdoc/doc-cfg-target-feature.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// only-x86_64
22
// compile-flags:--test
33
// should-fail
4-
// no-system-llvm
54

65
// #49723: rustdoc didn't add target features when extracting or running doctests
76

tests/ui/for-loop-while/issue-69841.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// LLVM bug which needed a fix to be backported.
33

44
// run-pass
5-
// no-system-llvm
65

76
fn main() {
87
let buffer = [49u8, 10];

tests/ui/issue-76387-llvm-miscompile.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// no-system-llvm
21
// compile-flags: -C opt-level=3
32
// aux-build: issue-76387.rs
43
// run-pass

0 commit comments

Comments
 (0)