-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiletest: "fix" FileCheck with --allow-unused-prefixes #84883
Conversation
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.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
It wasn't clear to me how I should gate this flag on LLVM >= 13, but the flag was new in https://reviews.llvm.org/D90281, which is dated October 2020 so it's a recent flag. I assume we need to do some detection on that, but how? Can someone guide me on that? Thanks! |
r? @nikic as you had comments on the LLVM thread, and I'm not sure if we want to follow with an allow or perhaps fix our tests. |
Can you maybe share an example of a test that currently fails without the flag? |
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/1517#08add164-76ca-4964-ad3d-eee03fd98059 has around 25. An example from there:
I think the problem is the unconditional inclusion of CHECK in the |
Thanks for the example. So the problem is that for tests with revisions, we translate the revisions to FileCheck prefixes, while also retaining So I think passing |
Updated - note that as of today rustc HEAD won't compile against LLVM HEAD, but you can test this change if you want against LLVM commit d2a291a - I'll try and work on the build-fix later today so we can see the remaining codegen bugs against head easily. |
Alternatively, you can wait for #85416 to be in and then this should be easy to test against LLVM/Rust HEADs. |
@bors r+ |
📌 Commit 3035816 has been approved by |
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.
Rollup of 8 pull requests Successful merges: - rust-lang#83366 (Stabilize extended_key_value_attributes) - rust-lang#83767 (Fix v0 symbol mangling bug) - rust-lang#84883 (compiletest: "fix" FileCheck with --allow-unused-prefixes) - rust-lang#85274 (Only pass --[no-]gc-sections if linker is GNU ld.) - rust-lang#85297 (bootstrap: build cargo only if requested in tools) - rust-lang#85396 (rustdoc: restore header sizes) - rust-lang#85425 (Fix must_use on `Option::is_none`) - rust-lang#85438 (Fix escape handling) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.