blob: 539e21fcfbeebb2cabba13b4929af46c4e5609d4 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
Fariborz Jahanianec805122011-01-13 20:00:54 +00002// rdar://8761767
3
4@class CPDestUser;
5
6CPDestUser* FUNC();
7
8// CHECK: {{call.* @objc_assign_global}}
9CPDestUser* globalUser = FUNC();
10
11// CHECK: {{call.* @objc_assign_weak}}
12__weak CPDestUser* weakUser = FUNC();
13
14
15// CHECK: {{call.* @objc_assign_global}}
16static CPDestUser* staticUser = FUNC();
17
18CPDestUser* 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}