aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-16 18:57:01 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-16 18:57:01 +0000
commit63e963cdffca9530f920dbab58b9b4eecb2a582c (patch)
tree807e73d8edf9a9d5ee0933cb78ecce26fbf98878 /test
parent2a70e94c543338059432fc38b801a56c60f0e0d7 (diff)
Handle case of missing '@end' in implementation context
gracefully, on par with gcc, by: Issuing a warning, doing final sematinc check of its definitions and generating its meta-data. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/NSString.m3
-rw-r--r--test/Analysis/PR3991.m11
-rw-r--r--test/Analysis/misc-ps.m1
-rw-r--r--test/Analysis/pr4209.m10
-rw-r--r--test/Analysis/region-1.m1
-rw-r--r--test/CodeGenObjC/missing-atend-metadata.m24
-rw-r--r--test/SemaObjC/compare-qualified-id.m5
-rw-r--r--test/SemaObjC/method-arg-decay.m5
8 files changed, 51 insertions, 9 deletions
diff --git a/test/Analysis/NSString.m b/test/Analysis/NSString.m
index 1cf8ae8b1e..481a94055f 100644
--- a/test/Analysis/NSString.m
+++ b/test/Analysis/NSString.m
@@ -371,5 +371,4 @@ void test_synchronized(id x) {
NSString *string = [[NSString stringWithFormat:@"%ld", (long) 100] retain]; // expected-warning {{leak}}
}
}
-
-
+@end
diff --git a/test/Analysis/PR3991.m b/test/Analysis/PR3991.m
index 765cc7e486..53a6b5257a 100644
--- a/test/Analysis/PR3991.m
+++ b/test/Analysis/PR3991.m
@@ -42,7 +42,15 @@ typedef struct _NSZone NSZone;
- (unsigned int)currentPathComponentIndex;
- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex;
- (NSURL *)folderFeedURL;
-@end @implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner {
+@end
+
+@implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner { // expected-warning {{incomplete implementation}} \
+// expected-warning {{method definition for 'entries' not found}} \
+// expected-warning {{method definition for 'feedDocList' not found}} \
+// expected-warning {{method definition for 'directoryPathComponents' not found}} \
+// expected-warning {{method definition for 'currentPathComponentIndex' not found}} \
+// expected-warning {{method definition for 'setCurrentPathComponentIndex:' not found}} \
+// expected-warning {{method definition for 'folderFeedURL' not found}}
return 0;
}
@@ -66,3 +74,4 @@ typedef struct _NSZone NSZone;
}
}
}
+@end
diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m
index 3004afc9b9..d2eef0d7fd 100644
--- a/test/Analysis/misc-ps.m
+++ b/test/Analysis/misc-ps.m
@@ -749,3 +749,4 @@ void test_undefined_array_subscript() {
int i, a[10];
int *p = &a[i]; // expected-warning{{Array subscript is undefined}}
}
+@end
diff --git a/test/Analysis/pr4209.m b/test/Analysis/pr4209.m
index 5d77414921..60161b1b08 100644
--- a/test/Analysis/pr4209.m
+++ b/test/Analysis/pr4209.m
@@ -49,17 +49,20 @@ CMProfileLocation;
GSEbayCategory *rootCategory;
}
- (NSMutableDictionary*)categoryDictionaryForCategoryID:(int)inID inRootTreeCategories:(NSMutableArray*)inRootTreeCategories;
--(NSString*) categoryID;
+-(NSString*) categoryID;
@end @interface GSEbayCategory : NSObject <NSCoding> {
}
- (int) categoryID;
- (GSEbayCategory *) parent;
- (GSEbayCategory*) subcategoryWithID:(int) inID;
-@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent {
+@end @implementation GBCategoryChooserPanelController + (int) chooseCategoryIDFromCategories:(NSArray*) inCategories searchRequest:(GBSearchRequest*)inRequest parentWindow:(NSWindow*) inParent { // expected-warning {{incomplete implementation}} \
+// expected-warning {{method definition for 'categoryDictionaryForCategoryID:inRootTreeCategories:' not found}} \
+// expected-warning {{method definition for 'categoryID' not found}}
return 0;
}
- (void) addCategory:(EBayCategoryType*)inCategory toRootTreeCategory:(NSMutableArray*)inRootTreeCategories {
- GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]];
+ GSEbayCategory *category = [rootCategory subcategoryWithID:[[inCategory categoryID] intValue]];
+
if (rootCategory != category) {
GSEbayCategory *parent = category;
while ((((void*)0) != (parent = [parent parent])) && ([parent categoryID] != 0)) {
@@ -69,3 +72,4 @@ CMProfileLocation;
}
}
}
+@end
diff --git a/test/Analysis/region-1.m b/test/Analysis/region-1.m
index 2ac1a9b78d..6a8ae49bba 100644
--- a/test/Analysis/region-1.m
+++ b/test/Analysis/region-1.m
@@ -89,3 +89,4 @@ Dos_CharacterRangeType = 0, Dos_LineRangeType = 1 }
symbol = [HancodeFett symbolFromClass:(JabaSCClass *) selectedClassifier];
}
}
+@end
diff --git a/test/CodeGenObjC/missing-atend-metadata.m b/test/CodeGenObjC/missing-atend-metadata.m
new file mode 100644
index 0000000000..664b6f0b16
--- /dev/null
+++ b/test/CodeGenObjC/missing-atend-metadata.m
@@ -0,0 +1,24 @@
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck %s
+
+@interface I0
+@end
+
+@implementation I0 // expected-warning {{'@end' is missing in implementation context}}
+- meth { return 0; }
+
+@interface I1 : I0
+@end
+
+@implementation I1 // expected-warning {{'@end' is missing in implementation context}}
+-(void) im0 { self = [super init]; }
+
+@interface I2 : I0
+- I2meth;
+@end
+
+@implementation I2 // expected-warning {{'@end' is missing in implementation context}}
+- I2meth { return 0; }
+
+@implementation I2(CAT) // expected-warning {{'@end' is missing in implementation context}}
+
+// CHECK: @"\01L_OBJC_CLASS_I1" = internal global
diff --git a/test/SemaObjC/compare-qualified-id.m b/test/SemaObjC/compare-qualified-id.m
index 86845c0358..22bec504a5 100644
--- a/test/SemaObjC/compare-qualified-id.m
+++ b/test/SemaObjC/compare-qualified-id.m
@@ -23,11 +23,12 @@ extern NSString * const NSTaskDidTerminateNotification;
- (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state;
@end
-@implementation XCPropertyExpansionContext
+@implementation XCPropertyExpansionContext // expected-warning {{method definition for 'copyWithZone:' not found}} \
+ // expected-warning {{incomplete implementation}}
- (NSString *)expandedValueForProperty:(NSString *)property {
id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}}
if (cachedValueNode == ((void *)0)) { }
NSString * expandedValue = [cachedValueNode evaluateAsStringInContext:self withNestingState:((void *)0)];
return expandedValue;
}
-
+@end
diff --git a/test/SemaObjC/method-arg-decay.m b/test/SemaObjC/method-arg-decay.m
index 7fd07d2ede..e81bcdf7b7 100644
--- a/test/SemaObjC/method-arg-decay.m
+++ b/test/SemaObjC/method-arg-decay.m
@@ -72,7 +72,9 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
}
- (PBXModule *) moduleForTab:(NSTabViewItem *)item;
@end
-@implementation XCPerspectiveModule
+@implementation XCPerspectiveModule // expected-warning {{method definition for 'moduleForTab:' not found}} \
+ // expected-warning {{method definition for 'performAction:withSelection:' not found}} \
+ // expected-warning {{incomplete implementation}}
+ (void) openForProjectDocument:(PBXProjectDocument *)projectDocument {
}
- (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data {
@@ -94,3 +96,4 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
prompts++;
return (BOOL)0;
}
+@end