blob: 7dc09f518627ac41da0749c07b4cfc9cce72ae16 [file] [log] [blame]
Dominic Chen184c6242017-03-03 18:02:02 +00001// RUN: %clang_analyze_cc1 -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