blob: 70da6786c067a5f30cb380eea528212dcd88ef53 [file] [log] [blame]
John McCall8f0e8d22011-06-15 23:25:17 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000
2// RUN: arcmt-test --args -arch x86_64 %s -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 > %t
3// RUN: diff %t %s.result
4
5#include "Common.h"
6
7@interface Foo : NSObject
8-(Foo *)something;
9@end
10
11void bar(void (^block)());
12
13void test1(Foo *p) {
14 __block Foo *x = p; // __block used just to break cycle.
15 bar(^{
16 [x something];
17 });
18}
19
20void test2(Foo *p) {
21 __block Foo *x; // __block used as output variable.
22 bar(^{
23 x = [p something];
24 });
25}