1// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
2// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
3// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
4// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
5
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
14void foo (__weak id *param) {
15 *param = 0;
16}
17
18int 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
29