about summary refs log tree commit diff
path: root/tests/mir-opt/dataflow-const-prop/struct.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-05-13 14:19:31 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-09-11 16:29:41 +0000
commit82f0468009da17c14a3ab69d01526db848cf8b55 (patch)
tree66bb1bb46f0789bf3b512c6e315be60fa754bd10 /tests/mir-opt/dataflow-const-prop/struct.rs
parent6ad6b4381cb38c7562649deb24374889f1f1b9ae (diff)
downloadrust-82f0468009da17c14a3ab69d01526db848cf8b55.tar.gz
rust-82f0468009da17c14a3ab69d01526db848cf8b55.zip
Handle reading statics.
Diffstat (limited to 'tests/mir-opt/dataflow-const-prop/struct.rs')
-rw-r--r--tests/mir-opt/dataflow-const-prop/struct.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs
index d2cd697db25..c171ed74c54 100644
--- a/tests/mir-opt/dataflow-const-prop/struct.rs
+++ b/tests/mir-opt/dataflow-const-prop/struct.rs
@@ -1,7 +1,9 @@
 // unit-test: DataflowConstProp
 
+#[derive(Copy, Clone)]
 struct S(i32);
 
+#[derive(Copy, Clone)]
 struct BigStruct(S, u8, f32, S);
 
 // EMIT_MIR struct.main.DataflowConstProp.diff
@@ -13,4 +15,7 @@ fn main() {
 
     const VAL: BigStruct = BigStruct(S(1), 5, 7., S(13));
     let BigStruct(a, b, c, d) = VAL;
+
+    static STAT: &BigStruct = &BigStruct(S(1), 5, 7., S(13));
+    let BigStruct(a, b, c, d) = *STAT;
 }