blob: a2a8ec6b87e63ec5f56604c6f2e5fa7334d075ae [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -Werror %s -analyzer-store=basic -verify
2// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -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) {
9 return p; // expected-warning{{incompatible pointer types returning 'int *', expected 'char *'}}
10}
11
12void g(int *p) {
13 if (!p) *p = 0; // expected-warning{{null}}
14}
15