rust/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
497 B
Rust
Raw Normal View History

// Tests that MIR inliner can handle `SourceScopeData` parenting correctly. (#76997)
// EMIT_MIR issue_76997_inline_scopes_parenting.main.Inline.after.mir
fn main() {
2023-10-20 23:57:08 -05:00
// CHECK-LABEL: fn main(
2023-10-22 11:27:43 -05:00
// CHECK: scope 1 {
// CHECK-NEXT: debug f
// CHECK-NEXT: scope 2 (inlined main::{closure#0}) {
2023-10-20 23:57:08 -05:00
// CHECK-NEXT: debug x
2023-10-22 11:27:43 -05:00
// CHECK-NEXT: scope 3 {
2023-10-20 23:57:08 -05:00
// CHECK-NEXT: debug y
2023-10-22 11:27:43 -05:00
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
let f = |x| { let y = x; y };
f(())
}