]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/enum-bounds-check.rs
Rollup merge of #69104 - tmiasko:configure-cmake, r=Mark-Simulacrum
[rust.git] / src / test / codegen / enum-bounds-check.rs
1 // compile-flags: -O
2
3 #![crate_type = "lib"]
4
5 pub enum Foo {
6     A, B
7 }
8
9 // CHECK-LABEL: @lookup
10 #[no_mangle]
11 pub fn lookup(buf: &[u8; 2], f: Foo) -> u8 {
12     // CHECK-NOT: panic_bounds_check
13     buf[f as usize]
14 }