OSDN Git Service

In gcc/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / pr23214.m
1 /* Test that there is no problem initializing multiple static
2    Protocol instances.  */
3
4 /* { dg-do run } */
5 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
6
7 #include <objc/Protocol.h>
8  
9 #ifdef __OBJC2__
10 /* The ObjC V2 "Object" does not provide -class.  */
11 @interface Object (TS_CAT)
12 - class;
13 @end
14
15 @implementation Object (TS_CAT)
16 - class { return isa; }
17 @end
18 #endif
19
20 @protocol A
21 @end
22
23 @protocol B 
24 @end
25
26 @interface Dummy : Object <B>
27 @end
28
29 int main ()
30 {
31   [@protocol(A) class];
32   [@protocol(B) class];
33
34   return 0;
35 }
36
37 @implementation Dummy
38 @end