Ted Kremenek | 2c4036e | 2009-05-07 19:02:53 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic -verify && |
Ted Kremenek | e1cea75 | 2009-07-06 21:58:46 +0000 | [diff] [blame] | 2 | // RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=basic-new-cast -verify && |
Ted Kremenek | 2c4036e | 2009-05-07 19:02:53 +0000 | [diff] [blame] | 3 | // RUN: clang-cc -analyze -checker-cfref -Werror %s -analyzer-store=region -verify |
| 4 | |
| 5 | // This test case illustrates that using '-analyze' overrides the effect of |
| 6 | // -Werror. This allows basic warnings not to interfere with producing |
| 7 | // analyzer results. |
| 8 | |
| 9 | char* f(int *p) { |
| 10 | return p; // expected-warning{{incompatible pointer types returning 'int *', expected 'char *'}} |
| 11 | } |
| 12 | |
| 13 | void g(int *p) { |
| 14 | if (!p) *p = 0; // expected-warning{{null}} |
| 15 | } |
| 16 | |