]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/match-unoptimized.rs
Update unsuspicious file list
[rustc.git] / src / test / codegen / match-unoptimized.rs
CommitLineData
487cf647
FG
1// compile-flags: -C no-prepopulate-passes -Copt-level=0
2
3#![crate_type = "lib"]
4
5#[repr(u16)]
6pub enum E2 {
7 A = 13,
8 B = 42,
9}
10
11// For unoptimized code we produce a `br` instead of a `switch`. Compare with
12// `src/test/codegen/match-optimized.rs`
13
14// CHECK-LABEL: @exhaustive_match_2
15#[no_mangle]
16pub fn exhaustive_match_2(e: E2) -> u8 {
17 // CHECK: %[[CMP:.+]] = icmp eq i16 %{{.+}}, 13
18 // CHECK-NEXT: br i1 %[[CMP:.+]],
19 match e {
20 E2::A => 0,
21 E2::B => 1,
22 }
23}