blob: de34ac827069f7a60b48ace8f9ee99577b18f12b [file] [log] [blame]
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -07001// RUN: %clang_cc1 -triple i686-pc-windows -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2// RUN: %clang_cc1 -triple i686-pc-windows -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3// RUN: %clang_cc1 -triple i686-pc-windows -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp
4// RUN: %clang_cc1 -triple i686-pc-windows -fsyntax-only -fms-extensions -Wno-address-of-temporary -Did="void *" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp
Fariborz Jahanianda4ad9f2010-11-08 18:37:50 +00005// radar 8608293
6
Fariborz Jahanian8b08adb2012-05-03 21:44:12 +00007typedef unsigned long size_t;
Fariborz Jahanianda4ad9f2010-11-08 18:37:50 +00008void *sel_registerName(const char *);
9
10extern "C" void nowarn(id);
11
12extern "C" void noblockwarn(void (^)());
13
14@interface INTFOFPROP
15@property (readwrite, retain) INTFOFPROP *outer;
16@property (readwrite, retain) id inner;
17@end
18
19@interface NSSet
20- (NSSet *)objectsPassingTest:(char (^)(id obj, char *stop))predicate ;
21@end
22
23@interface INTF
24- (NSSet *)Meth;
25@end
26
27@implementation INTF
28
29- (NSSet *)Meth
30{
31 NSSet *aces;
32
33 noblockwarn(^() {
34 INTFOFPROP *ace;
35 nowarn(ace.outer.inner);
36 noblockwarn(^() {
37 INTFOFPROP *ace;
38 nowarn(ace.outer.inner);
39 });
40 });
41
42 noblockwarn(^() {
43 INTFOFPROP *ace;
44 nowarn(ace.outer.inner);
45 });
46
47return [aces objectsPassingTest:^(id obj, char *stop)
48 {
49 INTFOFPROP *ace = (INTFOFPROP *)obj;
50 nowarn(ace.outer.inner);
51 return (char)0;
52 }];
53
54}
55@end