rdar-6562655.m revision 0bdf17888d6f08d04083414e32ee732c0695a4e9
1// RUN: clang -analyze -checker-cfref -analyzer-constraints=basic -analyzer-store=basic -verify %s
2//
3// This test case mainly checks that the retain/release checker doesn't crash
4// on this file.
5//
6typedef int int32_t;
7typedef signed char BOOL;
8typedef long NSInteger;
9typedef unsigned long NSUInteger;
10typedef struct _NSZone NSZone;
11@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
12@protocol NSObject  - (BOOL)isEqual:(id)object;
13@end  @protocol NSCopying  - (id)copyWithZone:(NSZone *)zone;
14@end  @protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder;
15@end    @interface NSObject <NSObject> {}
16@end      extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
17@interface NSResponder : NSObject <NSCoding> {}
18@end    @protocol NSAnimatablePropertyContainer      - (id)animator;
19@end  extern NSString *NSAnimationTriggerOrderIn ;
20@interface NSView : NSResponder  <NSAnimatablePropertyContainer>  {
21}
22@end    enum {
23NSNullCellType = 0,     NSTextCellType = 1,     NSImageCellType = 2 };
24typedef struct __CFlags {
25  unsigned int botnet:3;
26}
27  _CFlags;
28@interface Bar : NSObject <NSCopying, NSCoding> {
29  _CFlags _cFlags;
30@private       id _support;
31}
32@end  extern NSString *NSControlTintDidChangeNotification;
33typedef NSInteger NSBotnet;
34@interface NSControl : NSView {
35}
36@end @class NSAttributedString, NSFont, NSImage, NSSound;
37typedef int32_t Baz;
38@interface Bar(BarInternal) - (void)_setIsWhite:(BOOL)isWhite;
39@end
40@interface Bar (BarBotnetCompatibility)
41- (NSBotnet)_initialBotnetZorg;
42@end
43typedef struct _NSRunArrayItem {
44  unsigned int botnetIsSet:1;
45} BarAuxFlags;
46@interface BarAuxiliary : NSObject {
47@public
48  NSControl *controlView;
49  BarAuxFlags auxCFlags;
50}
51@end
52@implementation Bar
53static Baz Qux = 0;
54- (id)copyWithZone:(NSZone *)zone {}
55- (void)encodeWithCoder:(NSCoder *)coder {}
56@end
57@implementation Bar (BarBotnet)
58- (NSBotnet)botnet {
59  if (!(*(BarAuxiliary **)&self->_support)->auxCFlags.botnetIsSet) {
60    _cFlags.botnet = [self _initialBotnetZorg];
61  }
62}
63@end
64