Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
453b51a65ab00939d2dce3de24ce38489b5c7eb6
rust/tests/codegen/vec-optimizes-away.rs

12 lines
312 B
Rust
Raw Normal View History

tests/codegen: use -Copt-level=3 instead of -O
2025-02-08 19:45:40 -08:00
//@ compile-flags: -Copt-level=3
Prevent insta-stable no alloc shim support You will need to add the following as replacement for the old __rust_* definitions when not using the alloc shim. #[no_mangle] static __rust_no_alloc_shim_is_unstable: u8 = 0;
2022-09-10 11:33:44 +00:00
#![crate_type = "lib"]
std: Mark `Layout::repeat` as `#[inline]` This fixes an optimization regression by allowing LLVM to see through more functions. Closes #43272
2017-07-27 14:53:44 -07:00
#[no_mangle]
pub fn sum_me() -> i32 {
// CHECK-LABEL: @sum_me
// CHECK-NEXT: {{^.*:$}}
Prevent insta-stable no alloc shim support You will need to add the following as replacement for the old __rust_* definitions when not using the alloc shim. #[no_mangle] static __rust_no_alloc_shim_is_unstable: u8 = 0;
2022-09-10 11:33:44 +00:00
// CHECK-NEXT: {{.*}} load volatile i8, ptr @__rust_no_alloc_shim_is_unstable, align 1
std: Mark `Layout::repeat` as `#[inline]` This fixes an optimization regression by allowing LLVM to see through more functions. Closes #43272
2017-07-27 14:53:44 -07:00
// CHECK-NEXT: ret i32 6
vec![1, 2, 3].iter().sum::<i32>()
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1227ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API