Skip to content
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

mir-opt: support "FileCheck"-like annotations #85180

Closed
RalfJung opened this issue May 11, 2021 · 1 comment · Fixed by #116810
Closed

mir-opt: support "FileCheck"-like annotations #85180

RalfJung opened this issue May 11, 2021 · 1 comment · Fixed by #116810
Labels
A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@RalfJung
Copy link
Member

Ever since our mir-opt tests were changed to auto-blessing, we no longer have a way to say "but this part of the output must definitely look like that". This makes tests a lot more fragile. We should re-add some infrastructure like that.

LLVM has FileCheck for this. We also had something like that for mir-opt tests that we could reinstate (I think it was adequate for this job, it just didn't work well for large chunks of code).

Cc @rust-lang/wg-mir-opt

@oli-obk
Copy link
Contributor

oli-obk commented May 11, 2021

The old system was removed in d0e0f40#diff-03a0567fa80ca04ed5a55f9ac5c711b4f84659be2d0ac4a984196d581c04f76b, so we should be able to revert that commit with some minor adjustments

@wesleywiser wesleywiser added A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. labels May 12, 2021
fmease added a commit to fmease/rust that referenced this issue Oct 19, 2023
Add FileCheck annotations to mir-opt tests.

This PR makes compiletest run LLVM `FileCheck` tool on mir-opt tests.

The check is *run by default*, except if disabled using `// skip-filecheck` comment. This ensures that we do not have a silently broken test. For now, the check is only run on the output of `--emit=mir`, ie. on PreCodegen MIR.

I give an example on `reference_prop.rs`.

r? `@oli-obk`
cc `@RalfJung`

Fixes rust-lang#85180
@bors bors closed this as completed in e76cb8c Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants