rust/tests/mir-opt/deaggregator_test_enum_2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
384 B
Rust
Raw Normal View History

// unit-test: Deaggregator
// Test that deaggregate fires in more than one basic block
enum Foo {
A(i32),
B(i32),
}
2020-07-27 14:22:43 -05:00
// EMIT_MIR deaggregator_test_enum_2.test1.Deaggregator.diff
fn test1(x: bool, y: i32) -> Foo {
if x {
Foo::A(y)
} else {
Foo::B(y)
}
}
2017-10-30 12:20:07 -05:00
fn main() {
// Make sure the function actually gets instantiated.
test1(false, 0);
}