diff options
Diffstat (limited to 'test/CodeGenObjCXX/arc.mm')
-rw-r--r-- | test/CodeGenObjCXX/arc.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/arc.mm b/test/CodeGenObjCXX/arc.mm index 4ce59df..e3a6349 100644 --- a/test/CodeGenObjCXX/arc.mm +++ b/test/CodeGenObjCXX/arc.mm @@ -324,3 +324,13 @@ template void test40_helper<int>(); // CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[TEMP]] // CHECK-NEXT: call i8* @objc_retain(i8* [[T0]]) +// Check that moves out of __weak variables are compiled to use objc_moveWeak. +void test41(__weak id &&x) { + __weak id y = static_cast<__weak id &&>(x); +} +// CHECK-LABEL: define void @_Z6test41OU6__weakP11objc_object +// CHECK: [[X:%.*]] = alloca i8** +// CHECK: [[Y:%.*]] = alloca i8* +// CHECK: [[T0:%.*]] = load i8**, i8*** [[X]] +// CHECK-NEXT: call void @objc_moveWeak(i8** [[Y]], i8** [[T0]]) +// CHECK-NEXT: call void @objc_destroyWeak(i8** [[Y]]) |