Skip to content

Commit 20e7caa

Browse files
committed
FileCheck inline_coroutine
1 parent d8f33ef commit 20e7caa

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
fn main() -> () {
55
let mut _0: ();
66
let _1: std::ops::CoroutineState<i32, bool>;
7-
let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>;
8-
let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8};
9-
let mut _4: {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8};
7+
let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>;
8+
let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
9+
let mut _4: {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
1010
+ let mut _5: bool;
1111
scope 1 {
1212
debug _r => _1;
1313
}
1414
+ scope 2 (inlined g) {
1515
+ }
16-
+ scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>::new) {
16+
+ scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) {
1717
+ debug pointer => _3;
1818
+ scope 4 {
19-
+ scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>::new_unchecked) {
19+
+ scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) {
2020
+ debug pointer => _3;
2121
+ }
2222
+ }
2323
+ }
2424
+ scope 6 (inlined g::{closure#0}) {
2525
+ debug a => _5;
26-
+ let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8};
26+
+ let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
2727
+ let mut _7: u32;
2828
+ let mut _8: i32;
2929
+ }
@@ -37,20 +37,20 @@
3737
- }
3838
-
3939
- bb1: {
40-
+ _4 = {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8 (#0)};
40+
+ _4 = {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8 (#0)};
4141
_3 = &mut _4;
42-
- _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>::new(move _3) -> [return: bb2, unwind: bb5];
42+
- _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new(move _3) -> [return: bb2, unwind: bb5];
4343
- }
4444
-
4545
- bb2: {
46-
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}> { pointer: move _3 };
46+
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: move _3 };
4747
StorageDead(_3);
48-
- _1 = <{coroutine@$DIR/inline_coroutine.rs:17:5: 17:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb5];
48+
- _1 = <{coroutine@$DIR/inline_coroutine.rs:19:5: 19:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb5];
4949
+ StorageLive(_5);
5050
+ _5 = const false;
5151
+ StorageLive(_6);
5252
+ StorageLive(_7);
53-
+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8});
53+
+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8});
5454
+ _7 = discriminant((*_6));
5555
+ switchInt(move _7) -> [0: bb5, 1: bb9, 3: bb10, otherwise: bb11];
5656
}

tests/mir-opt/inline/inline_coroutine.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// skip-filecheck
21
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32
// compile-flags: -Zinline-mir-hint-threshold=1000
43
#![feature(coroutines, coroutine_trait)]
@@ -8,6 +7,9 @@ use std::pin::Pin;
87

98
// EMIT_MIR inline_coroutine.main.Inline.diff
109
fn main() {
10+
// CHECK-LABEL: fn main(
11+
// CHECK: (inlined g)
12+
// CHECK: (inlined g::{closure#0})
1113
let _r = Pin::new(&mut g()).resume(false);
1214
}
1315

0 commit comments

Comments
 (0)