File: vec-optimizes-away.rs

package info (click to toggle)
rustc 1.90.0%2Bdfsg1-1~bpo13%2B2
  • links: PTS, VCS
  • area: main
  • in suites: trixie-backports
  • size: 925,944 kB
  • sloc: xml: 158,148; javascript: 19,781; sh: 19,174; python: 15,732; ansic: 13,096; cpp: 7,181; asm: 4,376; makefile: 697; lisp: 176; sql: 15
file content (12 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

#[no_mangle]
pub fn sum_me() -> i32 {
    // CHECK-LABEL: @sum_me
    // CHECK-NEXT: {{^.*:$}}
    // CHECK-NEXT: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2
    // CHECK-NEXT: tail call void @_R{{.+}}__rust_no_alloc_shim_is_unstable_v2()
    // CHECK-NEXT: ret i32 6
    vec![1, 2, 3].iter().sum::<i32>()
}