Rollup merge of #84883 - durin42:allow-unused-prefixes, r=nikic

compiletest: "fix" FileCheck with --allow-unused-prefixes

The default of --allow-unused-prefixes used to be false, but in LLVM
change 87dbdd2e3b (https://reviews.llvm.org/D95849) the default became
true. I'm not quite sure how we could do better here (specifically not
providing the CHECK prefix when it's not needed), but this seems to work
for now.

This reduces codegen test failures against LLVM HEAD from 31 cases to 5.
This commit is contained in:
Jack Huey 2021-05-18 22:35:59 -04:00 committed by GitHub
commit 37ecede507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2327,7 +2327,11 @@ impl<'test> TestCx<'test> {
// For now, though…
if let Some(rev) = self.revision {
let prefixes = format!("CHECK,{}", rev);
filecheck.args(&["--check-prefixes", &prefixes]);
if self.config.llvm_version.unwrap_or(0) >= 130000 {
filecheck.args(&["--allow-unused-prefixes", "--check-prefixes", &prefixes]);
} else {
filecheck.args(&["--check-prefixes", &prefixes]);
}
}
self.compose_and_run(filecheck, "", None, None)
}