summaryrefslogtreecommitdiff
path: root/test/Analysis/track-control-dependency-conditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/track-control-dependency-conditions.m')
-rw-r--r--test/Analysis/track-control-dependency-conditions.m32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Analysis/track-control-dependency-conditions.m b/test/Analysis/track-control-dependency-conditions.m
new file mode 100644
index 0000000000..05b0638a5e
--- /dev/null
+++ b/test/Analysis/track-control-dependency-conditions.m
@@ -0,0 +1,32 @@
+// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,nullability -verify %s
+
+// expected-no-diagnostics
+
+@class C;
+
+#pragma clang assume_nonnull begin
+@interface I
+- foo:(C *)c;
+@end
+#pragma clang assume_nonnull end
+
+@interface J
+@property C *c;
+@end
+
+J *conjure_J();
+
+@implementation I
+- (void)bar {
+ if (self) { // no-crash
+ J *j = conjure_J();
+ if (j.c)
+ [self bar];
+ // FIXME: Should warn.
+ [self foo:j.c]; // no-warning
+ }
+}
+@end
+
+@implementation J
+@end