File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 4
4
// Test to check that types with "complex" destructors, but trivial `Default` impls
5
5
// are constructed directly into the allocation in `Box::default` and `Arc::default`.
6
6
7
+ use std:: rc:: Rc ;
7
8
use std:: sync:: Arc ;
8
9
9
10
// CHECK-LABEL: @box_default_inplace
@@ -16,6 +17,16 @@ pub fn box_default_inplace() -> Box<(String, String)> {
16
17
Box :: default ( )
17
18
}
18
19
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
+
19
30
// CHECK-LABEL: @arc_default_inplace
20
31
#[ no_mangle]
21
32
pub fn arc_default_inplace ( ) -> Arc < ( String , String ) > {
You can’t perform that action at this time.
0 commit comments