blob: d278f4709f576cf7c7d70fb393fa0c29be7e4ebd [file] [log] [blame]
Argyrios Kyrtzidisc4d2c902011-02-28 19:49:42 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental -Werror %s -analyzer-store=region -verify
Ted Kremenek2c4036e2009-05-07 19:02:53 +00002
3// This test case illustrates that using '-analyze' overrides the effect of
4// -Werror. This allows basic warnings not to interfere with producing
5// analyzer results.
6
7char* f(int *p) {
Douglas Gregord4eea832010-04-09 00:35:39 +00008 return p; // expected-warning{{incompatible pointer types}}
Ted Kremenek2c4036e2009-05-07 19:02:53 +00009}
10
11void g(int *p) {
12 if (!p) *p = 0; // expected-warning{{null}}
13}
14