Add more `// unit-test`s to MIR opt tests

This commit is contained in:
Jakob Degen 2022-08-02 17:44:25 -07:00
parent 9ee22ff7e8
commit 7a1bfc0ba7
36 changed files with 172 additions and 191 deletions

View File

@ -1,3 +1,5 @@
// unit-test: InstCombine
// EMIT_MIR bool_compare.opt1.InstCombine.diff
fn opt1(x: bool) -> u32 {
if x != true { 0 } else { 1 }

View File

@ -1,77 +0,0 @@
- // MIR for `norm2` before InstCombine
+ // MIR for `norm2` after InstCombine
fn norm2(_1: [f32; 2]) -> f32 {
debug x => _1; // in scope 0 at $DIR/combine_array_len.rs:+0:10: +0:11
let mut _0: f32; // return place in scope 0 at $DIR/combine_array_len.rs:+0:26: +0:29
let _2: f32; // in scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
let _3: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
let mut _4: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
let mut _5: bool; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
let _7: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:15: +2:16
let mut _8: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
let mut _9: bool; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
let mut _10: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:8
let mut _11: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:6
let mut _12: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:7: +3:8
let mut _13: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:14
let mut _14: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:12
let mut _15: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:13: +3:14
scope 1 {
debug a => _2; // in scope 1 at $DIR/combine_array_len.rs:+1:9: +1:10
let _6: f32; // in scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
scope 2 {
debug b => _6; // in scope 2 at $DIR/combine_array_len.rs:+2:9: +2:10
}
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
_3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
+ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
_5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
}
bb1: {
_2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:+1:17: +1:18
StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
_7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
+ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
_9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
}
bb2: {
_6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:+2:17: +2:18
StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
_11 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
_12 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
_10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
_14 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
_15 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
_13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
_0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:14
StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:+4:1: +4:2
StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:+4:1: +4:2
return; // scope 0 at $DIR/combine_array_len.rs:+4:2: +4:2
}
}

View File

@ -1,4 +1,4 @@
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// unit-test: InstCombine
// EMIT_MIR combine_array_len.norm2.InstCombine.diff
fn norm2(x: [f32; 2]) -> f32 {

View File

@ -1,3 +1,5 @@
// unit-test: ConstGoto
pub enum Foo {
A,
B,

View File

@ -17,7 +17,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:+1:9: +1:12
- StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
- nop; // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
- Deinit(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
- StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52

View File

@ -1,3 +1,5 @@
// unit-test: ConstGoto
// EMIT_MIR const_goto_storage.match_nested_if.ConstGoto.diff
fn match_nested_if() -> bool {
let val = match () {

View File

@ -1,3 +1,5 @@
// unit-test: Deaggregator
struct Baz {
x: usize,
y: f32,

View File

@ -1,3 +1,5 @@
// unit-test: Deaggregator
enum Baz {
Empty,
Foo { x: usize },

View File

@ -1,3 +1,4 @@
// unit-test: Deaggregator
// Test that deaggregate fires in more than one basic block
enum Foo {

View File

@ -1,3 +1,4 @@
// unit-test: Deaggregator
// Test that deaggregate fires more than once per block
enum Foo {

View File

@ -7,101 +7,94 @@
let mut _2: &[u8]; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
let mut _3: &str; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
let mut _4: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
let mut _5: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
let mut _6: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
let mut _7: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
scope 1 (inlined core::str::<impl str>::as_bytes) { // at $DIR/deduplicate_blocks.rs:3:11: 3:23
debug self => _3; // in scope 1 at $SRC_DIR/core/src/str/mod.rs:LL:COL
let mut _8: &str; // in scope 1 at $SRC_DIR/core/src/str/mod.rs:LL:COL
scope 2 {
}
}
let mut _5: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
let mut _6: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
let mut _7: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
let mut _8: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
let mut _9: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
bb0: {
StorageLive(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
StorageLive(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
_3 = _1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
StorageLive(_8); // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
_8 = _3; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
- _2 = transmute::<&str, &[u8]>(move _8) -> bb14; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
+ _2 = transmute::<&str, &[u8]>(move _8) -> bb12; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
_3 = &(*_1); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
_2 = core::str::<impl str>::as_bytes(move _3) -> bb1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
// mir::Constant
// + span: $SRC_DIR/core/src/str/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {transmute::<&str, &[u8]>}, val: Value(<ZST>) }
// + span: $DIR/deduplicate_blocks.rs:5:13: 5:21
// + literal: Const { ty: for<'r> fn(&'r str) -> &'r [u8] {core::str::<impl str>::as_bytes}, val: Value(<ZST>) }
}
bb1: {
switchInt((*_2)[0 of 4]) -> [47_u8: bb2, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
_7 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
_8 = const 4_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
_9 = Ge(move _7, move _8); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
switchInt(move _9) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
}
bb2: {
switchInt((*_2)[1 of 4]) -> [47_u8: bb3, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
switchInt((*_2)[0 of 4]) -> [47_u8: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb3: {
switchInt((*_2)[2 of 4]) -> [47_u8: bb4, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
switchInt((*_2)[1 of 4]) -> [47_u8: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb4: {
- switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[3 of 4]) -> [47_u8: bb9, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
switchInt((*_2)[2 of 4]) -> [47_u8: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb5: {
_4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
_5 = Ge(move _4, const 3_usize); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
switchInt(move _5) -> [false: bb9, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- switchInt((*_2)[3 of 4]) -> [47_u8: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb6: {
switchInt((*_2)[0 of 3]) -> [47_u8: bb7, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
_4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
_5 = const 3_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
_6 = Ge(move _4, move _5); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
switchInt(move _6) -> [false: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
}
bb7: {
switchInt((*_2)[1 of 3]) -> [47_u8: bb8, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
switchInt((*_2)[0 of 3]) -> [47_u8: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb8: {
- switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb12, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[2 of 3]) -> [47_u8: bb10, 33_u8: bb10, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
switchInt((*_2)[1 of 3]) -> [47_u8: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb9: {
- switchInt((*_2)[2 of 3]) -> [47_u8: bb12, 33_u8: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb10: {
- _0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
- }
-
- bb10: {
_0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
+ goto -> bb11; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
}
- bb11: {
- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
- }
-
- bb12: {
+ bb10: {
_0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
+ goto -> bb11; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
_0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
+ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
}
- bb12: {
- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
- }
-
- bb13: {
+ bb11: {
StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
_0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
+ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
}
- bb14: {
+ bb12: {
StorageDead(_8); // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
_6 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
_7 = Ge(move _6, const 4_usize); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
switchInt(move _7) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
}
}

View File

@ -1,3 +1,5 @@
// unit-test: DeduplicateBlocks
// EMIT_MIR deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
pub const fn is_line_doc_comment_2(s: &str) -> bool {
match s.as_bytes() {

View File

@ -30,12 +30,12 @@
StorageLive(_2); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_14 = const main::promoted[0]; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
// + span: $DIR/derefer_complex_case.rs:5:17: 5:26
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
// + literal: Const { ty: &[i32; 2], val: Unevaluated(main, [], Some(promoted[0])) }
_2 = &(*_14); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_1 = <&[i32; 2] as IntoIterator>::into_iter(move _2) -> bb1; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
// + span: $DIR/derefer_complex_case.rs:5:17: 5:26
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
// + literal: Const { ty: fn(&[i32; 2]) -> <&[i32; 2] as IntoIterator>::IntoIter {<&[i32; 2] as IntoIterator>::into_iter}, val: Value(<ZST>) }
}
@ -55,7 +55,7 @@
_8 = &mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_7 = <std::slice::Iter<i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
// + span: $DIR/derefer_complex_case.rs:5:17: 5:26
// + span: $DIR/derefer_complex_case.rs:6:17: 6:26
// + 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>) }
}
@ -76,7 +76,7 @@
_13 = _12; // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
_6 = std::mem::drop::<i32>(move _13) -> bb7; // scope 2 at $DIR/derefer_complex_case.rs:+1:29: +1:38
// mir::Constant
// + span: $DIR/derefer_complex_case.rs:5:29: 5:33
// + span: $DIR/derefer_complex_case.rs:6:29: 6:33
// + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
}

View File

@ -1,3 +1,4 @@
// unit-test: Derefer
// EMIT_MIR derefer_complex_case.main.Derefer.diff
// ignore-wasm32

View File

@ -17,7 +17,7 @@
_3 = AlignOf(std::boxed::Box<u32>); // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/derefer_inline_test.rs:+1:5: +1:12
// mir::Constant
// + span: $DIR/derefer_inline_test.rs:10:5: 10:12
// + span: $DIR/derefer_inline_test.rs:11:5: 11:12
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
}
@ -26,7 +26,7 @@
_5 = ShallowInitBox(move _4, std::boxed::Box<u32>); // scope 0 at $DIR/derefer_inline_test.rs:+1:5: +1:12
(*_5) = f() -> [return: bb2, unwind: bb6]; // scope 0 at $DIR/derefer_inline_test.rs:+1:9: +1:12
// mir::Constant
// + span: $DIR/derefer_inline_test.rs:10:9: 10:10
// + span: $DIR/derefer_inline_test.rs:11:9: 11:10
// + literal: Const { ty: fn() -> Box<u32> {f}, val: Value(<ZST>) }
}

View File

@ -1,3 +1,4 @@
// unit-test: Derefer
// EMIT_MIR derefer_inline_test.main.Derefer.diff
// ignore-wasm32 compiled with panic=abort by default

View File

@ -32,7 +32,7 @@
StorageLive(_1); // scope 0 at $DIR/derefer_terminator_test.rs:+1:9: +1:10
_1 = foo() -> bb1; // scope 0 at $DIR/derefer_terminator_test.rs:+1:13: +1:18
// mir::Constant
// + span: $DIR/derefer_terminator_test.rs:5:13: 5:16
// + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
// + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
}
@ -40,7 +40,7 @@
StorageLive(_2); // scope 1 at $DIR/derefer_terminator_test.rs:+2:9: +2:10
_2 = foo() -> bb2; // scope 1 at $DIR/derefer_terminator_test.rs:+2:13: +2:18
// mir::Constant
// + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
// + span: $DIR/derefer_terminator_test.rs:7:13: 7:16
// + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
}

View File

@ -1,3 +1,4 @@
// unit-test: Derefer
// EMIT_MIR derefer_terminator_test.main.Derefer.diff
// ignore-wasm32

View File

@ -1,3 +1,4 @@
// unit-test: Derefer
// EMIT_MIR derefer_test.main.Derefer.diff
fn main() {
let mut a = (42,43);

View File

@ -1,3 +1,4 @@
// unit-test: Derefer
// EMIT_MIR derefer_test_multiple.main.Derefer.diff
fn main () {
let mut a = (42, 43);

View File

@ -1,3 +1,5 @@
// unit-test InstCombine
// EMIT_MIR equal_true.opt.InstCombine.diff
fn opt(x: bool) -> i32 {

View File

@ -5,7 +5,7 @@
let mut _0: bool; // return place in scope 0 at /the/src/instrument_coverage.rs:+0:13: +0:17
bb0: {
+ 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
+ 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
_0 = const true; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +1:9
return; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
}

View File

@ -8,12 +8,12 @@
let mut _3: !; // in scope 0 at /the/src/instrument_coverage.rs:+2:18: +4:10
bb0: {
+ 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
+ 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
goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
}
bb1: {
+ 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
+ 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
falseUnwind -> [real: bb2, cleanup: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
}
@ -21,7 +21,7 @@
StorageLive(_2); // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
_2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
// mir::Constant
// + span: /the/src/instrument_coverage.rs:12:12: 12:15
// + span: /the/src/instrument_coverage.rs:13:12: 13:15
// + literal: Const { ty: fn() -> bool {bar}, val: Value(<ZST>) }
}
@ -30,15 +30,15 @@
}
bb4: {
+ 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
+ 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
+ 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
+ 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
_0 = const (); // scope 0 at /the/src/instrument_coverage.rs:+3:13: +3:18
StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
return; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
}
bb5: {
+ 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
+ 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
_1 = const (); // scope 0 at /the/src/instrument_coverage.rs:+4:10: +4:10
StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6

View File

@ -1,6 +1,7 @@
// Test that `-C instrument-coverage` injects Coverage statements. The Coverage Counter statements
// are later converted into LLVM instrprof.increment intrinsics, during codegen.
// unit-test: InstrumentCoverage
// needs-profiler-support
// ignore-windows
// compile-flags: -C instrument-coverage --remap-path-prefix={{src-base}}=/the/src

View File

@ -1,3 +1,4 @@
// unit-test: InstCombine
// EMIT_MIR not_equal_false.opt.InstCombine.diff
fn opt(x: bool) -> u32 {

View File

@ -23,13 +23,6 @@
scope 3 {
debug i => _12; // in scope 3 at $DIR/remove_storage_markers.rs:+2:9: +2:10
}
scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<i32>>::next) { // at $DIR/remove_storage_markers.rs:8:14: 8:19
debug self => _8; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _14: &mut std::ops::Range<i32>; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
}
scope 4 (inlined <std::ops::Range<i32> as IntoIterator>::into_iter) { // at $DIR/remove_storage_markers.rs:8:14: 8:19
debug self => _3; // in scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
}
}
@ -41,29 +34,39 @@
Deinit(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
(_3.0: i32) = const 0_i32; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
(_3.1: i32) = const 10_i32; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_2 = move _3; // scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
- StorageDead(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:18: +2:19
- StorageLive(_4); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_4 = move _2; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
goto -> bb1; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
_2 = <std::ops::Range<i32> as IntoIterator>::into_iter(move _3) -> bb1; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
// mir::Constant
// + span: $DIR/remove_storage_markers.rs:10:14: 10:19
// + 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>) }
}
bb1: {
- StorageDead(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:18: +2:19
- StorageLive(_4); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_4 = move _2; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
}
bb2: {
- StorageLive(_6); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_9 = &mut _4; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_8 = &mut (*_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_14); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_14 = &mut (*_8); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_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
_7 = <std::ops::Range<i32> as Iterator>::next(move _8) -> bb3; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
// mir::Constant
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
// + 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>) }
// + span: $DIR/remove_storage_markers.rs:10:14: 10:19
// + 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>) }
}
bb2: {
bb3: {
- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
_10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
}
bb4: {
- StorageLive(_12); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
_12 = ((_7 as Some).0: i32); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
- StorageLive(_13); // scope 3 at $DIR/remove_storage_markers.rs:+3:16: +3:17
@ -76,10 +79,14 @@
- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
- StorageDead(_6); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
_5 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
goto -> bb1; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
}
bb3: {
bb5: {
unreachable; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
}
bb6: {
_0 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- StorageDead(_9); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
@ -89,12 +96,5 @@
- StorageDead(_1); // scope 0 at $DIR/remove_storage_markers.rs:+5:1: +5:2
return; // scope 0 at $DIR/remove_storage_markers.rs:+5:2: +5:2
}
bb4: {
- StorageDead(_14); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
_10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
switchInt(move _10) -> [0_isize: bb3, otherwise: bb2]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
}
}

View File

@ -1,3 +1,5 @@
// unit-test: RemoveStorageMarkers
// Checks that storage markers are removed at opt-level=0.
//
// compile-flags: -C opt-level=0 -Coverflow-checks=off

View File

@ -1,4 +1,4 @@
// compile-flags: -Zmir-opt-level=3
// unit-test: RemoveZsts
// Ensure RemoveZsts doesn't remove ZST assignments to union fields,
// which causes problems in Miri.

View File

@ -80,7 +80,7 @@ fn array_casts() -> () {
_7 = _2; // scope 3 at $DIR/retag.rs:+3:15: +3:16
_6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> bb1; // scope 3 at $DIR/retag.rs:+3:15: +3:23
// mir::Constant
// + span: $DIR/retag.rs:60:17: 60:20
// + span: $DIR/retag.rs:61:17: 61:20
// + literal: Const { ty: unsafe fn(*mut usize, usize) -> *mut usize {ptr::mut_ptr::<impl *mut usize>::add}, val: Value(<ZST>) }
}
@ -111,7 +111,7 @@ fn array_casts() -> () {
_17 = _9; // scope 6 at $DIR/retag.rs:+7:26: +7:27
_16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> bb2; // scope 6 at $DIR/retag.rs:+7:26: +7:34
// mir::Constant
// + span: $DIR/retag.rs:64:28: 64:31
// + span: $DIR/retag.rs:65:28: 65:31
// + literal: Const { ty: unsafe fn(*const usize, usize) -> *const usize {ptr::const_ptr::<impl *const usize>::add}, val: Value(<ZST>) }
}

View File

@ -73,7 +73,7 @@ fn main() -> () {
Retag([2phase] _6); // scope 1 at $DIR/retag.rs:+3:29: +3:35
_3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36
// mir::Constant
// + span: $DIR/retag.rs:32:25: 32:28
// + span: $DIR/retag.rs:33:25: 33:28
// + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(<ZST>) }
}
@ -149,7 +149,7 @@ fn main() -> () {
StorageLive(_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23
_28 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:+18:21: +18:23
// mir::Constant
// + span: $DIR/retag.rs:47:21: 47:23
// + span: $DIR/retag.rs:48:21: 48:23
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
Retag(_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
_23 = &(*_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
@ -158,7 +158,7 @@ fn main() -> () {
Retag(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23
_19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7]; // scope 7 at $DIR/retag.rs:+18:5: +18:24
// mir::Constant
// + span: $DIR/retag.rs:47:13: 47:20
// + span: $DIR/retag.rs:48:13: 48:20
// + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(<ZST>) }
}
@ -182,7 +182,7 @@ fn main() -> () {
StorageLive(_27); // scope 8 at $DIR/retag.rs:+23:5: +23:18
_27 = array_casts() -> bb6; // scope 8 at $DIR/retag.rs:+23:5: +23:18
// mir::Constant
// + span: $DIR/retag.rs:52:5: 52:16
// + span: $DIR/retag.rs:53:5: 53:16
// + literal: Const { ty: fn() {array_casts}, val: Value(<ZST>) }
}

View File

@ -1,3 +1,4 @@
// unit-test: AddRetag
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-tidy-linelength
// compile-flags: -Z mir-emit-retag -Z mir-opt-level=0 -Z span_free_formats

View File

@ -1,6 +1,6 @@
// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo` after SimplifyCfg-elaborate-drops
// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo` after SimplifyCfg-elaborate-drops
fn <impl at $DIR/retag.rs:11:1: 11:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
fn <impl at $DIR/retag.rs:12:1: 12:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
debug self => _1; // in scope 0 at $DIR/retag.rs:+0:16: +0:21
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:23: +0:24
let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:53

View File

@ -1,6 +1,6 @@
// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo_shr` after SimplifyCfg-elaborate-drops
// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo_shr` after SimplifyCfg-elaborate-drops
fn <impl at $DIR/retag.rs:11:1: 11:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
fn <impl at $DIR/retag.rs:12:1: 12:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
debug self => _1; // in scope 0 at $DIR/retag.rs:+0:20: +0:25
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:27: +0:28
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:49

View File

@ -1,3 +1,4 @@
// unit-test: SimplifyLocals
// compile-flags: -C overflow-checks=no
fn use_zst(_: ((), ())) {}

View File

@ -16,29 +16,53 @@
- let mut _11: Temp; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+ let _1: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
+ let mut _2: ((), ()); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+ let _3: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ let mut _3: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
+ let mut _4: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
+ let _5: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ let mut _6: u8; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
+ let mut _7: u8; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
+ let mut _8: Temp; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
- StorageLive(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:21: +1:23
- Deinit(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:21: +1:23
- StorageLive(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:25: +1:27
- Deinit(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:25: +1:27
- Deinit(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
- (_1.0: ()) = move _2; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
- (_1.1: ()) = move _3; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
- StorageDead(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:27: +1:28
- StorageDead(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:27: +1:28
- StorageDead(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:28: +1:29
- StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
- StorageLive(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
- StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
- Deinit(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
- StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
- Deinit(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
- Deinit(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
- (_5.0: ()) = move _6; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
- (_5.1: ()) = move _7; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
- StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
- StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
- _4 = use_zst(move _5) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
+ StorageLive(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
+ StorageLive(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+ StorageLive(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
+ Deinit(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
+ StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
+ Deinit(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
+ Deinit(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+ (_2.0: ()) = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+ (_2.1: ()) = move _4; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+ StorageDead(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
+ StorageDead(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
+ _1 = use_zst(move _2) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
// mir::Constant
// + span: $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:12
// + span: $DIR/simplify-locals-removes-unused-consts.rs:15:5: 15:12
// + literal: Const { ty: fn(((), ())) {use_zst}, val: Value(<ZST>) }
}
@ -49,22 +73,36 @@
- StorageLive(_9); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
- StorageLive(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
- StorageLive(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
- Deinit(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
- (_11.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
- _10 = (_11.0: u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
- _9 = Add(move _10, const 2_u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
- StorageDead(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:33: +4:34
- _8 = use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
- _8 = use_u8(move _9) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ StorageDead(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:21: +2:22
+ StorageDead(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:22: +2:23
+ StorageLive(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ _3 = use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ StorageLive(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
+ StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
+ StorageLive(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+ Deinit(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+ (_8.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+ _7 = (_8.0: u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
+ _6 = Add(move _7, const 2_u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
+ StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:33: +4:34
+ _5 = use_u8(move _6) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
// mir::Constant
// + span: $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:11
// + span: $DIR/simplify-locals-removes-unused-consts.rs:17:5: 17:11
// + literal: Const { ty: fn(u8) {use_u8}, val: Value(<ZST>) }
}
bb2: {
- StorageDead(_9); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:34: +4:35
- StorageDead(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
- StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
+ StorageDead(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
+ StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:34: +4:35
StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
+ StorageDead(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
_0 = const (); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+0:11: +5:2
return; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+5:2: +5:2
}
}