xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-modern-ivars.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@protocol P @end
5*f4a2713aSLionel Sambuc@protocol P1 @end
6*f4a2713aSLionel Sambuc@interface INTF
7*f4a2713aSLionel Sambuc{
8*f4a2713aSLionel Sambuc  id CLASS_IVAR;
9*f4a2713aSLionel Sambuc  id<P, P1> Q_IVAR;
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc  void (^_block)(id<P>);
12*f4a2713aSLionel Sambuc  void (*_fptr)(void (^_block)(id<P>));
13*f4a2713aSLionel Sambuc  char CLASS_EXT_IVAR;
14*f4a2713aSLionel Sambuc  id<P, P1> (^ext_block)(id<P>, INTF<P,P1>*, INTF*);
15*f4a2713aSLionel Sambuc  id IMPL_IVAR;
16*f4a2713aSLionel Sambuc  double D_IMPL_IVAR;
17*f4a2713aSLionel Sambuc  INTF<P> *(*imp_fptr)(void (^_block)(id<P>, INTF<P,P1>*));
18*f4a2713aSLionel Sambuc  id arr[100];
19*f4a2713aSLionel Sambuc}
20*f4a2713aSLionel Sambuc@end
21*f4a2713aSLionel Sambuc
22*f4a2713aSLionel Sambuc@implementation INTF @end
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambuc@interface MISC_INTF
25*f4a2713aSLionel Sambuc{
26*f4a2713aSLionel Sambuc  id CLASS_IVAR;
27*f4a2713aSLionel Sambuc  id<P, P1> Q_IVAR;
28*f4a2713aSLionel Sambuc
29*f4a2713aSLionel Sambuc  void (^_block)(id<P>);
30*f4a2713aSLionel Sambuc  void (*_fptr)(void (^_block)(id<P>));
31*f4a2713aSLionel Sambuc  unsigned int BF : 8;
32*f4a2713aSLionel Sambuc}
33*f4a2713aSLionel Sambuc@end
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambuc@interface MISC_INTF()
36*f4a2713aSLionel Sambuc{
37*f4a2713aSLionel Sambuc  char CLASS_EXT_IVAR;
38*f4a2713aSLionel Sambuc  id<P, P1> (^ext_block)(id<P>, MISC_INTF<P,P1>*, MISC_INTF*);
39*f4a2713aSLionel Sambuc}
40*f4a2713aSLionel Sambuc@end
41*f4a2713aSLionel Sambuc
42*f4a2713aSLionel Sambuc@interface MISC_INTF() {
43*f4a2713aSLionel Sambuc  int II1;
44*f4a2713aSLionel Sambuc  double DD1; }
45*f4a2713aSLionel Sambuc@end
46*f4a2713aSLionel Sambuc
47*f4a2713aSLionel Sambuc@interface MISC_INTF() { int II2; double DD2; }
48*f4a2713aSLionel Sambuc@end
49*f4a2713aSLionel Sambuc
50*f4a2713aSLionel Sambuc@interface MISC_INTF() { int II3;
51*f4a2713aSLionel Sambuc  double DD3; }
52*f4a2713aSLionel Sambuc@end
53*f4a2713aSLionel Sambuc
54*f4a2713aSLionel Sambuc@interface MISC_INTF() { int II4; double DD4;
55*f4a2713aSLionel Sambuc}
56*f4a2713aSLionel Sambuc@end
57*f4a2713aSLionel Sambuc
58*f4a2713aSLionel Sambuc@implementation MISC_INTF
59*f4a2713aSLionel Sambuc{
60*f4a2713aSLionel Sambuc  id IMPL_IVAR;
61*f4a2713aSLionel Sambuc  double D_IMPL_IVAR;
62*f4a2713aSLionel Sambuc  MISC_INTF<P> *(*imp_fptr)(void (^_block)(id<P>, MISC_INTF<P,P1>*));
63*f4a2713aSLionel Sambuc}
64*f4a2713aSLionel Sambuc@end
65