]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/enum-bounds-check-issue-82871.rs
Rollup merge of #87644 - Flying-Toast:vec-remove-note, r=the8472
[rust.git] / src / test / codegen / enum-bounds-check-issue-82871.rs
1 // compile-flags: -O
2 // min-llvm-version: 11.0
3
4 #![crate_type = "lib"]
5
6 #[repr(C)]
7 pub enum E {
8     A,
9 }
10
11 // CHECK-LABEL: @index
12 #[no_mangle]
13 pub fn index(x: &[u32; 3], ind: E) -> u32{
14     // CHECK-NOT: panic_bounds_check
15     x[ind as usize]
16 }