Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7a1bfc0

Browse files
committedAug 10, 2022
Add more // unit-tests to MIR opt tests
1 parent 9ee22ff commit 7a1bfc0

36 files changed

+167
-186
lines changed
 

‎src/test/mir-opt/bool_compare.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: InstCombine
2+
13
// EMIT_MIR bool_compare.opt1.InstCombine.diff
24
fn opt1(x: bool) -> u32 {
35
if x != true { 0 } else { 1 }

‎src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff

Lines changed: 0 additions & 77 deletions
This file was deleted.

‎src/test/mir-opt/combine_array_len.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// EMIT_MIR_FOR_EACH_BIT_WIDTH
1+
// unit-test: InstCombine
22
// EMIT_MIR combine_array_len.norm2.InstCombine.diff
33

44
fn norm2(x: [f32; 2]) -> f32 {

‎src/test/mir-opt/const_goto.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: ConstGoto
2+
13
pub enum Foo {
24
A,
35
B,

‎src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
bb0: {
1818
StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:+1:9: +1:12
1919
- StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
20-
- nop; // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
20+
- Deinit(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
2121
- StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
2222
- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
2323
- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52

‎src/test/mir-opt/const_goto_storage.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: ConstGoto
2+
13
// EMIT_MIR const_goto_storage.match_nested_if.ConstGoto.diff
24
fn match_nested_if() -> bool {
35
let val = match () {

‎src/test/mir-opt/deaggregator_test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: Deaggregator
2+
13
struct Baz {
24
x: usize,
35
y: f32,

‎src/test/mir-opt/deaggregator_test_enum.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: Deaggregator
2+
13
enum Baz {
24
Empty,
35
Foo { x: usize },

‎src/test/mir-opt/deaggregator_test_enum_2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Deaggregator
12
// Test that deaggregate fires in more than one basic block
23

34
enum Foo {

‎src/test/mir-opt/deaggregator_test_multiple.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Deaggregator
12
// Test that deaggregate fires more than once per block
23

34
enum Foo {

‎src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,101 +7,94 @@
77
let mut _2: &[u8]; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
88
let mut _3: &str; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
99
let mut _4: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
10-
let mut _5: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
11-
let mut _6: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
12-
let mut _7: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
13-
scope 1 (inlined core::str::<impl str>::as_bytes) { // at $DIR/deduplicate_blocks.rs:3:11: 3:23
14-
debug self => _3; // in scope 1 at $SRC_DIR/core/src/str/mod.rs:LL:COL
15-
let mut _8: &str; // in scope 1 at $SRC_DIR/core/src/str/mod.rs:LL:COL
16-
scope 2 {
17-
}
18-
}
10+
let mut _5: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
11+
let mut _6: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
12+
let mut _7: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
13+
let mut _8: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
14+
let mut _9: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
1915

2016
bb0: {
2117
StorageLive(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
2218
StorageLive(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
23-
_3 = _1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
24-
StorageLive(_8); // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
25-
_8 = _3; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
26-
- _2 = transmute::<&str, &[u8]>(move _8) -> bb14; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
27-
+ _2 = transmute::<&str, &[u8]>(move _8) -> bb12; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
19+
_3 = &(*_1); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
20+
_2 = core::str::<impl str>::as_bytes(move _3) -> bb1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
2821
// mir::Constant
29-
// + span: $SRC_DIR/core/src/str/mod.rs:LL:COL
30-
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {transmute::<&str, &[u8]>}, val: Value(<ZST>) }
22+
// + span: $DIR/deduplicate_blocks.rs:5:13: 5:21
23+
// + literal: Const { ty: for<'r> fn(&'r str) -> &'r [u8] {core::str::<impl str>::as_bytes}, val: Value(<ZST>) }
3124
}
3225

3326
bb1: {
34-
switchInt((*_2)[0 of 4]) -> [47_u8: bb2, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
27+
StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
28+
_7 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
29+
_8 = const 4_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
30+
_9 = Ge(move _7, move _8); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
31+
switchInt(move _9) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
3532
}
3633

3734
bb2: {
38-
switchInt((*_2)[1 of 4]) -> [47_u8: bb3, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
35+
switchInt((*_2)[0 of 4]) -> [47_u8: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
3936
}
4037

4138
bb3: {
42-
switchInt((*_2)[2 of 4]) -> [47_u8: bb4, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
39+
switchInt((*_2)[1 of 4]) -> [47_u8: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
4340
}
4441

4542
bb4: {
46-
- switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
47-
+ switchInt((*_2)[3 of 4]) -> [47_u8: bb9, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
43+
switchInt((*_2)[2 of 4]) -> [47_u8: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
4844
}
4945

5046
bb5: {
51-
_4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
52-
_5 = Ge(move _4, const 3_usize); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
53-
switchInt(move _5) -> [false: bb9, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
47+
- switchInt((*_2)[3 of 4]) -> [47_u8: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
48+
+ switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
5449
}
5550

5651
bb6: {
57-
switchInt((*_2)[0 of 3]) -> [47_u8: bb7, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
52+
_4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
53+
_5 = const 3_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
54+
_6 = Ge(move _4, move _5); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
55+
switchInt(move _6) -> [false: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
5856
}
5957

6058
bb7: {
61-
switchInt((*_2)[1 of 3]) -> [47_u8: bb8, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
59+
switchInt((*_2)[0 of 3]) -> [47_u8: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
6260
}
6361

6462
bb8: {
65-
- switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb12, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
66-
+ switchInt((*_2)[2 of 3]) -> [47_u8: bb10, 33_u8: bb10, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
63+
switchInt((*_2)[1 of 3]) -> [47_u8: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
6764
}
6865

6966
bb9: {
67+
- switchInt((*_2)[2 of 3]) -> [47_u8: bb12, 33_u8: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
68+
+ switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
69+
}
70+
71+
bb10: {
7072
- _0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
71-
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
73+
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
7274
- }
7375
-
74-
- bb10: {
76+
- bb11: {
7577
_0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
76-
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
77-
+ goto -> bb11; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
78+
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
79+
+ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
7880
}
7981

80-
- bb11: {
82+
- bb12: {
8183
- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
82-
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
84+
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
8385
- }
8486
-
85-
- bb12: {
86-
+ bb10: {
87-
_0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
88-
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
89-
+ goto -> bb11; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
90-
}
91-
9287
- bb13: {
9388
+ bb11: {
94-
StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
95-
return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
89+
_0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
90+
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
91+
+ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
9692
}
9793

9894
- bb14: {
9995
+ bb12: {
100-
StorageDead(_8); // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
101-
StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
102-
_6 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
103-
_7 = Ge(move _6, const 4_usize); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
104-
switchInt(move _7) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
96+
StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
97+
return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
10598
}
10699
}
107100

‎src/test/mir-opt/deduplicate_blocks.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: DeduplicateBlocks
2+
13
// EMIT_MIR deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
24
pub const fn is_line_doc_comment_2(s: &str) -> bool {
35
match s.as_bytes() {

‎src/test/mir-opt/derefer_complex_case.main.Derefer.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
StorageLive(_2); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
3131
_14 = const main::promoted[0]; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
3232
// mir::Constant
33-
// + span: $DIR/derefer_complex_case.rs:5:17: 5:26
33+
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
3434
// + literal: Const { ty: &[i32; 2], val: Unevaluated(main, [], Some(promoted[0])) }
3535
_2 = &(*_14); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
3636
_1 = <&[i32; 2] as IntoIterator>::into_iter(move _2) -> bb1; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
3737
// mir::Constant
38-
// + span: $DIR/derefer_complex_case.rs:5:17: 5:26
38+
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
3939
// + literal: Const { ty: fn(&[i32; 2]) -> <&[i32; 2] as IntoIterator>::IntoIter {<&[i32; 2] as IntoIterator>::into_iter}, val: Value(<ZST>) }
4040
}
4141

@@ -55,7 +55,7 @@
5555
_8 = &mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
5656
_7 = <std::slice::Iter<i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
5757
// mir::Constant
58-
// + span: $DIR/derefer_complex_case.rs:5:17: 5:26
58+
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
5959
// + literal: Const { ty: for<'r> fn(&'r mut std::slice::Iter<i32>) -> Option<<std::slice::Iter<i32> as Iterator>::Item> {<std::slice::Iter<i32> as Iterator>::next}, val: Value(<ZST>) }
6060
}
6161

@@ -76,7 +76,7 @@
7676
_13 = _12; // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
7777
_6 = std::mem::drop::<i32>(move _13) -> bb7; // scope 2 at $DIR/derefer_complex_case.rs:+1:29: +1:38
7878
// mir::Constant
79-
// + span: $DIR/derefer_complex_case.rs:5:29: 5:33
79+
// + span: $DIR/derefer_complex_case.rs:6:29: 6:33
8080
// + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
8181
}
8282

‎src/test/mir-opt/derefer_complex_case.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Derefer
12
// EMIT_MIR derefer_complex_case.main.Derefer.diff
23
// ignore-wasm32
34

‎src/test/mir-opt/derefer_inline_test.main.Derefer.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
_3 = AlignOf(std::boxed::Box<u32>); // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
1818
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
1919
// mir::Constant
20-
// + span: $DIR/derefer_inline_test.rs:10:5: 10:12
20+
// + span: $DIR/derefer_inline_test.rs:11:5: 11:12
2121
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
2222
}
2323

@@ -26,7 +26,7 @@
2626
_5 = ShallowInitBox(move _4, std::boxed::Box<u32>); // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
2727
(*_5) = f() -> [return: bb2, unwind: bb6]; // scope 0 at $DIR/derefer_inline_test.rs:+1:9: +1:12
2828
// mir::Constant
29-
// + span: $DIR/derefer_inline_test.rs:10:9: 10:10
29+
// + span: $DIR/derefer_inline_test.rs:11:9: 11:10
3030
// + literal: Const { ty: fn() -> Box<u32> {f}, val: Value(<ZST>) }
3131
}
3232

‎src/test/mir-opt/derefer_inline_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Derefer
12
// EMIT_MIR derefer_inline_test.main.Derefer.diff
23
// ignore-wasm32 compiled with panic=abort by default
34

‎src/test/mir-opt/derefer_terminator_test.main.Derefer.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
StorageLive(_1); // scope 0 at $DIR/derefer_terminator_test.rs:+1:9: +1:10
3333
_1 = foo() -> bb1; // scope 0 at $DIR/derefer_terminator_test.rs:+1:13: +1:18
3434
// mir::Constant
35-
// + span: $DIR/derefer_terminator_test.rs:5:13: 5:16
35+
// + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
3636
// + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
3737
}
3838

3939
bb1: {
4040
StorageLive(_2); // scope 1 at $DIR/derefer_terminator_test.rs:+2:9: +2:10
4141
_2 = foo() -> bb2; // scope 1 at $DIR/derefer_terminator_test.rs:+2:13: +2:18
4242
// mir::Constant
43-
// + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
43+
// + span: $DIR/derefer_terminator_test.rs:7:13: 7:16
4444
// + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
4545
}
4646

‎src/test/mir-opt/derefer_terminator_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Derefer
12
// EMIT_MIR derefer_terminator_test.main.Derefer.diff
23
// ignore-wasm32
34

‎src/test/mir-opt/derefer_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Derefer
12
// EMIT_MIR derefer_test.main.Derefer.diff
23
fn main() {
34
let mut a = (42,43);

‎src/test/mir-opt/derefer_test_multiple.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Derefer
12
// EMIT_MIR derefer_test_multiple.main.Derefer.diff
23
fn main () {
34
let mut a = (42, 43);

‎src/test/mir-opt/equal_true.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test InstCombine
2+
13
// EMIT_MIR equal_true.opt.InstCombine.diff
24

35
fn opt(x: bool) -> i32 {

‎src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let mut _0: bool; // return place in scope 0 at /the/src/instrument_coverage.rs:+0:13: +0:17
66

77
bb0: {
8-
+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:19:1 - 21:2; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
8+
+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:20:1 - 22:2; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
99
_0 = const true; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +1:9
1010
return; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
1111
}

‎src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
let mut _3: !; // in scope 0 at /the/src/instrument_coverage.rs:+2:18: +4:10
99

1010
bb0: {
11-
+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:10:1 - 10:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
11+
+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:11:1 - 11:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
1212
goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
1313
}
1414

1515
bb1: {
16-
+ Coverage::Expression(4294967295) = 1 + 2 for /the/src/instrument_coverage.rs:11:5 - 12:17; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
16+
+ Coverage::Expression(4294967295) = 1 + 2 for /the/src/instrument_coverage.rs:12:5 - 13:17; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
1717
falseUnwind -> [real: bb2, cleanup: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
1818
}
1919

2020
bb2: {
2121
StorageLive(_2); // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
2222
_2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
2323
// mir::Constant
24-
// + span: /the/src/instrument_coverage.rs:12:12: 12:15
24+
// + span: /the/src/instrument_coverage.rs:13:12: 13:15
2525
// + literal: Const { ty: fn() -> bool {bar}, val: Value(<ZST>) }
2626
}
2727

@@ -30,15 +30,15 @@
3030
}
3131

3232
bb4: {
33-
+ Coverage::Expression(4294967293) = 4294967294 + 0 for /the/src/instrument_coverage.rs:16:1 - 16:2; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
34-
+ Coverage::Expression(4294967294) = 4294967295 - 2 for /the/src/instrument_coverage.rs:13:13 - 13:18; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
33+
+ Coverage::Expression(4294967293) = 4294967294 + 0 for /the/src/instrument_coverage.rs:17:1 - 17:2; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
34+
+ Coverage::Expression(4294967294) = 4294967295 - 2 for /the/src/instrument_coverage.rs:14:13 - 14:18; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
3535
_0 = const (); // scope 0 at /the/src/instrument_coverage.rs:+3:13: +3:18
3636
StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
3737
return; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
3838
}
3939

4040
bb5: {
41-
+ Coverage::Counter(2) for /the/src/instrument_coverage.rs:14:10 - 14:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
41+
+ Coverage::Counter(2) for /the/src/instrument_coverage.rs:15:10 - 15:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
4242
_1 = const (); // scope 0 at /the/src/instrument_coverage.rs:+4:10: +4:10
4343
StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
4444
goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6

‎src/test/mir-opt/instrument_coverage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Test that `-C instrument-coverage` injects Coverage statements. The Coverage Counter statements
22
// are later converted into LLVM instrprof.increment intrinsics, during codegen.
33

4+
// unit-test: InstrumentCoverage
45
// needs-profiler-support
56
// ignore-windows
67
// compile-flags: -C instrument-coverage --remap-path-prefix={{src-base}}=/the/src

‎src/test/mir-opt/not_equal_false.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: InstCombine
12
// EMIT_MIR not_equal_false.opt.InstCombine.diff
23

34
fn opt(x: bool) -> u32 {

‎src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
scope 3 {
2424
debug i => _12; // in scope 3 at $DIR/remove_storage_markers.rs:+2:9: +2:10
2525
}
26-
scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<i32>>::next) { // at $DIR/remove_storage_markers.rs:8:14: 8:19
27-
debug self => _8; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
28-
let mut _14: &mut std::ops::Range<i32>; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
29-
}
30-
}
31-
scope 4 (inlined <std::ops::Range<i32> as IntoIterator>::into_iter) { // at $DIR/remove_storage_markers.rs:8:14: 8:19
32-
debug self => _3; // in scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
3326
}
3427
}
3528

@@ -41,29 +34,39 @@
4134
Deinit(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
4235
(_3.0: i32) = const 0_i32; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
4336
(_3.1: i32) = const 10_i32; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
44-
_2 = move _3; // scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
37+
_2 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _3) -> bb1; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
38+
// mir::Constant
39+
// + span: $DIR/remove_storage_markers.rs:10:14: 10:19
40+
// + literal: Const { ty: fn(std::ops::Range<i32>) -> <std::ops::Range<i32> as IntoIterator>::IntoIter {<std::ops::Range<i32> as IntoIterator>::into_iter}, val: Value(<ZST>) }
41+
}
42+
43+
bb1: {
4544
- StorageDead(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:18: +2:19
4645
- StorageLive(_4); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
4746
_4 = move _2; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
48-
goto -> bb1; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
47+
goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
4948
}
5049

51-
bb1: {
50+
bb2: {
5251
- StorageLive(_6); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
5352
- StorageLive(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
5453
- StorageLive(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
5554
- StorageLive(_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
5655
_9 = &mut _4; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
5756
_8 = &mut (*_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
58-
- StorageLive(_14); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
59-
_14 = &mut (*_8); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
60-
_7 = <std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next(move _14) -> bb4; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
57+
_7 = <std::ops::Range<i32> as Iterator>::next(move _8) -> bb3; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
6158
// mir::Constant
62-
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
63-
// + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range<i32>) -> Option<<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(<ZST>) }
59+
// + span: $DIR/remove_storage_markers.rs:10:14: 10:19
60+
// + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range<i32>) -> Option<<std::ops::Range<i32> as Iterator>::Item> {<std::ops::Range<i32> as Iterator>::next}, val: Value(<ZST>) }
6461
}
6562

66-
bb2: {
63+
bb3: {
64+
- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
65+
_10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
66+
switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
67+
}
68+
69+
bb4: {
6770
- StorageLive(_12); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
6871
_12 = ((_7 as Some).0: i32); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
6972
- StorageLive(_13); // scope 3 at $DIR/remove_storage_markers.rs:+3:16: +3:17
@@ -76,10 +79,14 @@
7679
- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
7780
- StorageDead(_6); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
7881
_5 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
79-
goto -> bb1; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
82+
goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
8083
}
8184

82-
bb3: {
85+
bb5: {
86+
unreachable; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
87+
}
88+
89+
bb6: {
8390
_0 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
8491
- StorageDead(_9); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
8592
- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
@@ -89,12 +96,5 @@
8996
- StorageDead(_1); // scope 0 at $DIR/remove_storage_markers.rs:+5:1: +5:2
9097
return; // scope 0 at $DIR/remove_storage_markers.rs:+5:2: +5:2
9198
}
92-
93-
bb4: {
94-
- StorageDead(_14); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
95-
- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
96-
_10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
97-
switchInt(move _10) -> [0_isize: bb3, otherwise: bb2]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
98-
}
9999
}
100100

‎src/test/mir-opt/remove_storage_markers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: RemoveStorageMarkers
2+
13
// Checks that storage markers are removed at opt-level=0.
24
//
35
// compile-flags: -C opt-level=0 -Coverflow-checks=off

‎src/test/mir-opt/remove_zsts_dont_touch_unions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmir-opt-level=3
1+
// unit-test: RemoveZsts
22

33
// Ensure RemoveZsts doesn't remove ZST assignments to union fields,
44
// which causes problems in Miri.

‎src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn array_casts() -> () {
8080
_7 = _2; // scope 3 at $DIR/retag.rs:+3:15: +3:16
8181
_6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> bb1; // scope 3 at $DIR/retag.rs:+3:15: +3:23
8282
// mir::Constant
83-
// + span: $DIR/retag.rs:60:17: 60:20
83+
// + span: $DIR/retag.rs:61:17: 61:20
8484
// + literal: Const { ty: unsafe fn(*mut usize, usize) -> *mut usize {ptr::mut_ptr::<impl *mut usize>::add}, val: Value(<ZST>) }
8585
}
8686

@@ -111,7 +111,7 @@ fn array_casts() -> () {
111111
_17 = _9; // scope 6 at $DIR/retag.rs:+7:26: +7:27
112112
_16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> bb2; // scope 6 at $DIR/retag.rs:+7:26: +7:34
113113
// mir::Constant
114-
// + span: $DIR/retag.rs:64:28: 64:31
114+
// + span: $DIR/retag.rs:65:28: 65:31
115115
// + literal: Const { ty: unsafe fn(*const usize, usize) -> *const usize {ptr::const_ptr::<impl *const usize>::add}, val: Value(<ZST>) }
116116
}
117117

‎src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn main() -> () {
7373
Retag([2phase] _6); // scope 1 at $DIR/retag.rs:+3:29: +3:35
7474
_3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36
7575
// mir::Constant
76-
// + span: $DIR/retag.rs:32:25: 32:28
76+
// + span: $DIR/retag.rs:33:25: 33:28
7777
// + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(<ZST>) }
7878
}
7979

@@ -149,7 +149,7 @@ fn main() -> () {
149149
StorageLive(_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23
150150
_28 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:+18:21: +18:23
151151
// mir::Constant
152-
// + span: $DIR/retag.rs:47:21: 47:23
152+
// + span: $DIR/retag.rs:48:21: 48:23
153153
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
154154
Retag(_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
155155
_23 = &(*_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
@@ -158,7 +158,7 @@ fn main() -> () {
158158
Retag(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23
159159
_19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7]; // scope 7 at $DIR/retag.rs:+18:5: +18:24
160160
// mir::Constant
161-
// + span: $DIR/retag.rs:47:13: 47:20
161+
// + span: $DIR/retag.rs:48:13: 48:20
162162
// + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(<ZST>) }
163163
}
164164

@@ -182,7 +182,7 @@ fn main() -> () {
182182
StorageLive(_27); // scope 8 at $DIR/retag.rs:+23:5: +23:18
183183
_27 = array_casts() -> bb6; // scope 8 at $DIR/retag.rs:+23:5: +23:18
184184
// mir::Constant
185-
// + span: $DIR/retag.rs:52:5: 52:16
185+
// + span: $DIR/retag.rs:53:5: 53:16
186186
// + literal: Const { ty: fn() {array_casts}, val: Value(<ZST>) }
187187
}
188188

‎src/test/mir-opt/retag.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: AddRetag
12
// ignore-wasm32-bare compiled with panic=abort by default
23
// ignore-tidy-linelength
34
// compile-flags: -Z mir-emit-retag -Z mir-opt-level=0 -Z span_free_formats

‎src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo` after SimplifyCfg-elaborate-drops
1+
// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo` after SimplifyCfg-elaborate-drops
22

3-
fn <impl at $DIR/retag.rs:11:1: 11:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
3+
fn <impl at $DIR/retag.rs:12:1: 12:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
44
debug self => _1; // in scope 0 at $DIR/retag.rs:+0:16: +0:21
55
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:23: +0:24
66
let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:53

‎src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo_shr` after SimplifyCfg-elaborate-drops
1+
// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo_shr` after SimplifyCfg-elaborate-drops
22

3-
fn <impl at $DIR/retag.rs:11:1: 11:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
3+
fn <impl at $DIR/retag.rs:12:1: 12:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
44
debug self => _1; // in scope 0 at $DIR/retag.rs:+0:20: +0:25
55
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:27: +0:28
66
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:49

‎src/test/mir-opt/simplify-locals-removes-unused-consts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: SimplifyLocals
12
// compile-flags: -C overflow-checks=no
23

34
fn use_zst(_: ((), ())) {}

‎src/test/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals.diff

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,53 @@
1616
- let mut _11: Temp; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
1717
+ let _1: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
1818
+ let mut _2: ((), ()); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
19-
+ let _3: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
19+
+ let mut _3: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
20+
+ let mut _4: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
21+
+ let _5: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
22+
+ let mut _6: u8; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
23+
+ let mut _7: u8; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
24+
+ let mut _8: Temp; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
2025
scope 1 {
2126
}
2227

2328
bb0: {
2429
- StorageLive(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
2530
- StorageLive(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:21: +1:23
31+
- Deinit(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:21: +1:23
2632
- StorageLive(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:25: +1:27
33+
- Deinit(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:25: +1:27
34+
- Deinit(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
35+
- (_1.0: ()) = move _2; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
36+
- (_1.1: ()) = move _3; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
2737
- StorageDead(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:27: +1:28
2838
- StorageDead(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:27: +1:28
2939
- StorageDead(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:28: +1:29
3040
- StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
3141
- StorageLive(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
3242
- StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
43+
- Deinit(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
3344
- StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
45+
- Deinit(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
46+
- Deinit(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
47+
- (_5.0: ()) = move _6; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
48+
- (_5.1: ()) = move _7; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
3449
- StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
3550
- StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
3651
- _4 = use_zst(move _5) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
3752
+ StorageLive(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
3853
+ StorageLive(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
54+
+ StorageLive(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
55+
+ Deinit(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
56+
+ StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
57+
+ Deinit(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
58+
+ Deinit(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
59+
+ (_2.0: ()) = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
60+
+ (_2.1: ()) = move _4; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
61+
+ StorageDead(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
62+
+ StorageDead(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
3963
+ _1 = use_zst(move _2) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
4064
// mir::Constant
41-
// + span: $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:12
65+
// + span: $DIR/simplify-locals-removes-unused-consts.rs:15:5: 15:12
4266
// + literal: Const { ty: fn(((), ())) {use_zst}, val: Value(<ZST>) }
4367
}
4468

@@ -49,22 +73,36 @@
4973
- StorageLive(_9); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
5074
- StorageLive(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
5175
- StorageLive(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
76+
- Deinit(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
77+
- (_11.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
78+
- _10 = (_11.0: u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
79+
- _9 = Add(move _10, const 2_u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
5280
- StorageDead(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:33: +4:34
53-
- _8 = use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
81+
- _8 = use_u8(move _9) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
5482
+ StorageDead(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:21: +2:22
5583
+ StorageDead(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:22: +2:23
56-
+ StorageLive(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
57-
+ _3 = use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
84+
+ StorageLive(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
85+
+ StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
86+
+ StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
87+
+ StorageLive(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
88+
+ Deinit(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
89+
+ (_8.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
90+
+ _7 = (_8.0: u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
91+
+ _6 = Add(move _7, const 2_u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
92+
+ StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:33: +4:34
93+
+ _5 = use_u8(move _6) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
5894
// mir::Constant
59-
// + span: $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:11
95+
// + span: $DIR/simplify-locals-removes-unused-consts.rs:17:5: 17:11
6096
// + literal: Const { ty: fn(u8) {use_u8}, val: Value(<ZST>) }
6197
}
6298

6399
bb2: {
64100
- StorageDead(_9); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:34: +4:35
65101
- StorageDead(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
66-
- StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
67-
+ StorageDead(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
102+
+ StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:34: +4:35
103+
StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
104+
+ StorageDead(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
105+
_0 = const (); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+0:11: +5:2
68106
return; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+5:2: +5:2
69107
}
70108
}

0 commit comments

Comments
 (0)
Please sign in to comment.