Ted Kremenek | 565e465 | 2010-02-05 02:06:54 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -Werror %s -analyzer-store=basic -verify |
| 2 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -Werror %s -analyzer-store=region -verify |
Ted Kremenek | 2c4036e | 2009-05-07 19:02:53 +0000 | [diff] [blame] | 3 | |
| 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 | |
| 8 | char* f(int *p) { |
| 9 | return p; // expected-warning{{incompatible pointer types returning 'int *', expected 'char *'}} |
| 10 | } |
| 11 | |
| 12 | void g(int *p) { |
| 13 | if (!p) *p = 0; // expected-warning{{null}} |
| 14 | } |
| 15 | |