mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +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;
15 lines
330 B
Rust
15 lines
330 B
Rust
//
|
|
// no-system-llvm
|
|
// compile-flags: -O
|
|
#![crate_type = "lib"]
|
|
|
|
#[no_mangle]
|
|
pub fn alloc_test(data: u32) {
|
|
// CHECK-LABEL: @alloc_test
|
|
// CHECK-NEXT: start:
|
|
// CHECK-NEXT: {{.*}} load volatile i8, ptr @__rust_no_alloc_shim_is_unstable, align 1
|
|
// CHECK-NEXT: ret void
|
|
let x = Box::new(data);
|
|
drop(x);
|
|
}
|