diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2024-06-28 13:01:27 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2024-07-13 11:54:30 +0000 |
| commit | af876626b057bd4c1cf73897b8313f1d09ea6176 (patch) | |
| tree | 0bcaa3d2083bc9f26df4d99aef0735f04f25d9d6 /tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff | |
| parent | 76f5bc6a9ffcd0b3255b5266cc963635a12f6016 (diff) | |
| download | rust-af876626b057bd4c1cf73897b8313f1d09ea6176.tar.gz rust-af876626b057bd4c1cf73897b8313f1d09ea6176.zip | |
Add test for copying aggregates.
Diffstat (limited to 'tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff')
| -rw-r--r-- | tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff new file mode 100644 index 00000000000..19bbbad5123 --- /dev/null +++ b/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff @@ -0,0 +1,55 @@ +- // MIR for `foo` before DataflowConstProp ++ // MIR for `foo` after DataflowConstProp + + fn foo() -> u32 { + let mut _0: u32; + let _1: (u32, u32); + let mut _4: bool; + let mut _5: u32; + scope 1 { + debug a => _1; + let _2: (u32, u32); + scope 2 { + debug b => _2; + let _3: u32; + scope 3 { + debug c => _3; + } + } + } + + bb0: { + StorageLive(_1); + _1 = const Foo; + StorageLive(_2); + _2 = _1; + StorageLive(_3); + _3 = (_2.1: u32); + StorageLive(_4); + StorageLive(_5); + _5 = _3; + _4 = Ge(move _5, const 2_u32); + switchInt(move _4) -> [0: bb2, otherwise: bb1]; + } + + bb1: { + StorageDead(_5); + _0 = (_2.0: u32); + goto -> bb3; + } + + bb2: { + StorageDead(_5); + _0 = const 13_u32; + goto -> bb3; + } + + bb3: { + StorageDead(_4); + StorageDead(_3); + StorageDead(_2); + StorageDead(_1); + return; + } + } + |
