Skip to content

Commit

Permalink
Rollup merge of #84883 - durin42:allow-unused-prefixes, r=nikic
Browse files Browse the repository at this point in the history
compiletest: "fix" FileCheck with --allow-unused-prefixes

The default of --allow-unused-prefixes used to be false, but in LLVM
change 87dbdd2 (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.
  • Loading branch information
jackh726 committed May 19, 2021
2 parents 809e975 + 3035816 commit 37ecede
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 37ecede

Please sign in to comment.