blob: 899ea17793d06a72ce2dc8a6549d20c79ba4a400 [file] [log] [blame]
Ted Kremenek2c4036e2009-05-07 19:02:53 +00001// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic -verify &&
Ted Kremeneke1cea752009-07-06 21:58:46 +00002// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic-new-cast -verify &&
Ted Kremenek2c4036e2009-05-07 19:02:53 +00003// RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=region -verify
4
5// This test case illustrates that using '-analyze' overrides the effect of
6// -Werror. This allows basic warnings not to interfere with producing
7// analyzer results.
8
9char* f(int *p) {
10 return p; // expected-warning{{incompatible pointer types returning 'int *', expected 'char *'}}
11}
12
13void g(int *p) {
14 if (!p) *p = 0; // expected-warning{{null}}
15}
16