about summary refs log tree commit diff
path: root/tests/codegen/issues/issue-101814.rs
blob: 668ec8476e8c0f9b1627176b1198b696c915fae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

#[no_mangle]
pub fn test(a: [i32; 10]) -> i32 {
    // CHECK-LABEL: @test(
    // CHECK: [[L1:%.+]] = load i32
    // CHECK: [[L2:%.+]] = load i32
    // CHECK: [[R:%.+]] = add i32 [[L1]], [[L2]]
    // CHECK: ret i32 [[R]]
    let mut sum = 0;
    for v in a.iter().skip(8) {
        sum += v;
    }

    sum
}