Zhongxing Xu | 7caf9b3 | 2010-08-02 04:56:14 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store=flat -verify %s |
2 | #define FAIL ((void)*(char*)0) | ||||
3 | struct simple { int x; }; | ||||
4 | |||||
5 | void PR7297 () { | ||||
6 | struct simple a; | ||||
7 | struct simple *p = &a; | ||||
8 | p->x = 5; | ||||
9 | if (!p[0].x) FAIL; // no-warning | ||||
10 | if (p[0].x) FAIL; // expected-warning {{null}} | ||||
11 | } |