Skip to content

Commit 0d3954a

Browse files
authored
Update tests mention the enum name
1 parent 61fcdf6 commit 0d3954a

4 files changed

+50
-54
lines changed

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

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- // MIR for `main` before GVN
22
+ // MIR for `main` after GVN
3-
3+
44
fn main() -> () {
55
let mut _0: ();
66
let _1: std::alloc::Layout;
@@ -49,7 +49,7 @@
4949
debug val => _1;
5050
}
5151
}
52-
52+
5353
bb0: {
5454
- StorageLive(_1);
5555
+ nop;
@@ -62,14 +62,14 @@
6262
+ _10 = const 0_isize;
6363
+ switchInt(const 0_isize) -> [0: bb1, 1: bb2, otherwise: bb6];
6464
}
65-
65+
6666
bb1: {
6767
_11 = option::unwrap_failed() -> unwind unreachable;
6868
}
69-
69+
7070
bb2: {
7171
- _1 = move ((_2 as Some).0: std::alloc::Layout);
72-
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
72+
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
7373
StorageDead(_10);
7474
StorageDead(_2);
7575
StorageLive(_3);
@@ -83,10 +83,10 @@
8383
StorageLive(_8);
8484
- _8 = _1;
8585
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb3, unwind unreachable];
86-
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
87-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb3, unwind unreachable];
86+
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
87+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb3, unwind unreachable];
8888
}
89-
89+
9090
bb3: {
9191
StorageDead(_8);
9292
StorageDead(_7);
@@ -95,7 +95,7 @@
9595
_12 = discriminant(_6);
9696
switchInt(move _12) -> [0: bb5, 1: bb4, otherwise: bb6];
9797
}
98-
98+
9999
bb4: {
100100
_15 = const "called `Result::unwrap()` on an `Err` value";
101101
StorageLive(_16);
@@ -105,7 +105,7 @@
105105
StorageDead(_17);
106106
_14 = result::unwrap_failed(move _15, move _16) -> unwind unreachable;
107107
}
108-
108+
109109
bb5: {
110110
_5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
111111
StorageDead(_15);
@@ -127,15 +127,14 @@
127127
+ nop;
128128
return;
129129
}
130-
130+
131131
bb6: {
132132
unreachable;
133133
}
134134
}
135-
+
135+
+
136136
+ ALLOC0 (size: 8, align: 4) {
137137
+ 00 00 00 00 __ __ __ __ │ ....░░░░
138138
+ }
139-
+
139+
+
140140
+ ALLOC1 (size: 0, align: 1) {}
141-

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

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- // MIR for `main` before GVN
22
+ // MIR for `main` after GVN
3-
3+
44
fn main() -> () {
55
let mut _0: ();
66
let _1: std::alloc::Layout;
@@ -34,7 +34,7 @@
3434
debug val => _1;
3535
}
3636
}
37-
37+
3838
bb0: {
3939
- StorageLive(_1);
4040
+ nop;
@@ -47,7 +47,7 @@
4747
+ _10 = const 0_isize;
4848
+ switchInt(const 0_isize) -> [0: bb2, 1: bb3, otherwise: bb5];
4949
}
50-
50+
5151
bb1: {
5252
StorageDead(_6);
5353
- StorageLive(_12);
@@ -66,14 +66,14 @@
6666
+ nop;
6767
return;
6868
}
69-
69+
7070
bb2: {
7171
_11 = option::unwrap_failed() -> unwind continue;
7272
}
73-
73+
7474
bb3: {
7575
- _1 = move ((_2 as Some).0: std::alloc::Layout);
76-
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
76+
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
7777
StorageDead(_10);
7878
StorageDead(_2);
7979
StorageLive(_3);
@@ -87,24 +87,23 @@
8787
StorageLive(_8);
8888
- _8 = _1;
8989
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind continue];
90-
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
91-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb4, unwind continue];
90+
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
91+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind continue];
9292
}
93-
93+
9494
bb4: {
9595
StorageDead(_8);
9696
StorageDead(_7);
9797
_5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
9898
}
99-
99+
100100
bb5: {
101101
unreachable;
102102
}
103103
}
104-
+
104+
+
105105
+ ALLOC0 (size: 8, align: 4) {
106106
+ 00 00 00 00 __ __ __ __ │ ....░░░░
107107
+ }
108-
+
108+
+
109109
+ ALLOC1 (size: 0, align: 1) {}
110-

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

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- // MIR for `main` before GVN
22
+ // MIR for `main` after GVN
3-
3+
44
fn main() -> () {
55
let mut _0: ();
66
let _1: std::alloc::Layout;
@@ -49,7 +49,7 @@
4949
debug val => _1;
5050
}
5151
}
52-
52+
5353
bb0: {
5454
- StorageLive(_1);
5555
+ nop;
@@ -62,14 +62,14 @@
6262
+ _10 = const 0_isize;
6363
+ switchInt(const 0_isize) -> [0: bb1, 1: bb2, otherwise: bb6];
6464
}
65-
65+
6666
bb1: {
6767
_11 = option::unwrap_failed() -> unwind unreachable;
6868
}
69-
69+
7070
bb2: {
7171
- _1 = move ((_2 as Some).0: std::alloc::Layout);
72-
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
72+
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
7373
StorageDead(_10);
7474
StorageDead(_2);
7575
StorageLive(_3);
@@ -83,10 +83,10 @@
8383
StorageLive(_8);
8484
- _8 = _1;
8585
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb3, unwind unreachable];
86-
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
87-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb3, unwind unreachable];
86+
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
87+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb3, unwind unreachable];
8888
}
89-
89+
9090
bb3: {
9191
StorageDead(_8);
9292
StorageDead(_7);
@@ -95,7 +95,7 @@
9595
_12 = discriminant(_6);
9696
switchInt(move _12) -> [0: bb5, 1: bb4, otherwise: bb6];
9797
}
98-
98+
9999
bb4: {
100100
_15 = const "called `Result::unwrap()` on an `Err` value";
101101
StorageLive(_16);
@@ -105,7 +105,7 @@
105105
StorageDead(_17);
106106
_14 = result::unwrap_failed(move _15, move _16) -> unwind unreachable;
107107
}
108-
108+
109109
bb5: {
110110
_5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
111111
StorageDead(_15);
@@ -127,15 +127,14 @@
127127
+ nop;
128128
return;
129129
}
130-
130+
131131
bb6: {
132132
unreachable;
133133
}
134134
}
135-
+
135+
+
136136
+ ALLOC0 (size: 16, align: 8) {
137137
+ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
138138
+ }
139-
+
139+
+
140140
+ ALLOC1 (size: 0, align: 1) {}
141-

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

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- // MIR for `main` before GVN
22
+ // MIR for `main` after GVN
3-
3+
44
fn main() -> () {
55
let mut _0: ();
66
let _1: std::alloc::Layout;
@@ -34,7 +34,7 @@
3434
debug val => _1;
3535
}
3636
}
37-
37+
3838
bb0: {
3939
- StorageLive(_1);
4040
+ nop;
@@ -47,7 +47,7 @@
4747
+ _10 = const 0_isize;
4848
+ switchInt(const 0_isize) -> [0: bb2, 1: bb3, otherwise: bb5];
4949
}
50-
50+
5151
bb1: {
5252
StorageDead(_6);
5353
- StorageLive(_12);
@@ -66,14 +66,14 @@
6666
+ nop;
6767
return;
6868
}
69-
69+
7070
bb2: {
7171
_11 = option::unwrap_failed() -> unwind continue;
7272
}
73-
73+
7474
bb3: {
7575
- _1 = move ((_2 as Some).0: std::alloc::Layout);
76-
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
76+
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
7777
StorageDead(_10);
7878
StorageDead(_2);
7979
StorageLive(_3);
@@ -87,24 +87,23 @@
8787
StorageLive(_8);
8888
- _8 = _1;
8989
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind continue];
90-
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
91-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb4, unwind continue];
90+
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
91+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind continue];
9292
}
93-
93+
9494
bb4: {
9595
StorageDead(_8);
9696
StorageDead(_7);
9797
_5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
9898
}
99-
99+
100100
bb5: {
101101
unreachable;
102102
}
103103
}
104-
+
104+
+
105105
+ ALLOC0 (size: 16, align: 8) {
106106
+ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
107107
+ }
108-
+
108+
+
109109
+ ALLOC1 (size: 0, align: 1) {}
110-

0 commit comments

Comments
 (0)