diff options
Diffstat (limited to 'test/Analysis/flat-store.c')
-rw-r--r-- | test/Analysis/flat-store.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/flat-store.c b/test/Analysis/flat-store.c new file mode 100644 index 0000000..bb274b0 --- /dev/null +++ b/test/Analysis/flat-store.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store=flat -verify %s +#define FAIL ((void)*(char*)0) +struct simple { int x; }; + +void PR7297 () { + struct simple a; + struct simple *p = &a; + p->x = 5; + if (!p[0].x) FAIL; // no-warning + if (p[0].x) FAIL; // expected-warning {{null}} +} |