Skip to content

Commit 67553e8

Browse files
update tests that are ignored by debug
1 parent 39cf0b5 commit 67553e8

20 files changed

+326
-278
lines changed

tests/codegen/slice-as_chunks.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ pub fn chunks4(x: &[u8]) -> &[[u8; 4]] {
2222
// CHECK-LABEL: @chunks4_with_remainder
2323
#[no_mangle]
2424
pub fn chunks4_with_remainder(x: &[u8]) -> (&[[u8; 4]], &[u8]) {
25-
// CHECK: and i64 %x.1, -4
26-
// CHECK: and i64 %x.1, 3
27-
// CHECK: lshr exact
25+
// CHECK-DAG: and i64 %x.1, -4
26+
// CHECK-DAG: and i64 %x.1, 3
27+
// CHECK-DAG: lshr
2828
// CHECK-NOT: mul
2929
// CHECK-NOT: udiv
3030
// CHECK-NOT: urem

tests/codegen/slice-iter-nonnull.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ pub fn slice_iter_is_empty(it: &std::slice::Iter<'_, u32>) -> bool {
100100
// CHECK-LABEL: @slice_iter_len
101101
#[no_mangle]
102102
pub fn slice_iter_len(it: &std::slice::Iter<'_, u32>) -> usize {
103-
// CHECK: %[[START:.+]] = load ptr, ptr %it,
104-
// CHECK-SAME: !nonnull
105-
// CHECK-SAME: !noundef
106103
// CHECK: %[[ENDP:.+]] = getelementptr{{.+}}ptr %it,{{.+}} 1
107104
// CHECK: %[[END:.+]] = load ptr, ptr %[[ENDP]]
108105
// CHECK-SAME: !nonnull
109106
// CHECK-SAME: !noundef
107+
// CHECK: %[[START:.+]] = load ptr, ptr %it,
108+
// CHECK-SAME: !nonnull
109+
// CHECK-SAME: !noundef
110110

111111
// CHECK: ptrtoint
112112
// CHECK: ptrtoint

tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir

+58-77
Original file line numberDiff line numberDiff line change
@@ -7,130 +7,111 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool {
77
let mut _3: u32;
88
let mut _4: u32;
99
let mut _5: bool;
10-
let mut _6: bool;
10+
let mut _6: u32;
1111
let mut _7: u32;
12-
let mut _8: u32;
13-
let mut _9: bool;
14-
let mut _10: bool;
15-
let mut _11: u32;
12+
let mut _8: bool;
13+
let mut _9: u32;
14+
let mut _10: u32;
15+
let mut _11: bool;
1616
let mut _12: u32;
17-
let mut _13: bool;
17+
let mut _13: u32;
1818
let mut _14: bool;
1919
let mut _15: u32;
2020
let mut _16: u32;
21-
let mut _17: bool;
22-
let mut _18: u32;
23-
let mut _19: u32;
24-
let mut _20: bool;
2521

2622
bb0: {
27-
StorageLive(_14);
28-
StorageLive(_10);
29-
StorageLive(_6);
3023
StorageLive(_5);
3124
StorageLive(_3);
3225
_3 = ((*_1).0: u32);
3326
StorageLive(_4);
3427
_4 = ((*_2).0: u32);
3528
_5 = Eq(move _3, move _4);
36-
StorageDead(_4);
37-
StorageDead(_3);
3829
switchInt(move _5) -> [0: bb1, otherwise: bb2];
3930
}
4031

4132
bb1: {
42-
_6 = const false;
43-
goto -> bb3;
33+
StorageDead(_4);
34+
StorageDead(_3);
35+
goto -> bb8;
4436
}
4537

4638
bb2: {
47-
StorageLive(_9);
48-
StorageLive(_7);
49-
_7 = ((*_1).1: u32);
39+
StorageDead(_4);
40+
StorageDead(_3);
5041
StorageLive(_8);
51-
_8 = ((*_2).1: u32);
52-
_9 = Eq(move _7, move _8);
53-
StorageDead(_8);
54-
StorageDead(_7);
55-
_6 = move _9;
56-
goto -> bb3;
42+
StorageLive(_6);
43+
_6 = ((*_1).1: u32);
44+
StorageLive(_7);
45+
_7 = ((*_2).1: u32);
46+
_8 = Eq(move _6, move _7);
47+
switchInt(move _8) -> [0: bb3, otherwise: bb4];
5748
}
5849

5950
bb3: {
60-
StorageDead(_9);
61-
StorageDead(_5);
62-
switchInt(move _6) -> [0: bb4, otherwise: bb5];
51+
StorageDead(_7);
52+
StorageDead(_6);
53+
goto -> bb8;
6354
}
6455

6556
bb4: {
66-
_10 = const false;
67-
goto -> bb6;
57+
StorageDead(_7);
58+
StorageDead(_6);
59+
StorageLive(_11);
60+
StorageLive(_9);
61+
_9 = ((*_1).2: u32);
62+
StorageLive(_10);
63+
_10 = ((*_2).2: u32);
64+
_11 = Eq(move _9, move _10);
65+
switchInt(move _11) -> [0: bb5, otherwise: bb6];
6866
}
6967

7068
bb5: {
71-
StorageLive(_13);
72-
StorageLive(_11);
73-
_11 = ((*_1).2: u32);
74-
StorageLive(_12);
75-
_12 = ((*_2).2: u32);
76-
_13 = Eq(move _11, move _12);
77-
StorageDead(_12);
78-
StorageDead(_11);
79-
_10 = move _13;
80-
goto -> bb6;
69+
StorageDead(_10);
70+
StorageDead(_9);
71+
goto -> bb8;
8172
}
8273

8374
bb6: {
84-
StorageDead(_13);
85-
StorageDead(_6);
86-
switchInt(move _10) -> [0: bb7, otherwise: bb8];
75+
StorageDead(_10);
76+
StorageDead(_9);
77+
StorageLive(_14);
78+
StorageLive(_12);
79+
_12 = ((*_1).3: u32);
80+
StorageLive(_13);
81+
_13 = ((*_2).3: u32);
82+
_14 = Eq(move _12, move _13);
83+
switchInt(move _14) -> [0: bb7, otherwise: bb9];
8784
}
8885

8986
bb7: {
90-
_14 = const false;
91-
goto -> bb9;
87+
StorageDead(_13);
88+
StorageDead(_12);
89+
goto -> bb8;
9290
}
9391

9492
bb8: {
95-
StorageLive(_17);
93+
_0 = const false;
94+
goto -> bb10;
95+
}
96+
97+
bb9: {
98+
StorageDead(_13);
99+
StorageDead(_12);
96100
StorageLive(_15);
97-
_15 = ((*_1).3: u32);
101+
_15 = ((*_1).4: u32);
98102
StorageLive(_16);
99-
_16 = ((*_2).3: u32);
100-
_17 = Eq(move _15, move _16);
103+
_16 = ((*_2).4: u32);
104+
_0 = Eq(move _15, move _16);
101105
StorageDead(_16);
102106
StorageDead(_15);
103-
_14 = move _17;
104-
goto -> bb9;
105-
}
106-
107-
bb9: {
108-
StorageDead(_17);
109-
StorageDead(_10);
110-
switchInt(move _14) -> [0: bb10, otherwise: bb11];
107+
goto -> bb10;
111108
}
112109

113110
bb10: {
114-
_0 = const false;
115-
goto -> bb12;
116-
}
117-
118-
bb11: {
119-
StorageLive(_20);
120-
StorageLive(_18);
121-
_18 = ((*_1).4: u32);
122-
StorageLive(_19);
123-
_19 = ((*_2).4: u32);
124-
_20 = Eq(move _18, move _19);
125-
StorageDead(_19);
126-
StorageDead(_18);
127-
_0 = move _20;
128-
goto -> bb12;
129-
}
130-
131-
bb12: {
132-
StorageDead(_20);
133111
StorageDead(_14);
112+
StorageDead(_11);
113+
StorageDead(_8);
114+
StorageDead(_5);
134115
return;
135116
}
136117
}

tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir

+20-10
Original file line numberDiff line numberDiff line change
@@ -27,94 +27,104 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
2727
StorageLive(_4);
2828
_4 = ((*_2).0: u32);
2929
_5 = Ne(move _3, move _4);
30-
StorageDead(_4);
31-
StorageDead(_3);
3230
switchInt(move _5) -> [0: bb1, otherwise: bb10];
3331
}
3432

3533
bb1: {
34+
StorageDead(_4);
35+
StorageDead(_3);
3636
StorageDead(_5);
3737
StorageLive(_8);
3838
StorageLive(_6);
3939
_6 = ((*_1).1: u32);
4040
StorageLive(_7);
4141
_7 = ((*_2).1: u32);
4242
_8 = Ne(move _6, move _7);
43-
StorageDead(_7);
44-
StorageDead(_6);
4543
switchInt(move _8) -> [0: bb2, otherwise: bb9];
4644
}
4745

4846
bb2: {
47+
StorageDead(_7);
48+
StorageDead(_6);
4949
StorageDead(_8);
5050
StorageLive(_11);
5151
StorageLive(_9);
5252
_9 = ((*_1).2: u32);
5353
StorageLive(_10);
5454
_10 = ((*_2).2: u32);
5555
_11 = Ne(move _9, move _10);
56-
StorageDead(_10);
57-
StorageDead(_9);
5856
switchInt(move _11) -> [0: bb3, otherwise: bb8];
5957
}
6058

6159
bb3: {
60+
StorageDead(_10);
61+
StorageDead(_9);
6262
StorageDead(_11);
6363
StorageLive(_14);
6464
StorageLive(_12);
6565
_12 = ((*_1).3: u32);
6666
StorageLive(_13);
6767
_13 = ((*_2).3: u32);
6868
_14 = Ne(move _12, move _13);
69-
StorageDead(_13);
70-
StorageDead(_12);
7169
switchInt(move _14) -> [0: bb4, otherwise: bb7];
7270
}
7371

7472
bb4: {
73+
StorageDead(_13);
74+
StorageDead(_12);
7575
StorageDead(_14);
7676
StorageLive(_17);
7777
StorageLive(_15);
7878
_15 = ((*_1).4: u32);
7979
StorageLive(_16);
8080
_16 = ((*_2).4: u32);
8181
_17 = Ne(move _15, move _16);
82-
StorageDead(_16);
83-
StorageDead(_15);
8482
switchInt(move _17) -> [0: bb5, otherwise: bb6];
8583
}
8684

8785
bb5: {
86+
StorageDead(_16);
87+
StorageDead(_15);
8888
StorageDead(_17);
8989
_0 = const true;
9090
goto -> bb11;
9191
}
9292

9393
bb6: {
94+
StorageDead(_16);
95+
StorageDead(_15);
9496
_0 = const false;
9597
StorageDead(_17);
9698
goto -> bb11;
9799
}
98100

99101
bb7: {
102+
StorageDead(_13);
103+
StorageDead(_12);
100104
_0 = const false;
101105
StorageDead(_14);
102106
goto -> bb11;
103107
}
104108

105109
bb8: {
110+
StorageDead(_10);
111+
StorageDead(_9);
106112
_0 = const false;
107113
StorageDead(_11);
108114
goto -> bb11;
109115
}
110116

111117
bb9: {
118+
StorageDead(_7);
119+
StorageDead(_6);
112120
_0 = const false;
113121
StorageDead(_8);
114122
goto -> bb11;
115123
}
116124

117125
bb10: {
126+
StorageDead(_4);
127+
StorageDead(_3);
118128
_0 = const false;
119129
StorageDead(_5);
120130
goto -> bb11;

tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir

+10-4
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,22 @@ fn step_forward(_1: u32, _2: usize) -> u32 {
4040
_5 = Eq(_4, const 1_isize);
4141
_6 = Not(move _5);
4242
StorageDead(_5);
43-
StorageDead(_3);
44-
StorageDead(_8);
45-
switchInt(move _6) -> [0: bb3, otherwise: bb2];
43+
switchInt(move _6) -> [0: bb2, otherwise: bb3];
4644
}
4745

4846
bb2: {
49-
assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb3, unwind continue];
47+
StorageDead(_3);
48+
StorageDead(_8);
49+
goto -> bb4;
5050
}
5151

5252
bb3: {
53+
StorageDead(_3);
54+
StorageDead(_8);
55+
assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb4, unwind continue];
56+
}
57+
58+
bb4: {
5359
StorageDead(_6);
5460
StorageLive(_7);
5561
_7 = _2 as u32 (IntToInt);

tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir

+4-2
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,19 @@ fn int_range(_1: usize, _2: usize) -> () {
6363
_7 = Lt(move _5, move _6);
6464
StorageDead(_6);
6565
StorageDead(_5);
66-
StorageDead(_16);
67-
StorageDead(_15);
6866
switchInt(move _7) -> [0: bb2, otherwise: bb3];
6967
}
7068

7169
bb2: {
70+
StorageDead(_16);
71+
StorageDead(_15);
7272
_8 = Option::<usize>::None;
7373
goto -> bb5;
7474
}
7575

7676
bb3: {
77+
StorageDead(_16);
78+
StorageDead(_15);
7779
_9 = (_4.0: usize);
7880
StorageLive(_10);
7981
_10 = <usize as Step>::forward_unchecked(_9, const 1_usize) -> [return: bb4, unwind continue];

0 commit comments

Comments
 (0)