about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/self_assign.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mir-opt/dataflow-const-prop/self_assign.rs')
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/mir-opt/dataflow-const-prop/self_assign.rs b/tests/mir-opt/dataflow-const-prop/self_assign.rs
new file mode 100644
index 00000000000..8de2195f93b
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/self_assign.rs
@@ -0,0 +1,12 @@
+// unit-test: DataflowConstProp
+
+// EMIT_MIR self_assign.main.DataflowConstProp.diff
+fn main() {
+    let mut a = 0;
+    a = a + 1;
+    a = a;
+
+    let mut b = &a;
+    b = b;
+    a = *b;
+}