1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -verify
2 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -analyzer-werror -verify=werror
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
f(int * p)8 char* f(int *p) {
9 return p; // expected-warning{{incompatible pointer types}} \
10 werror-warning{{incompatible pointer types}}
11 }
12
g(int * p)13 void g(int *p) {
14 if (!p) *p = 0; // expected-warning{{null}} \
15 werror-error{{null}}
16 }
17
18