add codegen test for #93036
This commit is contained in:
parent
7d967ffa8d
commit
8bd6c04cfc
18
tests/codegen/issues/issue-93036-assert-index.rs
Normal file
18
tests/codegen/issues/issue-93036-assert-index.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//@ compile-flags: -O
|
||||||
|
//@ min-llvm-version: 17
|
||||||
|
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
// CHECK-LABEL: @foo
|
||||||
|
// CHECK: {{.*}}:
|
||||||
|
// CHECK: ret
|
||||||
|
// CHECK-NOT: unreachable
|
||||||
|
pub fn foo(arr: &mut [u32]) {
|
||||||
|
for i in 0..arr.len() {
|
||||||
|
for j in 0..i {
|
||||||
|
assert!(j < arr.len());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user