blob: a68ee1ed0a302e6c07eb46ec4c58ec2237f5af23 [file] [log] [blame]
Ted Kremenek722398f2012-08-24 20:39:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -verify
Ted Kremenek094bc312009-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 Gregorc68e1402010-04-09 00:35:39 +00008 return p; // expected-warning{{incompatible pointer types}}
Ted Kremenek094bc312009-05-07 19:02:53 +00009}
10
11void g(int *p) {
12 if (!p) *p = 0; // expected-warning{{null}}
13}
14