File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11//@ compile-flags: -O
2+ //@ compile-flags: -Zmerge-functions=disabled
23#![ crate_type = "lib" ]
34
45// Test to check that types with "complex" destructors, but trivial `Default` impls
56// are constructed directly into the allocation in `Box::default` and `Arc::default`.
67
8+ use std:: rc:: Rc ;
79use std:: sync:: Arc ;
810
911// CHECK-LABEL: @box_default_inplace
@@ -16,6 +18,16 @@ pub fn box_default_inplace() -> Box<(String, String)> {
1618 Box :: default ( )
1719}
1820
21+ // CHECK-LABEL: @rc_default_inplace
22+ #[ no_mangle]
23+ pub fn rc_default_inplace ( ) -> Rc < ( String , String ) > {
24+ // CHECK-NOT: alloca
25+ // CHECK: [[RC:%.*]] = {{.*}}call {{.*}}__rust_alloc(
26+ // CHECK-NOT: call void @llvm.memcpy
27+ // CHECK: ret ptr [[RC]]
28+ Rc :: default ( )
29+ }
30+
1931// CHECK-LABEL: @arc_default_inplace
2032#[ no_mangle]
2133pub fn arc_default_inplace ( ) -> Arc < ( String , String ) > {
You can’t perform that action at this time.
0 commit comments