-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Add FileCheck annotations to 5 MIR-opt tests #153147
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| // skip-filecheck | ||
| //@ compile-flags: -Z mir-opt-level=0 | ||
|
|
||
| // EMIT_MIR byte_slice.main.SimplifyCfg-pre-optimizations.after.mir | ||
| fn main() { | ||
| // CHECK-LABEL: fn main( | ||
| // CHECK: = const b"foo" | ||
| // CHECK: = [const 5_u8, const 120_u8] | ||
| let x = b"foo"; | ||
| let y = [5u8, b'x']; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| // skip-filecheck | ||
| // EMIT_MIR impossible_predicates.impossible_predicate.ImpossiblePredicates.diff | ||
|
|
||
| pub fn impossible_predicate(x: &mut i32) -> (&mut i32, &mut i32) | ||
| where | ||
| for<'a> &'a mut i32: Copy, | ||
| { | ||
| // CHECK-LABEL: fn impossible_predicate( | ||
| // CHECK: bb0: { | ||
| // CHECK-NEXT: unreachable; | ||
| // CHECK-NEXT: } | ||
| let y = x; | ||
| (y, x) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| // skip-filecheck | ||
| //@ compile-flags: -Zmir-opt-level=1 -Zinline-mir | ||
| pub fn f<T>(a: &T) -> *const T { | ||
| // CHECK-LABEL: fn f( | ||
| // CHECK: &raw const (*_1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not what the PR introducing this test was aiming for. If you look at 57d01a9aeea5, we are testing that |
||
| let b: &*const T = &(a as *const T); | ||
| *b | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,8 +1,11 @@ | ||||||
| // skip-filecheck | ||||||
| //@ compile-flags: -Z mir-opt-level=4 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file does not test what it's meant to test. Do you mind changing this line to the following? We should get two
Suggested change
|
||||||
| // EMIT_MIR multiple_return_terminators.test.MultipleReturnTerminators.diff | ||||||
|
|
||||||
| fn test(x: bool) { | ||||||
| // CHECK-LABEL: fn test( | ||||||
| // CHECK: bb0: { | ||||||
| // CHECK-NEXT: return; | ||||||
| // CHECK-NEXT: } | ||||||
| if x { | ||||||
| // test | ||||||
| } else { | ||||||
|
|
||||||
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.
A single
CHECK-NOTcan be very brittle. Do you mind adding some positiveCHECKs?