mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
66982a383b
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;
14 lines
371 B
Rust
14 lines
371 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: {{.*}} load volatile i8, ptr @__rust_no_alloc_shim_is_unstable, align 1
|
|
// CHECK-NEXT: ret i32 6
|
|
vec![1, 2, 3].iter().sum::<i32>()
|
|
}
|