1/* Check that typedefs of ObjC classes preserve
2   any @protocol qualifiers.  */
3/* { dg-do compile } */
4/* Suppress warnings that the GNUStep headers introduce.  */
5/* { dg-additional-options "-std=gnu++11 -Wno-expansion-to-defined -Wno-variadic-macros" { target *-*-darwin* } } */
6
7#ifdef __NEXT_RUNTIME__
8#include "../objc-obj-c++-shared/F-NSObject.h"
9#define OBJECT NSObject
10#else
11#include <objc/Object.h>
12#define OBJECT Object
13#endif
14
15@protocol CanDoStuff;
16
17typedef OBJECT<CanDoStuff> CanDoStuffType;
18typedef OBJECT<CanDoStuff> *CanDoStuffTypePtr;
19
20@protocol CanDoStuff
21- (int) dostuff;
22@end
23
24@protocol MoreStuff
25- (int) morestuff;
26@end
27
28int main(void)
29{
30    CanDoStuffTypePtr  dice     = nil;
31    CanDoStuffType    *nodice   = nil;
32    int count;
33    count = [dice dostuff];
34    count = [nodice dostuff];
35    return 0;
36}
37
38