Skip to content

Commit 5ffca45

Browse files
committed
bless mir-opt tests
1 parent f488b50 commit 5ffca45

26 files changed

Lines changed: 574 additions & 536 deletions

File tree

tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,33 @@
22

33
fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) -> Poll<()> {
44
debug _task_context => _2;
5-
debug x => ((*_20).0: T);
5+
debug x => ((*_19).0: T);
66
let mut _0: std::task::Poll<()>;
77
let _3: T;
88
let mut _4: impl std::future::Future<Output = ()>;
99
let mut _5: &mut T;
1010
let mut _6: std::pin::Pin<&mut T>;
1111
let mut _7: &mut T;
12-
let mut _8: *mut T;
13-
let mut _9: std::task::Poll<()>;
14-
let mut _10: &mut std::task::Context<'_>;
15-
let mut _11: &mut impl std::future::Future<Output = ()>;
16-
let mut _12: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
17-
let mut _13: isize;
18-
let mut _14: &mut std::task::Context<'_>;
19-
let mut _15: &mut impl std::future::Future<Output = ()>;
20-
let mut _16: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
21-
let mut _17: isize;
22-
let mut _18: ();
23-
let mut _19: u32;
24-
let mut _20: &mut {async fn body of a<T>()};
12+
let mut _8: std::task::Poll<()>;
13+
let mut _9: &mut std::task::Context<'_>;
14+
let mut _10: &mut impl std::future::Future<Output = ()>;
15+
let mut _11: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
16+
let mut _12: isize;
17+
let mut _13: &mut std::task::Context<'_>;
18+
let mut _14: &mut impl std::future::Future<Output = ()>;
19+
let mut _15: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
20+
let mut _16: isize;
21+
let mut _17: ();
22+
let mut _18: u32;
23+
let mut _19: &mut {async fn body of a<T>()};
2524
scope 1 {
26-
debug x => (((*_20) as variant#4).0: T);
25+
debug x => (((*_19) as variant#4).0: T);
2726
}
2827

2928
bb0: {
30-
_20 = copy (_1.0: &mut {async fn body of a<T>()});
31-
_19 = discriminant((*_20));
32-
switchInt(move _19) -> [0: bb9, 3: bb12, 4: bb13, otherwise: bb14];
29+
_19 = copy (_1.0: &mut {async fn body of a<T>()});
30+
_18 = discriminant((*_19));
31+
switchInt(move _18) -> [0: bb9, 3: bb12, 4: bb13, otherwise: bb14];
3332
}
3433

3534
bb1: {
@@ -45,28 +44,28 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>)
4544

4645
bb3: {
4746
_0 = Poll::<()>::Pending;
48-
discriminant((*_20)) = 4;
47+
discriminant((*_19)) = 4;
4948
return;
5049
}
5150

5251
bb4: {
53-
StorageLive(_16);
54-
_15 = &mut (((*_20) as variant#4).1: impl std::future::Future<Output = ()>);
55-
_16 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _15) -> [return: bb7, unwind unreachable];
52+
StorageLive(_15);
53+
_14 = &mut (((*_19) as variant#4).1: impl std::future::Future<Output = ()>);
54+
_15 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _14) -> [return: bb7, unwind unreachable];
5655
}
5756

5857
bb5: {
5958
unreachable;
6059
}
6160

6261
bb6: {
63-
StorageDead(_16);
64-
_17 = discriminant(_9);
65-
switchInt(move _17) -> [0: bb1, 1: bb3, otherwise: bb5];
62+
StorageDead(_15);
63+
_16 = discriminant(_8);
64+
switchInt(move _16) -> [0: bb1, 1: bb3, otherwise: bb5];
6665
}
6766

6867
bb7: {
69-
_9 = <impl Future<Output = ()> as Future>::poll(move _16, move _14) -> [return: bb6, unwind unreachable];
68+
_8 = <impl Future<Output = ()> as Future>::poll(move _15, move _13) -> [return: bb6, unwind unreachable];
7069
}
7170

7271
bb8: {
@@ -83,7 +82,7 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>)
8382
}
8483

8584
bb11: {
86-
drop(((*_20).0: T)) -> [return: bb10, unwind unreachable];
85+
drop(((*_19).0: T)) -> [return: bb10, unwind unreachable];
8786
}
8887

8988
bb12: {

tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,33 @@
22

33
fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) -> Poll<()> {
44
debug _task_context => _2;
5-
debug x => ((*_20).0: T);
5+
debug x => ((*_19).0: T);
66
let mut _0: std::task::Poll<()>;
77
let _3: T;
88
let mut _4: impl std::future::Future<Output = ()>;
99
let mut _5: &mut T;
1010
let mut _6: std::pin::Pin<&mut T>;
1111
let mut _7: &mut T;
12-
let mut _8: *mut T;
13-
let mut _9: std::task::Poll<()>;
14-
let mut _10: &mut std::task::Context<'_>;
15-
let mut _11: &mut impl std::future::Future<Output = ()>;
16-
let mut _12: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
17-
let mut _13: isize;
18-
let mut _14: &mut std::task::Context<'_>;
19-
let mut _15: &mut impl std::future::Future<Output = ()>;
20-
let mut _16: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
21-
let mut _17: isize;
22-
let mut _18: ();
23-
let mut _19: u32;
24-
let mut _20: &mut {async fn body of a<T>()};
12+
let mut _8: std::task::Poll<()>;
13+
let mut _9: &mut std::task::Context<'_>;
14+
let mut _10: &mut impl std::future::Future<Output = ()>;
15+
let mut _11: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
16+
let mut _12: isize;
17+
let mut _13: &mut std::task::Context<'_>;
18+
let mut _14: &mut impl std::future::Future<Output = ()>;
19+
let mut _15: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
20+
let mut _16: isize;
21+
let mut _17: ();
22+
let mut _18: u32;
23+
let mut _19: &mut {async fn body of a<T>()};
2524
scope 1 {
26-
debug x => (((*_20) as variant#4).0: T);
25+
debug x => (((*_19) as variant#4).0: T);
2726
}
2827

2928
bb0: {
30-
_20 = copy (_1.0: &mut {async fn body of a<T>()});
31-
_19 = discriminant((*_20));
32-
switchInt(move _19) -> [0: bb12, 2: bb18, 3: bb16, 4: bb17, otherwise: bb19];
29+
_19 = copy (_1.0: &mut {async fn body of a<T>()});
30+
_18 = discriminant((*_19));
31+
switchInt(move _18) -> [0: bb12, 2: bb18, 3: bb16, 4: bb17, otherwise: bb19];
3332
}
3433

3534
bb1: {
@@ -59,28 +58,28 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>)
5958

6059
bb6: {
6160
_0 = Poll::<()>::Pending;
62-
discriminant((*_20)) = 4;
61+
discriminant((*_19)) = 4;
6362
return;
6463
}
6564

6665
bb7: {
67-
StorageLive(_16);
68-
_15 = &mut (((*_20) as variant#4).1: impl std::future::Future<Output = ()>);
69-
_16 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _15) -> [return: bb10, unwind: bb15];
66+
StorageLive(_15);
67+
_14 = &mut (((*_19) as variant#4).1: impl std::future::Future<Output = ()>);
68+
_15 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _14) -> [return: bb10, unwind: bb15];
7069
}
7170

7271
bb8: {
7372
unreachable;
7473
}
7574

7675
bb9: {
77-
StorageDead(_16);
78-
_17 = discriminant(_9);
79-
switchInt(move _17) -> [0: bb1, 1: bb6, otherwise: bb8];
76+
StorageDead(_15);
77+
_16 = discriminant(_8);
78+
switchInt(move _16) -> [0: bb1, 1: bb6, otherwise: bb8];
8079
}
8180

8281
bb10: {
83-
_9 = <impl Future<Output = ()> as Future>::poll(move _16, move _14) -> [return: bb9, unwind: bb3];
82+
_8 = <impl Future<Output = ()> as Future>::poll(move _15, move _13) -> [return: bb9, unwind: bb3];
8483
}
8584

8685
bb11: {
@@ -97,11 +96,11 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>)
9796
}
9897

9998
bb14: {
100-
drop(((*_20).0: T)) -> [return: bb13, unwind: bb4];
99+
drop(((*_19).0: T)) -> [return: bb13, unwind: bb4];
101100
}
102101

103102
bb15 (cleanup): {
104-
discriminant((*_20)) = 2;
103+
discriminant((*_19)) = 2;
105104
resume;
106105
}
107106

tests/mir-opt/async_drop_mir_pin.core.future-async_drop-async_drop_in_place-{closure#0}.[Foo;1].MentionedItems.after.mir

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn async_drop_in_place::{closure#0}(_1: {async fn body of async_drop_in_place<[F
44
yields ()
55
{
66
let mut _0: ();
7-
let mut _3: *mut [Foo; 1];
7+
let mut _3: &mut [Foo; 1];
88
let mut _4: *mut [Foo; 1];
99
let mut _5: *mut [Foo];
1010
let mut _6: usize;
@@ -18,16 +18,14 @@ yields ()
1818
let mut _14: std::pin::Pin<&mut Foo>;
1919
let mut _15: &mut Foo;
2020
let mut _16: *mut Foo;
21-
let mut _17: *mut Foo;
22-
let mut _18: bool;
23-
let mut _19: impl std::future::Future<Output = ()>;
24-
let mut _20: &mut Foo;
25-
let mut _21: std::pin::Pin<&mut Foo>;
26-
let mut _22: &mut Foo;
27-
let mut _23: *mut Foo;
21+
let mut _17: bool;
22+
let mut _18: impl std::future::Future<Output = ()>;
23+
let mut _19: &mut Foo;
24+
let mut _20: std::pin::Pin<&mut Foo>;
25+
let mut _21: &mut Foo;
2826

2927
bb0: {
30-
_3 = move (_1.0: *mut [Foo; 1]);
28+
_3 = move (_1.0: &mut [Foo; 1]);
3129
goto -> bb17;
3230
}
3331

@@ -47,7 +45,7 @@ yields ()
4745

4846
bb4 (cleanup): {
4947
StorageDead(_12);
50-
StorageDead(_19);
48+
StorageDead(_18);
5149
_9 = Eq(copy _7, copy _6);
5250
switchInt(move _9) -> [0: bb3, otherwise: bb2];
5351
}
@@ -60,7 +58,7 @@ yields ()
6058
}
6159

6260
bb6: {
63-
StorageDead(_19);
61+
StorageDead(_18);
6462
_11 = Eq(copy _7, copy _6);
6563
switchInt(move _11) -> [0: bb5, otherwise: bb1];
6664
}
@@ -76,37 +74,35 @@ yields ()
7674

7775
bb9: {
7876
_15 = copy (_14.0: &mut Foo);
79-
_16 = &raw mut (*_15);
8077
StorageLive(_12);
81-
_12 = async_drop_in_place::<Foo>(move _16) -> [return: bb8, unwind: bb4];
78+
_12 = async_drop_in_place::<Foo>(move _15) -> [return: bb8, unwind: bb4];
8279
}
8380

8481
bb10: {
85-
_17 = &raw mut (*_5)[_7];
82+
_16 = &raw mut (*_5)[_7];
8683
_7 = Add(move _7, const 1_usize);
87-
_20 = &mut (*_17);
88-
_21 = Pin::<&mut Foo>::new_unchecked(move _20) -> [return: bb14, unwind: bb4];
84+
_19 = &mut (*_16);
85+
_20 = Pin::<&mut Foo>::new_unchecked(move _19) -> [return: bb14, unwind: bb4];
8986
}
9087

9188
bb11: {
92-
_18 = Eq(copy _7, copy _6);
93-
switchInt(move _18) -> [0: bb10, otherwise: bb1];
89+
_17 = Eq(copy _7, copy _6);
90+
switchInt(move _17) -> [0: bb10, otherwise: bb1];
9491
}
9592

9693
bb12: {
97-
StorageDead(_19);
94+
StorageDead(_18);
9895
goto -> bb11;
9996
}
10097

10198
bb13: {
102-
async drop((*_17); poll=_19) -> [return: bb12, unwind: bb4, drop: bb6];
99+
async drop((*_16); poll=_18) -> [return: bb12, unwind: bb4, drop: bb6];
103100
}
104101

105102
bb14: {
106-
_22 = copy (_21.0: &mut Foo);
107-
_23 = &raw mut (*_22);
108-
StorageLive(_19);
109-
_19 = async_drop_in_place::<Foo>(move _23) -> [return: bb13, unwind: bb4];
103+
_21 = copy (_20.0: &mut Foo);
104+
StorageLive(_18);
105+
_18 = async_drop_in_place::<Foo>(move _21) -> [return: bb13, unwind: bb4];
110106
}
111107

112108
bb15: {

tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-abort.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `main::{closure#0}` 0 coroutine_drop
22

3-
fn main::{closure#0}(_1: *mut {coroutine@$DIR/coroutine_drop_cleanup.rs:12:5: 12:7}) -> () {
3+
fn main::{closure#0}(_1: &mut {coroutine@$DIR/coroutine_drop_cleanup.rs:12:5: 12:7}) -> () {
44
let mut _0: ();
55
let mut _2: ();
66
let _3: std::string::String;

tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-unwind.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MIR for `main::{closure#0}` 0 coroutine_drop
22

3-
fn main::{closure#0}(_1: *mut {coroutine@$DIR/coroutine_drop_cleanup.rs:12:5: 12:7}) -> () {
3+
fn main::{closure#0}(_1: &mut {coroutine@$DIR/coroutine_drop_cleanup.rs:12:5: 12:7}) -> () {
44
let mut _0: ();
55
let mut _2: ();
66
let _3: std::string::String;

0 commit comments

Comments
 (0)