2011-10-02 09:16:38 +08:00
|
|
|
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
|
2011-06-16 07:02:42 +08:00
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
|
2011-06-16 07:02:42 +08:00
|
|
|
void test_objc_object_pseudo_dtor(__strong id *ptr, __weak id *wptr) {
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK: load i8**, i8***
|
|
|
|
// CHECK-NEXT: load i8*, i8**
|
2011-06-16 07:02:42 +08:00
|
|
|
// CHECK-NEXT: call void @objc_release
|
|
|
|
ptr->~id();
|
|
|
|
|
|
|
|
// CHECK: call void @objc_destroyWeak(i8** {{%.*}})
|
|
|
|
wptr->~id();
|
|
|
|
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK: load i8**, i8***
|
|
|
|
// CHECK-NEXT: load i8*, i8**
|
2011-06-16 07:02:42 +08:00
|
|
|
// CHECK-NEXT: call void @objc_release
|
|
|
|
(*ptr).~id();
|
|
|
|
|
|
|
|
// CHECK: call void @objc_destroyWeak(i8** {{%.*}})
|
|
|
|
(*wptr).~id();
|
|
|
|
// CHECK: ret void
|
|
|
|
}
|