1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s 2*f4a2713aSLionel Sambuc// rdar://8761767 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc@class CPDestUser; 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel SambucCPDestUser* FUNC(); 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc// CHECK: {{call.* @objc_assign_global}} 9*f4a2713aSLionel SambucCPDestUser* globalUser = FUNC(); 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel Sambuc// CHECK: {{call.* @objc_assign_weak}} 12*f4a2713aSLionel Sambuc__weak CPDestUser* weakUser = FUNC(); 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc 15*f4a2713aSLionel Sambuc// CHECK: {{call.* @objc_assign_global}} 16*f4a2713aSLionel Sambucstatic CPDestUser* staticUser = FUNC(); 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel SambucCPDestUser* GetDestUser() 19*f4a2713aSLionel Sambuc{ 20*f4a2713aSLionel Sambuc// CHECK: {{call.* @objc_assign_global}} 21*f4a2713aSLionel Sambuc static CPDestUser* gUser = FUNC(); 22*f4a2713aSLionel Sambuc// CHECK: {{call.* @objc_assign_weak}} 23*f4a2713aSLionel Sambuc static __weak CPDestUser* wUser = FUNC(); 24*f4a2713aSLionel Sambuc if (wUser) 25*f4a2713aSLionel Sambuc return wUser; 26*f4a2713aSLionel Sambuc if (staticUser) 27*f4a2713aSLionel Sambuc return staticUser; 28*f4a2713aSLionel Sambuc return gUser; 29*f4a2713aSLionel Sambuc} 30