Add FileCheck annotations to 5 MIR-opt tests#153147
Add FileCheck annotations to 5 MIR-opt tests#153147sivadeilra wants to merge 1 commit intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Remove skip-filecheck and add FileCheck directives for: - multiple_return_terminators.rs: verify pass collapses to single bb0 with return - impossible_predicates.rs: verify body becomes unreachable when predicates impossible - byte_slice.rs: verify byte slice literal lowering in MIR - lower_array_len.rs: verify array .len() lowered to const N by GVN - remove_zsts.rs: verify zero-sized types replaced with const ZeroSized
60ad693 to
bf43e31
Compare
| } | ||
| fn main() { | ||
| // CHECK-LABEL: fn main( | ||
| // CHECK-NOT: deref_copy |
There was a problem hiding this comment.
A single CHECK-NOT can be very brittle. Do you mind adding some positive CHECKs?
| //@ compile-flags: -Zmir-opt-level=1 -Zinline-mir | ||
| pub fn f<T>(a: &T) -> *const T { | ||
| // CHECK-LABEL: fn f( | ||
| // CHECK: &raw const (*_1) |
There was a problem hiding this comment.
This is not what the PR introducing this test was aiming for. If you look at 57d01a9aeea5, we are testing that _0 = (*_2) does not become _0 = (*_3), as _3 has no storage at that statement.
| @@ -1,8 +1,11 @@ | |||
| // skip-filecheck | |||
| //@ compile-flags: -Z mir-opt-level=4 | |||
There was a problem hiding this comment.
This file does not test what it's meant to test. Do you mind changing this line to the following? We should get two return; statements in the MIR for test.
| //@ compile-flags: -Z mir-opt-level=4 | |
| //@ test-mir-pass: MultipleReturnTerminators |
|
Thank you very much for continuing this. This is also an opportunity to cleanup the mir-opt test suite, which is why some comments discuss more than just the FileCheck annotations. |
|
☔ The latest upstream changes (presumably #155674) made this pull request unmergeable. Please resolve the merge conflicts. |
Add FileCheck annotations to 5 MIR-opt tests that previously used
// skip-filecheckChanges
byte_slice.rsb"foo"and byte array[5u8, b'x']appear in MIRmultiple_return_terminators.rsfn testcollapses to a singlebb0: { return; }impossible_predicates.rs&mut i32: Copy) becomesbb0: { unreachable; }lower_array_len.rs.len()lowered toconst N, bounds checks useLt(_, const N)remove_zsts.rsconst ZeroSizedAll annotations follow the patterns established in existing annotated tests (e.g.,
simd-intrinsic-mask-reduce.rs). Each usesCHECK-LABELto anchor on the function, thenCHECK/CHECK-NOT/CHECK-NEXTto verify the key optimization results.r? cjgillot