Add some more unit-test directives

This commit is contained in:
Jannis Christopher Köhl 2022-09-27 17:28:32 +02:00
parent 4cda6e5401
commit 97a69a7670
41 changed files with 137 additions and 112 deletions

View File

@ -22,22 +22,30 @@
_1 = const 0_i32; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:13: +1:14
StorageLive(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
StorageLive(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
_3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
_4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- _3 = _1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
+ _4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
}
bb1: {
_5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
_6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
_7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
}
bb2: {
_2 = Rem(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
- _2 = Rem(const 1_i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
+ _2 = Rem(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
nop; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +3:2
_0 = const (); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +3:2
StorageDead(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
StorageDead(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
return; // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:2: +3:2

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR bad_op_mod_by_zero.main.DataflowConstProp.diff
#[allow(unconditional_panic)]
fn main() {

View File

@ -27,9 +27,9 @@
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:25: 6:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_3 = &(*_9); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
@ -38,14 +38,16 @@
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
_7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
_8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
+ _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
}
bb1: {
_5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
nop; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
_0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2

View File

@ -27,9 +27,9 @@
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:25: 6:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_3 = &(*_9); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
StorageDead(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:34: +1:35
@ -38,14 +38,16 @@
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:23: +3:24
_7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
_8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
+ _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
}
bb1: {
_5 = (*_1)[_6]; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:18: +3:25
StorageDead(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+3:25: +3:26
nop; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
_0 = const (); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+2:5: +4:6
StorageDead(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:+4:5: +4:6
StorageDead(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:1: +5:2
return; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+5:2: +5:2

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR bad_op_unsafe_oob_for_slices.main.DataflowConstProp.diff
#[allow(unconditional_panic)]

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O -Zmir-opt-level=4
// unit-test: DataflowConstProp
// EMIT_MIR mult_by_zero.test.DataflowConstProp.diff
fn test(x: i32) -> i32 {

View File

@ -9,7 +9,7 @@
bb0: {
StorageLive(_2); // scope 0 at $DIR/mult_by_zero.rs:+1:5: +1:6
_2 = _1; // scope 0 at $DIR/mult_by_zero.rs:+1:5: +1:6
_0 = const 0_i32; // scope 0 at $DIR/mult_by_zero.rs:+1:5: +1:10
_0 = Mul(move _2, const 0_i32); // scope 0 at $DIR/mult_by_zero.rs:+1:5: +1:10
StorageDead(_2); // scope 0 at $DIR/mult_by_zero.rs:+1:9: +1:10
return; // scope 0 at $DIR/mult_by_zero.rs:+2:2: +2:2
}

View File

@ -17,8 +17,9 @@
_1 = const 42_i32; // scope 0 at $DIR/mutable_variable.rs:+1:17: +1:19
_1 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+2:5: +2:11
StorageLive(_2); // scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10
_2 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
nop; // scope 0 at $DIR/mutable_variable.rs:+0:11: +4:2
- _2 = _1; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
_0 = const (); // scope 0 at $DIR/mutable_variable.rs:+0:11: +4:2
StorageDead(_2); // scope 1 at $DIR/mutable_variable.rs:+4:1: +4:2
StorageDead(_1); // scope 0 at $DIR/mutable_variable.rs:+4:1: +4:2
return; // scope 0 at $DIR/mutable_variable.rs:+4:2: +4:2

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
// EMIT_MIR mutable_variable.main.DataflowConstProp.diff
fn main() {

View File

@ -19,8 +19,8 @@
(_1.1: i32) = const 43_i32; // scope 0 at $DIR/mutable_variable_aggregate.rs:+1:17: +1:25
(_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate.rs:+2:5: +2:13
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:9: +3:10
_2 = const (42_i32, 99_i32); // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14
nop; // scope 0 at $DIR/mutable_variable_aggregate.rs:+0:11: +4:2
_2 = _1; // scope 1 at $DIR/mutable_variable_aggregate.rs:+3:13: +3:14
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate.rs:+0:11: +4:2
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:1: +4:2
return; // scope 0 at $DIR/mutable_variable_aggregate.rs:+4:2: +4:2

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
// EMIT_MIR mutable_variable_aggregate.main.DataflowConstProp.diff
fn main() {

View File

@ -26,7 +26,7 @@
((*_2).1: i32) = const 99_i32; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+3:5: +3:13
StorageLive(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:9: +4:10
_3 = _1; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+4:13: +4:14
nop; // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+0:11: +5:2
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+0:11: +5:2
StorageDead(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:+5:1: +5:2

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
// EMIT_MIR mutable_variable_aggregate_mut_ref.main.DataflowConstProp.diff
fn main() {

View File

@ -16,7 +16,7 @@
StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
_1 = foo() -> bb1; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:29: +1:34
// mir::Constant
// + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:29: 6:32
// + span: $DIR/mutable_variable_aggregate_partial_read.rs:5:29: 5:32
// + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(<ZST>) }
}
@ -24,8 +24,9 @@
(_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+2:5: +2:13
(_1.0: i32) = const 42_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+3:5: +3:13
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:9: +4:10
_2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
nop; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +5:2
- _2 = (_1.1: i32); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+4:13: +4:16
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+0:11: +5:2
StorageDead(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
StorageDead(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:1: +5:2
return; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+5:2: +5:2

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
// EMIT_MIR mutable_variable_aggregate_partial_read.main.DataflowConstProp.diff
fn main() {

View File

@ -25,17 +25,17 @@
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
// mir::Constant
// + span: $DIR/mutable_variable_no_prop.rs:10:13: 10:19
// + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
_3 = (*_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
_1 = move _3; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19
StorageDead(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:18: +3:19
StorageDead(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:19: +3:20
nop; // scope 2 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
_2 = const (); // scope 2 at $DIR/mutable_variable_no_prop.rs:+2:5: +4:6
StorageDead(_2); // scope 1 at $DIR/mutable_variable_no_prop.rs:+4:5: +4:6
StorageLive(_5); // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:9: +5:10
_5 = _1; // scope 1 at $DIR/mutable_variable_no_prop.rs:+5:13: +5:14
nop; // scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +6:2
_0 = const (); // scope 0 at $DIR/mutable_variable_no_prop.rs:+0:11: +6:2
StorageDead(_5); // scope 1 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
StorageDead(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:1: +6:2
return; // scope 0 at $DIR/mutable_variable_no_prop.rs:+6:2: +6:2

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
static mut STATIC: u32 = 42;

View File

@ -25,7 +25,7 @@
StorageLive(_1); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:9: +1:10
_1 = foo() -> bb1; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+1:13: +1:18
// mir::Constant
// + span: $DIR/mutable_variable_unprop_assign.rs:6:13: 6:16
// + span: $DIR/mutable_variable_unprop_assign.rs:5:13: 5:16
// + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) }
}
@ -41,8 +41,9 @@
StorageLive(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
_4 = (_2.1: i32); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16
StorageLive(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
_5 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
nop; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +6:2
- _5 = (_2.0: i32); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
+ _5 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
_0 = const (); // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +6:2
StorageDead(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
StorageDead(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
StorageDead(_2); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
// EMIT_MIR mutable_variable_unprop_assign.main.DataflowConstProp.diff
fn main() {

View File

@ -18,22 +18,22 @@
StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
_3 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
// mir::Constant
// + span: $DIR/read_immutable_static.rs:8:13: 8:16
// + span: $DIR/read_immutable_static.rs:7:13: 7:16
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
_2 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
_2 = (*_3); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
_5 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
// mir::Constant
// + span: $DIR/read_immutable_static.rs:8:19: 8:22
// + span: $DIR/read_immutable_static.rs:7:19: 7:22
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
_4 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
_1 = const 4_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:22
_4 = (*_5); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
_1 = Add(move _2, move _4); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:22
StorageDead(_4); // scope 0 at $DIR/read_immutable_static.rs:+1:21: +1:22
StorageDead(_2); // scope 0 at $DIR/read_immutable_static.rs:+1:21: +1:22
StorageDead(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23
StorageDead(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:22: +1:23
nop; // scope 0 at $DIR/read_immutable_static.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/read_immutable_static.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/read_immutable_static.rs:+2:1: +2:2
return; // scope 0 at $DIR/read_immutable_static.rs:+2:2: +2:2
}

View File

@ -1,5 +1,4 @@
// unit-test
// compile-flags: -O
// unit-test: DataflowConstProp
static FOO: u8 = 2;

View File

@ -13,13 +13,13 @@
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
// mir::Constant
// + span: $DIR/ref_deref.rs:5:6: 5:10
// + span: $DIR/ref_deref.rs:6:6: 6:10
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
_2 = _4; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_1 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
_2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
StorageDead(_2); // scope 0 at $DIR/ref_deref.rs:+1:10: +1:11
StorageDead(_1); // scope 0 at $DIR/ref_deref.rs:+1:10: +1:11
nop; // scope 0 at $DIR/ref_deref.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/ref_deref.rs:+0:11: +2:2
return; // scope 0 at $DIR/ref_deref.rs:+2:2: +2:2
}
}

View File

@ -16,7 +16,7 @@
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ // mir::Constant
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
+ // + span: $DIR/ref_deref.rs:6:6: 6:10
+ // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
+ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR ref_deref.main.PromoteTemps.diff
// EMIT_MIR ref_deref.main.DataflowConstProp.diff

View File

@ -19,7 +19,7 @@
_1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
StorageDead(_2); // scope 0 at $DIR/ref_deref_project.rs:+1:17: +1:18
StorageDead(_1); // scope 0 at $DIR/ref_deref_project.rs:+1:17: +1:18
nop; // scope 0 at $DIR/ref_deref_project.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/ref_deref_project.rs:+0:11: +2:2
return; // scope 0 at $DIR/ref_deref_project.rs:+2:2: +2:2
}
}

View File

@ -1,4 +1,4 @@
// unit-test
// unit-test: DataflowConstProp
// EMIT_MIR ref_deref_project.main.PromoteTemps.diff
// EMIT_MIR ref_deref_project.main.DataflowConstProp.diff

View File

@ -15,14 +15,14 @@
StorageLive(_3); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
_3 = main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:17
// mir::Constant
// + span: $DIR/reify_fn_ptr.rs:4:13: 4:17
// + span: $DIR/reify_fn_ptr.rs:5:13: 5:17
// + literal: Const { ty: fn() {main}, val: Value(<ZST>) }
_2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:26
StorageDead(_3); // scope 0 at $DIR/reify_fn_ptr.rs:+1:25: +1:26
_1 = move _2 as *const fn() (PointerFromExposedAddress); // scope 0 at $DIR/reify_fn_ptr.rs:+1:13: +1:41
StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:+1:40: +1:41
StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:+1:41: +1:42
nop; // scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/reify_fn_ptr.rs:+0:11: +2:2
return; // scope 0 at $DIR/reify_fn_ptr.rs:+2:2: +2:2
}
}

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR reify_fn_ptr.main.DataflowConstProp.diff
fn main() {

View File

@ -20,18 +20,20 @@
_3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:+1:18: +1:25
StorageLive(_4); // scope 0 at $DIR/repeat.rs:+1:26: +1:27
_4 = const 2_usize; // scope 0 at $DIR/repeat.rs:+1:26: +1:27
_5 = const 8_usize; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_6 = const true; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_5 = Len(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
+ _6 = Lt(const 2_usize, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
+ assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
}
bb1: {
_2 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_1 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:32
_2 = _3[_4]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:+1:18: +1:32
StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
nop; // scope 0 at $DIR/repeat.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/repeat.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
}

View File

@ -20,18 +20,20 @@
_3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:+1:18: +1:25
StorageLive(_4); // scope 0 at $DIR/repeat.rs:+1:26: +1:27
_4 = const 2_usize; // scope 0 at $DIR/repeat.rs:+1:26: +1:27
_5 = const 8_usize; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_6 = const true; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_5 = Len(_3); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
+ _6 = Lt(const 2_usize, _5); // scope 0 at $DIR/repeat.rs:+1:18: +1:28
+ assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
}
bb1: {
_2 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_1 = const 42_u32; // scope 0 at $DIR/repeat.rs:+1:18: +1:32
_2 = _3[_4]; // scope 0 at $DIR/repeat.rs:+1:18: +1:28
_1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:+1:18: +1:32
StorageDead(_2); // scope 0 at $DIR/repeat.rs:+1:31: +1:32
StorageDead(_4); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
StorageDead(_3); // scope 0 at $DIR/repeat.rs:+1:32: +1:33
nop; // scope 0 at $DIR/repeat.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/repeat.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/repeat.rs:+2:1: +2:2
return; // scope 0 at $DIR/repeat.rs:+2:2: +2:2
}

View File

@ -1,4 +1,4 @@
// compile-flags: -O
// unit-test: DataflowConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR repeat.main.DataflowConstProp.diff

View File

@ -6,12 +6,14 @@
let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
bb0: {
_1 = const (4_u32, false); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
_1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
}
bb1: {
_0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
- _0 = move (_1.0: u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
+ _0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
return; // scope 0 at $DIR/return_place.rs:+2:2: +2:2
}
}

View File

@ -2,8 +2,14 @@
fn add() -> u32 {
let mut _0: u32; // return place in scope 0 at $DIR/return_place.rs:+0:13: +0:16
let mut _1: (u32, bool); // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
bb0: {
_1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
}
bb1: {
_0 = const 4_u32; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
return; // scope 0 at $DIR/return_place.rs:+2:2: +2:2
}

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// compile-flags: -C overflow-checks=on
// EMIT_MIR return_place.add.DataflowConstProp.diff

View File

@ -15,17 +15,19 @@
_1 = const 1_u32; // scope 0 at $DIR/scalar_literal_propagation.rs:+1:13: +1:14
StorageLive(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
StorageLive(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
_3 = const 1_u32; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
_2 = consume(const 1_u32) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
- _3 = _1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
- _2 = consume(move _3) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
+ _3 = const 1_u32; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:13: +2:14
+ _2 = consume(const 1_u32) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
// mir::Constant
// + span: $DIR/scalar_literal_propagation.rs:4:5: 4:12
// + span: $DIR/scalar_literal_propagation.rs:5:5: 5:12
// + literal: Const { ty: fn(u32) {consume}, val: Value(<ZST>) }
}
bb1: {
StorageDead(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:14: +2:15
StorageDead(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:+2:15: +2:16
nop; // scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +3:2
_0 = const (); // scope 0 at $DIR/scalar_literal_propagation.rs:+0:11: +3:2
StorageDead(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:+3:1: +3:2
return; // scope 0 at $DIR/scalar_literal_propagation.rs:+3:2: +3:2
}

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR scalar_literal_propagation.main.DataflowConstProp.diff
fn main() {
let x = 1;

View File

@ -12,7 +12,6 @@
let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
let mut _10: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
bb0: {
StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
@ -21,29 +20,28 @@
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + span: $DIR/slice_len.rs:6:6: 6:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageLive(_10); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_10 = _3; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_4 = &(*_9); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_3 = &(*_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
_7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
StorageDead(_10); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
_8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
_7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
+ _8 = Lt(const 1_usize, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
}
bb1: {
_1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
_1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
StorageDead(_6); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
StorageDead(_4); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
StorageDead(_2); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
StorageDead(_1); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
nop; // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
return; // scope 0 at $DIR/slice_len.rs:+2:2: +2:2
}
}

View File

@ -12,7 +12,6 @@
let mut _7: usize; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
let mut _8: bool; // in scope 0 at $DIR/slice_len.rs:+1:5: +1:33
let mut _9: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
let mut _10: &[u32; 3]; // in scope 0 at $DIR/slice_len.rs:+1:6: +1:19
bb0: {
StorageLive(_1); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
@ -21,29 +20,28 @@
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + span: $DIR/slice_len.rs:6:6: 6:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageLive(_10); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_10 = _3; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_4 = &(*_9); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_3 = &(*_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:+1:18: +1:19
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:+1:31: +1:32
_7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
StorageDead(_10); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
_8 = const true; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
_7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
+ _8 = Lt(const 1_usize, _7); // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
}
bb1: {
_1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
_1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:+1:5: +1:33
StorageDead(_6); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
StorageDead(_4); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
StorageDead(_2); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
StorageDead(_1); // scope 0 at $DIR/slice_len.rs:+1:33: +1:34
nop; // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/slice_len.rs:+0:11: +2:2
return; // scope 0 at $DIR/slice_len.rs:+2:2: +2:2
}
}

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR slice_len.main.DataflowConstProp.diff

View File

@ -17,17 +17,17 @@
(_1.1: u32) = const 2_u32; // scope 0 at $DIR/tuple_literal_propagation.rs:+1:13: +1:19
StorageLive(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
StorageLive(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
_3 = const (1_u32, 2_u32); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
_3 = _1; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:13: +3:14
_2 = consume(move _3) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:+3:5: +3:15
// mir::Constant
// + span: $DIR/tuple_literal_propagation.rs:5:5: 5:12
// + span: $DIR/tuple_literal_propagation.rs:6:5: 6:12
// + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(<ZST>) }
}
bb1: {
StorageDead(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:14: +3:15
StorageDead(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:+3:15: +3:16
nop; // scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +4:2
_0 = const (); // scope 0 at $DIR/tuple_literal_propagation.rs:+0:11: +4:2
StorageDead(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:+4:1: +4:2
return; // scope 0 at $DIR/tuple_literal_propagation.rs:+4:2: +4:2
}

View File

@ -1,3 +1,4 @@
// unit-test: DataflowConstProp
// EMIT_MIR tuple_literal_propagation.main.DataflowConstProp.diff
fn main() {
let x = (1, 2);