]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenObjCXX/arc-pseudo-destructors.mm
Vendor import of clang release_30 branch r142614:
[FreeBSD/FreeBSD.git] / test / CodeGenObjCXX / arc-pseudo-destructors.mm
1 // RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
2
3 // CHECK: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
4 void test_objc_object_pseudo_dtor(__strong id *ptr, __weak id *wptr) {
5   // CHECK: load i8***
6   // CHECK-NEXT: load i8** 
7   // CHECK-NEXT: call void @objc_release
8   ptr->~id();
9
10   // CHECK: call void @objc_destroyWeak(i8** {{%.*}})
11   wptr->~id();
12
13   // CHECK: load i8***
14   // CHECK-NEXT: load i8** 
15   // CHECK-NEXT: call void @objc_release
16   (*ptr).~id();
17
18   // CHECK: call void @objc_destroyWeak(i8** {{%.*}})
19   (*wptr).~id();
20   // CHECK: ret void
21 }