1 // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-darwin9 %s 2 // FIXME: must also compile as Objective-C++ 3 4 // <rdar://problem/6487662> 5 typedef struct objc_selector *SEL; 6 typedef signed char BOOL; 7 typedef unsigned int NSUInteger; 8 typedef struct _NSZone NSZone; 9 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; 10 @protocol NSObject 11 - (BOOL)isEqual:(id)object; 12 - (BOOL)respondsToSelector:(SEL)aSelector; 13 @end 14 @protocol NSCopying 15 - (id)copyWithZone:(NSZone *)zone; 16 @end 17 @protocol NSMutableCopying 18 - (id)mutableCopyWithZone:(NSZone *)zone; 19 @end 20 @protocol NSCoding 21 - (void)encodeWithCoder:(NSCoder *)aCoder; 22 @end 23 @interface NSObject <NSObject> {} 24 @end 25 @class NSString, NSData; 26 typedef struct _NSPoint {} 27 NSRange; 28 @interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> 29 - (NSUInteger)length; 30 @end 31 @interface NSMutableString : NSString 32 - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString; 33 @end 34 @class NSArray, NSDictionary, NSMapTable; 35 @interface NSResponder : NSObject <NSCoding> {} 36 @end 37 @protocol NSAnimatablePropertyContainer 38 - (id)animator; 39 @end 40 extern NSString *NSAnimationTriggerOrderIn ; 41 @interface NSView : NSResponder <NSAnimatablePropertyContainer> { 42 struct __VFlags2 {} _vFlags2; 43 } 44 @end 45 @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView; 46 @interface FooiagramView : NSView { 47 id _delegate; 48 } 49 @end 50 @class FooiagramView; 51 @interface _FooiagramViewReserved : NSObject { 52 @public 53 NSMutableString *_typeToSelectString; 54 struct _FooiagramViewFlags { 55 unsigned int delegateRespondsToPrintInfoForBarView : 1; 56 } _dvFlags; 57 } 58 @end 59 extern _FooiagramViewReserved *_FooiagramViewBarViewReserved(FooiagramView *BarView); 60 @interface FooiagramView (FooiagramViewPrivate) 61 + (Class)_defaultBarToolManagerClass; 62 @end 63 @implementation FooiagramView 64 static NSMapTable *_defaultMenuForClass = 0; 65 - (void)setDelegate:(id)delegate { 66 if (_delegate != delegate) { 67 struct _FooiagramViewFlags *dvFlags = 68 &_FooiagramViewBarViewReserved(self)->_dvFlags; 69 if (_delegate != ((void *)0)) { 70 dvFlags->delegateRespondsToPrintInfoForBarView = [_delegate respondsToSelector:@selector(printInfoForBarView:)]; 71 } 72 } 73 } 74 @end 75 76 // <rdar://problem/6487684> 77 @interface WizKing_MIKeep { 78 struct __LoreStuffNode *_historyStuff; 79 } 80 @end 81 typedef struct __LoreStuffNode {} LoreStuffNode; 82 @implementation WizKing_MIKeep 83 - init { 84 LoreStuffNode *node; 85 node = &(_historyStuff[1]); 86 return 0; 87 } 88 @end 89 90 // <rdar://problem/6487702> 91 typedef long unsigned int __darwin_size_t; 92 typedef __darwin_size_t size_t; 93 void *memset(void *, int, size_t); 94 @class NSString, NSURL, NSError; 95 @interface OingoWerdnaPeon : NSObject {} 96 @end typedef enum { 97 OingoPT_SmashOK, OingoPT_NoSuchFile, } 98 OingoWerdnaPeonIOMethod; 99 @interface OingoWerdnaPeonSmashDrivel : NSObject <NSCopying> {} 100 @end 101 @interface OingoBoingoContraptionPeon : OingoWerdnaPeon { 102 struct _OingoBoingoContraptionPeonFlags {} 103 _nfttFlags; 104 } 105 @end 106 @implementation OingoBoingoContraptionPeon 107 + (void)initialize {} 108 - (id)initWithSmashDrivel:(OingoWerdnaPeonSmashDrivel *)info { 109 if (self != ((void *)0)) { 110 (void)memset(&_nfttFlags, 0, sizeof(struct _OingoBoingoContraptionPeonFlags)); 111 } 112 return 0; 113 } 114 @end 115 116 @interface Blah { 117 struct X { 118 int x; 119 } value; 120 } 121 @end 122 123 @implementation Blah 124 - (int)getValue { 125 struct X *xp = &value; 126 return xp->x; 127 } 128 @end 129