aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/objc-for.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/objc-for.m')
-rw-r--r--test/Analysis/objc-for.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Analysis/objc-for.m b/test/Analysis/objc-for.m
index f191e86cc4e4..b59a5c2cf177 100644
--- a/test/Analysis/objc-for.m
+++ b/test/Analysis/objc-for.m
@@ -32,6 +32,7 @@ typedef unsigned long NSUInteger;
@interface NSDictionary (SomeCategory)
- (void)categoryMethodOnNSDictionary;
+- (id) allKeys;
@end
@interface NSMutableDictionary : NSDictionary
@@ -343,3 +344,10 @@ void boxedArrayEscape(NSMutableArray *array) {
for (id key in array)
clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
}
+
+int not_reachable_on_iteration_through_nil() {
+ NSDictionary* d = nil;
+ for (NSString* s in [d allKeys])
+ clang_analyzer_warnIfReached(); // no-warning
+ return 0;
+}