From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaObjC/method-lookup.m | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 clang/test/SemaObjC/method-lookup.m (limited to 'clang/test/SemaObjC/method-lookup.m') diff --git a/clang/test/SemaObjC/method-lookup.m b/clang/test/SemaObjC/method-lookup.m new file mode 100644 index 0000000..13e2d7f --- /dev/null +++ b/clang/test/SemaObjC/method-lookup.m @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +typedef signed char BOOL; +typedef int NSInteger; + +@protocol NSObject +- (BOOL)isEqual:(id)object; +- (BOOL)respondsToSelector:(SEL)s; +@end + +@interface NSObject {} +@end + +@class NSString, NSData, NSMutableData, NSMutableDictionary, NSMutableArray; + +@protocol PBXCompletionItem +- (NSString *) name; +- (NSInteger)priority; +- setPriority:(NSInteger)p; +@end + +@implementation PBXCodeAssistant // expected-warning{{cannot find interface declaration for 'PBXCodeAssistant'}} +static NSMutableArray * recentCompletions = ((void *)0); ++ (float) factorForRecentCompletion:(NSString *) completion +{ + for (NSObject * item in [self completionItems]) // expected-warning{{method '+completionItems' not found (return type defaults to 'id')}} + { + if ([item respondsToSelector:@selector(setPriority:)]) + { + [(id)item setPriority:[item priority] / [PBXCodeAssistant factorForRecentCompletion:[item name]]]; + } + } + return 0; +} +@end + -- cgit v1.2.3