summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs')
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
new file mode 100644
index 000000000..9bb62b897
--- /dev/null
+++ b/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
@@ -0,0 +1,14 @@
+// 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!()
+}