summaryrefslogtreecommitdiffstats
path: root/test/Analysis/flat-store.c
blob: bf93c724400f19d74dd594f76e6924c4fc9b6232 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=flat -Wno-null-dereference -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}}
}
OpenPOWER on IntegriCloud