]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/dest-prop/unreachable.rs
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
[rust.git] / tests / mir-opt / dest-prop / unreachable.rs
1 // Check that unreachable code is removed after the destination propagation.
2 // Regression test for issue #105428.
3 //
4 // compile-flags: --crate-type=lib -Zmir-opt-level=0
5 // compile-flags: -Zmir-enable-passes=+ConstProp,+SimplifyConstCondition-after-const-prop,+DestinationPropagation
6
7 // EMIT_MIR unreachable.f.DestinationPropagation.diff
8 pub fn f<T: Copy>(a: T) {
9     let b = a;
10     if false {
11         g(a, b);
12     } else {
13         g(b, b);
14     }
15 }
16
17 #[inline(never)]
18 pub fn g<T: Copy>(_: T, _: T) {}