Skip to content

Commit 43b457f

Browse files
committed
Bless tests
1 parent e3b7ab9 commit 43b457f

21 files changed

+327
-335
lines changed

tests/coverage/closure.cov-map

+10-8
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,19 @@ Number of file 0 mappings: 6
140140
- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
141141
Highest counter ID seen: c1
142142

143-
Function name: closure::main::{closure#18} (unused)
144-
Raw bytes (24): 0x[01, 01, 00, 04, 00, 19, 0d, 02, 1c, 00, 02, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 01, 0e]
143+
Function name: closure::main::{closure#18}
144+
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 19, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e]
145145
Number of files: 1
146146
- file 0 => global file 1
147-
Number of expressions: 0
147+
Number of expressions: 1
148+
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
148149
Number of file 0 mappings: 4
149-
- Code(Zero) at (prev + 25, 13) to (start + 2, 28)
150-
- Code(Zero) at (prev + 2, 29) to (start + 2, 18)
151-
- Code(Zero) at (prev + 2, 17) to (start + 0, 18)
152-
- Code(Zero) at (prev + 1, 17) to (start + 1, 14)
153-
Highest counter ID seen: (none)
150+
- Code(Counter(0)) at (prev + 25, 13) to (start + 2, 28)
151+
- Code(Counter(1)) at (prev + 2, 29) to (start + 2, 18)
152+
- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18)
153+
= (c0 - c1)
154+
- Code(Counter(0)) at (prev + 1, 17) to (start + 1, 14)
155+
Highest counter ID seen: c1
154156

155157
Function name: closure::main::{closure#19}
156158
Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 43, 0d, 02, 1c, 05, 02, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 01, 0e]

tests/coverage/issue-84561.cov-map

+93-109
Large diffs are not rendered by default.

tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff

+9-5
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@
1414

1515
bb0: {
1616
StorageLive(_1);
17-
StorageLive(_2);
17+
- StorageLive(_2);
1818
- StorageLive(_3);
19+
+ nop;
1920
+ nop;
2021
_3 = const {ALLOC0: &u8};
21-
_2 = copy (*_3);
22+
- _2 = copy (*_3);
23+
+ _2 = const 2_u8;
2224
StorageLive(_4);
2325
StorageLive(_5);
2426
_5 = const {ALLOC0: &u8};
2527
- _4 = copy (*_5);
26-
+ _4 = copy (*_3);
27-
_1 = Add(move _2, move _4);
28+
- _1 = Add(move _2, move _4);
29+
+ _4 = const 2_u8;
30+
+ _1 = const 4_u8;
2831
StorageDead(_4);
29-
StorageDead(_2);
32+
- StorageDead(_2);
33+
+ nop;
3034
StorageDead(_5);
3135
- StorageDead(_3);
3236
+ nop;

tests/mir-opt/const_prop/read_immutable_static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ static FOO: u8 = 2;
66
fn main() {
77
// CHECK-LABEL: fn main(
88
// CHECK: debug x => [[x:_.*]];
9-
// CHECK-NOT: [[x]] = const 4_u8;
9+
// CHECK: [[x]] = const 4_u8;
1010
let x = FOO + FOO;
1111
}

tests/mir-opt/const_prop/ref_deref.main.GVN.diff

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
StorageLive(_2);
1717
_4 = const main::promoted[0];
1818
_2 = &(*_4);
19-
_1 = copy (*_2);
19+
- _1 = copy (*_2);
20+
+ _1 = const 4_i32;
2021
StorageDead(_2);
2122
_0 = const ();
2223
StorageDead(_1);

tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
StorageLive(_2);
1717
_4 = const main::promoted[0];
1818
_2 = &((*_4).1: i32);
19-
_1 = copy (*_2);
19+
- _1 = copy (*_2);
20+
+ _1 = const 5_i32;
2021
StorageDead(_2);
2122
_0 = const ();
2223
StorageDead(_1);

tests/mir-opt/const_prop/ref_deref_project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
fn main() {
66
// CHECK-LABEL: fn main(
77
// CHECK: debug a => [[a:_.*]];
8-
// CHECK-NOT: [[a]] = const 5_i32;
8+
// CHECK: [[a]] = const 5_i32;
99
let a = *(&(4, 5).1);
1010
}

tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
bb1: {
4242
- _1 = copy (*_2)[_6];
43-
+ _1 = copy (*_2)[1 of 2];
43+
+ _1 = const 2_u32;
4444
StorageDead(_6);
4545
StorageDead(_4);
4646
StorageDead(_2);

tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
bb1: {
4242
- _1 = copy (*_2)[_6];
43-
+ _1 = copy (*_2)[1 of 2];
43+
+ _1 = const 2_u32;
4444
StorageDead(_6);
4545
StorageDead(_4);
4646
StorageDead(_2);

tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
bb1: {
4242
- _1 = copy (*_2)[_6];
43-
+ _1 = copy (*_2)[1 of 2];
43+
+ _1 = const 2_u32;
4444
StorageDead(_6);
4545
StorageDead(_4);
4646
StorageDead(_2);

tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
bb1: {
4242
- _1 = copy (*_2)[_6];
43-
+ _1 = copy (*_2)[1 of 2];
43+
+ _1 = const 2_u32;
4444
StorageDead(_6);
4545
StorageDead(_4);
4646
StorageDead(_2);

tests/mir-opt/const_prop/slice_len.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
// CHECK-LABEL: fn main(
99
// CHECK: debug a => [[a:_.*]];
1010
// CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize, AsCast));
11-
// CHECK-NOT: assert(const true,
12-
// CHECK-NOT: [[a]] = const 2_u32;
11+
// CHECK: assert(const true,
12+
// CHECK: [[a]] = const 2_u32;
1313
let a = (&[1u32, 2, 3] as &[u32])[1];
1414
}

tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
}
1919

2020
bb2: {
21-
_0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind unreachable];
21+
- _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind unreachable];
22+
+ _0 = opaque::<T>(copy _1) -> [return: bb3, unwind unreachable];
2223
}
2324

2425
bb3: {

tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
}
1919

2020
bb2: {
21-
_0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind continue];
21+
- _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind continue];
22+
+ _0 = opaque::<T>(copy _1) -> [return: bb3, unwind continue];
2223
}
2324

