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