Skip to content
/ rustc Public
forked from rust-lang/rust

Commit

Permalink
add codegen test for rust-lang#93036
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jun 8, 2024
1 parent eeffa51 commit 7101d0c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/codegen/issues/issue-93036-assert-index.rs
Original file line number Diff line number Diff line change
@@ -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());
}
}
}

0 comments on commit 7101d0c

Please sign in to comment.