summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs')
-rw-r--r--tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs
new file mode 100644
index 000000000..9060f7e9b
--- /dev/null
+++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs
@@ -0,0 +1,10 @@
+// unit-test
+// compile-flags: -O
+
+// EMIT_MIR mutable_variable_aggregate_mut_ref.main.ConstProp.diff
+fn main() {
+ let mut x = (42, 43);
+ let z = &mut x;
+ z.1 = 99;
+ let y = x;
+}