summary refs log tree commit diff
path: root/src/test/codegen/enum-bounds-check-issue-82871.rs
blob: a1fa1387d9441d0f00d83b8e87fae37d51b7663e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// compile-flags: -O

#![crate_type = "lib"]

#[repr(C)]
pub enum E {
    A,
}

// CHECK-LABEL: @index
#[no_mangle]
pub fn index(x: &[u32; 3], ind: E) -> u32{
    // CHECK-NOT: panic_bounds_check
    x[ind as usize]
}