From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenObjC/objc2-weak-assign.m | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 clang/test/CodeGenObjC/objc2-weak-assign.m (limited to 'clang/test/CodeGenObjC/objc2-weak-assign.m') diff --git a/clang/test/CodeGenObjC/objc2-weak-assign.m b/clang/test/CodeGenObjC/objc2-weak-assign.m new file mode 100644 index 0000000..e5c67c5 --- /dev/null +++ b/clang/test/CodeGenObjC/objc2-weak-assign.m @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6 +// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s +// RUN: grep -e "objc_assign_weak" %t | grep -e "call" | count 6 + +__weak id* x; +id* __weak y; +id* __weak* z; + +__weak id* a1[20]; +id* __weak a2[30]; +id** __weak a3[40]; + +void foo (__weak id *param) { + *param = 0; +} + +int main() +{ + *x = 0; + *y = 0; + **z = 0; + + a1[3] = 0; + a2[3] = 0; + a3[3][4] = 0; +} + -- cgit v1.2.3