rust/tests/codegen/issues/issue-101082.rs
2024-02-23 18:04:01 -05:00

16 lines
270 B
Rust

//@ compile-flags: -O
#![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
}