summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjCXX/arc-pseudo-destructors.mm
blob: 2f8d9e1878bb8c4a07fc535fa8b2533e394e697c (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s

// CHECK: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
void test_objc_object_pseudo_dtor(__strong id *ptr, __weak id *wptr) {
  // CHECK: load i8***
  // CHECK-NEXT: load i8** 
  // CHECK-NEXT: call void @objc_release
  ptr->~id();

  // CHECK: call void @objc_destroyWeak(i8** {{%.*}})
  wptr->~id();

  // CHECK: load i8***
  // CHECK-NEXT: load i8** 
  // CHECK-NEXT: call void @objc_release
  (*ptr).~id();

  // CHECK: call void @objc_destroyWeak(i8** {{%.*}})
  (*wptr).~id();
  // CHECK: ret void
}