]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/move-val-init.rs
Rollup merge of #61389 - Zoxc:arena-cleanup, r=eddyb
[rust.git] / src / test / codegen / move-val-init.rs
1 // compile-flags: -C no-prepopulate-passes
2
3 #![feature(core_intrinsics)]
4 #![crate_type = "lib"]
5
6 // test that `move_val_init` actually avoids big allocas
7
8 use std::intrinsics::move_val_init;
9
10 pub struct Big {
11     pub data: [u8; 65536]
12 }
13
14 // CHECK-LABEL: @test_mvi
15 #[no_mangle]
16 pub unsafe fn test_mvi(target: *mut Big, make_big: fn() -> Big) {
17     // CHECK: call void %make_big(%Big*{{[^%]*}} %target)
18     move_val_init(target, make_big());
19 }