Skip to content

Commit a030c92

Browse files
committed
Bless mir-opt tests
1 parent 1a19c1d commit a030c92

File tree

46 files changed

+820
-974
lines changed

Some content is hidden

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

46 files changed

+820
-974
lines changed

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

+23-23
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,14 @@ fn main() -> () {
4747
StorageLive(_5); // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
4848
StorageLive(_6); // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
4949
_6 = move _4; // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
50-
replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
50+
replace(_5 <- move _6) -> [return: bb1, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
5151
}
5252

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

5757
bb2: {
58-
drop(_6) -> [return: bb6, unwind: bb4]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
59-
}
60-
61-
bb3 (cleanup): {
62-
drop(_4) -> bb1; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
63-
}
64-
65-
bb4 (cleanup): {
66-
drop(_5) -> bb3; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
67-
}
68-
69-
bb5 (cleanup): {
70-
drop(_6) -> bb4; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
71-
}
72-
73-
bb6: {
7458
StorageDead(_6); // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
7559
_0 = const (); // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
7660
// ty::Const
@@ -79,18 +63,34 @@ fn main() -> () {
7963
// mir::Constant
8064
// + span: $DIR/basic_assignment.rs:10:11: 24:2
8165
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
82-
drop(_5) -> [return: bb7, unwind: bb3]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
66+
drop(_5) -> [return: bb3, unwind: bb7]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
8367
}
8468

85-
bb7: {
69+
bb3: {
8670
StorageDead(_5); // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
87-
drop(_4) -> [return: bb8, unwind: bb1]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
71+
drop(_4) -> [return: bb4, unwind: bb8]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
8872
}
8973

90-
bb8: {
74+
bb4: {
9175
StorageDead(_4); // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
9276
StorageDead(_2); // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
9377
StorageDead(_1); // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
9478
return; // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
9579
}
80+
81+
bb5 (cleanup): {
82+
drop(_6) -> bb6; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
83+
}
84+
85+
bb6 (cleanup): {
86+
drop(_5) -> bb7; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
87+
}
88+
89+
bb7 (cleanup): {
90+
drop(_4) -> bb8; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
91+
}
92+
93+
bb8 (cleanup): {
94+
resume; // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
95+
}
9696
}

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

+20-20
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ 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) = const S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
17+
(*_2) = const S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
1818
// ty::Const
1919
// + ty: fn() -> S {S::new}
2020
// + val: Value(Scalar(<ZST>))
@@ -23,25 +23,17 @@ fn main() -> () {
2323
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
2424
}
2525

26-
bb1 (cleanup): {
27-
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
28-
}
29-
30-
bb2: {
26+
bb1: {
3127
_1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
32-
drop(_2) -> bb4; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
33-
}
34-
35-
bb3 (cleanup): {
36-
drop(_2) -> bb1; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
28+
drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
3729
}
3830

39-
bb4: {
31+
bb2: {
4032
StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
4133
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
4234
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
4335
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
44-
_3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
36+
_3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
4537
// ty::Const
4638
// + ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}
4739
// + val: Value(Scalar(<ZST>))
@@ -50,7 +42,7 @@ fn main() -> () {
5042
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
5143
}
5244

53-
bb5: {
45+
bb3: {
5446
StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
5547
StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
5648
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
@@ -60,19 +52,27 @@ fn main() -> () {
6052
// mir::Constant
6153
// + span: $DIR/box_expr.rs:6:11: 9:2
6254
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
63-
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
55+
drop(_1) -> bb4; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
56+
}
57+
58+
bb4: {
59+
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
60+
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
61+
}
62+
63+
bb5 (cleanup): {
64+
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
6465
}
6566

6667
bb6 (cleanup): {
67-
drop(_1) -> bb1; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
68+
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
6869
}
6970

7071
bb7 (cleanup): {
71-
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
72+
drop(_2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
7273
}
7374

74-
bb8: {
75-
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
76-
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
75+
bb8 (cleanup): {
76+
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
7777
}
7878
}

src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), [], 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 = const 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 = const 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
// ty::Const
3838
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
3939
// + val: Value(Scalar(<ZST>))
@@ -42,15 +42,15 @@
4242
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
4343
}
4444

45-
bb1 (cleanup): {
46-
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
47-
}
48-
49-
bb2: {
45+
bb1: {
5046
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
5147
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
5248
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
5349
}
50+
51+
bb2 (cleanup): {
52+
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
53+
}
5454
- }
5555
-
5656
- alloc0 (static: Y, size: 4, align: 4) {

src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), [], 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 = const 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 = const 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
// ty::Const
4040
// + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
4141
// + val: Value(Scalar(<ZST>))
@@ -44,15 +44,15 @@
4444
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
4545
}
4646

47-
bb1 (cleanup): {
48-
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
49-
}
50-
51-
bb2: {
47+
bb1: {
5248
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
5349
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
5450
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
5551
}
52+
53+
bb2 (cleanup): {
54+
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
55+
}
5656
}
5757
-
5858
- alloc2 (extern static: X)

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@
3535
// + span: $DIR/boxes.rs:12:25: 12:26
3636
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
3737
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
38-
drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
38+
drop(_3) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
3939
}
4040

41-
bb1 (cleanup): {
42-
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
43-
}
44-
45-
bb2: {
41+
bb1: {
4642
StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
4743
_0 = const (); // scope 0 at $DIR/boxes.rs:11:11: 13:2
4844
// ty::Const
@@ -54,5 +50,9 @@
5450
StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
5551
return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
5652
}
53+
54+
bb2 (cleanup): {
55+
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
56+
}
5757
}
5858

src/test/mir-opt/generator-drop-cleanup/rustc.main-{{closure}}.generator_drop.0.mir

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

2222
bb0: {
2323
_9 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
24-
switchInt(move _9) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
24+
switchInt(move _9) -> [0u32: bb7, 3u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
2525
}
2626

27-
bb1 (cleanup): {
28-
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
27+
bb1: {
28+
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
29+
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
30+
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
2931
}
3032

31-
bb2 (cleanup): {
33+
bb2: {
3234
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
3335
goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
3436
}
3537

3638
bb3: {
37-
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
38-
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
39-
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
39+
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
4040
}
4141

42-
bb4: {
43-
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
44-
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
42+
bb4 (cleanup): {
43+
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
4544
}
4645

47-
bb5: {
48-
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
46+
bb5 (cleanup): {
47+
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
48+
goto -> bb4; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
4949
}
5050

5151
bb6: {
5252
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
5353
}
5454

5555
bb7: {
56-
goto -> bb10; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
56+
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
5757
}
5858

59-
bb8 (cleanup): {
60-
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
59+
bb8: {
60+
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
6161
}
6262

6363
bb9: {
64-
goto -> bb5; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
65-
}
66-
67-
bb10: {
6864
goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
6965
}
7066

71-
bb11: {
67+
bb10: {
7268
StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
7369
StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
74-
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
70+
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
7571
}
7672

77-
bb12: {
73+
bb11: {
7874
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
7975
}
8076
}

0 commit comments

Comments
 (0)