-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add FileCheck annotations to retag mir-opt test #150479
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
base: main
Are you sure you want to change the base?
Conversation
- Add CHECK for closure (main::{closure#0})
- Use CHECK-NEXT to verify Retag statements order after bb0
- Verify Retag for both self (_1) and reference parameters (_2)
|
| // CHECK: bb0: { | ||
| // CHECK-NEXT: Retag([fn entry] _1); | ||
| // CHECK-NEXT: Retag([fn entry] _2); | ||
| // CHECK: Retag(_0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are checking that we retag just after assigning to _0.
| // CHECK: Retag(_0); | |
| // CHECK: _0 = {{.*}}; | |
| // CHECK-NEXT: Retag(_0); |
| // EMIT_MIR retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.mir | ||
| pub fn main() { | ||
| // CHECK-LABEL: fn main( | ||
| // CHECK: Retag(_{{[0-9]+}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate a bit? There should be 7 retags in this function.
| // CHECK-LABEL: fn main::{closure#0}( | ||
| // CHECK: bb0: { | ||
| // CHECK-NEXT: Retag([fn entry] _1); | ||
| // CHECK-NEXT: Retag([fn entry] _2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the Retag(_3)?
| /// Casting directly to an array should also go through `&raw` and thus add appropriate retags. | ||
| // EMIT_MIR retag.array_casts.SimplifyCfg-pre-optimizations.after.mir | ||
| // CHECK-LABEL: fn array_casts( | ||
| // CHECK: Retag( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate? There are 4 retags in this function.
Part of #116971.
Add FileCheck annotations to
tests/mir-opt/retag.rs, removing the// skip-filecheckdirective.The added CHECK directives verify that the
AddRetagpass correctly insertsRetagstatements:selfand reference parameters (Retag([fn entry] _1),Retag([fn entry] _2))CHECK-NEXTto verify Retag statements appear immediately afterbb0: {Retag(_0))main::{closure#0}) with proper entry retagsarray_castsfunction (testing retags through&raw)box_to_raw_mutfunction with[raw]retag (Retag([raw] _0))r? @cjgillot