about summary refs log tree commit diff
path: root/tests/codegen/const-array.rs
blob: e257d8acc0881520d96f39db67e15e3822d079d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

const LUT: [u8; 2] = [1, 1];

// CHECK-LABEL: @decode
#[no_mangle]
pub fn decode(i: u8) -> u8 {
    // CHECK: start:
    // CHECK-NEXT: icmp
    // CHECK-NEXT: select
    // CHECK-NEXT: ret
    if i < 2 { LUT[i as usize] } else { 2 }
}