File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 44// Test to check that types with "complex" destructors, but trivial `Default` impls
55// are constructed directly into the allocation in `Box::default` and `Arc::default`.
66
7+ use std:: rc:: Rc ;
78use std:: sync:: Arc ;
89
910// CHECK-LABEL: @box_default_inplace
@@ -16,6 +17,16 @@ pub fn box_default_inplace() -> Box<(String, String)> {
1617 Box :: default ( )
1718}
1819
20+ // CHECK-LABEL: @rc_default_inplace
21+ #[ no_mangle]
22+ pub fn rc_default_inplace ( ) -> Rc < ( String , String ) > {
23+ // CHECK-NOT: alloca
24+ // CHECK: [[RC:%.*]] = {{.*}}call {{.*}}__rust_alloc(
25+ // CHECK-NOT: call void @llvm.memcpy
26+ // CHECK: ret ptr [[RC]]
27+ Rc :: default ( )
28+ }
29+
1930// CHECK-LABEL: @arc_default_inplace
2031#[ no_mangle]
2132pub fn arc_default_inplace ( ) -> Arc < ( String , String ) > {
You can’t perform that action at this time.
0 commit comments