summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/pr23214.m
blob: d8092a8067aed145be4af0e2aca5656999e5fb4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Test that there is no problem initializing multiple static
   Protocol instances.  */

/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */

#include <objc/Protocol.h>
 
#ifdef __OBJC2__
/* The ObjC V2 "Object" does not provide -class.  */
@interface Object (TS_CAT)
- class;
@end

@implementation Object (TS_CAT)
- class { return isa; }
@end
#endif

@protocol A
@end

@protocol B 
@end

@interface Dummy : Object <B>
@end

int main ()
{
  [@protocol(A) class];
  [@protocol(B) class];

  return 0;
}

@implementation Dummy
@end