blob: fc739df5fc9114ca75784f38952a4d24b50a6cbd [file] [log] [blame]
Argyrios Kyrtzidisb3d74da2011-02-28 17:36:18 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-check-objc-mem -analyzer-store=flat -verify %s
Zhongxing Xu7caf9b32010-08-02 04:56:14 +00002#define FAIL ((void)*(char*)0)
3struct simple { int x; };
4
5void 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}