blob: c5546aac5fcdc1dc0e5cbbe8df8428883e6d823f [file] [log] [blame]
Anna Zaks841f1682013-04-03 19:28:19 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-null-dereference %s
2
3@interface Foo
4- (int &)ref;
5@end
6
7Foo *getFoo() { return 0; }
8
9void testNullPointerSuppression() {
10 getFoo().ref = 1;
11}
12
13void testPositiveNullReference() {
14 Foo *x = 0;
15 x.ref = 1; // expected-warning {{The receiver of message 'ref' is nil, which results in forming a null reference}}
16}
17