Skip to content

Commit 33337bb

Browse files
committed
Bless mir-opt tests
1 parent 8478385 commit 33337bb

File tree

62 files changed

+827
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+827
-1003
lines changed

src/test/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir

+21-21
Original file line numberDiff line numberDiff line change
@@ -41,44 +41,44 @@ fn main() -> () {
4141
StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
4242
StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
4343
_6 = move _4; // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
44-
replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
44+
replace(_5 <- move _6) -> [return: bb1, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
4545
}
4646

47-
bb1 (cleanup): {
48-
resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
47+
bb1: {
48+
drop(_6) -> [return: bb2, unwind: bb6]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
4949
}
5050

5151
bb2: {
52-
drop(_6) -> [return: bb6, unwind: bb4]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
52+
StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
53+
_0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
54+
drop(_5) -> [return: bb3, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
5355
}
5456

55-
bb3 (cleanup): {
56-
drop(_4) -> bb1; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
57+
bb3: {
58+
StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
59+
drop(_4) -> [return: bb4, unwind: bb8]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
5760
}
5861

59-
bb4 (cleanup): {
60-
drop(_5) -> bb3; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
62+
bb4: {
63+
StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
64+
StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
65+
StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
66+
return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
6167
}
6268

6369
bb5 (cleanup): {
64-
drop(_6) -> bb4; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
70+
drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
6571
}
6672

67-
bb6: {
68-
StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
69-
_0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
70-
drop(_5) -> [return: bb7, unwind: bb3]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
73+
bb6 (cleanup): {
74+
drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
7175
}
7276

73-
bb7: {
74-
StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
75-
drop(_4) -> [return: bb8, unwind: bb1]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
77+
bb7 (cleanup): {
78+
drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
7679
}
7780

78-
bb8: {
79-
StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
80-
StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
81-
StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
82-
return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
81+
bb8 (cleanup): {
82+
resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
8383
}
8484
}

src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir

+20-20
Original file line numberDiff line numberDiff line change
@@ -14,53 +14,53 @@ fn main() -> () {
1414
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
1515
StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
1616
_2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
17-
(*_2) = S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
17+
(*_2) = S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
1818
// mir::Constant
1919
// + span: $DIR/box_expr.rs:7:17: 7:23
2020
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
2121
}
2222

23-
bb1 (cleanup): {
24-
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
25-
}
26-
27-
bb2: {
23+
bb1: {
2824
_1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
29-
drop(_2) -> bb4; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
30-
}
31-
32-
bb3 (cleanup): {
33-
drop(_2) -> bb1; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
25+
drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
3426
}
3527

36-
bb4: {
28+
bb2: {
3729
StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
3830
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
3931
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
4032
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
41-
_3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
33+
_3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
4234
// mir::Constant
4335
// + span: $DIR/box_expr.rs:8:5: 8:9
4436
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
4537
}
4638

47-
bb5: {
39+
bb3: {
4840
StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
4941
StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
5042
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
51-
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
43+
drop(_1) -> bb4; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
44+
}
45+
46+
bb4: {
47+
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
48+
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
49+
}
50+
51+
bb5 (cleanup): {
52+
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
5253
}
5354

5455
bb6 (cleanup): {
55-
drop(_1) -> bb1; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
56+
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
5657
}
5758

5859
bb7 (cleanup): {
59-
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
60+
drop(_2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
6061
}
6162

62-
bb8: {
63-
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
64-
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
63+
bb8 (cleanup): {
64+
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
6565
}
6666
}

src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@
3333
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[317d]::BAR), const_param_did: None }, [], Some(promoted[0])) }
3434
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
3535
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
36-
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
36+
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
3737
// mir::Constant
3838
// + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42
3939
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
4040
}
4141

42-
bb1 (cleanup): {
43-
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
44-
}
45-
46-
bb2: {
42+
bb1: {
4743
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
4844
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
4945
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
5046
}
47+
48+
bb2 (cleanup): {
49+
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
50+
}
5151
- }
5252
-
5353
- alloc0 (static: Y, size: 4, align: 4) {

src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@
3535
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[317d]::FOO), const_param_did: None }, [], Some(promoted[0])) }
3636
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
3737
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
38-
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
38+
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
3939
// mir::Constant
4040
// + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53
4141
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
4242
}
4343

44-
bb1 (cleanup): {
45-
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
46-
}
47-
48-
bb2: {
44+
bb1: {
4945
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
5046
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
5147
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
5248
}
49+
50+
bb2 (cleanup): {
51+
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
52+
}
5353
}
5454
-
5555
- alloc2 (extern static: X)

src/test/mir-opt/const_prop/boxes.main.ConstProp.diff

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
_2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22
2424
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26
2525
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
26-
drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
26+
drop(_3) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
2727
}
2828

29-
bb1 (cleanup): {
30-
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
31-
}
32-
33-
bb2: {
29+
bb1: {
3430
StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
3531
_0 = const (); // scope 0 at $DIR/boxes.rs:11:11: 13:2
3632
StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
3733
return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
3834
}
35+
36+
bb2 (cleanup): {
37+
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
38+
}
3939
}
4040

src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyBranches-after-copy-prop.after.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2
110110
+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7
111111
+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2
112-
return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:14: 27:28
112+
return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2
113113
}
114114

115115
+ bb2: {

src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:27: 27:28
9090
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:28:6: 28:7
9191
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:1: 29:2
92-
return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:27:14: 27:28
92+
return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:29:2: 29:2
9393
}
9494

9595
- bb3: {

src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir

+18-22
Original file line numberDiff line numberDiff line change
@@ -34,60 +34,56 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
3434

3535
bb0: {
3636
_9 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
37-
switchInt(move _9) -> [0_u32: bb7, 3_u32: bb11, otherwise: bb12]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
37+
switchInt(move _9) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
3838
}
3939

40-
bb1 (cleanup): {
41-
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
40+
bb1: {
41+
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
42+
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
43+
drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
4244
}
4345

44-
bb2 (cleanup): {
46+
bb2: {
4547
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
4648
goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
4749
}
4850

4951
bb3: {
50-
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
51-
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
52-
drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
52+
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
5353
}
5454

55-
bb4: {
56-
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
57-
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
55+
bb4 (cleanup): {
56+
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
5857
}
5958

60-
bb5: {
61-
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
59+
bb5 (cleanup): {
60+
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
61+
goto -> bb4; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
6262
}
6363

6464
bb6: {
6565
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
6666
}
6767

6868
bb7: {
69-
goto -> bb10; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
69+
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
7070
}
7171

72-
bb8 (cleanup): {
73-
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
72+
bb8: {
73+
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
7474
}
7575

7676
bb9: {
77-
goto -> bb5; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
78-
}
79-
80-
bb10: {
8177
goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
8278
}
8379

84-
bb11: {
80+
bb10: {
8581
StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
8682
StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
87-
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
83+
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
8884
}
8985

90-
bb12: {
86+
bb11: {
9187
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
9288
}
9389
}

0 commit comments

Comments
 (0)