]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/issue-73031.rs
Update unsuspicious file list
[rustc.git] / src / test / codegen / issue-73031.rs
CommitLineData
6a06907d
XL
1// compile-flags: -O
2#![crate_type = "lib"]
3
4// Test that LLVM can eliminate the unreachable `All::None` branch.
5
6pub enum All {
7 None,
8 Foo,
9 Bar,
10}
11
12// CHECK-LABEL: @issue_73031
13#[no_mangle]
14pub fn issue_73031(a: &mut All, q: i32) -> i32 {
15 *a = if q == 5 {
16 All::Foo
17 } else {
18 All::Bar
19 };
20 match *a {
21 // CHECK-NOT: panic
22 All::None => panic!(),
23 All::Foo => 1,
24 All::Bar => 2,
25 }
26}