Skip to content

Commit ab64580

Browse files
committed
Bless tests
1 parent 19eaee2 commit ab64580

10 files changed

+342
-213
lines changed

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

+40-26
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,78 @@
33
fn main() -> () {
44
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:6:11: 6:11
55
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:9: 7:10
6-
let mut _2: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
7-
let _3: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
8-
let mut _4: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
6+
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
7+
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
8+
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
9+
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
10+
let _6: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
11+
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
912
scope 1 {
1013
debug x => _1; // in scope 1 at $DIR/box_expr.rs:7:9: 7:10
1114
}
15+
scope 2 {
16+
}
1217

1318
bb0: {
1419
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
15-
StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
16-
_2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
17-
(*_2) = S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
20+
_2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
21+
_3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
22+
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:7:13: 7:25
1823
// mir::Constant
19-
// + span: $DIR/box_expr.rs:7:17: 7:23
20-
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
24+
// + span: $DIR/box_expr.rs:7:13: 7:25
25+
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
2126
}
2227

2328
bb1: {
24-
_1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
25-
drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
29+
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
30+
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
31+
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
32+
// mir::Constant
33+
// + span: $DIR/box_expr.rs:7:17: 7:23
34+
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
2635
}
2736

2837
bb2: {
29-
StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
30-
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
31-
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
32-
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
33-
_3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
38+
_1 = move _5; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
39+
drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
40+
}
41+
42+
bb3: {
43+
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
44+
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
45+
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
46+
_7 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
47+
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
3448
// mir::Constant
3549
// + span: $DIR/box_expr.rs:8:5: 8:9
3650
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
3751
}
3852

39-
bb3: {
40-
StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
41-
StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
53+
bb4: {
54+
StorageDead(_7); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
55+
StorageDead(_6); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
4256
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
43-
drop(_1) -> bb4; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
57+
drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
4458
}
4559

46-
bb4: {
60+
bb5: {
4761
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
4862
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
4963
}
5064

51-
bb5 (cleanup): {
52-
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
53-
}
54-
5565
bb6 (cleanup): {
56-
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
66+
drop(_7) -> bb7; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
5767
}
5868

5969
bb7 (cleanup): {
60-
drop(_2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
70+
drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
6171
}
6272

6373
bb8 (cleanup): {
74+
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
75+
}
76+
77+
bb9 (cleanup): {
6478
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
6579
}
6680
}

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

+26-9
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,51 @@
66
let _1: i32; // in scope 0 at $DIR/boxes.rs:12:9: 12:10
77
let mut _2: i32; // in scope 0 at $DIR/boxes.rs:12:13: 12:22
88
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
9-
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
9+
let mut _4: usize; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
10+
let mut _5: usize; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
11+
let mut _6: *mut u8; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
12+
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
1013
scope 1 {
1114
debug x => _1; // in scope 1 at $DIR/boxes.rs:12:9: 12:10
1215
}
16+
scope 2 {
17+
}
1318

1419
bb0: {
1520
StorageLive(_1); // scope 0 at $DIR/boxes.rs:12:9: 12:10
1621
StorageLive(_2); // scope 0 at $DIR/boxes.rs:12:13: 12:22
1722
StorageLive(_3); // scope 0 at $DIR/boxes.rs:12:14: 12:22
18-
StorageLive(_4); // scope 0 at $DIR/boxes.rs:12:14: 12:22
19-
_4 = Box(i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
20-
(*_4) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
21-
_3 = move _4; // scope 0 at $DIR/boxes.rs:12:14: 12:22
22-
StorageDead(_4); // scope 0 at $DIR/boxes.rs:12:21: 12:22
23+
- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:12:14: 12:22
24+
- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:12:14: 12:22
25+
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
26+
+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:12:14: 12:22
27+
+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:12:14: 12:22
28+
+ _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
29+
// mir::Constant
30+
// + span: $DIR/boxes.rs:12:14: 12:22
31+
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
32+
}
33+
34+
bb1: {
35+
StorageLive(_7); // scope 0 at $DIR/boxes.rs:12:14: 12:22
36+
_7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
37+
(*_7) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
38+
_3 = move _7; // scope 0 at $DIR/boxes.rs:12:14: 12:22
39+
StorageDead(_7); // scope 0 at $DIR/boxes.rs:12:21: 12:22
2340
_2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22
2441
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26
2542
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
26-
drop(_3) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
43+
drop(_3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
2744
}
2845

29-
bb1: {
46+
bb2: {
3047
StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
3148
nop; // scope 0 at $DIR/boxes.rs:11:11: 13:2
3249
StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
3350
return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
3451
}
3552

36-
bb2 (cleanup): {
53+
bb3 (cleanup): {
3754
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
3855
}
3956
}

src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff

+37-23
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,37 @@
44
fn main() -> () {
55
let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
66
let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
7-
let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
8-
let mut _3: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
9-
+ let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
7+
let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
8+
let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
9+
let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
10+
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
11+
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
12+
+ let mut _7: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
1013
scope 1 {
1114
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:8:9: 8:11
1215
}
13-
+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
16+
scope 2 {
17+
}
18+
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
1419
+ }
1520

1621
bb0: {
1722
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
18-
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
19-
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
20-
- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
21-
+ StorageLive(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
22-
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
23-
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
23+
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
24+
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
25+
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
26+
// mir::Constant
27+
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
28+
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
29+
}
30+
31+
bb1: {
32+
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
33+
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
34+
- (*_5) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
35+
+ StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
36+
+ _7 = &mut (*_5); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
37+
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
2438
+ // ty::Const
2539
+ // + ty: alloc::raw_vec::RawVec<u32>
2640
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
@@ -30,32 +44,32 @@
3044
- // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
3145
- }
3246
-
33-
- bb1: {
47+
- bb2: {
3448
+ // + span: $DIR/inline-into-box-place.rs:8:33: 8:43
3549
+ // + user_ty: UserType(0)
3650
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
37-
+ ((*_4).1: usize) = const 0_usize; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
38-
+ StorageDead(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
39-
_1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
40-
StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
51+
+ ((*_7).1: usize) = const 0_usize; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
52+
+ StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
53+
_1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
54+
StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
4155
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
42-
- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
43-
+ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
56+
- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
57+
+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
4458
}
4559

46-
- bb2: {
47-
+ bb1: {
60+
- bb3: {
61+
+ bb2: {
4862
StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
4963
return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
5064
}
5165

52-
- bb3 (cleanup): {
53-
+ bb2 (cleanup): {
66+
- bb4 (cleanup): {
67+
+ bb3 (cleanup): {
5468
resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
5569
- }
5670
-
57-
- bb4 (cleanup): {
58-
- _3 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_2.1: std::alloc::Global)) -> bb3; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
71+
- bb5 (cleanup): {
72+
- _6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
5973
- // mir::Constant
6074
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
6175
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<std::vec::Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }

0 commit comments

Comments
 (0)