about summary refs log tree commit diff
path: root/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs
blob: bffbcd7d069e86f692f00017473727ecf5ffc427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Tests that there's no bounds check for the inner loop after the assert.

//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

// CHECK-LABEL: @zero
#[no_mangle]
pub fn zero(d: &mut [Vec<i32>]) {
    // CHECK-NOT: panic_bounds_check
    let n = d.len();
    for i in 0..n {
        assert!(d[i].len() == n);
        for j in 0..n {
            d[i][j] = 0;
        }
    }
}