rust/tests/codegen/issues/issue-116878.rs
Nikita Popov 31f5f033e9 Remove uses of no-system-llvm
It looks like none of these are actually needed.
2024-01-23 10:31:07 +01:00

13 lines
377 B
Rust

// compile-flags: -O
// ignore-debug: the debug assertions get in the way
#![crate_type = "lib"]
/// Make sure no bounds checks are emitted after a `get_unchecked`.
// CHECK-LABEL: @unchecked_slice_no_bounds_check
#[no_mangle]
pub unsafe fn unchecked_slice_no_bounds_check(s: &[u8]) -> u8 {
let a = *s.get_unchecked(1);
// CHECK-NOT: panic_bounds_check
a + s[0]
}