-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add FileCheck annotations to MIR-opt tests #116971
Comments
I'll try working on |
Hi! I'd love to get started contributing to Rust, but I'd need a little help getting started since this would be my first ever GitHub contribution. You've included the tags Easy, and Help-Wanted, so since there are plenty of files to work on besides the one @rmehri01 claimed, if you could help me out I'm eager to get to work. |
Hey there, I can offer a bit of insight but maybe someone else can add more details :) For getting started, check out CONTRIBUTING.md if you haven't already, the rustc dev guide is really comprehensive and helpful! For this issue specifically, I basically went to each file in the above directory and went through the GitHub history (related issues and PRs, especially the initial PR that created the test file) to try to determine what is trying to be tested. The diff files for each test are also really helpful for this since they show what changes the test actually made. Along with the file name and comments, you can usually get an idea of what to test. Then you can use the LLVM FileCheck syntax to check the expected result. Feel free to reach out if you're stuck, I'll try my best to help. |
I'm still a beginner so I definitely appreciate the willingness to help! Let me know if I have a good handle on the issue: the tests/mir-opt/ directory contains code for various tests you can run from the command line to test MIR optimizations. After some minor "git-archaeology" it seems the pattern is the You mention running the FileCheck test, and getting an idea of what to test, but how would I go about that? Additionally, I don't quite understand the code in the .diff files. As a beginner I really appreciate your time and effort! |
Not quite, the
And we want to add the FileCheck annotations to the source You can check out the commits in the PR mentioned in the issue or in my PR for some examples. You want to remove that |
…tests, r=cjgillot Add FileCheck annotations to MIR-opt inlining tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`. I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop. r? cjgillot
…tests, r=cjgillot Add FileCheck annotations to MIR-opt inlining tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`. I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop. r? cjgillot
I'll start on the |
…tests, r=cjgillot Add FileCheck annotations to MIR-opt inlining tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`. I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop. r? cjgillot
…sts, r=cjgillot Add FileCheck annotations to MIR-opt inlining tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`. I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop. r? cjgillot
…k-Simulacrum Add FileCheck annotations to const_prop tests Unblocks rust-lang#116012 Advances rust-lang#116971
Add FileCheck annotations to const_prop tests Unblocks rust-lang/rust#116012 Advances rust-lang/rust#116971
I'll start on the |
I'll work on the |
I've started on directory |
Add FileCheck annotations to dataflow-const-prop tests part of rust-lang#116971. A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax. Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments. r? cjgillot
Add FileCheck annotations to dataflow-const-prop tests part of rust-lang#116971. A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax. Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments. r? cjgillot
Just some experience to share: we should test against 32 bit and 64 bit platforms, as well as platforms with different unwinding. |
I'll work on the |
Add FileCheck annotations to dataflow-const-prop tests part of rust-lang#116971. A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax. Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments. r? cjgillot
Add FileCheck annotations to dataflow-const-prop tests part of rust-lang#116971. A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax. Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments. r? cjgillot
Add FileCheck annotations to dataflow-const-prop tests part of rust-lang#116971. A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax. Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments. r? cjgillot
Rollup merge of rust-lang#119759 - sfzhu93:master, r=cjgillot Add FileCheck annotations to dataflow-const-prop tests part of rust-lang#116971. A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax. Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments. r? cjgillot
…illot Add FileCheck annotations to MIR-opt SROA tests Part of rust-lang#116971, adds FileCheck annotations to SROA MIR-opt tests in `tests/mir-opt/sroa` and a few uncategorized files. r? cjgillot
…illot Add FileCheck annotations to MIR-opt SROA tests Part of rust-lang#116971, adds FileCheck annotations to SROA MIR-opt tests in `tests/mir-opt/sroa` and a few uncategorized files. r? cjgillot
…illot Add FileCheck annotations to MIR-opt SROA tests Part of rust-lang#116971, adds FileCheck annotations to SROA MIR-opt tests in `tests/mir-opt/sroa` and a few uncategorized files. r? cjgillot
Rollup merge of rust-lang#120455 - JarlEvanson:sroa-miri-tests, r=cjgillot Add FileCheck annotations to MIR-opt SROA tests Part of rust-lang#116971, adds FileCheck annotations to SROA MIR-opt tests in `tests/mir-opt/sroa` and a few uncategorized files. r? cjgillot
I'll work on the |
…ck, r=oli-obk Add FileCheck annotations to MIR-opt unnamed-fields tests Part of rust-lang#116971 Adds filecheck annotations to unnamed-fields mir-opt tests in `tests/mir-opt/unnamed-fields`
…ck, r=oli-obk Add FileCheck annotations to MIR-opt unnamed-fields tests Part of rust-lang#116971 Adds filecheck annotations to unnamed-fields mir-opt tests in `tests/mir-opt/unnamed-fields`
…ck, r=oli-obk Add FileCheck annotations to MIR-opt unnamed-fields tests Part of rust-lang#116971 Adds filecheck annotations to unnamed-fields mir-opt tests in `tests/mir-opt/unnamed-fields`
Rollup merge of rust-lang#121865 - Kirandevraj:unnamed-fields-filecheck, r=oli-obk Add FileCheck annotations to MIR-opt unnamed-fields tests Part of rust-lang#116971 Adds filecheck annotations to unnamed-fields mir-opt tests in `tests/mir-opt/unnamed-fields`
Add FileCheck annotations to const_prop tests Unblocks rust-lang/rust#116012 Advances rust-lang/rust#116971
Add FileCheck annotations to const_prop tests Unblocks rust-lang/rust#116012 Advances rust-lang/rust#116971
Add FileCheck annotations to mir-opt/dest-prop tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in tests/mir-opt/dest-prop. I would like some feedback. Also, I don't know how to approach `union.rs`. I couldn't figure out what it is testing. r? cjgillot
Add FileCheck annotations to mir-opt/dest-prop tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in tests/mir-opt/dest-prop. I would like some feedback. Also, I don't know how to approach `union.rs`. I couldn't figure out what it is testing. r? cjgillot
Add FileCheck annotations to mir-opt/dest-prop tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in tests/mir-opt/dest-prop. I would like some feedback. Also, I don't know how to approach `union.rs`. I couldn't figure out what it is testing. r? cjgillot
Add FileCheck annotations to mir-opt/dest-prop tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in tests/mir-opt/dest-prop. I would like some feedback. Also, I don't know how to approach `union.rs`. I couldn't figure out what it is testing. r? cjgillot
Rollup merge of rust-lang#122300 - CastilloDel:master, r=cjgillot Add FileCheck annotations to mir-opt/dest-prop tests Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in tests/mir-opt/dest-prop. I would like some feedback. Also, I don't know how to approach `union.rs`. I couldn't figure out what it is testing. r? cjgillot
Add FileCheck annotations to mir-opt/dest-prop tests Part of rust-lang/rust#116971, adds FileCheck annotations to MIR-opt tests in tests/mir-opt/dest-prop. I would like some feedback. Also, I don't know how to approach `union.rs`. I couldn't figure out what it is testing. r? cjgillot
…s, r=Mark-Simulacrum Check for filecheck directives in files marked `skip-filecheck` cc rust-lang#116971
Rollup merge of rust-lang#131927 - clubby789:skip-filecheck-directives, r=Mark-Simulacrum Check for filecheck directives in files marked `skip-filecheck` cc rust-lang#116971
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, andtests/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:
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.The text was updated successfully, but these errors were encountered: