diff --git a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir new file mode 100644 index 00000000000..8c3f3a4589e --- /dev/null +++ b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir @@ -0,0 +1,59 @@ +// MIR for `bar` after Inline + +fn bar() -> bool { + let mut _0: bool; + let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; + let mut _2: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; + let mut _3: &i32; + let _4: &i32; + let _5: i32; + let mut _6: &i32; + let _7: &i32; + let _8: i32; + scope 1 { + debug f => _1; + let mut _9: &i32; + let mut _10: &i32; + scope 2 (inlined foo) { + debug x => _3; + debug y => _6; + let mut _11: i32; + let mut _12: i32; + } + } + + bb0: { + StorageLive(_1); + _1 = foo; + StorageLive(_2); + _2 = _1; + StorageLive(_3); + StorageLive(_4); + _10 = const _; + Retag(_10); + _4 = &(*_10); + _3 = &(*_4); + StorageLive(_6); + StorageLive(_7); + _9 = const _; + Retag(_9); + _7 = &(*_9); + _6 = &(*_7); + Retag(_3); + Retag(_6); + StorageLive(_11); + _11 = (*_3); + StorageLive(_12); + _12 = (*_6); + _0 = Eq(move _11, move _12); + StorageDead(_12); + StorageDead(_11); + StorageDead(_6); + StorageDead(_3); + StorageDead(_2); + StorageDead(_1); + StorageDead(_7); + StorageDead(_4); + return; + } +} diff --git a/tests/mir-opt/inline/inline_retag.bar.Inline.diff b/tests/mir-opt/inline/inline_retag.bar.Inline.diff deleted file mode 100644 index 8f53f6342ec..00000000000 --- a/tests/mir-opt/inline/inline_retag.bar.Inline.diff +++ /dev/null @@ -1,65 +0,0 @@ -- // MIR for `bar` before Inline -+ // MIR for `bar` after Inline - - fn bar() -> bool { - let mut _0: bool; - let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; - let mut _2: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; - let mut _3: &i32; - let _4: &i32; - let _5: i32; - let mut _6: &i32; - let _7: &i32; - let _8: i32; - scope 1 { - debug f => _1; - let mut _9: &i32; - let mut _10: &i32; -+ scope 2 (inlined foo) { -+ debug x => _3; -+ debug y => _6; -+ let mut _11: i32; -+ let mut _12: i32; -+ } - } - - bb0: { - StorageLive(_1); - _1 = foo; - StorageLive(_2); - _2 = _1; - StorageLive(_3); - StorageLive(_4); - _10 = const _; - Retag(_10); - _4 = &(*_10); - _3 = &(*_4); - StorageLive(_6); - StorageLive(_7); - _9 = const _; - Retag(_9); - _7 = &(*_9); - _6 = &(*_7); -- _0 = move _2(move _3, move _6) -> [return: bb1, unwind continue]; -- } -- -- bb1: { -+ Retag(_3); -+ Retag(_6); -+ StorageLive(_11); -+ _11 = (*_3); -+ StorageLive(_12); -+ _12 = (*_6); -+ _0 = Eq(move _11, move _12); -+ StorageDead(_12); -+ StorageDead(_11); - StorageDead(_6); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); - StorageDead(_7); - StorageDead(_4); - return; - } - } - diff --git a/tests/mir-opt/inline/inline_retag.rs b/tests/mir-opt/inline/inline_retag.rs index b9058905892..9fb6f709223 100644 --- a/tests/mir-opt/inline/inline_retag.rs +++ b/tests/mir-opt/inline/inline_retag.rs @@ -6,7 +6,7 @@ fn main() { println!("{}", bar()); } -// EMIT_MIR inline_retag.bar.Inline.diff +// EMIT_MIR inline_retag.bar.Inline.after.mir fn bar() -> bool { // CHECK-LABEL: fn bar( // CHECK: (inlined foo)