Skip to content

Commit b7f0509

Browse files
committed
Bless mir-opt tests.
1 parent 2b2dc5c commit b7f0509

File tree

3 files changed

+94
-18
lines changed

3 files changed

+94
-18
lines changed

src/test/mir-opt/inline/cycle.g.Inline.diff

+37-4
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,55 @@
44
fn g() -> () {
55
let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:11:8: 11:8
66
let _1: (); // in scope 0 at $DIR/cycle.rs:12:5: 12:12
7+
+ let mut _2: fn() {main}; // in scope 0 at $DIR/cycle.rs:12:5: 12:12
8+
+ let mut _5: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8
9+
+ scope 1 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
10+
+ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7
11+
+ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
12+
+ let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6
13+
+ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
14+
+ }
15+
+ }
716

817
bb0: {
918
StorageLive(_1); // scope 0 at $DIR/cycle.rs:12:5: 12:12
10-
_1 = f::<fn() {main}>(main) -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 12:12
11-
// mir::Constant
12-
// + span: $DIR/cycle.rs:12:5: 12:6
13-
// + literal: Const { ty: fn(fn() {main}) {f::<fn() {main}>}, val: Value(Scalar(<ZST>)) }
19+
- _1 = f::<fn() {main}>(main) -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 12:12
20+
+ StorageLive(_2); // scope 0 at $DIR/cycle.rs:12:5: 12:12
21+
+ _2 = main; // scope 0 at $DIR/cycle.rs:12:5: 12:12
1422
// mir::Constant
23+
- // + span: $DIR/cycle.rs:12:5: 12:6
24+
- // + literal: Const { ty: fn(fn() {main}) {f::<fn() {main}>}, val: Value(Scalar(<ZST>)) }
25+
- // mir::Constant
1526
// + span: $DIR/cycle.rs:12:7: 12:11
1627
// + literal: Const { ty: fn() {main}, val: Value(Scalar(<ZST>)) }
28+
+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
29+
+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6
30+
+ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6
31+
+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
32+
+ _5 = const (); // scope 1 at $DIR/cycle.rs:6:5: 6:8
33+
+ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL
1734
}
1835

1936
bb1: {
37+
+ StorageDead(_2); // scope 0 at $DIR/cycle.rs:12:5: 12:12
2038
StorageDead(_1); // scope 0 at $DIR/cycle.rs:12:12: 12:13
2139
_0 = const (); // scope 0 at $DIR/cycle.rs:11:8: 13:2
2240
return; // scope 0 at $DIR/cycle.rs:13:2: 13:2
41+
+ }
42+
+
43+
+ bb2 (cleanup): {
44+
+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
45+
+ }
46+
+
47+
+ bb3 (cleanup): {
48+
+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
49+
+ }
50+
+
51+
+ bb4: {
52+
+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
53+
+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
54+
+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9
55+
+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
2356
}
2457
}
2558

src/test/mir-opt/inline/cycle.main.Inline.diff

+54-4
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,72 @@
44
fn main() -> () {
55
let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:16:11: 16:11
66
let _1: (); // in scope 0 at $DIR/cycle.rs:17:5: 17:9
7+
+ let mut _2: fn() {g}; // in scope 0 at $DIR/cycle.rs:17:5: 17:9
8+
+ let mut _5: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8
9+
+ scope 1 (inlined f::<fn() {g}>) { // at $DIR/cycle.rs:17:5: 17:9
10+
+ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7
11+
+ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
12+
+ let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6
13+
+ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8
14+
+ scope 3 (inlined g) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
15+
+ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:12:5: 12:12
16+
+ scope 4 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
17+
+ debug g => _6; // in scope 4 at $DIR/cycle.rs:5:6: 5:7
18+
+ let _7: (); // in scope 4 at $DIR/cycle.rs:6:5: 6:8
19+
+ let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:6:5: 6:6
20+
+ scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
21+
+ }
22+
+ }
23+
+ }
24+
+ }
25+
+ }
726

