1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s
2 // expected-no-diagnostics
4 // This test case mainly checks that the retain/release checker doesn't crash
8 typedef signed char BOOL;
9 typedef long NSInteger;
10 typedef unsigned long NSUInteger;
11 typedef struct _NSZone NSZone;
12 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
13 @protocol NSObject - (BOOL)isEqual:(id)object;
14 @end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
15 @end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
16 @end @interface NSObject <NSObject> {}
17 @end extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
18 @interface NSResponder : NSObject <NSCoding> {}
19 @end @protocol NSAnimatablePropertyContainer - (id)animator;
20 @end extern NSString *NSAnimationTriggerOrderIn ;
21 @interface NSView : NSResponder <NSAnimatablePropertyContainer> {
24 NSNullCellType = 0, NSTextCellType = 1, NSImageCellType = 2 };
25 typedef struct __CFlags {
26 unsigned int botnet:3;
29 @interface Bar : NSObject <NSCopying, NSCoding> {
33 @end extern NSString *NSControlTintDidChangeNotification;
34 typedef NSInteger NSBotnet;
35 @interface NSControl : NSView {
37 @end @class NSAttributedString, NSFont, NSImage, NSSound;
39 @interface Bar(BarInternal) - (void)_setIsWhite:(BOOL)isWhite;
41 @interface Bar (BarBotnetCompatibility)
42 - (NSBotnet)_initialBotnetZorg;
44 typedef struct _NSRunArrayItem {
45 unsigned int botnetIsSet:1;
47 @interface BarAuxiliary : NSObject {
49 NSControl *controlView;
50 BarAuxFlags auxCFlags;
55 - (id)copyWithZone:(NSZone *)zone { return 0; }
56 - (void)encodeWithCoder:(NSCoder *)coder {}
58 @implementation Bar (BarBotnet)
60 if (!(*(BarAuxiliary **)&self->_support)->auxCFlags.botnetIsSet) {
61 _cFlags.botnet = [self _initialBotnetZorg];