Skip to content

Commit e5d60af

Browse files
committedSep 2, 2022
Simplify MIR opt tests
This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the result of the net result of the optimization pipeline's output is.
1 parent 10706d6 commit e5d60af

File tree

58 files changed

+742
-1509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+742
-1509
lines changed
 

‎src/test/mir-opt/early_otherwise_branch_68867.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// compile-flags: -Z mir-opt-level=4 -Zunsound-mir-opts
1+
// unit-test: EarlyOtherwiseBranch
2+
3+
// FIXME: This test was broken by the derefer change.
24

35
// example from #68867
46
type CSSFloat = f32;
@@ -11,7 +13,6 @@ pub enum ViewportPercentageLength {
1113
}
1214

1315
// EMIT_MIR early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
14-
// EMIT_MIR early_otherwise_branch_68867.try_sum EarlyOtherwiseBranch.before SimplifyConstCondition-final.after
1516
#[no_mangle]
1617
pub extern "C" fn try_sum(
1718
x: &ViewportPercentageLength,

‎src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyConstCondition-final.after.diff

-322
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.