]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/deaggregator_test_enum_2.rs
Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514
[rust.git] / src / test / mir-opt / deaggregator_test_enum_2.rs
1 // Test that deaggregate fires in more than one basic block
2
3 enum Foo {
4     A(i32),
5     B(i32),
6 }
7
8 // EMIT_MIR deaggregator_test_enum_2.test1.Deaggregator.diff
9 fn test1(x: bool, y: i32) -> Foo {
10     if x {
11         Foo::A(y)
12     } else {
13         Foo::B(y)
14     }
15 }
16
17 fn main() {
18     // Make sure the function actually gets instantiated.
19     test1(false, 0);
20 }