Skip to content

Commit dd27a59

Browse files
committed
Bless or tweak the mir-opt tests
1 parent 6ddbf3b commit dd27a59

19 files changed

+48
-50
lines changed

tests/mir-opt/const_debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ test-mir-pass: SingleUseConsts
2-
//@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN
2+
//@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN -C debuginfo=full
33

44
#![allow(unused)]
55

tests/mir-opt/issue_76432.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// skip-filecheck
2+
//@ compile-flags: -C debuginfo=full
23
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
34
// Check that we do not insert StorageDead at each target if StorageDead was never seen
45

tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ fn <impl at $DIR/derived_ord.rs:6:10: 6:20>::partial_cmp(_1: &MultiField, _2: &M
77
let mut _6: std::option::Option<std::cmp::Ordering>;
88
let mut _7: i8;
99
scope 1 {
10-
debug cmp => _6;
1110
}
1211
scope 2 (inlined std::cmp::impls::<impl PartialOrd for char>::partial_cmp) {
1312
let mut _3: char;

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,34 @@
1818
debug ptr => _3;
1919
}
2020
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
21+
debug self => _9;
22+
debug layout => _8;
2123
}
2224
scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) {
25+
debug self => _6;
2326
let mut _12: isize;
2427
let _13: std::alloc::AllocError;
2528
let mut _14: !;
2629
let mut _15: &dyn std::fmt::Debug;
2730
let mut _16: &std::alloc::AllocError;
2831
scope 7 {
32+
debug t => _5;
2933
}
3034
scope 8 {
35+
debug e => const std::alloc::AllocError;
3136
}
3237
}
3338
scope 9 (inlined NonNull::<[u8]>::as_ptr) {
39+
debug self => _5;
3440
let mut _17: *const [u8];
3541
}
3642
}
3743
scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) {
44+
debug self => _2;
3845
let mut _10: isize;
3946
let mut _11: !;
4047
scope 4 {
48+
debug val => _1;
4149
}
4250
}
4351

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@
1818
debug ptr => _3;
1919
}
2020
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
21+
debug self => _9;
22+
debug layout => _8;
2123
}
2224
scope 6 (inlined NonNull::<[u8]>::as_ptr) {
25+
debug self => _5;
2326
let mut _12: *const [u8];
2427
}
2528
}
2629
scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) {
30+
debug self => _2;
2731
let mut _10: isize;
2832
let mut _11: !;
2933
scope 4 {
34+
debug val => _1;
3035
}
3136
}
3237

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,34 @@
1818
debug ptr => _3;
1919
}
2020
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
21+
debug self => _9;
22+
debug layout => _8;
2123
}
2224
scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) {
25+
debug self => _6;
2326
let mut _12: isize;
2427
let _13: std::alloc::AllocError;
2528
let mut _14: !;
2629
let mut _15: &dyn std::fmt::Debug;
2730
let mut _16: &std::alloc::AllocError;
2831
scope 7 {
32+
debug t => _5;
2933
}
3034
scope 8 {
35+
debug e => const std::alloc::AllocError;
3136
}
3237
}
3338
scope 9 (inlined NonNull::<[u8]>::as_ptr) {
39+
debug self => _5;
3440
let mut _17: *const [u8];
3541
}
3642
}
3743
scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) {
44+
debug self => _2;
3845
let mut _10: isize;
3946
let mut _11: !;
4047
scope 4 {
48+
debug val => _1;
4149
}
4250
}
4351

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@
1818
debug ptr => _3;
1919
}
2020
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
21+
debug self => _9;
22+
debug layout => _8;
2123
}
2224
scope 6 (inlined NonNull::<[u8]>::as_ptr) {
25+
debug self => _5;
2326
let mut _12: *const [u8];
2427
}
2528
}
2629
scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) {
30+
debug self => _2;
2731
let mut _10: isize;
2832
let mut _11: !;
2933
scope 4 {
34+
debug val => _1;
3035
}
3136
}
3237

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Verify that we do not ICE when printing an invalid constant.
22
// EMIT_MIR_FOR_EACH_BIT_WIDTH
33
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
4+
//@ compile-flags: -C debuginfo=full
45

56
#![feature(allocator_api)]
67

tests/mir-opt/pre-codegen/optimizes_into_variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// skip-filecheck
22
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
3-
//@ compile-flags: -C overflow-checks=on
3+
//@ compile-flags: -C overflow-checks=on -C debuginfo=2
44

