rust/tests/codegen/issues/issue-93036-assert-index.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
243 B
Rust
Raw Normal View History

2024-05-20 15:15:31 -05:00
//@ compile-flags: -O
#![crate_type = "lib"]
#[no_mangle]
// CHECK-LABEL: @foo
// CHECK-NOT: unreachable
pub fn foo(arr: &mut [u32]) {
for i in 0..arr.len() {
for j in 0..i {
assert!(j < arr.len());
}
}
}