Skip to content

Commit 0363694

Browse files
committed
emit diff after SimplifyBranches-after-copy-prop
1 parent e25738f commit 0363694

3 files changed

+480
-168
lines changed

src/test/mir-opt/early_otherwise_branch_68867.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-tidy-linelength
12
// compile-flags: -Z mir-opt-level=3
23

34
// example from #68867
@@ -11,10 +12,12 @@ pub enum ViewportPercentageLength {
1112
}
1213

1314
// EMIT_MIR early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
15+
// EMIT_MIR early_otherwise_branch_68867.try_sum EarlyOtherwiseBranch.before SimplifyBranches-after-copy-prop.after
1416
#[no_mangle]
15-
pub extern "C" fn try_sum(x: &ViewportPercentageLength,
16-
other: &ViewportPercentageLength)
17-
-> Result<ViewportPercentageLength, ()> {
17+
pub extern "C" fn try_sum(
18+
x: &ViewportPercentageLength,
19+
other: &ViewportPercentageLength,
20+
) -> Result<ViewportPercentageLength, ()> {
1821
use self::ViewportPercentageLength::*;
1922
Ok(match (x, other) {
2023
(&Vw(one), &Vw(other)) => Vw(one + other),
@@ -25,7 +28,6 @@ pub extern "C" fn try_sum(x: &ViewportPercentageLength,
2528
})
2629
}
2730

28-
2931
fn main() {
3032
try_sum(&ViewportPercentageLength::Vw(1.0), &ViewportPercentageLength::Vw(2.0));
3133
}

0 commit comments

Comments
 (0)