xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/region-1.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
2f4a2713aSLionel Sambuc// expected-no-diagnostics
3f4a2713aSLionel Sambuc//
4f4a2713aSLionel Sambuc// This test case simply should not crash.  It evaluates the logic of not
5f4a2713aSLionel Sambuc// using MemRegion::getRValueType in incorrect places.
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuctypedef signed char BOOL;
8f4a2713aSLionel Sambuctypedef unsigned int NSUInteger;
9f4a2713aSLionel Sambuc@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
10f4a2713aSLionel Sambuc@protocol NSObject  - (BOOL)isEqual:(id)object;
11f4a2713aSLionel Sambuc- (Class)class;
12f4a2713aSLionel Sambuc- (BOOL)isLegOfClass:(Class)aClass;
13f4a2713aSLionel Sambuc@end  @protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder;
14f4a2713aSLionel Sambuc@end    @interface NSObject <NSObject> {
15f4a2713aSLionel Sambuc}
16f4a2713aSLionel Sambuc@end @class NSArray;
17f4a2713aSLionel Sambuc@interface NSResponder : NSObject <NSCoding> {
18f4a2713aSLionel Sambuc}
19f4a2713aSLionel Sambuc@end  @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView;
20f4a2713aSLionel Sambuc@class JabasectItem;
21f4a2713aSLionel Sambuc@protocol EcoClassifier;
22f4a2713aSLionel Sambuc@protocol EcoClassInterfaceCommons <EcoClassifier>    @end  @protocol EcoImplementation;
23f4a2713aSLionel Sambuc@protocol EcoBehavioredClassifier <EcoClassInterfaceCommons>      - (NSArray *) implementations;
24f4a2713aSLionel Sambuc@end enum {
25f4a2713aSLionel SambucCK_UNRESTRICTED= 0,     CK_READ_ONLY,     CK_ADD_ONLY,     CK_REMOVE_ONLY };
26f4a2713aSLionel Sambuc@protocol EcoClass <EcoBehavioredClassifier>      - (NSArray *) ownedAttributes;
27f4a2713aSLionel Sambuc@end @protocol EcoNamespace;
28*0a6a1f1dSLionel Sambuc@protocol EcoType @end;
29f4a2713aSLionel Sambuc@protocol EcoClassifier <EcoNamespace,EcoType>    - (NSArray *) features;
30f4a2713aSLionel Sambuc@end @protocol EcoComment;
31f4a2713aSLionel Sambuc@protocol EcoElement <NSObject> - (NSArray *) ownedElements;
32f4a2713aSLionel Sambuc@end @protocol EcoDirectedRelationship;
33f4a2713aSLionel Sambuc@protocol EcoNamedElement <EcoElement>     - (NSString *) name;
34f4a2713aSLionel Sambuc@end  extern NSString *const JabaPathSeparator;
35f4a2713aSLionel Sambuc@protocol EcoNamespace <EcoNamedElement>       - (NSArray *) Legs;
36f4a2713aSLionel Sambuc@end enum {
37f4a2713aSLionel SambucPDK_IN=0,     PDK_INOUT,     PDK_OUT,     PDK_RETURN };
38f4a2713aSLionel Sambuc@interface EcoElementImp : NSObject <EcoElement, NSCoding> {
39f4a2713aSLionel Sambuc}
40f4a2713aSLionel Sambuc@end @class EcoNamespace;
41f4a2713aSLionel Sambuc@interface EcoNamedElementImp : EcoElementImp <EcoNamedElement>{
42f4a2713aSLionel Sambuc}
43f4a2713aSLionel Sambuc@end   @interface EcoNamespaceImp : EcoNamedElementImp <EcoNamespace> {
44f4a2713aSLionel Sambuc}
45f4a2713aSLionel Sambuc@end  @class JabaSCDocController, JabaSCDisplaySpecification;
46f4a2713aSLionel Sambuc@interface JabaSCSharedDiagramViewController : NSObject {
47f4a2713aSLionel Sambuc}
48f4a2713aSLionel Sambuc@end  extern NSString *const JabaSCsectGraphicNamesectIdentifier;
49f4a2713aSLionel Sambuc@interface EcoClassifierImp : EcoNamespaceImp <EcoClassifier> {
50f4a2713aSLionel Sambuc}
51f4a2713aSLionel Sambuc@end  @class EcoOperationImp;
52f4a2713aSLionel Sambuc@interface EcoClassImp : EcoClassifierImp <EcoClass> {
53f4a2713aSLionel Sambuc}
54f4a2713aSLionel Sambuc@end  extern NSString *const JabaAddedUMLElements;
55f4a2713aSLionel Sambuc@class JabaSCClass, JabaSCInterface, JabaSCOperation;
56f4a2713aSLionel Sambuc@class DosLegVaseSymbol, DosProtocolSymbol, DosMethodSymbol, DosFileReference;
57f4a2713aSLionel Sambuc@interface HancodeFett : NSObject {
58f4a2713aSLionel Sambuc}
59f4a2713aSLionel Sambuc+ (DosLegVaseSymbol *) symbolFromClass: (JabaSCClass *) clz;
60f4a2713aSLionel Sambuc@end enum _JabaSourceLanguage {
61f4a2713aSLionel SambucJabaSourceUnknown=0,     JabaSourcePrawn,     JabaSourceC,     JabaSourceCPP,     JabaSourceObjectiveC };
62f4a2713aSLionel Sambuctypedef NSUInteger JabaSourceLanguage;
63f4a2713aSLionel Sambuc@protocol JabaSCClassifier <EcoClassInterfaceCommons> - (JabaSourceLanguage)language;
64f4a2713aSLionel Sambuc@end  @interface JabaSCClass : EcoClassImp <JabaSCClassifier> {
65f4a2713aSLionel Sambuc}
66f4a2713aSLionel Sambuc@end  @class DosGlobalID, DosPQuLC, DosPQuUnLC;
67f4a2713aSLionel Sambuc@protocol XCProxyObjectProtocol - (id) representedObject;
68f4a2713aSLionel Sambuc@end typedef union _Dossymbollocation {
69f4a2713aSLionel Sambuc}
70f4a2713aSLionel Sambuc  DosRecordArrPrl;
71f4a2713aSLionel Sambuc@interface DosIndexEntry : NSObject {
72f4a2713aSLionel Sambuc}
73f4a2713aSLionel Sambuc@end    @class DosProjectIndex, DosTextPapyruswiggle, DosDocPapyruswiggle, DosLegVaseSymbol;
74f4a2713aSLionel Sambuc@interface DosSymbol : DosIndexEntry {
75f4a2713aSLionel Sambuc}
76f4a2713aSLionel Sambuc@end  @interface DosLegVaseSymbol : DosSymbol {
77f4a2713aSLionel Sambuc}
78f4a2713aSLionel Sambuc@end typedef enum _DosTextRangeType {
79f4a2713aSLionel SambucDos_CharacterRangeType = 0,     Dos_LineRangeType = 1 }
80f4a2713aSLionel Sambuc  DosTextRangeType;
81f4a2713aSLionel Sambuc@implementation JabaSCSharedDiagramViewController  + (NSImage *)findImageNamed:(NSString *)name {
82f4a2713aSLionel Sambuc  return 0;
83f4a2713aSLionel Sambuc}
84f4a2713aSLionel Sambuc- (void)revealSourceInEditor:(JabasectItem *)sectItem duperGesture:(BOOL)duperGesture {
85f4a2713aSLionel Sambuc  id <EcoNamedElement> selectedElement = [sectItem representedObject];
86f4a2713aSLionel Sambuc  id <EcoNamedElement> selectedClassifier = selectedElement;
87f4a2713aSLionel Sambuc  DosSymbol *symbol=((void *)0);
88f4a2713aSLionel Sambuc  if([selectedClassifier isLegOfClass:[JabaSCClass class]]) {
89f4a2713aSLionel Sambuc    symbol = [HancodeFett symbolFromClass:(JabaSCClass *) selectedClassifier];
90f4a2713aSLionel Sambuc  }
91f4a2713aSLionel Sambuc}
92f4a2713aSLionel Sambuc@end
93