2012-06-20 14:18:46 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
|
2009-06-04 01:15:17 +08:00
|
|
|
// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
|
2012-06-20 14:18:46 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
|
2010-05-21 02:22:28 +08:00
|
|
|
// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6
|
2009-06-04 01:15:17 +08:00
|
|
|
|
|
|
|
__weak id* x;
|
|
|
|
id* __weak y;
|
|
|
|
id* __weak* z;
|
|
|
|
|
|
|
|
__weak id* a1[20];
|
|
|
|
id* __weak a2[30];
|
|
|
|
id** __weak a3[40];
|
|
|
|
|
2009-09-17 02:09:18 +08:00
|
|
|
void foo (__weak id *param) {
|
|
|
|
*param = 0;
|
|
|
|
}
|
|
|
|
|
2009-06-04 01:15:17 +08:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
*x = 0;
|
|
|
|
*y = 0;
|
|
|
|
**z = 0;
|
|
|
|
|
|
|
|
a1[3] = 0;
|
|
|
|
a2[3] = 0;
|
|
|
|
a3[3][4] = 0;
|
|
|
|
}
|
|
|
|
|