Ted Kremenek | 033a07e | 2011-08-03 23:14:55 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -Werror %s -analyzer-store=region -verify |
Ted Kremenek | 2c4036e | 2009-05-07 19:02:53 +0000 | [diff] [blame] | 2 | |
| 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 | |
| 7 | char* f(int *p) { |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 8 | return p; // expected-warning{{incompatible pointer types}} |
Ted Kremenek | 2c4036e | 2009-05-07 19:02:53 +0000 | [diff] [blame] | 9 | } |
| 10 | |
| 11 | void g(int *p) { |
| 12 | if (!p) *p = 0; // expected-warning{{null}} |
| 13 | } |
| 14 | |