2425
bb3: {

tests/mir-opt/gvn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ fn borrowed<T: Copy + Freeze>(x: T) {
742742
// CHECK: bb1: {
743743
// CHECK-NEXT: _0 = opaque::<T>(copy _1)
744744
// CHECK: bb2: {
745-
// CHECK-NEXT: _0 = opaque::<T>(copy (*_3))
745+
// CHECK-NEXT: _0 = opaque::<T>(copy _1)
746746
mir! {
747747
{
748748
let a = x;

tests/mir-opt/gvn.slices.GVN.panic-abort.diff

+24-14
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@
111111
StorageLive(_7);
112112
StorageLive(_8);
113113
- StorageLive(_9);
114+
- StorageLive(_10);
115+
+ nop;
114116
+ nop;
115-
StorageLive(_10);
116117
StorageLive(_11);
117118
_11 = &(*_1);
118119
_10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind unreachable];
@@ -122,8 +123,9 @@
122123
StorageDead(_11);
123124
_9 = &_10;
124125
- StorageLive(_12);
126+
- StorageLive(_13);
127+
+ nop;
125128
+ nop;
126-
StorageLive(_13);
127129
StorageLive(_14);
128130
- _14 = &(*_4);
129131
+ _14 = &(*_1);
@@ -148,11 +150,12 @@
148150
StorageLive(_17);
149151
StorageLive(_18);
150152
- _18 = copy (*_15);
151-
+ _18 = copy (*_9);
153+
+ _18 = copy _10;
152154
StorageLive(_19);
153155
- _19 = copy (*_16);
154-
+ _19 = copy (*_12);
155-
_17 = Eq(move _18, move _19);
156+
- _17 = Eq(move _18, move _19);
157+
+ _19 = copy _13;
158+
+ _17 = Eq(copy _10, copy _13);
156159
switchInt(move _17) -> [0: bb6, otherwise: bb5];
157160
}
158161

@@ -163,8 +166,10 @@
163166
StorageDead(_17);
164167
StorageDead(_16);
165168
StorageDead(_15);
166-
StorageDead(_13);
167-
StorageDead(_10);
169+
- StorageDead(_13);
170+
- StorageDead(_10);
171+
+ nop;
172+
+ nop;
168173
StorageDead(_8);
169174
StorageDead(_7);
170175
- StorageLive(_29);
@@ -213,8 +218,9 @@
213218
StorageLive(_33);
214219
StorageLive(_34);
215220
- StorageLive(_35);
221+
- StorageLive(_36);
222+
+ nop;
216223
+ nop;
217-
StorageLive(_36);
218224
StorageLive(_37);
219225
_37 = &(*_1);
220226
_36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind unreachable];
@@ -224,8 +230,9 @@
224230
StorageDead(_37);
225231
_35 = &_36;
226232
- StorageLive(_38);
233+
- StorageLive(_39);
234+
+ nop;
227235
+ nop;
228-
StorageLive(_39);
229236
StorageLive(_40);
230237
_40 = &(*_29);
231238
_39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind unreachable];
@@ -249,11 +256,12 @@
249256
StorageLive(_43);
250257
StorageLive(_44);
251258
- _44 = copy (*_41);
252-
+ _44 = copy (*_35);
259+
+ _44 = copy _36;
253260
StorageLive(_45);
254261
- _45 = copy (*_42);
255-
+ _45 = copy (*_38);
256-
_43 = Eq(move _44, move _45);
262+
- _43 = Eq(move _44, move _45);
263+
+ _45 = copy _39;
264+
+ _43 = Eq(copy _36, copy _39);
257265
switchInt(move _43) -> [0: bb11, otherwise: bb10];
258266
}
259267

