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