Description
The MIR-opt testsuite (tests/mir-opt
) supports checking the MIR output using LLVM FileCheck tool. The purpose of this check is to write in the .rs
file what we expect to see, similar to the annotations we have for ui tests. See individual commits in #116810 for a few examples, and tests/mir-opt/README.md
for tips in dealing with functions, locals and basic blocks.
Most testcases disable this using a // skip-filecheck
comment. They should not.
We need to go through all the test cases in the MIR-opt suite to write these annotations.
Exception: the tests/mir-opt/pre-codegen
does not need these directives, as its purpose is to track the quality of the MIR we emit.
Steps, for each test case:
- figure out what is being tested (that's sometimes not directly obvious, may need git archeology);
- write the FileCheck annotations based on the emitted MIR (see the MIR dumps to help).
In some cases, it may be interesting to strengthen the test cases to better verify what they meant to verify. This can be done by adding a // unit-test: SomePassName
directive at the top, or changing compiler flags.
The point is to add check directives for what we want to check. Skipping storage statements, basic-block numbers, useless assignments is encouraged.
For volunteers: please post a comment with the files you want to work with. Please do not claim the whole issue, there is plenty to do. Please r? cjgillot
in the PR so I can keep track of them.
Activity