Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaObjC / method-lookup.m
blob13e2d7fe4c3e04dd8324c8b2d7295d8f48b24a74
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2 typedef signed char BOOL;
3 typedef int NSInteger;
5 @protocol NSObject
6 - (BOOL)isEqual:(id)object;
7 - (BOOL)respondsToSelector:(SEL)s;
8 @end
10 @interface NSObject <NSObject> {}
11 @end
13 @class NSString, NSData, NSMutableData, NSMutableDictionary, NSMutableArray;
15 @protocol PBXCompletionItem
16 - (NSString *) name;
17 - (NSInteger)priority;
18 - setPriority:(NSInteger)p;
19 @end
21 @implementation PBXCodeAssistant // expected-warning{{cannot find interface declaration for 'PBXCodeAssistant'}}
22 static NSMutableArray * recentCompletions = ((void *)0);
23 + (float) factorForRecentCompletion:(NSString *) completion
25     for (NSObject<PBXCompletionItem> * item in [self completionItems]) // expected-warning{{method '+completionItems' not found (return type defaults to 'id')}}
26     {
27         if ([item respondsToSelector:@selector(setPriority:)])
28         {
29             [(id)item setPriority:[item priority] / [PBXCodeAssistant factorForRecentCompletion:[item name]]];
30         }
31     }
32     return 0;
34 @end