about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs
blob: 561bafa96516db7f1471a1bc12aa499218c5817c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// skip-filecheck
//@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=0

#![crate_type = "lib"]

pub enum Thing {
    A,
    B,
}

// EMIT_MIR duplicate_switch_targets.ub_if_b.PreCodegen.after.mir
pub unsafe fn ub_if_b(t: Thing) -> Thing {
    match t {
        Thing::A => t,
        Thing::B => std::hint::unreachable_unchecked(),
    }
}