rust/tests/codegen/vec-optimizes-away.rs
2023-01-11 09:32:08 +00:00

13 lines
278 B
Rust

// ignore-debug: the debug assertions get in the way
// no-system-llvm
// compile-flags: -O
#![crate_type="lib"]
#[no_mangle]
pub fn sum_me() -> i32 {
// CHECK-LABEL: @sum_me
// CHECK-NEXT: {{^.*:$}}
// CHECK-NEXT: ret i32 6
vec![1, 2, 3].iter().sum::<i32>()
}