diff options
Diffstat (limited to 'tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs')
-rw-r--r-- | tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs new file mode 100644 index 000000000..cb59509ff --- /dev/null +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs @@ -0,0 +1,15 @@ +// unit-test +// compile-flags: -O + +// EMIT_MIR mutable_variable_aggregate_partial_read.main.ConstProp.diff +fn main() { + let mut x: (i32, i32) = foo(); + x.1 = 99; + x.0 = 42; + let y = x.1; +} + +#[inline(never)] +fn foo() -> (i32, i32) { + unimplemented!() +} |