Emit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses...
[clang/stm8.git] / test / Analysis / flat-store.c
blobbf93c724400f19d74dd594f76e6924c4fc9b6232
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=flat -Wno-null-dereference -verify %s
2 #define FAIL ((void)*(char*)0)
3 struct simple { int x; };
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}}