From 36981b17ed939300f6f8fc2355a255f711fcef71 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 20 Oct 2011 21:14:49 +0000 Subject: Vendor import of clang release_30 branch r142614: http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614 --- test/Rewriter/rewrite-foreach-in-block.mm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/Rewriter/rewrite-foreach-in-block.mm (limited to 'test/Rewriter/rewrite-foreach-in-block.mm') diff --git a/test/Rewriter/rewrite-foreach-in-block.mm b/test/Rewriter/rewrite-foreach-in-block.mm new file mode 100644 index 000000000000..971330c6bfe9 --- /dev/null +++ b/test/Rewriter/rewrite-foreach-in-block.mm @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp +// rdar:// 9878420 + +void objc_enumerationMutation(id); +void *sel_registerName(const char *); +typedef void (^CoreDAVCompletionBlock)(void); + +@interface I +- (void)M; +- (id) ARR; +@property (readwrite, copy, nonatomic) CoreDAVCompletionBlock c; +@end + +@implementation I +- (void)M { + I* ace; + self.c = ^() { + // sanity test for the changes. + [ace ARR]; + for (I *privilege in [ace ARR]) { } + }; + self.c = ^() { + // sanity test for the changes. + [ace ARR]; + }; +} +@end -- cgit v1.2.3