blob: d3b75f694d0b03e1f39fccf1e99dba0697c62a43 [file] [log] [blame]
Ted Kremenek033a07e2011-08-03 23:14:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -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