diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/inlining/false-positive-suppression.m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Analysis/inlining/false-positive-suppression.m b/clang/test/Analysis/inlining/false-positive-suppression.m index 7be1cb8472f..d9678206c7c 100644 --- a/clang/test/Analysis/inlining/false-positive-suppression.m +++ b/clang/test/Analysis/inlining/false-positive-suppression.m @@ -45,6 +45,8 @@ __attribute__((objc_root_class)) @property(readonly) int *propertyReturningNull; +@property(readonly) int *synthesizedProperty; + @end @implementation SomeClass @@ -72,3 +74,14 @@ void testPropertyReturningNull(SomeClass *sc) { // expected-warning@-2 {{Dereference of null pointer}} #endif } + +void testSynthesizedPropertyReturningNull(SomeClass *sc) { + if (sc.synthesizedProperty) + return; + + int *result = sc.synthesizedProperty; + *result = 1; +#ifndef SUPPRESSED + // expected-warning@-2 {{Dereference of null pointer}} +#endif +} |