55
struct Point {
66
x: u32,

tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
1212
let _13: ();
1313
scope 1 {
1414
debug ((iter: std::ops::Range<u32>).0: u32) => _4;
15-
debug ((iter: std::ops::Range<u32>).1: u32) => _2;
1615
let _10: u32;
1716
scope 2 {
1817
debug x => _10;

tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
1212
let _13: ();
1313
scope 1 {
1414
debug ((iter: std::ops::Range<u32>).0: u32) => _4;
15-
debug ((iter: std::ops::Range<u32>).1: u32) => _2;
1615
let _10: u32;
1716
scope 2 {
1817
debug x => _10;

tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
1414
let _16: ();
1515
scope 1 {
1616
debug ((iter: std::ops::Range<usize>).0: usize) => _4;
17-
debug ((iter: std::ops::Range<usize>).1: usize) => _3;
1817
let _10: usize;
1918
scope 2 {
2019
debug i => _10;

tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
1414
let _16: ();
1515
scope 1 {
1616
debug ((iter: std::ops::Range<usize>).0: usize) => _4;
17-
debug ((iter: std::ops::Range<usize>).1: usize) => _3;
1817
let _10: usize;
1918
scope 2 {
2019
debug i => _10;

tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
let _5: usize;
1111
let mut _6: isize;
1212
let _7: i32;
13-
let _8: usize;
1413
scope 1 {
1514
debug v => _4;
1615
}
@@ -21,7 +20,6 @@
2120
debug v => _7;
2221
}
2322
scope 4 {
24-
debug r => _8;
2523
}
2624

2725
bb0: {
@@ -54,10 +52,7 @@
5452
}
5553

5654
bb5: {
57-
StorageLive(_8);
58-
_8 = ((_2 as Break).0: usize);
5955
_0 = const Option::<i32>::None;
60-
StorageDead(_8);
6156
goto -> bb7;
6257
}
6358

tests/mir-opt/simplify_locals.c.SimplifyLocals-before-const-prop.diff

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
fn c() -> () {
55
let mut _0: ();
6-
let _1: [u8; 10];
6+
- let _1: [u8; 10];
77
- let mut _2: &[u8];
88
- let mut _3: &[u8; 10];
99
- let _4: &[u8; 10];
1010
scope 1 {
11-
debug bytes => _1;
11+
- debug bytes => _1;
1212
scope 2 {
1313
}
1414
}
1515

1616
bb0: {
17-
StorageLive(_1);
18-
_1 = [const 0_u8; 10];
17+
- StorageLive(_1);
18+
- _1 = [const 0_u8; 10];
1919
- StorageLive(_2);
2020
- StorageLive(_3);
2121
- StorageLive(_4);
@@ -26,7 +26,7 @@
2626
- StorageDead(_4);
2727
- StorageDead(_2);
2828
_0 = const ();
29-
StorageDead(_1);
29+
- StorageDead(_1);
3030
return;
3131
}
3232
}

tests/mir-opt/simplify_locals.r.SimplifyLocals-before-const-prop.diff

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33

44
fn r() -> () {
55
let mut _0: ();
6-
let mut _1: i32;
6+
- let mut _1: i32;
77
- let mut _2: &i32;
88
- let mut _3: &mut i32;
99
scope 1 {
10-
debug a => _1;
10+
- debug a => _1;
1111
scope 2 {
1212
scope 3 {
1313
}
1414
}
1515
}
1616

1717
bb0: {
18-
StorageLive(_1);
19-
_1 = const 1_i32;
18+
- StorageLive(_1);
19+
- _1 = const 1_i32;
2020
- StorageLive(_2);
2121
- _2 = &_1;
2222
- StorageDead(_2);
2323
- StorageLive(_3);
2424
- _3 = &mut _1;
2525
- StorageDead(_3);
2626
_0 = const ();
27-
StorageDead(_1);
27+
- StorageDead(_1);
2828
return;
2929
}
3030
}

tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
let mut _4: isize;
1010
let mut _5: isize;
1111
scope 1 {
12-
debug a => _6;
13-
let _6: u8;
1412
}
1513

1614
bb0: {
@@ -23,31 +21,24 @@
2321
StorageDead(_3);
2422
StorageDead(_2);
2523
_5 = discriminant((_1.0: std::option::Option<u8>));
26-
switchInt(move _5) -> [1: bb1, 0: bb3, otherwise: bb5];
24+
switchInt(move _5) -> [1: bb1, 0: bb2, otherwise: bb4];
2725
}
2826

2927
bb1: {
3028
_4 = discriminant((_1.1: std::option::Option<T>));
31-
switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb5];
29+
switchInt(move _4) -> [0: bb2, 1: bb2, otherwise: bb4];
3230
}
3331

3432
bb2: {
35-
StorageLive(_6);
36-
_6 = (((_1.0: std::option::Option<u8>) as Some).0: u8);
37-
StorageDead(_6);
38-
goto -> bb3;
33+
drop(_1) -> [return: bb3, unwind unreachable];
3934
}
4035

4136
bb3: {
42-
drop(_1) -> [return: bb4, unwind unreachable];
43-
}
44-
45-
bb4: {
4637
StorageDead(_1);
4738
return;
4839
}
4940

50-
bb5: {
41+
bb4: {
5142
unreachable;
5243
}
5344
}

tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
let mut _4: isize;
1010
let mut _5: isize;
1111
scope 1 {
12-
debug a => _6;
13-
let _6: u8;
1412
}
1513

1614
bb0: {
@@ -23,31 +21,24 @@
2321
StorageDead(_3);
2422
StorageDead(_2);
2523
_5 = discriminant((_1.0: std::option::Option<u8>));
26-
switchInt(move _5) -> [1: bb1, 0: bb3, otherwise: bb5];
24+
switchInt(move _5) -> [1: bb1, 0: bb2, otherwise: bb4];
2725
}
2826

2927
bb1: {
3028
_4 = discriminant((_1.1: std::option::Option<T>));
31-
switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb5];
29+
switchInt(move _4) -> [0: bb2, 1: bb2, otherwise: bb4];
3230
}
3331

3432
bb2: {
35-
StorageLive(_6);
36-
_6 = (((_1.0: std::option::Option<u8>) as Some).0: u8);
37-
StorageDead(_6);
38-
goto -> bb3;
33+
drop(_1) -> [return: bb3, unwind continue];
3934
}
4035

4136
bb3: {
42-
drop(_1) -> [return: bb4, unwind continue];
43-
}
44-
45-
bb4: {
4637
StorageDead(_1);
4738
return;
4839
}
4940

50-
bb5: {
41+
bb4: {
5142
unreachable;
5243
}
5344
}

tests/mir-opt/uninhabited_enum.process_never.SimplifyLocals-final.after.mir

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
fn process_never(_1: *const !) -> () {
44
debug input => _1;
55
let mut _0: ();
6-
let _2: &!;
76
scope 1 {
8-
debug _input => _2;
97
}
108

119
bb0: {

0 commit comments

Comments
 (0)