diff options
| author | bors <bors@rust-lang.org> | 2024-11-14 10:59:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-14 10:59:49 +0000 |
| commit | a4cedecc9ec76b46dcbb954750068c832cf2dd43 (patch) | |
| tree | 5cca9e887688858b4d1473a3c5d322e3c6fe7593 /src/tools | |
| parent | dae7ac133b9eda152784c075facb31a6688c92b1 (diff) | |
| parent | e6cd8699eab4c434a54c92aa1747e97dc5da3663 (diff) | |
| download | rust-a4cedecc9ec76b46dcbb954750068c832cf2dd43.tar.gz rust-a4cedecc9ec76b46dcbb954750068c832cf2dd43.zip | |
Auto merge of #133032 - GuillaumeGomez:rollup-vqakdmw, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - #132010 (ci: Enable full `debuginfo-level=2` in `DEPLOY_ALT`) - #132310 (compiletest: add `max-llvm-major-version` directive) - #132773 (PassWrapper: disable UseOdrIndicator for Asan Win32) - #133013 (compiletest: known-bug / crashes: allow for an "auxiliary" directory to contain files that do not have a "known-bug" directive) - #133027 (Fix a copy-paste issue in the NuttX raw type definition) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/compiletest/src/directive-list.rs | 1 | ||||
| -rw-r--r-- | src/tools/compiletest/src/header.rs | 14 | ||||
| -rw-r--r-- | src/tools/compiletest/src/header/tests.rs | 9 | ||||
| -rw-r--r-- | src/tools/tidy/src/known_bug.rs | 18 |
4 files changed, 40 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs index 038de9036bf..bdd0b80b395 100644 --- a/src/tools/compiletest/src/directive-list.rs +++ b/src/tools/compiletest/src/directive-list.rs @@ -120,6 +120,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "incremental", "known-bug", "llvm-cov-flags", + "max-llvm-major-version", "min-cdb-version", "min-gdb-version", "min-lldb-version", diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 0e81f675474..3539e85ba63 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -1547,6 +1547,20 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision { }; } } else if let Some(version_string) = + config.parse_name_value_directive(line, "max-llvm-major-version") + { + let max_version = extract_llvm_version(&version_string); + // Ignore if actual major version is larger than the maximum required major version. + if actual_version.major > max_version.major { + return IgnoreDecision::Ignore { + reason: format!( + "ignored when the LLVM version ({actual_version}) is newer than major\ + version {}", + max_version.major + ), + }; + } + } else if let Some(version_string) = config.parse_name_value_directive(line, "min-system-llvm-version") { let min_version = extract_llvm_version(&version_string); diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 6c52a1b9507..4d75c38dd32 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -299,6 +299,15 @@ fn llvm_version() { let config: Config = cfg().llvm_version("10.6.2").build(); assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10")); + + let config: Config = cfg().llvm_version("19.0.0").build(); + assert!(!check_ignore(&config, "//@ max-llvm-major-version: 19")); + + let config: Config = cfg().llvm_version("19.1.2").build(); + assert!(!check_ignore(&config, "//@ max-llvm-major-version: 19")); + + let config: Config = cfg().llvm_version("20.0.0").build(); + assert!(check_ignore(&config, "//@ max-llvm-major-version: 19")); } #[test] diff --git a/src/tools/tidy/src/known_bug.rs b/src/tools/tidy/src/known_bug.rs index 182a81c6ec9..a8771654144 100644 --- a/src/tools/tidy/src/known_bug.rs +++ b/src/tools/tidy/src/known_bug.rs @@ -6,8 +6,22 @@ use crate::walk::*; pub fn check(filepath: &Path, bad: &mut bool) { walk(filepath, |path, _is_dir| filter_not_rust(path), &mut |entry, contents| { - let file = entry.path(); - if !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) { + let file: &Path = entry.path(); + + // files in "auxiliary" do not need to crash by themselves + let test_path_segments = + file.iter().map(|s| s.to_string_lossy().into()).collect::<Vec<String>>(); + let test_path_segments_str = + test_path_segments.iter().map(|s| s.as_str()).collect::<Vec<&str>>(); + + if !matches!(test_path_segments_str[..], [ + .., + "tests", + "crashes", + "auxiliary", + _aux_file_rs + ]) && !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) + { tidy_error!( bad, "{} crash/ice test does not have a \"//@ known-bug: \" directive", |
