xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-nested-property-in-blocks.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
4*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
5*f4a2713aSLionel Sambuc// radar 8608293
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuctypedef unsigned long size_t;
8*f4a2713aSLionel Sambucvoid *sel_registerName(const char *);
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambucextern "C" void nowarn(id);
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambucextern "C" void noblockwarn(void (^)());
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@interface INTFOFPROP
15*f4a2713aSLionel Sambuc@property (readwrite, retain) INTFOFPROP *outer;
16*f4a2713aSLionel Sambuc@property (readwrite, retain) id inner;
17*f4a2713aSLionel Sambuc@end
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc@interface NSSet
20*f4a2713aSLionel Sambuc- (NSSet *)objectsPassingTest:(char (^)(id obj, char *stop))predicate ;
21*f4a2713aSLionel Sambuc@end
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc@interface INTF
24*f4a2713aSLionel Sambuc- (NSSet *)Meth;
25*f4a2713aSLionel Sambuc@end
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuc@implementation INTF
28*f4a2713aSLionel Sambuc
29*f4a2713aSLionel Sambuc- (NSSet *)Meth
30*f4a2713aSLionel Sambuc{
31*f4a2713aSLionel Sambuc    NSSet *aces;
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc    noblockwarn(^() {
34*f4a2713aSLionel Sambuc        INTFOFPROP *ace;
35*f4a2713aSLionel Sambuc        nowarn(ace.outer.inner);
36*f4a2713aSLionel Sambuc        noblockwarn(^() {
37*f4a2713aSLionel Sambuc          INTFOFPROP *ace;
38*f4a2713aSLionel Sambuc          nowarn(ace.outer.inner);
39*f4a2713aSLionel Sambuc        });
40*f4a2713aSLionel Sambuc    });
41*f4a2713aSLionel Sambuc
42*f4a2713aSLionel Sambuc    noblockwarn(^() {
43*f4a2713aSLionel Sambuc        INTFOFPROP *ace;
44*f4a2713aSLionel Sambuc        nowarn(ace.outer.inner);
45*f4a2713aSLionel Sambuc    });
46*f4a2713aSLionel Sambuc
47*f4a2713aSLionel Sambucreturn [aces objectsPassingTest:^(id obj, char *stop)
48*f4a2713aSLionel Sambuc    {
49*f4a2713aSLionel Sambuc        INTFOFPROP *ace = (INTFOFPROP *)obj;
50*f4a2713aSLionel Sambuc        nowarn(ace.outer.inner);
51*f4a2713aSLionel Sambuc        return (char)0;
52*f4a2713aSLionel Sambuc    }];
53*f4a2713aSLionel Sambuc
54*f4a2713aSLionel Sambuc}
55*f4a2713aSLionel Sambuc@end
56