summaryrefslogtreecommitdiffstats
path: root/tests/codegen/alloc-optimisation.rs
blob: f88d695d87e1e57d40dbab9202a4559f3eba40be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//
// 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);
}