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