summaryrefslogtreecommitdiffstats
path: root/tests/codegen/issues/issue-101082.rs
blob: 2cbe99942cba3e26c079c3da4a4c2d545e95d63c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// compile-flags: -O
// min-llvm-version: 16
// ignore-debug: the debug assertions get in the way

#![crate_type = "lib"]

#[no_mangle]
pub fn test() -> usize {
    // CHECK-LABEL: @test(
    // CHECK: ret {{i64|i32}} 165
    let values = [23, 16, 54, 3, 60, 9];
    let mut acc = 0;
    for item in values {
        acc += item;
    }
    acc
}