blob: 13ce3386c034cf25ac9866e5379a35e70b5a8315 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
Fariborz Jahanian4027cd12009-06-03 17:15:17 +00002// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
John McCall260611a2012-06-20 06:18:46 +00003// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
Fariborz Jahanian27b7aa02010-05-20 18:22:28 +00004// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
Fariborz Jahanian4027cd12009-06-03 17:15:17 +00005
6__weak id* x;
7id* __weak y;
8id* __weak* z;
9
10__weak id* a1[20];
11id* __weak a2[30];
12id** __weak a3[40];
13
Fariborz Jahanian59a53fa2009-09-16 18:09:18 +000014void foo (__weak id *param) {
15 *param = 0;
16}
17
Fariborz Jahanian4027cd12009-06-03 17:15:17 +000018int main()
19{
20 *x = 0;
21 *y = 0;
22 **z = 0;
23
24 a1[3] = 0;
25 a2[3] = 0;
26 a3[3][4] = 0;
27}
28