override-werror.c revision c037eac3bda3c636c961aab6377beea3242e81e4
1// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic -verify &&
2// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic-old-cast -verify &&
3// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=region -verify
4
5// This test case illustrates that using '-analyze' overrides the effect of
6// -Werror.  This allows basic warnings not to interfere with producing
7// analyzer results.
8
9char* f(int *p) {
10  return p; // expected-warning{{incompatible pointer types returning 'int *', expected 'char *'}}
11}
12
13void g(int *p) {
14  if (!p) *p = 0; // expected-warning{{null}}
15}
16
17