@@ -264,8 +272,10 @@
264272
StorageDead(_43);
265273
StorageDead(_42);
266274
StorageDead(_41);
267-
StorageDead(_39);
268-
StorageDead(_36);
275+
- StorageDead(_39);
276+
- StorageDead(_36);
277+
+ nop;
278+
+ nop;
269279
StorageDead(_34);
270280
StorageDead(_33);
271281
_0 = const ();

tests/mir-opt/gvn.slices.GVN.panic-unwind.diff

+24-14
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@
111111
StorageLive(_7);
112112
StorageLive(_8);
113113
- StorageLive(_9);
114+
- StorageLive(_10);
115+
+ nop;
114116
+ nop;
115-
StorageLive(_10);
116117
StorageLive(_11);
117118
_11 = &(*_1);
118119
_10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind continue];
@@ -122,8 +123,9 @@
122123
StorageDead(_11);
123124
_9 = &_10;
124125
- StorageLive(_12);
126+
- StorageLive(_13);
127+
+ nop;
125128
+ nop;
126-
StorageLive(_13);
127129
StorageLive(_14);
128130
- _14 = &(*_4);
129131
+ _14 = &(*_1);
@@ -148,11 +150,12 @@
148150
StorageLive(_17);
149151
StorageLive(_18);
150152
- _18 = copy (*_15);
151-
+ _18 = copy (*_9);
153+
+ _18 = copy _10;
152154
StorageLive(_19);
153155
- _19 = copy (*_16);
154-
+ _19 = copy (*_12);
155-
_17 = Eq(move _18, move _19);
156+
- _17 = Eq(move _18, move _19);
157+
+ _19 = copy _13;
158+
+ _17 = Eq(copy _10, copy _13);
156159
switchInt(move _17) -> [0: bb6, otherwise: bb5];
157160
}
158161

@@ -163,8 +166,10 @@
163166
StorageDead(_17);
164167
StorageDead(_16);
165168
StorageDead(_15);
166-
StorageDead(_13);
167-
StorageDead(_10);
169+
- StorageDead(_13);
170+
- StorageDead(_10);
171+
+ nop;
172+
+ nop;
168173
StorageDead(_8);
169174
StorageDead(_7);
170175
- StorageLive(_29);
@@ -213,8 +218,9 @@
213218
StorageLive(_33);
214219
StorageLive(_34);
215220
- StorageLive(_35);
221+
- StorageLive(_36);
222+
+ nop;
216223
+ nop;
217-
StorageLive(_36);
218224
StorageLive(_37);
219225
_37 = &(*_1);
220226
_36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind continue];
@@ -224,8 +230,9 @@
224230
StorageDead(_37);
225231
_35 = &_36;
226232
- StorageLive(_38);
233+
- StorageLive(_39);
234+
+ nop;
227235
+ nop;
228-
StorageLive(_39);
229236
StorageLive(_40);
230237
_40 = &(*_29);
231238
_39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind continue];
@@ -249,11 +256,12 @@
249256
StorageLive(_43);
250257
StorageLive(_44);
251258
- _44 = copy (*_41);
252-
+ _44 = copy (*_35);
259+
+ _44 = copy _36;
253260
StorageLive(_45);
254261
- _45 = copy (*_42);
255-
+ _45 = copy (*_38);
256-
_43 = Eq(move _44, move _45);
262+
- _43 = Eq(move _44, move _45);
263+
+ _45 = copy _39;
264+
+ _43 = Eq(copy _36, copy _39);
257265
switchInt(move _43) -> [0: bb11, otherwise: bb10];
258266
}
259267

@@ -264,8 +272,10 @@
264272
StorageDead(_43);
265273
StorageDead(_42);
266274
StorageDead(_41);
267-
StorageDead(_39);
268-
StorageDead(_36);
275+
- StorageDead(_39);
276+
- StorageDead(_36);
277+
+ nop;
278+
+ nop;
269279
StorageDead(_34);
270280
StorageDead(_33);
271281
_0 = const ();

tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff

+8-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717
StorageLive(_3);
1818
_5 = const f::promoted[0];
1919
_3 = &(*_5);
20-
_2 = copy ((*_3).1: E);
21-
- StorageLive(_1);
22-
+ nop;
23-
_1 = copy ((_2 as A).1: u32);
20+
- _2 = copy ((*_3).1: E);
21+
+ _2 = copy ((*_5).1: E);
22+
StorageLive(_1);
23+
- _1 = copy ((_2 as A).1: u32);
24+
+ _1 = const 0_u32;
2425
StorageDead(_3);
2526
StorageDead(_2);
26-
_0 = copy _1;
27-
- StorageDead(_1);
28-
+ nop;
27+
- _0 = copy _1;
28+
+ _0 = const 0_u32;
29+
StorageDead(_1);
2930
return;
3031
}
3132
}

0 commit comments

Comments
 (0)