1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -fblocks -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc// CHECK-LABEL: define void @_Z28test_objc_object_pseudo_dtorPU8__strongP11objc_objectPU6__weakS0_
4*f4a2713aSLionel Sambucvoid test_objc_object_pseudo_dtor(__strong id *ptr, __weak id *wptr) {
5*f4a2713aSLionel Sambuc  // CHECK: load i8***
6*f4a2713aSLionel Sambuc  // CHECK-NEXT: load i8**
7*f4a2713aSLionel Sambuc  // CHECK-NEXT: call void @objc_release
8*f4a2713aSLionel Sambuc  ptr->~id();
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc  // CHECK: call void @objc_destroyWeak(i8** {{%.*}})
11*f4a2713aSLionel Sambuc  wptr->~id();
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc  // CHECK: load i8***
14*f4a2713aSLionel Sambuc  // CHECK-NEXT: load i8**
15*f4a2713aSLionel Sambuc  // CHECK-NEXT: call void @objc_release
16*f4a2713aSLionel Sambuc  (*ptr).~id();
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc  // CHECK: call void @objc_destroyWeak(i8** {{%.*}})
19*f4a2713aSLionel Sambuc  (*wptr).~id();
20*f4a2713aSLionel Sambuc  // CHECK: ret void
21*f4a2713aSLionel Sambuc}
22