827
bb0: {
928
StorageLive(_1); // scope 0 at $DIR/cycle.rs:17:5: 17:9
10-
_1 = f::<fn() {g}>(g) -> bb1; // scope 0 at $DIR/cycle.rs:17:5: 17:9
11-
// mir::Constant
12-
// + span: $DIR/cycle.rs:17:5: 17:6
13-
// + literal: Const { ty: fn(fn() {g}) {f::<fn() {g}>}, val: Value(Scalar(<ZST>)) }
29+
- _1 = f::<fn() {g}>(g) -> bb1; // scope 0 at $DIR/cycle.rs:17:5: 17:9
30+
+ StorageLive(_2); // scope 0 at $DIR/cycle.rs:17:5: 17:9
31+
+ _2 = g; // scope 0 at $DIR/cycle.rs:17:5: 17:9
1432
// mir::Constant
33+
- // + span: $DIR/cycle.rs:17:5: 17:6
34+
- // + literal: Const { ty: fn(fn() {g}) {f::<fn() {g}>}, val: Value(Scalar(<ZST>)) }
35+
- // mir::Constant
1536
// + span: $DIR/cycle.rs:17:7: 17:8
1637
// + literal: Const { ty: fn() {g}, val: Value(Scalar(<ZST>)) }
38+
+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
39+
+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6
40+
+ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6
41+
+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
42+
+ _5 = const (); // scope 1 at $DIR/cycle.rs:6:5: 6:8
43+
+ StorageLive(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12
44+
+ StorageLive(_7); // scope 4 at $DIR/cycle.rs:6:5: 6:8
45+
+ StorageLive(_8); // scope 4 at $DIR/cycle.rs:6:5: 6:6
46+
+ _8 = &_6; // scope 4 at $DIR/cycle.rs:6:5: 6:6
47+
+ _7 = move (*_8)() -> [return: bb4, unwind: bb2]; // scope 5 at $SRC_DIR/core/src/ops/function.rs:LL:COL
1748
}
1849

1950
bb1: {
51+
+ StorageDead(_2); // scope 0 at $DIR/cycle.rs:17:5: 17:9
2052
StorageDead(_1); // scope 0 at $DIR/cycle.rs:17:9: 17:10
2153
_0 = const (); // scope 0 at $DIR/cycle.rs:16:11: 18:2
2254
return; // scope 0 at $DIR/cycle.rs:18:2: 18:2
55+
+ }
56+
+
57+
+ bb2 (cleanup): {
58+
+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
59+
+ }
60+
+
61+
+ bb3 (cleanup): {
62+
+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
63+
+ }
64+
+
65+
+ bb4: {
66+
+ StorageDead(_8); // scope 4 at $DIR/cycle.rs:6:7: 6:8
67+
+ StorageDead(_7); // scope 4 at $DIR/cycle.rs:6:8: 6:9
68+
+ StorageDead(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12
69+
+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
70+
+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
71+
+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9
72+
+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
2373
}
2474
}
2575

src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff

+3-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,13 @@
44
fn main() -> () {
55
let mut _0: (); // return place in scope 0 at $DIR/inline-cycle-generic.rs:8:11: 8:11
66
let _1: (); // in scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24
7-
+ scope 1 (inlined <C as Call>::call) { // at $DIR/inline-cycle-generic.rs:9:5: 9:24
8-
+ scope 2 (inlined <B<A> as Call>::call) { // at $DIR/inline-cycle-generic.rs:38:9: 38:31
9-
+ }
10-
+ }
117

128
bb0: {
139
StorageLive(_1); // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24
14-
- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24
15-
+ _1 = <A as Call>::call() -> bb1; // scope 2 at $DIR/inline-cycle-generic.rs:31:9: 31:28
10+
_1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24
1611
// mir::Constant
17-
- // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22
18-
- // + literal: Const { ty: fn() {<C as Call>::call}, val: Value(Scalar(<ZST>)) }
19-
+ // + span: $DIR/inline-cycle-generic.rs:31:9: 31:26
20-
+ // + literal: Const { ty: fn() {<A as Call>::call}, val: Value(Scalar(<ZST>)) }
12+
// + span: $DIR/inline-cycle-generic.rs:9:5: 9:22
13+
// + literal: Const { ty: fn() {<C as Call>::call}, val: Value(Scalar(<ZST>)) }
2114
}
2215

2316
bb1: {

0 commit comments

Comments
 (0)